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

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


    // a harvest instance exists for this collection
    HarvestedCollection hc = HarvestedCollection.find(context, collectionID);
    String baseURL = contextPath + "/admin/collection?administrative-continue=" + knot.getId();
   
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-harvesting-setup",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().addXref(baseURL+"&submit_metadata",T_options_metadata);
      options.addItem().addXref(baseURL+"&submit_roles",T_options_roles);
      options.addItem().addHighlight("bold").addXref(baseURL+"&submit_harvesting",T_options_harvest);
     
     
      // The top-level, all-setting, countent source radio button
      List harvestSource = main.addList("harvestSource", "form");
     
      harvestSource.addLabel(T_label_source);
      Radio source = harvestSource.addItem().addRadio("source");
      source.addOption(hc == null, "source_normal", T_source_normal);
      source.addOption(hc != null, "source_harvested", T_source_harvested);
  
    Para buttonList = main.addPara();
      buttonList.addButton("submit_save").setValue(T_submit_save);
      buttonList.addButton("submit_return").setValue(T_submit_return);
     
      main.addHidden("administrative-continue").setValue(knot.getId());
    }
View Full Code Here


        String baseURL = contextPath+"/admin/epeople?administrative-continue="+knot.getId();
       
        ArrayList<ResourcePolicy> policies = new ArrayList<ResourcePolicy>();

        // DIVISION: edit-container-policies
        Division main = body.addInteractiveDivision("edit-container-policies",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
   
    if (containerType == Constants.COLLECTION)
      {
      Collection col = Collection.find(context, containerID);
      main.setHead(T_main_head_collection.parameterize(col.getMetadata("name"),col.getHandle(),col.getID()));
      policies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, col);
      }
    else
    {
      Community com = Community.find(context, containerID);
      main.setHead(T_main_head_community.parameterize(com.getMetadata("name"),com.getHandle(),com.getID()));
      policies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, com);
    }
   
    /* Adding a new policy link */
    main.addPara().addXref(baseURL + "&submit_add", T_add_link);
   
      Table table = main.addTable("container-policy-list",policies.size() + 1, 4);
        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);
     
      for (ResourcePolicy policy : policies)
      {
        Row row;
      if (policy.getID() == highlightID)
        row = table.addRow(null, null, "highlight");
      else
        row = table.addRow();
       
        CheckBox select = row.addCell().addCheckBox("select_policy");
          select.setLabel(String.valueOf(policy.getID()));
          select.addOption(String.valueOf(policy.getID()));
         
          // Accounting for the funky case of an empty policy
          Group policyGroup = policy.getGroup();
         
          row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID(), String.valueOf(policy.getID()));
          row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID(), policy.getActionText());
          if (policyGroup != null) {
            Cell groupCell = row.addCell();
            groupCell.addContent(policyGroup.getName());
            Highlight groupHigh = groupCell.addHighlight("fade");
            groupHigh.addContent(" [");
            groupHigh.addXref(baseURL + "&submit_edit_group&group_id=" + policyGroup.getID(), T_group_edit);
            groupHigh.addContent("]");
          }
          else {
              row.addCell().addContent("...");
          }
      }
      Para buttons = main.addPara();
      buttons.addButton("submit_delete").setValue(T_submit_delete);
      buttons.addButton("submit_return").setValue(T_submit_return);
     
    main.addHidden("administrative-continue").setValue(knot.getId());
   }
