private void addAdministratorOnlyButton(Cell cell, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = cell.addButton(buttonName); button.setValue(buttonLabel); if (!AuthorizeManager.isAdmin(context)) { // Only admins can create or delete button.setDisabled(); cell.addHighlight("fade").addContent(T_sysadmins_only); } } }
private void addAdministratorOnlyButton(Cell cell, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = cell.addButton(buttonName); button.setValue(buttonLabel); if (!AuthorizeManager.isAdmin(context)) { // Only admins can create or delete button.setDisabled(); cell.addHighlight("fade").addContent(T_sysadmins_only); } } }
groupData.addCell().addHighlight("bold").addContent(group.getID()); if (AuthorizeManager.isAdmin(context)) nameCell.addHighlight("bold").addXref(url, T_members_group_name.parameterize(name)); nameCell.addHighlight("bold").addContent(T_members_group_name.parameterize(name)); nameCell.addHighlight("warn").addContent(T_members_pending); groupData.addCell().addHighlight("warn").addContent(T_pending);
nameCell.addHighlight("warn").addContent(T_members_pending); personData.addCell().addHighlight("warn").addContent(T_pending);
table.addRow().addCell(1, 4).addHighlight("italic").addContent(T_no_policies); Cell groupCell = row.addCell(1,2); groupCell.addContent(policyGroup.getName()); Highlight groupHigh = groupCell.addHighlight("fade"); groupHigh.addContent(" ["); groupHigh.addXref(baseURL + "&submit_edit_group&group_id=" + policyGroup.getID(), T_group_edit);
private void addXMLWorkflowRoles(Collection thisCollection, String baseURL, HashMap<String, Role> roles, Table rolesTable) throws WingException, SQLException { Row tableRow; if(roles != null){ //ROLES: show group name instead of role name for(String roleId: roles.keySet()){ Role role = roles.get(roleId); if (role.getScope() == Role.Scope.COLLECTION) { tableRow = rolesTable.addRow(Row.ROLE_DATA); tableRow.addCell(Cell.ROLE_HEADER).addContent(role.getName()); Group roleGroup = WorkflowUtils.getRoleGroup(context, thisCollection.getID(), role); if (roleGroup != null) { tableRow.addCell().addXref(baseURL + "&submit_edit_wf_role_" + roleId, roleGroup.getName()); addAdministratorOnlyButton(tableRow.addCell(), "submit_delete_wf_role_" + roleId, T_delete); } else { tableRow.addCell().addContent(T_no_role); addAdministratorOnlyButton(tableRow.addCell(), "submit_create_wf_role_" + roleId, T_create); } // help and directions row tableRow = rolesTable.addRow(Row.ROLE_DATA); tableRow.addCell(); if (role.getDescription() != null){ tableRow.addCell(1,2).addHighlight("fade offset").addContent(role.getDescription()); } } } } }
subheader.addCell(1, 4).addHighlight("bold").addContent(T_subhead_item); subheader.addCell().addHighlight("bold").addXref(baseURL + "&submit_add_item", T_add_itemPolicy_link); subheader.addCell(null, null, 1, 4, "indent").addHighlight("bold").addContent(T_subhead_bundle.parameterize(bundle.getName(),bundle.getID())); subheader.addCell().addHighlight("bold").addXref(baseURL + "&submit_add_bundle_" + bundle.getID(), T_add_bundlePolicy_link);
Highlight highlight = cell.addHighlight("fade"); highlight.addContent("["); highlight.addXref(contextPath+"/handle/"+collection.getHandle(), T_groups_collection_link); row.addCell().addHighlight("warn").addContent(T_pending);
row.addCell(0,5).addHighlight("italic").addContent(T_w_info2); row.addCell(0,5).addHighlight("italic").addContent(T_w_info3);
personData.addCell().addHighlight("warn").addContent(T_pending);
table.addRow().addCell(1,4).addHighlight("italic").addContent(T_empty); main.addPara().addButton("submit_return").setValue(T_submit_return);
Highlight highlight = cell.addHighlight("fade"); cell.addHighlight("italic").addContent(T_no_results);
tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step1); tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step2); tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step3);
Highlight highlight = row.addCell().addHighlight("fade"); highlight.addContent("["); highlight.addXref(viewURL, T_view_link); cell.addHighlight("fade").addContent(T_no_upload);
Cell groupCell = row.addCell(); groupCell.addContent(policyGroup.getName()); Highlight groupHigh = groupCell.addHighlight("fade"); groupHigh.addContent(" ["); groupHigh.addXref(baseURL + "&submit_edit_group&group_id=" + policyGroup.getID(), T_group_edit);
tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_admins); tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_submitters); tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_default_read);
header.addCell(0,5).addHighlight("italic").addContent(T_s_info3);
cell.addHighlight("italic").addContent(T_no_results);
checksumRow.addCell(); Cell checksumCell = checksumRow.addCell(null, null, 0, 6, null); checksumCell.addHighlight("bold").addContent(T_checksum); checksumCell.addContent(" "); checksumCell.addContent(algorithm + ":" + checksum);
tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_admins);