int groupID = parameters.getParameterAsInteger("groupID",-1);
String currentName = URLDecode(parameters.getParameter("groupName",null));
if (currentName == null || currentName.length() == 0)
currentName = FlowGroupUtils.getName(context, groupID);
Group group = null;
if (groupID >= 0)
group = Group.find(context,groupID);
// Find the collection or community if applicable
Collection collection = null;
Community community = null;
if (group != null)
{
int collectionID = FlowGroupUtils.getCollectionId(group.getName());
if (collectionID > -1)
collection = Collection.find(context, collectionID);
else
{
int communityID = FlowGroupUtils.getCommunityId(group.getName());
if (communityID > -1)
community = Community.find(context, communityID);
}
}
// Get list of member groups
String memberGroupIDsString = parameters.getParameter("memberGroupIDs",null);
ArrayList<Integer> memberGroupIDs = new ArrayList<Integer>();
if (memberGroupIDsString != null)
{
for (String id : memberGroupIDsString.split(","))
{
if (id.length() > 0)
memberGroupIDs.add(Integer.valueOf(id));
}
}
// Get list of member epeople
String memberEPeopleIDsString = parameters.getParameter("memberEPeopleIDs",null);
ArrayList<Integer> memberEPeopleIDs = new ArrayList<Integer>();
if (memberEPeopleIDsString != null)
{
for (String id : memberEPeopleIDsString.split(","))
if (id.length() > 0)
memberEPeopleIDs.add(Integer.valueOf(id));
}
// Get highlight parameters
int highlightEPersonID = parameters.getParameterAsInteger("highlightEPersonID",-1);
int highlightGroupID = parameters.getParameterAsInteger("highlightGroupID",-1);
// Get search parameters
String query = URLDecode(parameters.getParameter("query",null));
int page = parameters.getParameterAsInteger("page",0);
String type = parameters.getParameter("type",null);
// Get any errors
String errorString = parameters.getParameter("errors",null);
ArrayList<String> errors = new ArrayList<String>();
if (errorString != null)
for (String error : errorString.split(","))
errors.add(error);
//DIVISION: group-edit
Division main = body.addInteractiveDivision("group-edit",contextPath+"/admin/groups",Division.METHOD_POST,"primary administrative groups");
if (group == null)
main.setHead(T_main_head_new);
else
main.setHead(T_main_head.parameterize(group.getName(),groupID));
if(collection != null)
{
Para para = main.addPara();