View Full Code Here

      bitstreams = bundles[0].getBitstreams();
    }
   
    // Part A:
    //  First ask the user if they would like to upload a new file (may be the first one)
      Division div = body.addInteractiveDivision("submit-upload", actionURL, Division.METHOD_MULTIPART, "primary submission");
      div.setHead(T_submission_head);
      addSubmissionProgressList(div);
     
     
      List upload = null;
      if (!workflow)
      {
        // Only add the upload capabilities for new item submissions
        upload = div.addList("submit-upload-new", List.TYPE_FORM);
          upload.setHead(T_head);   
         
          File file = upload.addItem().addFile("file");
          file.setLabel(T_file);
          file.setHelp(T_file_help);
          file.setRequired();
         
          //if no files found error was thrown by processing class, display it!
          if (this.errorFlag==org.dspace.submit.step.UploadStep.STATUS_NO_FILES_ERROR)
          {
                file.addError(T_file_error);
            }

            // if an upload error was thrown by processing class, display it!
            if (this.errorFlag == org.dspace.submit.step.UploadStep.STATUS_UPLOAD_ERROR)
            {
                file.addError(T_upload_error);
            }
           
          Text description = upload.addItem().addText("description");
          description.setLabel(T_description);
          description.setHelp(T_description_help);
         
          Button uploadSubmit = upload.addItem().addButton("submit_upload");
          uploadSubmit.setValue(T_submit_upload);
      }
       
        // Part B:
        //  If the user has allready uploaded files provide a list for the user.
        if (bitstreams.length > 0 || workflow)
    {
          Table summary = div.addTable("submit-upload-summary",(bitstreams.length * 2) + 2,7);
          summary.setHead(T_head2);
         
          Row header = summary.addRow(Row.ROLE_HEADER);
          header.addCellContent(T_column0); // primary bitstream
          header.addCellContent(T_column1); // select checkbox
          header.addCellContent(T_column2); // file name
          header.addCellContent(T_column3); // size
          header.addCellContent(T_column4); // description
          header.addCellContent(T_column5); // format
          header.addCellContent(T_column6); // edit button
         
          for (Bitstream bitstream : bitstreams)
          {
            int id = bitstream.getID();
            String name = bitstream.getName();
            String url = makeBitstreamLink(item, bitstream);
            long bytes = bitstream.getSize();
            String desc = bitstream.getDescription();
            String algorithm = bitstream.getChecksumAlgorithm();
            String checksum = bitstream.getChecksum();
            BitstreamFormat format = bitstream.getFormat();
            int support = format.getSupportLevel();
           
           
            Row row = summary.addRow();

              // Add radio-button to select this as the primary bitstream
                Radio primary = row.addCell().addRadio("primary_bitstream_id");
                primary.addOption(String.valueOf(id));
               
                // If this bitstream is already marked as the primary bitstream
                // mark it as such.
                if(bundles[0].getPrimaryBitstreamID() == id) {
                    primary.setOptionSelected(String.valueOf(id));
                }
           
            if (!workflow)
            {
              // Workflow users can not remove files.
                CheckBox remove = row.addCell().addCheckBox("remove");
                remove.setLabel("remove");
                remove.addOption(id);
            }
            else
            {
              row.addCell();
            }
           
              row.addCell().addXref(url,name);
              row.addCellContent(bytes + " bytes");
              if (desc == null || desc.length() == 0)
                row.addCellContent(T_unknown_name);
              else
                row.addCellContent(desc);
             
              if (format == null)
              {
                row.addCellContent(T_unknown_format);
              }
              else
              {
                Cell cell = row.addCell();
                cell.addContent(format.getMIMEType());
                cell.addContent(" ");
                switch (support)
                {
                case 1:
                  cell.addContent(T_supported);
                  break;
                case 2:
                  cell.addContent(T_known);
                  break;
                case 3:
                  cell.addContent(T_unsupported);
                  break;
                }
              }
             
              Button edit = row.addCell().addButton("submit_edit_"+id);
              edit.setValue(T_submit_edit)
             
              Row checksumRow = summary.addRow();
              checksumRow.addCell();
              Cell checksumCell = checksumRow.addCell(null, null, 0, 6, null);
              checksumCell.addHighlight("bold").addContent(T_checksum);
              checksumCell.addContent(" ");
              checksumCell.addContent(algorithm + ":" + checksum);
          }
         
          if (!workflow)
          {
            // Workflow user's can not remove files.
            Row actionRow = summary.addRow();
            actionRow.addCell();
            Button removeSeleceted = actionRow.addCell(null, null, 0, 6, null).addButton("submit_remove_selected");
            removeSeleceted.setValue(T_submit_remove);
          }
         
          upload = div.addList("submit-upload-new-part2", List.TYPE_FORM);
    }
       
        // Part C:
        // add standard control/paging buttons
        addControlButtons(upload);
