int communityID = parameters.getParameterAsInteger("communityID", -1);
Community thisCommunity = Community.find(context, communityID);
String baseURL = contextPath + "/admin/community?administrative-continue=" + knot.getId();
Group admins = thisCommunity.getAdministrators();
// DIVISION: main
Division main = body.addInteractiveDivision("community-assign-roles",contextPath+"/admin/community",Division.METHOD_POST,"primary administrative community");
main.setHead(T_main_head.parameterize(thisCommunity.getName()));
List options = main.addList("options", List.TYPE_SIMPLE, "horizontal");
options.addItem().addXref(baseURL+"&submit_metadata",T_options_metadata);
options.addItem().addHighlight("bold").addXref(baseURL+"&submit_roles",T_options_roles);
// The table of admin roles
Table rolesTable = main.addTable("roles-table", 6, 5);
Row tableRow;
// The header row
Row tableHeader = rolesTable.addRow(Row.ROLE_HEADER);
tableHeader.addCell().addContent(T_role_name);
tableHeader.addCell().addContent(T_role_group);
tableHeader.addCell().addContent(T_role_buttons);
rolesTable.addRow();
/*
* The community admins
*/
// data row
tableRow = rolesTable.addRow(Row.ROLE_DATA);
tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_admins);
if (admins != null)
{
try
{
AuthorizeUtil.authorizeManageAdminGroup(context, thisCommunity);
tableRow.addCell().addXref(baseURL + "&submit_edit_admin", admins.getName());
}
catch (AuthorizeException authex) {
// add a notice, the user is not authorized to create/edit community's admin group
tableRow.addCell().addContent(T_sysadmins_only);
}