Package org.dspace.app.xmlui.wing.element

Examples of org.dspace.app.xmlui.wing.element.Division


      fields.add(field);
    }
   
    // DIVISION: metadata-field-move
      Division moved = body.addInteractiveDivision("metadata-field-move",contextPath+"/admin/metadata-registry",Division.METHOD_POST,"primary administrative metadata-registry");
      moved.setHead(T_head1);
      moved.addPara(T_para1);
     
      Table table = moved.addTable("metadata-field-move",fields.size() + 1, 3);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_column1);
        header.addCell().addContent(T_column2);
        header.addCell().addContent(T_column3);
     
      for (MetadataField field : fields)
      {
        String fieldID = String.valueOf(field.getFieldID());
      String fieldEelement = field.getElement();
      String fieldQualifier = field.getQualifier();
     
      MetadataSchema schema = MetadataSchema.find(context, field.getSchemaID());
      String schemaName = schema.getName();
     
      String fieldName = schemaName +"."+ fieldEelement;
      if (fieldQualifier != null && fieldQualifier.length() > 0)
        fieldName += "."+fieldQualifier;
       
      String fieldScopeNote = field.getScopeNote();
       
        Row row = table.addRow();
        row.addCell().addContent(fieldID);
          row.addCell().addContent(fieldName);
          row.addCell().addContent(fieldScopeNote);
      }

      Row row = table.addRow();
      Cell cell = row.addCell(1,3);
      cell.addContent(T_para2);
      Select toSchema = cell.addSelect("to_schema");
      for (MetadataSchema schema : schemas)
      {
        toSchema.addOption(schema.getSchemaID(), schema.getNamespace());
      }
     
      Para buttons = moved.addPara();
      buttons.addButton("submit_move").setValue(T_submit_move);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
     
     
      moved.addHidden("administrative-continue").setValue(knot.getId());
    }
View Full Code Here


   
   
   
   
    // DIVISION: manage-mapper
    Division div = body.addInteractiveDivision("manage-mapper",contextPath + "/admin/mapper", Division.METHOD_GET,"primary administrative mapper");
    div.setHead(T_head1);
   
    div.addPara(T_para1.parameterize(collection.getMetadata("name")));
   
    div.addPara(T_para2);
   
   
    // LIST: Author search form
    List form = div.addList("mapper-form")
   
    form.addLabel(T_stat_label);
    form.addItem(T_stat_info.parameterize(count_import,count_native+count_import));
   
    form.addLabel(T_search_label);
    org.dspace.app.xmlui.wing.element.Item queryItem = form.addItem();
    Text query = queryItem.addText("query");
    Button button = queryItem.addButton("submit_author");
    button.setValue(T_submit_search);
    if (!AuthorizeManager.authorizeActionBoolean(context, collection, Constants.ADD))
    {
      query.setDisabled();
      button.setDisabled();
      queryItem.addHighlight("fade").addContent(T_no_add);
    }
   
    // PARA: actions
    Para actions = div.addPara();
    actions.addButton("submit_browse").setValue(T_submit_browse);
    actions.addButton("submit_return").setValue(T_submit_return);
   
   
    div.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

      showfull = null;
   
   
        // Generate a from asking the user two questions: multiple
        // titles & published before.
      Division div = body.addInteractiveDivision("perform-task", actionURL, Division.METHOD_POST, "primary workflow");
        div.setHead(T_workflow_head);
     
     
        if (showfull == null)
        {
          ReferenceSet referenceSet = div.addReferenceSet("narf",ReferenceSet.TYPE_SUMMARY_VIEW);
          referenceSet.addReference(item);
          div.addPara().addButton("showfull").setValue(T_showfull);
        }
        else
        {
            ReferenceSet referenceSet = div.addReferenceSet("narf",ReferenceSet.TYPE_DETAIL_VIEW);
            referenceSet.addReference(item);
            div.addPara().addButton("showsimple").setValue(T_showsimple);
           
            div.addHidden("showfull").setValue("true");
        }
     
      
        //FIXME: set the correct table size.
        Table table = div.addTable("workflow-actions", 1, 1);
        table.setHead(T_info1);
       
        // Header
        Row row;

        if (state == WFSTATE_STEP1POOL ||
          state == WFSTATE_STEP2POOL ||
          state == WFSTATE_STEP3POOL)
        {
          // Take task
          row = table.addRow();
          row.addCellContent(T_take_help);
          row.addCell().addButton("submit_take_task").setValue(T_take_submit);
      
          // Leave task
          row = table.addRow();
          row.addCellContent(T_leave_help);
          row.addCell().addButton("submit_leave").setValue(T_leave_submit);
        }
       
        if (state == WFSTATE_STEP1 ||
          state == WFSTATE_STEP2)
        {
          // Approve task
          row = table.addRow();
          row.addCellContent(T_approve_help);
          row.addCell().addButton("submit_approve").setValue(T_approve_submit);
        }
       
        if (state == WFSTATE_STEP3)
        {
          // Commit to archive
          row = table.addRow();
          row.addCellContent(T_commit_help);
          row.addCell().addButton("submit_approve").setValue(T_commit_submit);
        }
       
        if (state == WFSTATE_STEP1 ||
          state == WFSTATE_STEP2)
        {
          // Reject item
          row = table.addRow();
          row.addCellContent(T_reject_help);
          row.addCell().addButton("submit_reject").setValue(T_reject_submit);
        }
       
        if (state == WFSTATE_STEP2 ||
          state == WFSTATE_STEP3 )
        {
          // Edit metadata
          row = table.addRow();
          row.addCellContent(T_edit_help);
          row.addCell().addButton("submit_edit").setValue(T_edit_submit);
        }
       
        if (state == WFSTATE_STEP1 ||
            state == WFSTATE_STEP2 ||
            state == WFSTATE_STEP3 )
        {
          // Return to pool
          row = table.addRow();
          row.addCellContent(T_return_help);
          row.addCell().addButton("submit_return").setValue(T_return_submit);
        }
       
       
        // Everyone can just cancel
        row = table.addRow();
        row.addCell(0, 2).addButton("submit_leave").setValue(T_cancel_submit);
       
        div.addHidden("submission-continue").setValue(knot.getId());
    }