View Full Code Here

      MetadataSchema schema = MetadataSchema.find(context,Integer.valueOf(id));
      schemas.add(schema);
    }
    // DIVISION: metadata-schema-confirm-delete
      Division deleted = body.addInteractiveDivision("metadata-schema-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("schema-confirm-delete",schemas.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 (MetadataSchema schema : schemas)
      {
        Row row = table.addRow();
        row.addCell().addContent(schema.getSchemaID());
          row.addCell().addContent(schema.getNamespace());
          row.addCell().addContent(schema.getName());
      }
      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

    int defaultReadID = FlowContainerUtils.getCollectionDefaultRead(context, collectionID);
    if (defaultReadID >= 0)
      defaultRead = Group.find(context, defaultReadID);
   
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-assign-roles",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection");
      main.setHead(T_main_head.parameterize(thisCollection.getMetadata("name")));
     
      List options = main.addList("options", List.TYPE_SIMPLE, "horizontal");
      options.addItem().addXref(baseURL+"&submit_metadata",T_options_metadata);
      options.addItem().addHighlight("bold").addXref(baseURL+"&submit_roles",T_options_roles);
      options.addItem().addXref(baseURL+"&submit_harvesting",T_options_harvest);
           
      // The table of admin roles
      Table rolesTable = main.addTable("roles-table", 6, 5);
      Row tableRow;
     
      // The header row
      Row tableHeader = rolesTable.addRow(Row.ROLE_HEADER);
      tableHeader.addCell().addContent(T_role_name);
      tableHeader.addCell().addContent(T_role_group);
      tableHeader.addCell().addContent(T_role_buttons);
      rolesTable.addRow();
           
     
      /*
       * The collection admins
       */
      // data row
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_admins);
      if (admins != null)
      {
          try
            {
                AuthorizeUtil.authorizeManageAdminGroup(context, thisCollection);
                tableRow.addCell().addXref(baseURL + "&submit_edit_admin", admins.getName());
            }
          catch (AuthorizeException authex) {
                // add a notice, the user is not authorized to create/edit collection's admin group
                tableRow.addCell().addContent(T_not_allowed);
            }
            try
            {
                AuthorizeUtil.authorizeRemoveAdminGroup(context, thisCollection);
                tableRow.addCell().addButton("submit_delete_admin").setValue(T_delete);
            }
            catch (AuthorizeException authex)
            {
                // nothing to add, the user is not allowed to delete the group
            }
      }
      else
      {
        tableRow.addCell().addContent(T_no_role);
        try
            {
                AuthorizeUtil.authorizeManageAdminGroup(context, thisCollection);
                tableRow.addCell().addButton("submit_create_admin").setValue(T_create);
            }
            catch (AuthorizeException authex) {
                // add a notice, the user is not authorized to create/edit collection's admin group
                tableRow.addCell().addContent(T_not_allowed);
            }
      }
      // help and directions row
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell();
      tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_admins);
     
     
      /*
       * Workflow steps 1-3
       */
      // data row
      try
        {
            AuthorizeUtil.authorizeManageWorkflowsGroup(context, thisCollection);
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf_step1);
          if (wfStep1 != null)
          {
            tableRow.addCell().addXref(baseURL + "&submit_edit_wf_step1", wfStep1.getName());
                tableRow.addCell().addButton("submit_delete_wf_step1").setValue(T_delete);
          }
          else
          {
            tableRow.addCell().addContent(T_no_role);
                tableRow.addCell().addButton("submit_create_wf_step1").setValue(T_create);
          }
          // help and directions row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell();
          tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step1);
         
         
          // data row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf_step2);
          if (wfStep2 != null)
          {
            tableRow.addCell().addXref(baseURL + "&submit_edit_wf_step2", wfStep2.getName());
                tableRow.addCell().addButton("submit_delete_wf_step2").setValue(T_delete);
          }
          else
          {
            tableRow.addCell().addContent(T_no_role);
                tableRow.addCell().addButton("submit_create_wf_step2").setValue(T_create);
          }
          // help and directions row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell();
          tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step2);
         
         
          // data row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf_step3);
          if (wfStep3 != null)
          {
            tableRow.addCell().addXref(baseURL + "&submit_edit_wf_step3", wfStep3.getName());
                tableRow.addCell().addButton("submit_delete_wf_step3").setValue(T_delete);
          }
          else
          {
            tableRow.addCell().addContent(T_no_role);
                tableRow.addCell().addButton("submit_create_wf_step3").setValue(T_create);
          }
          // help and directions row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell();
          tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step3);
        }
      catch (AuthorizeException authex) {
            // add a notice, the user is not allowed to manage workflow group
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
            tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf);
            tableRow.addCell().addContent(T_not_allowed);
        }
       
      /*
       * The collection submitters
       */
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_submitters);
      try
      {
          AuthorizeUtil.authorizeManageSubmittersGroup(context, thisCollection);
          if (submitters != null)
          {
            tableRow.addCell().addXref(baseURL + "&submit_edit_submit", submitters.getName());
                tableRow.addCell().addButton("submit_delete_submit").setValue(T_delete);
          }
          else
          {
            tableRow.addCell().addContent(T_no_role);
                tableRow.addCell().addButton("submit_create_submit").setValue(T_create);
          }
      }
      catch (AuthorizeException authex)
      {
          tableRow.addCell().addContent(T_not_allowed);
      }
      // help and directions row
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell();
      tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_submitters);
     
     
      /*
       * The collection's default read authorizations
       */
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_default_read);
      if (defaultRead == null)
      {
        // Custome reading permissions, we can't handle it, just provide a link to the
        // authorizations manager.
        tableRow.addCell(1,2).addContent(T_default_read_custom);
      }
      else if (defaultRead.getID() == 0) {
        // Anonymous reading
        tableRow.addCell().addContent(T_default_read_anonymous);
        addAdministratorOnlyButton(tableRow.addCell(),"submit_create_default_read",T_restrict);
      }
      else
      {
        // A specific group is dedicated to reading.
        tableRow.addCell().addXref(baseURL + "&submit_edit_default_read", defaultRead.getName());
        addAdministratorOnlyButton(tableRow.addCell(),"submit_delete_default_read",T_delete);
      }
  
      // help and directions row
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell();
      tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_default_read);
     
      try
      {
          AuthorizeUtil.authorizeManageCollectionPolicy(context, thisCollection);
        // add one last link to edit the raw authorizations
        Cell authCell =rolesTable.addRow().addCell(1,3);
        authCell.addXref(baseURL + "&submit_authorizations", T_edit_authorization);
      }
      catch (AuthorizeException authex) {
            // nothing to add, the user is not authorized to edit collection's policies
        }

      Para buttonList = main.addPara();
      buttonList.addButton("submit_return").setValue(T_submit_return);
     
     
     
      main.addHidden("administrative-continue").setValue(knot.getId());
     
    }
