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

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


   * List important DSpace configuration parameters.
   */
  private void addDSpaceConfiguration(Division div) throws WingException
  {
    // LIST: DSpace
        List dspace = div.addList("dspace");
        dspace.setHead(T_DSPACE_HEAD);
       
        dspace.addLabel(T_DSPACE_DIR);
      dspace.addItem(ConfigurationManager.getProperty("dspace.dir"));
   
        dspace.addLabel(T_DSPACE_URL);
      dspace.addItem(ConfigurationManager.getProperty("dspace.url"));

        dspace.addLabel(T_DSPACE_HOST_NAME);
      dspace.addItem(ConfigurationManager.getProperty("dspace.hostname"));

        dspace.addLabel(T_DSPACE_NAME);
      dspace.addItem(ConfigurationManager.getProperty("dspace.name"));

        dspace.addLabel(T_DB_NAME);
      dspace.addItem(ConfigurationManager.getProperty("db.name"));

      dspace.addLabel(T_DB_URL);
      dspace.addItem(ConfigurationManager.getProperty("db.url"));

        dspace.addLabel(T_DB_DRIVER);
      dspace.addItem(ConfigurationManager.getProperty("db.driver"));

      dspace.addLabel(T_DB_MAX_CONN);
      dspace.addItem(ConfigurationManager.getProperty("db.maxconnections"));


        dspace.addLabel(T_DB_MAX_WAIT);
      dspace.addItem(ConfigurationManager.getProperty("db.maxwait"));
     
        dspace.addLabel(T_DB_MAX_IDLE);
      dspace.addItem(ConfigurationManager.getProperty("db.maxidle"));

         dspace.addLabel(T_MAIL_SERVER);
      dspace.addItem(ConfigurationManager.getProperty("mail.server"));
        dspace.addLabel(T_MAIL_FROM_ADDRESS);
      dspace.addItem(ConfigurationManager.getProperty("mail.from.address"));

        dspace.addLabel(T_FEEDBACK_RECIPIENT);
      dspace.addItem(ConfigurationManager.getProperty("feedback.recipient"));

        dspace.addLabel(T_MAIL_ADMIN);
      dspace.addItem(ConfigurationManager.getProperty("mail.admin"));       
  }