View Full Code Here

   
       
 
       
        // DIVISION: edit-bitstream-format
    Division main = body.addInteractiveDivision("edit-bitstream-format",contextPath+"/admin/format-registry",Division.METHOD_POST,"primary administrative format-registry");
    if (formatID == -1)
      main.setHead(T_head1);
    else
      main.setHead(T_head2.parameterize(nameValue));
    main.addPara(T_para1);
 
    List form = main.addList("edit-bitstream-format",List.TYPE_FORM);
   
    Text name = form.addItem().addText("short_description");
    name.setRequired();
    name.setLabel(T_name);
    name.setHelp(T_name_help);
    name.setValue(nameValue);
    name.setSize(35);
    if (errors.contains("short_description"))
      name.addError(T_name_error);
   
    Text mimeType = form.addItem().addText("mimetype");
    mimeType.setLabel(T_mimetype);
    mimeType.setHelp(T_mimetype_help);
    mimeType.setValue(mimetypeValue);
    mimeType.setSize(35);
   
    // Do not allow anyone to change the name of the unknown format.
    if (format != null && format.getID() == 1)
      name.setDisabled();

    TextArea description = form.addItem().addTextArea("description");
    description.setLabel(T_description);
    description.setValue(descriptionValue);
    description.setSize(3, 35);
   
    Select supportLevel = form.addItem().addSelect("support_level");
    supportLevel.setLabel(T_support);
    supportLevel.setHelp(T_support_help);
    supportLevel.addOption(0,T_support_0);
    supportLevel.addOption(1,T_support_1);
    supportLevel.addOption(2,T_support_2);
    supportLevel.setOptionSelected(supportLevelValue);
   
    CheckBox internal = form.addItem().addCheckBox("internal");
    internal.setLabel(T_internal);
    internal.setHelp(T_internal_help);
    internal.addOption((internalValue != null),"true");
   
    Text extensions = form.addItem().addText("extensions");
    extensions.setLabel(T_extensions);
    extensions.setHelp(T_extensions_help);
    extensions.enableAddOperation();
    extensions.enableDeleteOperation();
    for (String extensionValue : extensionValues)
    {
      extensions.addInstance().setValue(extensionValue);
    }
   
    Item actions = form.addItem();
    actions.addButton("submit_save").setValue(T_submit_save);
    actions.addButton("submit_cancel").setValue(T_submit_cancel);
   
   
    main.addHidden("administrative-continue").setValue(knot.getId());
       
   }