View Full Code Here

      BitstreamFormat format = BitstreamFormat.find(context,Integer.valueOf(id));
      formats.add(format);
    }
    // DIVISION: bitstream-format-confirm-delete
      Division deleted = body.addInteractiveDivision("bitstream-format-confirm-delete",contextPath+"/admin/format-registry",Division.METHOD_POST,"primary administrative format-registry");
      deleted.setHead(T_head);
      deleted.addPara(T_para1);
     
      Table table = deleted.addTable("format-confirm-delete",formats.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 (BitstreamFormat format : formats)
      {
        if (format == null)
          continue;
       
        String formatID = String.valueOf(format.getID());
        String mimetype = format.getMIMEType();
        String name = format.getShortDescription();

       
        Row row = table.addRow();
        row.addCell().addContent(formatID);
          row.addCell().addContent(mimetype);
          row.addCell().addContent(name);
      }
      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

   
    ArrayList<ResourcePolicy> bundlePolicies = new ArrayList<ResourcePolicy>();
    ArrayList<ResourcePolicy> bitstreamPolicies = new ArrayList<ResourcePolicy>();

    // DIVISION: main
    Division main = body.addInteractiveDivision("edit-item-policies",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
    main.setHead(T_main_head.parameterize(item.getHandle(),item.getID()));
    main.addPara().addHighlight("italic").addContent(T_main_para1);
    main.addPara().addHighlight("italic").addContent(T_main_para2);
   
      Table table = main.addTable("policies-confirm-delete",itemPolicies.size() + 3, 5);
        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();

       
        // First, the item's policies are listed
        Row subheader = table.addRow(null,Row.ROLE_HEADER,"subheader");
        subheader.addCell(1, 4).addHighlight("bold").addContent(T_subhead_item);
        subheader.addCell().addHighlight("bold").addXref(baseURL + "&submit_add_item", T_add_itemPolicy_link);
       
        this.rowBuilder(baseURL, table, itemPolicies, item.getID(), Constants.ITEM, highlightID);
     
      // Next, one by one, we get the bundles
      for (Bundle bundle : bundles) {
        subheader = table.addRow(null,Row.ROLE_HEADER,"subheader");
        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);

        bundlePolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bundle);
        this.rowBuilder(baseURL, table, bundlePolicies, bundle.getID(), Constants.BUNDLE, highlightID);
       
        // And eventually to the bundle's bitstreams
        bitstreams = bundle.getBitstreams();
        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);

            bitstreamPolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bitstream);
            this.rowBuilder(baseURL, table, bitstreamPolicies, bitstream.getID(), Constants.BITSTREAM, highlightID);         
        }
      }
     
      Para buttons = main.addPara();
      buttons.addButton("submit_delete").setValue(T_submit_delete);
      buttons.addButton("submit_return").setValue(T_submit_return);
       
   
    main.addHidden("administrative-continue").setValue(knot.getId());
   }
