Examples of Division


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

      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

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

    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

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

    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

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

    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

Examples of pass.Division

public class DivisionTest extends TestCase {
  private Division division;
 
  protected void setUp() throws Exception {
    super.setUp();
    division = new Division();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.