View Full Code Here

    public void addBody(Body body) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {
        if (this.bodyEmpty)
        {
            Division notFound = body.addDivision("page-not-found","primary");
           
            notFound.setHead(T_head);
           
            notFound.addPara(T_para1);
           
            notFound.addPara().addXref(contextPath + "/",T_go_home);

      HttpServletResponse response = (HttpServletResponse)objectModel
    .get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
      response.setStatus(HttpServletResponse.SC_NOT_FOUND);
        }
View Full Code Here

    if (showfull != null && request.getParameter("showsimple") != null)
      showfull = null;
   
   

      Division div = body.addInteractiveDivision("reject-task", actionURL, Division.METHOD_POST, "primary workflow");
        div.setHead(T_workflow_head);
     
     
        if (showfull == null)
        {
          ReferenceSet referenceSet = div.addReferenceSet("narf",ReferenceSet.TYPE_SUMMARY_VIEW);
          referenceSet.addReference(item);
          div.addPara().addButton("showfull").setValue(T_showfull);
        }
        else
        {
            ReferenceSet referenceSet = div.addReferenceSet("narf",ReferenceSet.TYPE_DETAIL_VIEW);
            referenceSet.addReference(item);
            div.addPara().addButton("showsimple").setValue(T_showsimple);
           
            div.addHidden("showfull").setValue("true");
        }
       

        List form = div.addList("reject-workflow",List.TYPE_FORM);
       
        form.addItem(T_info1);
       
        TextArea reason = form.addItem().addTextArea("reason");
        reason.setLabel(T_reason);
        reason.setRequired();
        reason.setSize(15, 50);
        if (this.errorFields.contains("reason"))
          reason.addError(T_reason_required);
     
        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);
       
        div.addHidden("submission-continue").setValue(knot.getId());

        log.info(LogManager.getHeader(context, "get_reject_reason",
                "workflow_id=" + submission.getID() + ",item_id="
                        + item.getID()));
    }
View Full Code Here

      phoneValue = request.getParameter("phone");
   
   
   
    // DIVISION: eperson-edit
      Division edit = body.addInteractiveDivision("eperson-edit",contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative eperson");
      edit.setHead(T_head1);
     
     
      if (errors.contains("eperson_email_key")) {
        Para problem = edit.addPara();
        problem.addHighlight("bold").addContent(T_email_taken);
      }
       
     
        List identity = edit.addList("form",List.TYPE_FORM);
        identity.setHead(T_head2.parameterize(eperson.getFullName()));      
       
        if (admin)
        {
          Text email = identity.addItem().addText("email_address");
          email.setRequired();
          email.setLabel(T_email_address);
          email.setValue(emailValue);
          if (errors.contains("eperson_email_key"))
            email.addError(T_error_email_unique);
          else if (errors.contains("email_address"))
            email.addError(T_error_email);
        }
        else
        {
          identity.addLabel(T_email_address);
          identity.addItem(emailValue);
        }
       
        if (admin)
        {
          Text firstName = identity.addItem().addText("first_name");
          firstName.setRequired();
          firstName.setLabel(T_first_name);
          firstName.setValue(firstValue);
          if (errors.contains("first_name"))
            firstName.addError(T_error_fname);
        }
        else
        {
          identity.addLabel(T_first_name);
          identity.addItem(firstValue);
        }
       
        if (admin)
        {
          Text lastName = identity.addItem().addText("last_name");
          lastName.setRequired();
          lastName.setLabel(T_last_name);
          lastName.setValue(lastValue);
          if (errors.contains("last_name"))
            lastName.addError(T_error_lname);
        }
        else
        {
          identity.addLabel(T_last_name);
          identity.addItem(lastValue);
        }
       
        if (admin)
        {
          Text phone = identity.addItem().addText("phone");
          phone.setLabel(T_telephone);
          phone.setValue(phoneValue);
        }
        else
        {
          identity.addLabel(T_telephone);
          identity.addItem(phoneValue);
        }
       
        if (admin)
        { 
          // Administrative options:
          CheckBox canLogInField = identity.addItem().addCheckBox("can_log_in");
          canLogInField.setLabel(T_can_log_in);
          canLogInField.addOption(canLogInValue, "true");
         
          CheckBox certificateField = identity.addItem().addCheckBox("certificate");
          certificateField.setLabel(T_req_certs);
          certificateField.addOption(certificatValue,"true");
         
         
          // Buttons to reset, delete or login as
          identity.addItem().addHighlight("italic").addContent(T_special_help);
          Item special = identity.addItem();
          special.addButton("submit_reset_password").setValue(T_submit_reset_password);
         
          Button submitDelete = special.addButton("submit_delete");
          submitDelete.setValue(T_submit_delete);
        
          Button submitLoginAs = special.addButton("submit_login_as");
          submitLoginAs.setValue(T_submit_login_as);
          if (!ConfigurationManager.getBooleanProperty("xmlui.user.assumelogin", false))
            submitLoginAs.setDisabled();
        
          if (deleteConstraints != null && deleteConstraints.size() > 0)
          {
            submitDelete.setDisabled();
           
            Highlight hi = identity.addItem("eperson-delete-constraint","eperson-delete-constraint").addHighlight("error");
            hi.addContent(T_delete_constraint);
            hi.addContent(" ");
           
            for (String constraint : deleteConstraints)
            {
              int idx = deleteConstraints.indexOf(constraint);
              if (idx > 0 && idx == deleteConstraints.size() -1 )
              {
                hi.addContent(", ");
                hi.addContent(T_constraint_last_conjunction);
                hi.addContent(" ");
              }
              else if (idx > 0)
                hi.addContent(", ");
             
              if ("item".equals(constraint))
                hi.addContent(T_constraint_item);
              else if ("workflowitem".equals(constraint))
                hi.addContent(T_constraint_workflowitem);
              else if ("tasklistitem".equals(constraint))
                hi.addContent(T_constraint_tasklistitem);
              else
                hi.addContent(T_constraint_unknown);
             
            }
            hi.addContent(".");
          }
        }
       
       
        Item buttons = identity.addItem();
        if (admin)
          buttons.addButton("submit_save").setValue(T_submit_save);
        buttons.addButton("submit_cancel").setValue(T_submit_cancel);
       
       
       
        if (admin)
        {
          List member = edit.addList("eperson-member-of");
          member.setHead(T_member_head);

          Group[] groups = Group.allMemberGroups(context, eperson);
          for (Group group : groups)
          {
            String url = contextPath + "/admin/groups?administrative-continue="+knot.getId()+"&submit_edit_group&groupID="+group.getID();
           
            Item item = member.addItem();
            item.addXref(url,group.getName());
           
            // Check if this membership is via another group or not, if so then add a note.
            Group via = findViaGroup(eperson, group);
            if (via != null)
              item.addHighlight("fade").addContent(T_indirect_member.parameterize(via.getName()));
           
          }
         
          if (groups.length <= 0)
            member.addItem().addHighlight("italic").addContent(T_member_none);
         
        }
       
      edit.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

    else if ("success".equals(outcome))
      rend += " success";
    else if ("failure".equals(outcome))
      rend += " failure";
   
    Division div = body.addDivision("general-message",rend);
    if ((header != null) && (!"".equals(header)))
      div.setHead(message(header));
    else
      div.setHead(T_head);

    if (message != null && message.length() > 0)
      div.addPara(message(message));
   
    if (characters != null && characters.length() > 0)
      div.addPara(characters);
  }
