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

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


    boolean certificateValue = (request.getParameter("certificate") == null) ? false : true;
          
   
   
    // DIVISION: eperson-add
      Division add = body.addInteractiveDivision("eperson-add",contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative eperson");
     
      add.setHead(T_head1);
     
      if (errors.contains("eperson_email_key")) {
        Para problem = add.addPara();
        problem.addHighlight("bold").addContent(T_email_taken);
      }
               
        List identity = add.addList("identity",List.TYPE_FORM);
        identity.setHead(T_head2);      
       
        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);
        }
       
        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);
        }
       
        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);
        }
       
        Text phone = identity.addItem().addText("phone");
        phone.setLabel(T_telephone);
        phone.setValue(phoneValue);
       
        CheckBox canLogIn = identity.addItem().addCheckBox("can_log_in");
        canLogIn.setLabel(T_can_log_in);
        canLogIn.addOption(canLogInValue, "yes");
       
        CheckBox certificate = identity.addItem().addCheckBox("certificate");
        certificate.setLabel(T_req_certs);
        certificate.addOption(certificateValue,"yes");
       
        Item buttons = identity.addItem();
        buttons.addButton("submit_save").setValue(T_submit_create);
        buttons.addButton("submit_cancel").setValue(T_submit_cancel);
       
        add.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here


      EPerson person = EPerson.find(context,Integer.valueOf(id));
      epeople.add(person);
    }
    // DIVISION: epeople-confirm-delete
      Division deleted = body.addInteractiveDivision("epeople-confirm-delete",contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative eperson");
      deleted.setHead(T_confirm_head);
      deleted.addPara(T_confirm_para);
     
      Table table = deleted.addTable("epeople-confirm-delete",epeople.size() + 1, 1);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_head_id);
        header.addCell().addContent(T_head_name);
        header.addCell().addContent(T_head_email);
     
      for (EPerson eperson : epeople)
      {
        Row row = table.addRow();
        row.addCell().addContent(eperson.getID());
          row.addCell().addContent(eperson.getFullName());
          row.addCell().addContent(eperson.getEmail());
      }
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_confirm);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
      deleted.addHidden("administrative-continue").setValue(knot.getId());
    }
View Full Code Here

        int resultCount   = EPerson.searchResultCount(context, query)
        EPerson[] epeople = EPerson.search(context, query, page*PAGE_SIZE, PAGE_SIZE);
       
       
        // DIVISION: eperson-main
    Division main = body.addInteractiveDivision("epeople-main",contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative eperson");
    main.setHead(T_main_head);
   
   
   
   
    // DIVISION: eperson-actions
        Division actions = main.addDivision("epeople-actions");
        actions.setHead(T_actions_head);
       
        List actionsList = actions.addList("actions");
        actionsList.addLabel(T_actions_create);
        actionsList.addItemXref(baseURL+"&submit_add", T_actions_create_link);
        actionsList.addLabel(T_actions_browse);
        actionsList.addItemXref(baseURL+"&query&submit_search",
            T_actions_browse_link);
     
        actionsList.addLabel(T_actions_search);
        org.dspace.app.xmlui.wing.element.Item actionItem = actionsList.addItem();
        Text queryField = actionItem.addText("query");
        if (query != null)
          queryField.setValue(query);
        queryField.setHelp(T_search_help);
        actionItem.addButton("submit_search").setValue(T_go);
      
       
       
        // DIVISION: eperson-search
        Division search = main.addDivision("eperson-search");
    search.setHead(T_search_head);
       
        // If there are more than 10 results the paginate the division.
        if (resultCount > PAGE_SIZE)
    {
          // If there are enough results then paginate the results
          int firstIndex = page*PAGE_SIZE+1;
          int lastIndex = page*PAGE_SIZE + epeople.length;
      
          String nextURL = null, prevURL = null;
          if (page < (resultCount / PAGE_SIZE))
            nextURL = baseURL+"&page="+(page+1);
          if (page > 0)
            prevURL = baseURL+"&page="+(page-1);
         
      search.setSimplePagination(resultCount,firstIndex,lastIndex,prevURL, nextURL);
    }
       
   
         
        Table table = search.addTable("eperson-search-table", epeople.length + 1, 1);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_search_column1);
        header.addCell().addContent(T_search_column2);
        header.addCell().addContent(T_search_column3);
        header.addCell().addContent(T_search_column4);

        CheckBox selectEPerson;
        for (EPerson person : epeople)
        {
          String epersonID = String.valueOf(person.getID());
          String fullName = person.getFullName();
          String email = person.getEmail();
          String url = baseURL+"&submit_edit&epersonID="+epersonID;
          Vector<String> deleteConstraints = person.getDeleteConstraints();
         
         
          Row row;
          if (person.getID() == highlightID)
            // This is a highlighted eperson
            row = table.addRow(null, null, "highlight");
          else
            row = table.addRow();
         
          selectEPerson = row.addCell().addCheckBox("select_eperson");
          selectEPerson.setLabel(epersonID);
          selectEPerson.addOption(epersonID);
          if (deleteConstraints != null && deleteConstraints.size() > 0)
            selectEPerson.setDisabled();
         
         
          row.addCellContent(epersonID);
            row.addCell().addXref(url, fullName);
            row.addCell().addXref(url, email);
        }
       
        if (epeople.length <= 0)
    {
          Cell cell = table.addRow().addCell(1, 4);
          cell.addHighlight("italic").addContent(T_no_results);
        }
        else
        {
          search.addPara().addButton("submit_delete").setValue(T_submit_delete);
        }
   
    main.addHidden("administrative-continue").setValue(knot.getId());
       
   }
