Exemplo n.º 1
0
  public void addName(String name_, List form, int errorFlag) throws WingException {
    if (isAdvancedFormEnabled) {
      Text name = form.addItem().addText("name");
      name.setSize(0, 30);
      name.setLabel(T_name);
      name.setHelp(T_name_help);

      if (name_ != null && errorFlag != org.dspace.submit.step.AccessStep.STATUS_COMPLETE)
        name.setValue(name_);
    }
  }
  public void addBody(Body body) throws WingException, SQLException, AuthorizeException {
    int communityID = parameters.getParameterAsInteger("communityID", -1);
    Community parentCommunity = Community.find(context, communityID);

    // DIVISION: main
    Division main =
        body.addInteractiveDivision(
            "create-collection",
            contextPath + "/admin/collection",
            Division.METHOD_MULTIPART,
            "primary administrative collection");
    main.setHead(T_main_head.parameterize(parentCommunity.getMetadata("name")));

    // 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);

    // short description
    metadataList.addLabel(T_label_short_description);
    Text short_description = metadataList.addItem().addText("short_description");
    short_description.setSize(40);

    // introductory text
    metadataList.addLabel(T_label_introductory_text);
    TextArea introductory_text = metadataList.addItem().addTextArea("introductory_text");
    introductory_text.setSize(6, 40);

    // copyright text
    metadataList.addLabel(T_label_copyright_text);
    TextArea copyright_text = metadataList.addItem().addTextArea("copyright_text");
    copyright_text.setSize(6, 40);

    // 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.setSize(6, 40);

    // license text
    metadataList.addLabel(T_label_license);
    TextArea license = metadataList.addItem().addTextArea("license");
    license.setSize(6, 40);

    // provenance description
    metadataList.addLabel(T_label_provenance_description);
    TextArea provenance_description = metadataList.addItem().addTextArea("provenance_description");
    provenance_description.setSize(6, 40);

    // the row to upload a new logo
    metadataList.addLabel(T_label_logo);
    metadataList.addItem().addFile("logo");

    Para buttonList = main.addPara();
    buttonList.addButton("submit_save").setValue(T_submit_save);
    buttonList.addButton("submit_cancel").setValue(T_submit_cancel);

    main.addHidden("administrative-continue").setValue(knot.getId());
  }