View Full Code Here


      div.addPara().addXref(makeURL(help,false),"Turn errors OFF");
    else
      div.addPara().addXref(makeURL(help,true),"Turn errors ON");
   
   
    List list = div.addList("fieldTest",List.TYPE_FORM);
    list.setHead("Tests");
   
    // text
    Text text = list.addItem().addText("text");
    text.setLabel("Text");
    text.enableAddOperation();
    text.enableDeleteOperation();
    if (help)
      text.setHelp("This is helpfull text.");
    if (error)
      text.addError("This field is in error.");
    text.setValue("First is special");
    Instance instance = text.addInstance();
    instance.setValue("Second raw");
    instance.setInterpretedValue("Second interpreted");
    instance = text.addInstance();
    instance.setValue("Third raw");
    instance.setInterpretedValue("Third interpreted");

    // Select
    Select select = list.addItem().addSelect("select");
    select.setLabel("Text");
    select.enableAddOperation();
    select.enableDeleteOperation();
    select.setMultiple();
    select.setSize(4);
    if (help)
      select.setHelp("This is helpfull text.");
    if (error)
      select.addError("This field is in error.");
    select.addOption("one", "uno");
    select.addOption("two", "dos");
    select.addOption("three", "tres");
    select.addOption("four", "cuatro");
    select.addOption("five", "cinco");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
    instance.setOptionSelected("three");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
    instance.setOptionSelected("three");
    instance.setOptionSelected("four");
   
    instance = select.addInstance();
    instance.setOptionSelected("one");
    instance.setOptionSelected("two");
    instance.setOptionSelected("three");
    instance.setOptionSelected("four");
    instance.setOptionSelected("five");
   

        // composite two text fields  
        Composite composite = list.addItem().addComposite("compositeA");
        composite.setLabel("Composite (two text fields)");
        composite.enableAddOperation();
        composite.enableDeleteOperation();
        if (help)
          composite.setHelp("This field is composed of two text fields, fill them both in.");
        if (error)
          composite.addError("Just the composite is in error.");
        text = composite.addText("firstA");
        if (help)
          text.setHelp("This is helpfull text.");
        text.addInstance().setValue("1, Raw A");
        text.addInstance().setValue("2, Raw A");
        text.addInstance().setValue("3, Raw A");
       
        text = composite.addText("secondA");
        if (help)
          text.setHelp("This is helpfull text.");
        text.addInstance().setValue("1, Raw B");
        text.addInstance().setValue("2, Raw B");
        text.addInstance().setValue("3, Raw B");
       
        // composite select & text fields
        composite = list.addItem().addComposite("compositeB");
        composite.setLabel("Composite (select & text fields)");
        composite.enableAddOperation();
        composite.enableDeleteOperation();
        if (help)
          composite.setHelp("This field is composed of a select and text field, select one and type the other.");
 
        select = composite.addSelect("selectB");
        if (help)
          select.setHelp("Me, me, me..... select me!");
        if (error)
          select.addError("The composite elements are in error.");
        select.addOption("one","uno");
        select.addOption("two","dos");
        select.addOption("three","tres");
        select.addOption("four","cuatro");
        select.addOption("five","cinco");
        select.setOptionSelected("one");
       
        select.addInstance().addOptionValue("one");
        select.addInstance().addOptionValue("two");
        select.addInstance().addOptionValue("three");
       
        text = composite.addText("TextB");
        if (help)
          text.setHelp("Yay, yet another text field");
        if (error)
          text.addError("The composite elements are in error.");
        text.addInstance().setValue("1, Raw B");
        text.addInstance().setValue("2, Raw B");
        text.addInstance().setValue("3, Raw B");
       
        composite.addInstance().setInterpretedValue("One interpreted.");
        composite.addInstance().setInterpretedValue("Two interpreted.");
        composite.addInstance().setInterpretedValue("Three interpreted.");
       
        // Composite (date)
        composite = list.addItem().addComposite("composite-date");
        composite.setLabel("Composite (date)");
        composite.enableAddOperation();
        composite.enableDeleteOperation();
        if (help)
          composite.setHelp("The date when something happened.");
        if (error)
          composite.setHelp("The composite is in error.");
       
        text = composite.addText("day");
        if (help)
          text.setHelp("day");
        if (error)
          text.setHelp("The first text field is in error.");
        text.setSize(4,2);
       
        text.addInstance().setValue("1");
        text.addInstance().setValue("2");
        text.addInstance().setValue("3");
        text.addInstance().setValue("4");
        text.addInstance().setValue("5");
       
        select = composite.addSelect("month");
        if (error)
          select.setHelp("The select box is in error.");
        select.addOption("","(Select Month)");
        select.addOption(1,"January");
        select.addOption(2,"Feburary");
        select.addOption(3,"March");
        select.addOption(4,"April");
        select.addOption(5,"May");
        select.addOption(6,"June");
        select.addOption(7,"July");
        select.addOption(8,"August");
        select.addOption(9,"September");
        select.addOption(10,"August");
        select.addOption(11,"October");
        select.addOption(12,"November");
        select.addOption(13,"December");
       
        select.addInstance().setOptionSelected(1);
        select.addInstance().setOptionSelected(2);
        select.addInstance().setOptionSelected(3);
        select.addInstance().setOptionSelected(4);
        select.addInstance().setOptionSelected(5);
       
        text = composite.addText("year");
        text.setSize(4,4);
        if (help)
          text.setHelp("year");
        if (error)
          text.setHelp("The second text field is in error.");
        text.addInstance().setValue("2001");
        text.addInstance().setValue("2002");
        text.addInstance().setValue("2003");
        text.addInstance().setValue("2004");
        text.addInstance().setValue("2005");
       
        // Buttons one typical finds at the end of forums
        Item actions = list.addItem();
        actions.addButton("submit_save").setValue("Save");
        actions.addButton("submit_cancel").setValue("Cancel");
  }