View Full Code Here

    MetadataSchema[] schemas = MetadataSchema.findAll(context);
       
   
   
        // DIVISION: metadata-registry-main
    Division main = body.addInteractiveDivision("metadata-registry-main",contextPath+"/admin/metadata-registry",Division.METHOD_POST,"primary administrative metadata-registry ");
    main.setHead(T_head1);
    main.addPara(T_para1);
   
    Table table = main.addTable("metadata-registry-main-table", schemas.length+1, 5);
   
    Row header = table.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
    header.addCellContent(T_column4);
   
    for (MetadataSchema schema : schemas)
    {
      int schemaID     = schema.getSchemaID();
      String namespace = schema.getNamespace();
      String name      = schema.getName();
      String url = contextPath + "/admin/metadata-registry?administrative-continue="+knot.getId()+"&submit_edit&schemaID="+schemaID;
     
      Row row = table.addRow();
      if (schemaID > 1)
      {
        // If the schema is not in the required DC schema allow the user to delete it. 
        CheckBox select = row.addCell().addCheckBox("select_schema");
        select.setLabel(String.valueOf(schemaID));
        select.addOption(String.valueOf(schemaID));
      }
      else
      {
        // The DC schema can not be removed.
        row.addCell();
      }
     
      row.addCell().addContent(schemaID);
      row.addCell().addXref(url,namespace);
      row.addCell().addXref(url,name);
    }
    if (schemas.length > 1)
    {
      // Only give the delete option if there are more schema's than the required dublin core.
      main.addPara().addButton("submit_delete").setValue(T_submit_delete);
    }
   
   
   
    // DIVISION: add new schema
    Division newSchema = main.addDivision("add-schema");
    newSchema.setHead(T_head2);
   
    List form = newSchema.addList("new-schema",List.TYPE_FORM);
   
    Text namespace = form.addItem().addText("namespace");
    namespace.setLabel(T_namespace);
    namespace.setRequired();
    namespace.setHelp(T_namespace_help);
View Full Code Here

    int groupID = parameters.getParameterAsInteger("groupID", -1);
    Group toBeDeleted = Group.find(context, groupID);
   
   
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-role-delete",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection");
      main.setHead(T_main_head.parameterize(role));
      // Different help message for the default read group to enforce its non-retroactive nature
      if (role == "DEFAULT_READ")
        main.addPara(T_main_para_read.parameterize(toBeDeleted.getName()));
      else
        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());
    }
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.wing.element.Division

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.