View Full Code Here

    String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";
    String licenseText = LicenseUtils.getLicenseText(context
                .getCurrentLocale(), collection, submission.getItem(),
                submission.getSubmitter());
   
    Division div = body.addInteractiveDivision("submit-license",actionURL, Division.METHOD_POST,"primary submission");
    div.setHead(T_submission_head);
    addSubmissionProgressList(div);
   
    Division inner = div.addDivision("submit-license-inner");
    inner.setHead(T_head);
    inner.addPara(T_info1);
    inner.addPara(T_info2);
   
   
    // Add the actual text of the license:
    Division displayLicense = inner.addDivision("submit-license-standard-text","license-text");
    displayLicense.addSimpleHTMLFragment(true, licenseText);
   
    inner.addPara(T_info3);
   
    List controls = inner.addList("submit-review", List.TYPE_FORM);
   
View Full Code Here

        pageMeta.addTrail().addContent(T_trail);
    }
   
  public void addBody(Body body) throws WingException, SQLException
  {
    Division main = body.addInteractiveDivision("advanced-authorization",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
    main.setHead(T_main_head);
    main.addPara(T_main_para);   
   
   
    List actionsList = main.addList("actions","form");
       
    // For all of the selected groups...
    actionsList.addItem().addContent(T_actions_groupSentence);
        actionsList.addLabel(T_actions_policyGroup);
        Select groupSelect = actionsList.addItem().addSelect("group_id");
        groupSelect.setMultiple(true);
        groupSelect.setSize(15);
        for (Group group : Group.findAll(context, Group.NAME))
           groupSelect.addOption(false, group.getID(), group.getName());
       
        // Grant the ability to perform the following action...
        actionsList.addItem().addContent(T_actions_actionSentence);
        actionsList.addLabel(T_actions_policyAction);
        Select actionSelect = actionsList.addItem().addSelect("action_id");
        for( int i = 0; i < Constants.actionText.length; i++ )
            actionSelect.addOption(i, Constants.actionText[i]);
       
        // For all following object types...
        actionsList.addItem().addContent(T_actions_resourceSentence);
        actionsList.addLabel(T_actions_policyResource);
        Select resourceSelect = actionsList.addItem().addSelect("resource_id");
        resourceSelect.addOption(true, Constants.ITEM, "item");
        resourceSelect.addOption(false, Constants.BITSTREAM, "bitstream");
       
        // Across the following collections...
        actionsList.addItem().addContent(T_actions_collectionSentence);
        actionsList.addLabel(T_actions_policyCollections);
        Select collectionsSelect = actionsList.addItem().addSelect("collection_id");
        collectionsSelect.setMultiple(true);
        collectionsSelect.setSize(15);
        for (Collection collection : Collection.findAll(context))
          collectionsSelect.addOption(false, collection.getID(), collection.getMetadata("name"));
       
       
      Para buttons = main.addPara();
      buttons.addButton("submit_add").setValue(T_submit_add);
      buttons.addButton("submit_remove_all").setValue(T_submit_remove_all);
      buttons.addButton("submit_return").setValue(T_submit_return);
     
    main.addHidden("administrative-continue").setValue(knot.getId());
   }
View Full Code Here

      MetadataField field = MetadataField.find(context,Integer.valueOf(id));
      fields.add(field);
    }
    // DIVISION: metadata-field-confirm-delete
      Division deleted = body.addInteractiveDivision("metadata-field-confirm-delete",contextPath+"/admin/metadata-registry",Division.METHOD_POST,"primary administrative metadata-registry");
      deleted.setHead(T_head);
      deleted.addPara(T_para1);
      Para warning = deleted.addPara();
      warning.addHighlight("bold").addContent(T_warning);
      warning.addContent(T_para2);
     
      Table table = deleted.addTable("field-confirm-delete",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)
      {
        if (field == null)
          continue;
       
        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);
      }
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_delete);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
      deleted.addHidden("administrative-continue").setValue(knot.getId());
    }