View Full Code Here

    BitstreamFormat[] formats = BitstreamFormat.findAll(context);
    String addURL = contextPath+"/admin/format-registry?administrative-continue="+knot.getId()+"&submit_add";
   
 
        // DIVISION: bitstream-format-registry
    Division main = body.addInteractiveDivision("bitstream-format-registry",contextPath+"/admin/format-registry",Division.METHOD_POST,"primary administrative format-registry");
    main.setHead(T_head);
    main.addPara(T_para1);
    main.addPara().addXref(addURL,T_new_link);
   
   
    Table table = main.addTable("bitstream-format-registry", formats.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);
    header.addCellContent(T_column5);
   
    for (BitstreamFormat format : formats)
    {
      String id = String.valueOf(format.getID());
      String mimeType = format.getMIMEType();
      String name = format.getShortDescription();
      int supportLevel = format.getSupportLevel();
      boolean internal = format.isInternal();
     
      boolean highlight = false;
      if (format.getID() == highlightID)
        highlight = true;

      String url = contextPath + "/admin/format-registry?administrative-continue="+knot.getId()+"&submit_edit&formatID="+id;

     
      Row row;
      if (highlight)
        row = table.addRow(null,null,"highlight");
      else
        row = table.addRow();
     
      // Select checkbox
      Cell cell = row.addCell();
      if (format.getID() > 1)
      {
        // Do not allow unknown to be removed.
        CheckBox select = cell.addCheckBox("select_format");
        select.setLabel(id);
        select.addOption(id);
      }
     
      // ID
      row.addCell().addContent(id);

      // Name
      row.addCell().addXref(url,name);
     
      // Mime type
      cell = row.addCell();
      cell.addXref(url,mimeType);
      if (internal)
      {
        cell.addContent(" ");
        cell.addContent(T_internal);
      }
     
      // support level
      switch (supportLevel)
      {
      case 0:
        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;
      }
    }
   
    main.addPara().addButton("submit_delete").setValue(T_submit_delete);
   
    main.addHidden("administrative-continue").setValue(knot.getId());
       
  }
