Exemplo n.º 1
0
  /**
   * Each submission step must define its own information to be reviewed during the final
   * Review/Verify Step in the submission process.
   *
   * <p>The information to review should be tacked onto the passed in List object.
   *
   * <p>NOTE: To remain consistent across all Steps, you should first add a sub-List object (with
   * this step's name as the heading), by using a call to reviewList.addList(). This sublist is the
   * list you return from this method!
   *
   * @param reviewList The List to which all reviewable information should be added
   * @return The new sub-List object created by this step, which contains all the reviewable
   *     information. If this step has nothing to review, then return null!
   */
  public List addReviewSection(List reviewList)
      throws SAXException, WingException, UIException, SQLException, IOException,
          AuthorizeException {
    // Create a new list section for this step (and set its heading)
    List uploadSection = reviewList.addList("submit-review-" + this.stepAndPage, List.TYPE_FORM);
    uploadSection.setHead(T_head);

    // Review all uploaded files
    Item item = submission.getItem();
    Bundle[] bundles = item.getBundles("ORIGINAL");
    Bitstream[] bitstreams = new Bitstream[0];
    if (bundles.length > 0) {
      bitstreams = bundles[0].getBitstreams();
    }

    for (Bitstream bitstream : bitstreams) {
      BitstreamFormat bitstreamFormat = bitstream.getFormat();

      String name = bitstream.getName();
      String url = makeBitstreamLink(item, bitstream);
      String format = bitstreamFormat.getShortDescription();
      Message support = ReviewStep.T_unknown;
      if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN) {
        support = T_known;
      } else if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED) {
        support = T_supported;
      }

      org.dspace.app.xmlui.wing.element.Item file = uploadSection.addItem();
      file.addXref(url, name);
      file.addContent(" - " + format + " ");
      file.addContent(support);
    }

    // return this new "upload" section
    return uploadSection;
  }
Exemplo n.º 2
0
  public void addAccessRadios(
      String selectedRadio, String date, List form, int errorFlag, DSpaceObject dso)
      throws WingException, SQLException {

    if (!isAdvancedFormEnabled) {
      addEmbargoDateSimpleForm(dso, form, errorFlag);
    } else {

      org.dspace.app.xmlui.wing.element.Item radiosAndDate = form.addItem();
      Radio openAccessRadios = radiosAndDate.addRadio("open_access_radios");
      openAccessRadios.setLabel(T_radios_embargo);
      if (selectedRadio != null
          && Integer.parseInt(selectedRadio) == RADIO_OPEN_ACCESS_ITEM_EMBARGOED
          && errorFlag != org.dspace.submit.step.AccessStep.STATUS_COMPLETE) {
        openAccessRadios.addOption(RADIO_OPEN_ACCESS_ITEM_VISIBLE, T_item_will_be_visible);
        openAccessRadios.addOption(true, RADIO_OPEN_ACCESS_ITEM_EMBARGOED, T_item_embargoed);
      } else {
        openAccessRadios.addOption(true, RADIO_OPEN_ACCESS_ITEM_VISIBLE, T_item_will_be_visible);
        openAccessRadios.addOption(RADIO_OPEN_ACCESS_ITEM_EMBARGOED, T_item_embargoed);
      }

      // Date
      Text startDate = radiosAndDate.addText("embargo_until_date");
      startDate.setLabel("");
      startDate.setHelp(T_label_date_help);
      if (errorFlag == org.dspace.submit.step.AccessStep.STATUS_ERROR_FORMAT_DATE) {
        startDate.addError(T_error_date_format);
      } else if (errorFlag == org.dspace.submit.step.AccessStep.STATUS_ERROR_MISSING_DATE) {
        startDate.addError(T_error_missing_date);
      }

      if (date != null && errorFlag != org.dspace.submit.step.AccessStep.STATUS_COMPLETE) {
        startDate.setValue(date);
      }
    }
  }