View Full Code Here

        SubmissionConfig subConfig = submissionInfo.getSubmissionConfig();
       
        //Part A:
        // Build the main Review Form!
        Division div = body.addInteractiveDivision("submit-upload", actionURL, Division.METHOD_POST, "primary submission");
        div.setHead(T_submission_head);
        addSubmissionProgressList(div);
       
        List review = div.addList("submit-review", List.TYPE_FORM);
        review.setHead(T_head);
       
        // Part B:
        // Add review section for each step
       
View Full Code Here

    Collection collection = Collection.find(context,collectionID);
   
    ArrayList<Item> items = getMappedItems(collection);
   
    // DIVISION: browse-items
    Division div = body.addInteractiveDivision("browse-items",contextPath + "/admin/mapper", Division.METHOD_GET,"primary administrative mapper");
    div.setHead(T_head1);
   
    if (AuthorizeManager.authorizeActionBoolean(context, collection, Constants.REMOVE))
    {
      Para actions = div.addPara();
      actions.addButton("submit_unmap").setValue(T_submit_unmap);
      actions.addButton("submit_return").setValue(T_submit_return);
    }
    else
    {
      Para actions = div.addPara();
      Button button = actions.addButton("submit_unmap");
      button.setValue(T_submit_unmap);
      button.setDisabled();
      actions.addButton("submit_return").setValue(T_submit_return);
     
      div.addPara().addHighlight("fade").addContent(T_no_remove);
    }
   
    Table table = div.addTable("browse-items-table",1,1);
   
    Row header = table.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
    header.addCellContent(T_column4);
   
    for (Item item : items)
    {
      String itemID = String.valueOf(item.getID());
      Collection owningCollection = item.getOwningCollection();
      String owning = owningCollection.getMetadata("name");
      String author = "unkown";
      DCValue[] dcAuthors = item.getDC("contributor",Item.ANY,Item.ANY);
      if (dcAuthors != null && dcAuthors.length >= 1)
        author = dcAuthors[0].value;
     
      String title = "untitled";
      DCValue[] dcTitles = item.getDC("title",null,Item.ANY);
      if (dcTitles != null && dcTitles.length >= 1)
        title = dcTitles[0].value;

      String url = contextPath+"/handle/"+item.getHandle();
     
      Row row = table.addRow();
     
      CheckBox select = row.addCell().addCheckBox("itemID");
      select.setLabel("Select");
      select.addOption(itemID);
     
      row.addCellContent(owning);
      row.addCell().addXref(url,author);
      row.addCell().addXref(url,title);
    }
   
    if (AuthorizeManager.authorizeActionBoolean(context, collection, Constants.REMOVE))
    {
      Para actions = div.addPara();
      actions.addButton("submit_unmap").setValue(T_submit_unmap);
      actions.addButton("submit_return").setValue(T_submit_return);
    }
    else
    {
      Para actions = div.addPara();
      Button button = actions.addButton("submit_unmap");
      button.setValue(T_submit_unmap);
      button.setDisabled();
      actions.addButton("submit_return").setValue(T_submit_return);
     
      div.addPara().addHighlight("fade").addContent(T_no_remove);
    }
   
   
   
    div.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

      String introductory_text_error = FlowContainerUtils.checkXMLFragment(thisCollection.getMetadata("introductory_text"));
      String copyright_text_error = FlowContainerUtils.checkXMLFragment(thisCollection.getMetadata("copyright_text"));
      String side_bar_text_error = FlowContainerUtils.checkXMLFragment(thisCollection.getMetadata("side_bar_text"));
     
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-metadata-edit",contextPath+"/admin/collection",Division.METHOD_MULTIPART,"primary administrative collection");
      main.setHead(T_main_head.parameterize(thisCollection.getMetadata("name")));
  
      List options = main.addList("options",List.TYPE_SIMPLE,"horizontal");
      options.addItem().addHighlight("bold").addXref(baseURL+"&submit_metadata",T_options_metadata);
      options.addItem().addXref(baseURL+"&submit_roles",T_options_roles);
      options.addItem().addXref(baseURL+"&submit_harvesting",T_options_harvest);
     
     
      // The grand list of metadata options
      List metadataList = main.addList("metadataList", "form");
     
      // collection name
      metadataList.addLabel(T_label_name);
      Text name = metadataList.addItem().addText("name");
      name.setSize(40);
      name.setValue(thisCollection.getMetadata("name"));
     
      // short description
      metadataList.addLabel(T_label_short_description);
      Text short_description = metadataList.addItem().addText("short_description");
      short_description.setValue(thisCollection.getMetadata("short_description"));
      short_description.setSize(40);
      if (short_description_error != null)
        short_description.addError(short_description_error);
     
      // introductory text
      metadataList.addLabel(T_label_introductory_text);
      TextArea introductory_text = metadataList.addItem().addTextArea("introductory_text");
      introductory_text.setValue(thisCollection.getMetadata("introductory_text"));
      introductory_text.setSize(6, 40);
      if (introductory_text_error != null)
        introductory_text.addError(introductory_text_error);
     
      // copyright text
      metadataList.addLabel(T_label_copyright_text);
      TextArea copyright_text = metadataList.addItem().addTextArea("copyright_text");
      copyright_text.setValue(thisCollection.getMetadata("copyright_text"));
      copyright_text.setSize(6, 40);
      if (copyright_text_error != null)
        copyright_text.addError(copyright_text_error);
     
      // legacy sidebar text; may or may not be used for news
      metadataList.addLabel(T_label_side_bar_text);
      TextArea side_bar_text = metadataList.addItem().addTextArea("side_bar_text");
      side_bar_text.setValue(thisCollection.getMetadata("side_bar_text"));
      side_bar_text.setSize(6, 40);
      if (side_bar_text_error != null)
        side_bar_text.addError(side_bar_text_error);
     
      // license text
      metadataList.addLabel(T_label_license);
      TextArea license = metadataList.addItem().addTextArea("license");
      license.setValue(thisCollection.getMetadata("license"));
      license.setSize(6, 40);
     
      // provenance description
      metadataList.addLabel(T_label_provenance_description);
      TextArea provenance_description = metadataList.addItem().addTextArea("provenance_description");
      provenance_description.setValue(thisCollection.getMetadata("provenance_description"));
      provenance_description.setSize(6, 40);
           
      // the row to upload a new logo
      metadataList.addLabel(T_label_logo);
      metadataList.addItem().addFile("logo");

      // the row displaying an existing logo
      Item item;
      if (thisCollection.getLogo() != null) {
        metadataList.addLabel(T_label_existing_logo);
        item = metadataList.addItem();
        item.addFigure(contextPath + "/bitstream/id/" + thisCollection.getLogo().getID() + "/bob.jpg", null, null);
        item.addButton("submit_delete_logo").setValue(T_submit_delete_logo);
      }
     
      // item template creation and removal
      metadataList.addLabel(T_label_item_template);
      item = metadataList.addItem();
     
      if (thisCollection.getTemplateItem() == null)
        item.addButton("submit_create_template").setValue(T_submit_create_template);
      else
      {
        item.addButton("submit_edit_template").setValue(T_submit_edit_template);
        item.addButton("submit_delete_template").setValue(T_submit_delete_template);
      }
     
    Para buttonList = main.addPara();
      buttonList.addButton("submit_save").setValue(T_submit_save);
        //Only System Admins can Delete Collections
      if (AuthorizeManager.isAdmin(context))
        {
        buttonList.addButton("submit_delete").setValue(T_submit_delete);
        }
      buttonList.addButton("submit_return").setValue(T_submit_return);
     
      main.addHidden("administrative-continue").setValue(knot.getId());
    }
View Full Code Here

    {
      for (String error : errorString.split(","))
        errors.add(error);
    }
       
        Division main = body.addInteractiveDivision("authorization-main",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
    main.setHead(T_main_head);
    //main.addPara(T_main_para);   
   
   
    // DIVISION: authorization-actions
        Division actions = main.addDivision("authorization-actions");
        actions.setHead(T_actions_head);
       
        List actionsList = actions.addList("actions");
        actionsList.addLabel(T_actions_item_lookup);
        Item actionItem = actionsList.addItem();
        Text queryField = actionItem.addText("identifier");
        if (query != null)
          queryField.setValue(query);
        if (errors.contains("identifier"))
          queryField.addError(T_bad_name);
        queryField.setHelp(T_search_help);
        actionItem.addButton("submit_edit").setValue(T_submit_find);
        actionsList.addLabel(T_actions_advanced);
        actionsList.addItemXref(baseURL+"&submit_wildcard", T_actions_advanced_link);
   
        // DIVISION: authorization-containerList
        Division containers = main.addDivision("authorization-containerList");
        containers.setHead(T_containerList_head);
        containers.addPara(T_containerList_para);
       
        List containerList = containers.addList("containerList");
        this.containerListBuilder(baseURL,containerList,null);
       
    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.