View Full Code Here

   
 
  public void addBody(Body body) throws SAXException, WingException,
  UIException, SQLException, IOException, AuthorizeException
 
    Division div = body.addInteractiveDivision("submit-removed",contextPath+"/submit", Division.METHOD_POST,"primary submission");
   
    div.setHead(T_head);
   
    div.addPara(T_info1);
   
    div.addPara().addXref(contextPath+"/submissions",T_go_submissions);
  }
View Full Code Here

    String metadataFormatValue = hc.getHarvestMetadataConfig();
    int harvestLevelValue = hc.getHarvestType();
    int harvestStatusValue = hc.getHarvestStatus();
             
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-harvesting-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().addXref(baseURL+"&submit_metadata",T_options_metadata);
      options.addItem().addXref(baseURL+"&submit_roles",T_options_roles);
      options.addItem().addHighlight("bold").addXref(baseURL+"&submit_harvesting",T_options_harvest);
     
     
      // The top-level, all-setting, countent source radio button
      List harvestSource = main.addList("harvestSource", "form");
     
      harvestSource.addLabel(T_label_source);
      Radio source = harvestSource.addItem().addRadio("source");
      source.addOption(hc == null, "source_normal", T_source_normal);
      source.addOption(hc != null, "source_harvested", T_source_harvested);
     
      List settings = main.addList("harvestSettings", "form");
      settings.setHead(T_main_settings_head);
     
      settings.addLabel(T_label_oai_provider);
      settings.addItem(oaiProviderValue);
     
      settings.addLabel(T_label_setid);
      settings.addItem(oaiSetIdValue);

      // The big complex way of getting to our metadata
      settings.addLabel(T_label_metadata_format);
   
      String key = "harvester.oai.metadataformats." + metadataFormatValue;
      String metadataString = ConfigurationManager.getProperty(key);

      String displayName;
      if (metadataString.indexOf(',') != -1)
        displayName = metadataString.substring(metadataString.indexOf(',') + 1);
      else
        displayName = metadataFormatValue + "(" + metadataString + ")";
           
      settings.addItem(displayName);
     
      settings.addLabel(T_label_harvest_level);
      Item harvestLevel = settings.addItem();
      switch (harvestLevelValue) {
        case 1: harvestLevel.addContent(T_option_md_only); break;
        case 2: harvestLevel.addContent(T_option_md_and_ref); break;
        default: harvestLevel.addContent(T_option_md_and_bs); break;
      }
                 
        /* Results of the last harvesting cycle */
        if (harvestLevelValue > 0) {
          settings.addLabel(T_label_harvest_result);
          Item harvestResult = settings.addItem();
          if (hc.getHarvestMessage() != null) {
            harvestResult.addContent(hc.getHarvestMessage() + " on " + hc.getHarvestStartTime());
          }
          else {
            harvestResult.addContent(T_harvest_result_new);
          }
        }
       
        /* Current status */
        settings.addLabel(T_label_harvest_status);
      Item harvestStatus = settings.addItem();
        switch(harvestStatusValue) {
          case HarvestedCollection.STATUS_READY: harvestStatus.addContent(T_harvest_status_ready); break;
          case HarvestedCollection.STATUS_BUSY: harvestStatus.addContent(T_harvest_status_busy); break;
          case HarvestedCollection.STATUS_QUEUED: harvestStatus.addContent(T_harvest_status_queued); break;
          case HarvestedCollection.STATUS_OAI_ERROR: harvestStatus.addContent(T_harvest_status_oai_error); break;
          case HarvestedCollection.STATUS_UNKNOWN_ERROR: harvestStatus.addContent(T_harvest_status_unknown_error); break;
        }
           
        settings.addLabel();
      Item harvestButtons = settings.addItem();
      harvestButtons.addButton("submit_change").setValue(T_submit_change_settings);
      harvestButtons.addButton("submit_import_now").setValue(T_submit_import_now);
      harvestButtons.addButton("submit_reimport").setValue(T_submit_reimport_collection);
       
    Para buttonList = main.addPara();
      buttonList.addButton("submit_save").setValue(T_submit_save);
      buttonList.addButton("submit_return").setValue(T_submit_return);
     
      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.