View Full Code Here

        // titles & published before.
      Division div = body.addInteractiveDivision("submit-initial-questions", actionURL, Division.METHOD_POST, "primary submission");
      div.setHead(T_submission_head);
      addSubmissionProgressList(div);
     
      List form = div.addList("submit-initial-questions", List.TYPE_FORM);
        form.setHead(T_head);   
       
        CheckBox multipleTitles = form.addItem().addCheckBox("multiple_titles");
        multipleTitles.setLabel(T_multiple_titles);
        multipleTitles.setHelp(T_multiple_titles_help);
        multipleTitles.addOption("true");
        if (submission.hasMultipleTitles())
        {
          multipleTitles.setOptionSelected("true");
        }
       
        // If any titles would be removed if the user unselected this box then
        // warn the user!
        if (titles.length > 0)
        {
          org.dspace.app.xmlui.wing.element.Item note = form.addItem();
          note.addHighlight("bold").addContent(T_important_note);
          note.addContent(T_multiple_titles_note);
          for (int i=0; i< titles.length; i++)
          {
            if (i > 0)
              note.addContent(T_separator);
            note.addContent("\"");
            note.addHighlight("bold").addContent(titles[i].value);
            note.addContent("\"");
          }
        }
       
        CheckBox publishedBefore = form.addItem().addCheckBox("published_before");
        publishedBefore.setLabel(T_published_before);
        publishedBefore.setHelp(T_published_before_help);
        publishedBefore.addOption("true");
        if (submission.isPublishedBefore())
        {
          publishedBefore.setOptionSelected("true");
        }
       
        // If any metadata would be removed if the user unselected the box then warn
        // the user about what will be removed.
        if (dateIssued.length > 0 || citation.length > 0 || publisher.length > 0)
        {
          org.dspace.app.xmlui.wing.element.Item note = form.addItem();
          note.addHighlight("bold").addContent(T_important_note);
          note.addContent(T_published_before_note);
         
          // Start a convoluted processes to build an english list of values.
          // Format: Date Issued (value, value, value), Citation (value, value, value), Publisher (value, value, value)
View Full Code Here

    Division div = body.addInteractiveDivision("edit-bitstream", contextPath+"/admin/item", Division.METHOD_MULTIPART, "primary administrative item");     
    div.setHead(T_head1);


    // LIST: edit form
    List edit = div.addList("edit-bitstream-list", List.TYPE_FORM);

    edit.addLabel(T_file_label);
    edit.addItem().addXref(fileUrl, fileName);

   
    Select primarySelect = edit.addItem().addSelect("primary");
    primarySelect.setLabel(T_primary_label);
    primarySelect.addOption(primaryBitstream,"yes",T_primary_option_yes);
    primarySelect.addOption(!primaryBitstream,"no",T_primary_option_no);
   
    Text description = edit.addItem().addText("description");
    description.setLabel(T_description_label);
    description.setHelp(T_description_help);
    description.setValue(bitstream.getDescription());

    edit.addItem(T_para1);

    // System supported formats
    Select format = edit.addItem().addSelect("formatID");
    format.setLabel(T_format_label);

                // load the options menu, skipping the "Unknown" format since "Not on list" takes its place
                int unknownFormatID = BitstreamFormat.findUnknown(context).getID();
    format.addOption(-1,T_format_default);
    for (BitstreamFormat bitstreamFormat : bitstreamFormats)
    {
                        if (bitstreamFormat.getID() == unknownFormatID)
                            continue;
      String supportLevel = "Unknown";
      if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN)
        supportLevel = "known";
      else if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED)
        supportLevel = "Supported";
      String name = bitstreamFormat.getShortDescription()+" ("+supportLevel+")";
                        if (bitstreamFormat.isInternal())
                            name += " (Internal)";
      int id = bitstreamFormat.getID();

      format.addOption(id,name);
    }
    if (currentFormat != null)
    {
      format.setOptionSelected(currentFormat.getID());
    }
    else
    {
      format.setOptionSelected(-1);
    }

    edit.addItem(T_para2);

    // User supplied format
    Text userFormat = edit.addItem().addText("user_format");
    userFormat.setLabel(T_user_label);
    userFormat.setHelp(T_user_help);
    userFormat.setValue(bitstream.getUserFormatDescription());




    // ITEM: form actions
    org.dspace.app.xmlui.wing.element.Item actions = edit.addItem();
    actions.addButton("submit_save").setValue(T_submit_save);
    actions.addButton("submit_cancel").setValue(T_submit_cancel);

    div.addHidden("administrative-continue").setValue(knot.getId());
View Full Code Here

    public List addReviewSection(List reviewList) throws SAXException,
        WingException, UIException, SQLException, IOException,
        AuthorizeException
    {
        //Create a new section for this Initial Questions information
        List initSection = reviewList.addList("submit-review-" + this.stepAndPage, List.TYPE_FORM);
        initSection.setHead(T_head);
       
        //add information to review
        Message multipleTitles = ReviewStep.T_no;
        if (submission.hasMultipleTitles())
            multipleTitles = ReviewStep.T_yes;
   
        Message publishedBefore = ReviewStep.T_no;
        if (submission.isPublishedBefore())
            publishedBefore = ReviewStep.T_yes;
       
        initSection.addLabel(T_multiple_titles);
        initSection.addItem(multipleTitles);
        initSection.addLabel(T_published_before);
        initSection.addItem(publishedBefore);
       
        //return this new review section
        return initSection;
    }
