personData.addCell().addContent(eperson.getID()); nameCell.addXref(url, fullName); if (pendingAddition) nameCell.addContent(" "); nameCell.addHighlight("warn").addContent(T_members_pending); personData.addCell().addXref(url, email); personData.addCell().addHighlight("warn").addContent(T_pending); personData.addCell().addButton("submit_remove_eperson_" + eperson.getID()).setValue(T_submit_remove);
String rend) throws WingException Cell cell = new Cell(context, name, role, rows, cols, rend); contents.add(cell); return cell;
protected void buildSearchControls(Division div) throws WingException, SQLException { Request request = ObjectModelHelper.getRequest(objectModel); Table controlsTable = div.addTable("search-controls", 1, 3); Row controlsRow = controlsTable.addRow(Row.ROLE_DATA); // Create a control for the number of records to display Cell rppCell = controlsRow.addCell(); rppCell.addContent("pagesize"); Select rppSelect = rppCell.addSelect("rpp"); for (int i : RESULTS_PER_PAGE_PROGRESSION) { rppSelect.addOption((i == getParameterRpp()), i, Integer.toString(i)); } Cell filterCell = controlsRow.addCell(); // Create a drop down of the different sort columns available int selectedCollectionId = Util.getIntParameter(request, "filter_collection"); filterCell.addContent("Collection filter:"); Select sortSelect = filterCell.addSelect("filter_collection"); sortSelect.addOption(-1 == selectedCollectionId,-1, "None"); Collection[] collections = Collection.findAll(context); for (Collection collection : collections) { sortSelect.addOption(collection.getID() == selectedCollectionId, collection.getID(), collection.getName()); } controlsRow.addCell().addButton("submit_search_controls").setValue(T_go); }
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); } } }
/** * Add a new cell to the table. The cell element contained in a row of a * table carries content for that table. It is a character container, just * like p, item, and hi, and its primary purpose is to display textual data, * possibly enhanced with hyperlinks, emphasized blocks of text, images and * form fields. * * Once the cell has been created set the cell's contents to the provided * content. * * @param message * (Required) Key to the i18n catalogue to translate the content * into the language preferred by the user. */ public void addCellContent(Message message) throws WingException { Cell cell = this.addCell(); cell.addContent(message); }
private void renderFacetField(SearchFilterParam browseParams, DSpaceObject dso, String facetField, Table singleTable, List<String> filterQueries, DiscoverResult.FacetResult value) throws SQLException, WingException, UnsupportedEncodingException { String displayedValue = value.getDisplayedValue(); String filterQuery = value.getAsFilterQuery(); // if(field.getGap() != null){ // //We have a date get the year so we can display it // DateFormat simpleDateformat = new SimpleDateFormat("yyyy"); // displayedValue = simpleDateformat.format(SolrServiceImpl.toDate(displayedValue)); // filterQuery = ClientUtils.escapeQueryChars(value.getFacetField().getName()) + ":" + displayedValue + "*"; // } Cell cell = singleTable.addRow().addCell(); //No use in selecting the same filter twice if(filterQueries.contains(filterQuery)){ cell.addContent(displayedValue + " (" + value.getCount() + ")"); } else { //Add the basics Map<String, String> urlParams = new HashMap<String, String>(); urlParams.putAll(browseParams.getCommonBrowseParams()); String url = generateURL(contextPath + (dso == null ? "" : "/handle/" + dso.getHandle()) + "/discover", urlParams); //Add already existing filter queries url = addFilterQueriesToUrl(url); //Last add the current filter query url += "&fq=" + URLEncoder.encode(filterQuery, "UTF-8"); cell.addXref(url, displayedValue + " (" + value.getCount() + ")" ); } }
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()); } } } } }
CheckBox select = cell.addCheckBox("select_format"); select.setLabel(id); select.addOption(id); row.addCell().addContent(id); row.addCell().addXref(url, name); cell.addXref(url, mimeType); if (internal) cell.addContent(" "); cell.addContent(T_internal); row.addCell().addXref(url, T_support_0); break; case 1: row.addCell().addXref(url, T_support_1); break; case 2: row.addCell().addXref(url, T_support_2); break;
header.addCell().addContent(T_column1); header.addCell().addContent(T_column2); header.addCell().addContent(T_column3); header.addCell().addContent(T_column4); CheckBox remove = row.addCell().addCheckBox("remove_"+index); remove.setLabel("remove"); remove.addOption(index); cell.addContent(name.replaceAll("_", ". ")); cell.addHidden("name_"+index).setValue(name); Params.PRESENTATION_SELECT.equals(cmgr.getPresentation(fieldKey))) Select mdSelect = mdCell.addSelect("value_"+index); mdSelect.setSize(1); Choices cs = cmgr.getMatches(fieldKey, value.value, collectionID, 0, 0, null); TextArea mdValue = mdCell.addTextArea("value_"+index); mdValue.setSize(4,35); mdValue.setValue(value.value); Text mdLang = row.addCell().addText("language_"+index); mdLang.setSize(6); mdLang.setValue(value.language);
header.addCell().addContent(T_groups_column1); header.addCell().addContent(T_groups_column2); header.addCell().addContent(T_groups_column3); header.addCell().addContent(T_groups_column4); row.addCell().addContent(groupID); row.addCell().addXref(url,name); row.addCell().addContent(otherAuthorizations.substring(0,otherAuthorizations.lastIndexOf(", "))); row.addCell().addContent("-"); row.addCell().addButton("submit_group_id_" + groupID).setValue(T_set_group); row.addCell().addContent(T_current_group); table.addRow().addCell(1, 4).addContent(T_no_results);
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.addContent(" "); nameCell.addHighlight("warn").addContent(T_members_pending); groupData.addCell().addContent("-"); groupData.addCell().addHighlight("warn").addContent(T_pending); groupData.addCell().addButton("submit_remove_group_" + group.getID()).setValue(T_submit_remove);
header.addCell().addContent(T_column1); header.addCell().addContent(T_column2); header.addCell().addContent(T_column3); row.addCell().addContent(fieldID); row.addCell().addContent(fieldName.toString()); row.addCell().addContent(fieldScopeNote); cell.addContent(T_para2); Select toSchema = cell.addSelect("to_schema"); for (MetadataSchema schema : schemas)
header.addCell().addContent(T_epeople_column1); header.addCell().addContent(T_epeople_column2); header.addCell().addContent(T_epeople_column3); header.addCell().addContent(T_epeople_column4); personData.addCell().addContent(person.getID()); personData.addCell().addContent(fullName); personData.addCell().addContent(email); personData.addCell().addButton("submit_select_reviewer_"+epersonID).setValue(T_select_reviewer_button);
itemRow.addCell().addCheckBox("workflow_id").addOption(wfi.getID()); itemRow.addCell().addXref(request.getContextPath() + "/admin/display-workflowItem?wfiId=" +wfi.getID(), item.getName() ); itemRow.addCell().addXref(HandleManager.resolveToURL(context, wfi.getCollection().getHandle()), wfi.getCollection().getName()); itemRow.addCell().addXref("mailto:" + wfi.getSubmitter().getEmail(), wfi.getSubmitter().getFullName());
private void renderMainPage(Division div) throws WingException { Table table = div.addTable("workflow-actions", 1, 1); table.setHead(T_info1); // Approve task Row row = table.addRow(); row.addCellContent(T_approve_help); row.addCell().addButton("submit_approve").setValue(T_approve_submit); // Reject item row = table.addRow(); row.addCellContent(T_reject_help); row.addCell().addButton("submit_reject").setValue(T_reject_submit); // Everyone can just cancel row = table.addRow(); row.addCell(0, 2).addButton("submit_leave").setValue(T_cancel_submit); div.addHidden("page").setValue(org.dspace.xmlworkflow.state.actions.processingaction.ReviewAction.MAIN_PAGE); }
/** * Build a conjunction field in the given for the given cell. A * conjunction consists of logical the operators AND, OR, NOT. * * @param row The current row * @param cell The current cell */ private void buildConjunctionField(int row, Cell cell) throws WingException { // No conjunction for the first row. if (row == 1) { return; } Request request = ObjectModelHelper.getRequest(objectModel); String current = request.getParameter("conjunction" + row); // default to AND if nothing specified. if (current == null || current.length() == 0) { current = "AND"; } Select select = cell.addSelect("conjunction" + row); select.addOption("AND".equals(current), "AND").addContent(T_and); select.addOption("OR".equals(current), "OR").addContent(T_or); select.addOption("NOT".equals(current), "NOT").addContent(T_not); }
/** * Add a new cell to the table. The cell element contained in a row of a * table carries content for that table. It is a character container, just * like p, item, and hi, and its primary purpose is to display textual data, * possibly enhanced with hyperlinks, emphasized blocks of text, images and * form fields. * * Once the cell has been created set the cell's contents to the provided * content. * * @param characters * (Required) Untranslated character data to be included. */ public void addCellContent(String characters) throws WingException { Cell cell = this.addCell(); cell.addContent(characters); }
cell.addContent(displayedValue + " (" + value.getCount() + ")"); } else { cell.addXref( contextPath + (dso == null ? "" : "/handle/" + dso.getHandle()) + "/discover?" +
Row header = table.addRow(Row.ROLE_HEADER); header.addCell(); header.addCell().addContent(T_head_id); header.addCell().addContent(T_head_action); header.addCell().addContent(T_head_group); header.addCell(); 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); for (Bitstream bitstream : bitstreams) { subheader = table.addRow(null,Row.ROLE_HEADER,"subheader"); subheader.addCell(null, null, 1, 4, "doubleIndent").addContent(T_subhead_bitstream.parameterize(bitstream.getName(),bitstream.getID())); subheader.addCell().addXref(baseURL + "&submit_add_bitstream_" + bitstream.getID(), T_add_bitstreamPolicy_link);
CheckBox select = row.addCell().addCheckBox("select_schema"); select.setLabel(String.valueOf(schemaID)); select.addOption(String.valueOf(schemaID)); row.addCell().addContent(schemaID); row.addCell().addXref(url, namespace); row.addCell().addXref(url, name);