/** * Set the button's label, removing any previous label's * * @param characters * (May be null) The button's label as a string. */ public void setValue(String characters) throws WingException { Value value = this.setValue(); value.addContent(characters); }
/** * Set the button's label, removing any previous labels. * * @param translated * (Required) A key into the i18n catalogue for translation into * the user's preferred language. */ public void setValue(Message translated) throws WingException { Value value = this.setValue(); value.addContent(translated); } }
/** * Add a disabled button with a "not allowed" notice * @param item * @param buttonName * @param buttonLabel * @throws WingException * @throws SQLException */ private void addNotAllowedButton(org.dspace.app.xmlui.wing.element.Item item, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = item.addButton(buttonName); button.setValue(buttonLabel); button.setDisabled(); item.addHighlight("fade").addContent(T_not_allowed); }
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 addCollectionAdminOnlyButton(org.dspace.app.xmlui.wing.element.Item item, Collection collection, String buttonName, Message buttonLabel) throws WingException, SQLException { Button button = item.addButton(buttonName); button.setValue(buttonLabel); if (!AuthorizeManager.isAdmin(context, collection)) { // Only admins can create or delete button.setDisabled(); item.addHighlight("fade").addContent(T_collectionadmins_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); } } }
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException { Collection collection = submission.getCollection(); String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue"; Division div = body.addInteractiveDivision("submit-save-or-cancel",actionURL, Division.METHOD_POST,"primary submission"); div.setHead(T_submission_head); addSubmissionProgressList(div); List saveOrCancel = div.addList("submit-review", List.TYPE_FORM); saveOrCancel.setHead(T_head); saveOrCancel.addItem(T_info1); org.dspace.app.xmlui.wing.element.Item actions = saveOrCancel.addItem(); actions.addButton("submit_back").setValue(T_submit_back); actions.addButton("submit_save").setValue(T_submit_save); actions.addButton("submit_remove").setValue(T_submit_remove); } }
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException { Division search = body.addInteractiveDivision("front-page-search",contextPath+"/discover",Division.METHOD_GET,"primary"); search.setHead(T_head); search.addPara(T_para1); Para fields = search.addPara(); fields.addText("query"); fields.addButton("submit").setValue(T_go); } }
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); }
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); // Edit metadata row = table.addRow(); row.addCellContent(T_edit_help); row.addCell().addButton("submit_edit").setValue(T_edit_submit); // Everyone can just cancel row = table.addRow(); row.addCell(0, 2).addButton("submit_leave").setValue(T_submit_cancel); div.addHidden("page").setValue(ReviewAction.MAIN_PAGE); } }
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); // Edit metadata row = table.addRow(); row.addCellContent(T_edit_help); row.addCell().addButton("submit_edit").setValue(T_edit_submit); // Everyone can just cancel row = table.addRow(); row.addCell(0, 2).addButton("submit_leave").setValue(T_cancel_submit); div.addHidden("page").setValue(ReviewAction.MAIN_PAGE); }
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException { Division search = body.addInteractiveDivision("front-page-search",contextPath+"/search",Division.METHOD_GET,"primary"); search.setHead(T_head); search.addPara(T_para1); Para fields = search.addPara(); fields.addText("query"); fields.addButton("submit").setValue(T_go); } }
private void renderRejectPage(Division div) throws WingException { Request request = ObjectModelHelper.getRequest(objectModel); List form = div.addList("reject-workflow",List.TYPE_FORM); form.addItem(T_info2); TextArea reason = form.addItem().addTextArea("reason"); reason.setLabel(T_reason); reason.setRequired(); reason.setSize(15, 50); if (Action.getErrorFields(request).contains("reason")) reason.addError(T_reason_required); div.addHidden("page").setValue(ReviewAction.REJECT_PAGE); org.dspace.app.xmlui.wing.element.Item actions = form.addItem(); actions.addButton("submit_reject").setValue(T_submit_reject); actions.addButton("submit_cancel").setValue(T_submit_cancel); } }
private void renderRejectPage(Division div) throws WingException { Request request = ObjectModelHelper.getRequest(objectModel); List form = div.addList("reject-workflow",List.TYPE_FORM); form.addItem(T_info2); TextArea reason = form.addItem().addTextArea("reason"); reason.setLabel(T_reason); reason.setRequired(); reason.setSize(15, 50); if (Action.getErrorFields(request).contains("reason")) reason.addError(T_reason_required); div.addHidden("page").setValue(ReviewAction.REJECT_PAGE); org.dspace.app.xmlui.wing.element.Item actions = form.addItem(); actions.addButton("submit_reject").setValue(T_submit_reject); actions.addButton("submit_cancel").setValue(T_submit_cancel); } }
private void renderRejectPage(Division div) throws WingException { Request request = ObjectModelHelper.getRequest(objectModel); List form = div.addList("reject-workflow",List.TYPE_FORM); form.addItem(T_info2); TextArea reason = form.addItem().addTextArea("reason"); reason.setLabel(T_reason); reason.setRequired(); reason.setSize(15, 50); if (Action.getErrorFields(request).contains("reason")) reason.addError(T_reason_required); div.addHidden("page").setValue(org.dspace.xmlworkflow.state.actions.processingaction.ReviewAction.REJECT_PAGE); org.dspace.app.xmlui.wing.element.Item actions = form.addItem(); actions.addButton("submit_reject").setValue(T_submit_reject); actions.addButton("submit_cancel").setValue(T_submit_cancel); } }
public void addBody(Body body) throws WingException, SQLException, AuthorizeException { String role = parameters.getParameter("role", null); int groupID = parameters.getParameterAsInteger("groupID", -1); Group toBeDeleted = Group.find(context, groupID); // DIVISION: main Division main = body.addInteractiveDivision("community-role-delete",contextPath+"/admin/community",Division.METHOD_POST,"primary administrative community"); main.setHead(T_main_head.parameterize(role)); main.addPara(T_main_para.parameterize(toBeDeleted.getName())); Para buttonList = main.addPara(); buttonList.addButton("submit_confirm").setValue(T_submit_confirm); buttonList.addButton("submit_cancel").setValue(T_submit_cancel); main.addHidden("administrative-continue").setValue(knot.getId()); } }
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException { Division div = body.addInteractiveDivision("submit-complete",contextPath+"/handle/"+handle+"/submit", Division.METHOD_POST,"primary submission"); div.setHead(T_head); div.addPara(T_info1); div.addPara().addXref(contextPath+"/submissions",T_go_submission); div.addPara().addButton("submit_again").setValue(T_submit_again); div.addHidden("handle").setValue(handle); }
public void addBody(Body body) throws SAXException, WingException, SQLException { // DIVISION: metadata-import Division div = body.addInteractiveDivision("metadata-import",contextPath + "/admin/metadataimport", Division.METHOD_MULTIPART,"primary administrative"); div.setHead(T_head1); Para file = div.addPara(); file.addFile("file"); Para actions = div.addPara(); Button button = actions.addButton("submit_upload"); button.setValue(T_submit_upload); div.addHidden("administrative-continue").setValue(knot.getId()); }
public void addBody(Body body) throws WingException, SQLException, AuthorizeException { int collectionID = parameters.getParameterAsInteger("collectionID", -1); Collection thisCollection = Collection.find(context, collectionID); // DIVISION: main Division main = body.addInteractiveDivision("collection-confirm-delete",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection"); main.setHead(T_main_head.parameterize(collectionID)); main.addPara(T_main_para.parameterize(thisCollection.getMetadata("name"))); List deleteConfirmHelp = main.addList("consequences",List.TYPE_BULLETED); deleteConfirmHelp.addItem(T_confirm_item1); deleteConfirmHelp.addItem(T_confirm_item2); deleteConfirmHelp.addItem(T_confirm_item3); Para buttonList = main.addPara(); buttonList.addButton("submit_confirm").setValue(T_submit_confirm); buttonList.addButton("submit_cancel").setValue(T_submit_cancel); main.addHidden("administrative-continue").setValue(knot.getId()); } }
public void addBody(Body body) throws WingException, SQLException, AuthorizeException { int communityID = parameters.getParameterAsInteger("communityID", -1); Community thisCommunity = Community.find(context, communityID); // DIVISION: main Division main = body.addInteractiveDivision("community-confirm-delete",contextPath+"/admin/community",Division.METHOD_POST,"primary administrative community"); main.setHead(T_main_head.parameterize(communityID)); main.addPara(T_main_para.parameterize(thisCommunity.getMetadata("name"))); List deleteConfirmHelp = main.addList("consequences",List.TYPE_BULLETED); deleteConfirmHelp.addItem(T_confirm_item1); deleteConfirmHelp.addItem(T_confirm_item2); deleteConfirmHelp.addItem(T_confirm_item3); deleteConfirmHelp.addItem(T_confirm_item4); Para buttonList = main.addPara(); buttonList.addButton("submit_confirm").setValue(T_submit_confirm); buttonList.addButton("submit_cancel").setValue(T_submit_cancel); main.addHidden("administrative-continue").setValue(knot.getId()); } }