View Full Code Here

           exists.setHead(T_head1);
          
           exists.addPara(T_para1);

           List form = exists.addList("form");
          
           form.addLabel(T_reset_password_for);
           form.addItem(this.email);
          
           form.addLabel();
           Item submit = form.addItem();
           submit.addButton("submit_forgot").setValue(T_submit_reset);
          
           exists.addHidden("email").setValue(this.email);
           exists.addHidden("eperson-continue").setValue(knot.getId());
       }
      
      
       Division register = body.addInteractiveDivision("register",
               contextPath+"/register",Division.METHOD_POST,"primary");
      
       register.setHead(T_head2);
      
       EPersonUtils.registrationProgressList(register,1);
      
       register.addPara(T_para2);
      
       List form = register.addList("form",List.TYPE_FORM);
      
       Text email = form.addItem().addText("email");
       email.setRequired();
       email.setLabel(T_email_address);
       email.setHelp(T_email_address_help);
       email.setValue(this.email);
       if (errors.contains("email"))
           email.addError(T_error_bad_email);
      
       Item submit = form.addItem();
       submit.addButton("submit").setValue(T_submit_register);
      
       register.addHidden("eperson-continue").setValue(knot.getId());
   }
View Full Code Here

            UIException, SQLException, IOException, AuthorizeException
    {
        /* Create skeleton menu structure to ensure consistent order between aspects,
         * even if they are never used
         */
        List browse = options.addList("browse");
        options.addList("account");
        options.addList("context");
        options.addList("administrative");
       
       
        browse.setHead(T_head_browse);

        List browseGlobal = browse.addList("global");
        List browseContext = browse.addList("context");

        browseGlobal.setHead(T_head_all_of_dspace);

        browseGlobal.addItemXref(contextPath + "/community-list",T_communities_and_collections);

        // Add the configured browse lists for 'top level' browsing
        addBrowseOptions(browseGlobal, contextPath + "/browse");

        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (dso != null)
        {
            if (dso instanceof Item)
            {
                // If we are an item change the browse scope to the parent
                // collection.
                dso = ((Item) dso).getOwningCollection();
            }

            if (dso instanceof Collection)
            {
                browseContext.setHead(T_head_this_collection);
            }
            if (dso instanceof Community)
            {
                browseContext.setHead(T_head_this_community);
            }

            // Add the configured browse lists for scoped browsing
            String handle = dso.getHandle();
            addBrowseOptions(browseContext, contextPath + "/handle/" + handle + "/browse");
View Full Code Here

        Division main = body.addInteractiveDivision("move-item", contextPath+"/admin/item", Division.METHOD_POST, "primary administrative item");
        main.setHead(T_head1.parameterize(item.getHandle()));

        Collection[] collections = Collection.findAuthorized(context, null, Constants.ADD);

        List list = main.addList("select-collection", List.TYPE_FORM);
        Select select = list.addItem().addSelect("collectionID");
        select.setLabel(T_collection);
        select.setHelp(T_collection_help);
       
        Collection owningCollection = item.getOwningCollection();
        if (owningCollection == null) {
            select.addOption("",T_collection_default);
        }
       
        for (Collection collection : collections)
        {
            String name = collection.getMetadata("name");
            if (name.length() > 50)
                name = name.substring(0, 47) + "...";
            select.addOption(collection.equals(owningCollection), collection.getID(), name);
        }
       
        org.dspace.app.xmlui.wing.element.Item actions = list.addItem();
        actions.addButton("submit_move").setValue(T_submit_move);
    actions.addButton("submit_cancel").setValue(T_submit_cancel);

    main.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

     * @param step The current step of the workflow (-1 if no step)
     *
     */
    public static void registrationProgressList(Division form, int step) throws WingException
    {
        List progress = form.addList("registration-progress",
                List.TYPE_PROGRESS);

        new Message("default","xmlui.EPerson.EPersonUtils.register_verify_email");
       
        progress.addItem("register-verify-email", render(step, 1)).addContent(
                new Message("default","xmlui.EPerson.EPersonUtils.register_verify_email"));

        progress.addItem("register-create-profile", render(step, 2)).addContent(
                new Message("default","xmlui.EPerson.EPersonUtils.register_create_profile"));

        progress.addItem("register-finished", render(step, 3)).addContent(
                new Message("default","xmlui.EPerson.EPersonUtils.register_finished"));
    }
View Full Code Here

     * @param step The current step of the workflow (-1 if no step)
     */
    public static void forgottProgressList(Division form, int step) throws WingException
    {

        List progress = form.addList("forgot-password-progress",
                List.TYPE_PROGRESS);

        progress.addItem("forgot-verify-email", render(step, 1)).addContent(
                new Message("default","xmlui.EPerson.EPersonUtils.forgot_verify_email"));

        progress.addItem("forgot-reset-passowrd", render(step, 2)).addContent(
                new Message("default","xmlui.EPerson.EPersonUtils.forgot_reset_password"));

        progress.addItem("forgot-finished", render(step, 3)).addContent(
                new Message("default","xmlui.EPerson.EPersonUtils.forgot_finished"));
    }
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.wing.element.List

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.