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

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


   
    // DIVISION: find-item
    Division findItem = body.addInteractiveDivision("find-item",contextPath + "/admin/item", Division.METHOD_GET,"primary administrative item");
    findItem.setHead(T_head1);
   
    List form = findItem.addList("find-item-form", List.TYPE_FORM);
   
    Text id = form.addItem().addText("identifier");
    id.setLabel(T_identifier_label);
    if (identifier != null)
      id.setValue(identifier);
    if (errors.contains("identifier"))
      id.addError(T_identifier_error);
   
    form.addItem().addButton("submit_find").setValue(T_find);
   
    findItem.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here


    // DIVISION: main
      Division main = body.addInteractiveDivision("community-assign-roles",contextPath+"/admin/community",Division.METHOD_POST,"primary administrative community");
        main.setHead(T_main_head.parameterize(thisCommunity.getName()));
     
      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);

      // The table of admin roles
      Table rolesTable = main.addTable("roles-table", 6, 5);
      Row tableRow;
     
View Full Code Here

               
               
                // LIST: options
                if (!editingTemplateItem)
        {
                  List options = main.addList("options",List.TYPE_SIMPLE,"horizontal");
                  options.addItem().addXref(baseURL+"&submit_status",T_option_status);
                  options.addItem().addXref(baseURL+"&submit_bitstreams",T_option_bitstreams);
                  options.addItem().addHighlight("bold").addXref(baseURL+"&submit_metadata",T_option_metadata);
                  options.addItem().addXref(baseURL + "&view_item", T_option_view);
                }

                // LIST: add new metadata
                List addForm = main.addList("addItemMetadata",List.TYPE_FORM);
                addForm.setHead(T_head1);

                Select addName = addForm.addItem().addSelect("field");
                addName.setLabel(T_name_label);
                MetadataField[] fields = MetadataField.findAll(context);
                for (MetadataField field : fields)
                {
                        int fieldID = field.getFieldID();
                        MetadataSchema schema = MetadataSchema.find(context, field.getSchemaID());
                        String name = schema.getName() +"."+field.getElement();
                        if (field.getQualifier() != null)
                                name += "."+field.getQualifier();

                        addName.addOption(fieldID, name);
                }
                if (previousFieldID != null)
                        addName.setOptionSelected(previousFieldID);


                Composite addComposite = addForm.addItem().addComposite("value");
                addComposite.setLabel(T_value_label);
                TextArea addValue = addComposite.addTextArea("value");
                Text addLang = addComposite.addText("language");

                addValue.setSize(4, 35);
                addLang.setLabel(T_lang_label);
                addLang.setSize(6);

                addForm.addItem().addButton("submit_add").setValue(T_submit_add);

               
               

                // PARA: Disclaimer
View Full Code Here

     
    // DIVISION: main
      Division main = body.addInteractiveDivision("community-metadata-edit",contextPath+"/admin/community",Division.METHOD_MULTIPART,"primary administrative community");
      main.setHead(T_main_head.parameterize(thisCommunity.getName()));
     
        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);
     
      // The grand list of metadata options
      List metadataList = main.addList("metadataList", "form");
     
      // community name
      metadataList.addLabel(T_label_name);
      Text name = metadataList.addItem().addText("name");
      name.setSize(40);
      name.setValue(thisCommunity.getMetadata("name"));
     
      // short description
      metadataList.addLabel(T_label_short_description);
      Text short_description = metadataList.addItem().addText("short_description");
      short_description.setValue(thisCommunity.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(thisCommunity.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(thisCommunity.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(thisCommunity.getMetadata("side_bar_text"));
      side_bar_text.setSize(6, 40);
      if (side_bar_text_error != null)
        side_bar_text.addError(side_bar_text_error);
           
      // 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 (thisCommunity.getLogo() != null) {
        metadataList.addLabel(T_label_existing_logo);
        item = metadataList.addItem();
        item.addFigure(contextPath + "/bitstream/id/" + thisCommunity.getLogo().getID() + "/bob.jpg", null, null);
        item.addButton("submit_delete_logo").setValue(T_submit_delete_logo);
      }
     
      Para buttonList = main.addPara();
View Full Code Here

        /////////////////////////////////////
        // List test
        Division listT = test.addDivision("list");
        listT.setHead("2) List Tests");
       
        List list = listT.addList("simple");
        list.setHead("Simple list");
        list.addItem("one");
        list.addItem("two");
        list.addItem("three");
   
        list = listT.addList("labeled");
        list.setHead("Simple list ( with labels )");
        list.addLabel("uno");
        list.addItem("one");
        list.addLabel("dos");
        list.addItem("two");
        list.addLabel("threes");
        list.addItem("three");
       
        list = listT.addList("bulleted",List.TYPE_BULLETED);
        list.setHead("Bulleted list");
        list.addItem("one");
        list.addItem("two");
        list.addItem("three");
       
        list = listT.addList("ordered",List.TYPE_ORDERED);
        list.setHead("Ordered list");
        list.addItem("one");
        list.addItem("two");
        list.addItem("three");
       
        list = listT.addList("glossary",List.TYPE_GLOSS);
        list.setHead("Glossary list");
        list.addLabel("uno");
        list.addItem("one");
        list.addLabel("dos");
        list.addItem("two");
        list.addLabel("tres");
        list.addItem("three");
       
        // Nests
       
        list = listT.addList("simple-nest");
        list.setHead("Simple list ( nested )");
        list.addItem("one");
        list.addItem("two");
        List nest = list.addList("nest1");
        nest.setHead("Sub list point three");
        nest.addItem("three point one");
        nest.addItem("three point two");
        nest.addItem("three point three");
        list.addItem("four");
       
        list = listT.addList("labeled-nest");
        list.setHead("Simple list ( with labels and nested )");
        list.addLabel("uno");
        list.addItem("one");
        list.addLabel("dos");
        list.addItem("two");
        nest = list.addList("nest2");
        nest.addLabel("dos punto uno");
        nest.addItem("two point one");
        nest.addLabel("dos punto dos");
        nest.addItem("two point two");
        nest.addLabel("dos punto tres");
        nest.addItem("two point three");
        list.addLabel("threes");
        list.addItem("three");
       
        list = listT.addList("bulleted-nest",List.TYPE_BULLETED);
        list.setHead("Bulleted list ( nested )");
        list.addItem("one");
        list.addItem("two");
        nest = list.addList("nest3");
        nest.addItem("three point one");
        nest.addItem("three point two");
        nest.addItem("three point three");
        list.addItem("four");
       
        list = listT.addList("ordered-nest",List.TYPE_ORDERED);
        list.setHead("Ordered list ( nested )");
        list.addItem("one");
        list.addItem("two");
        nest = list.addList("nest4");
        nest.setHead("Sub list point three");
        nest.addItem("three point one");
        nest.addItem("three point two");
        nest.addItem("three point three");
        list.addItem("four");
       
        list = listT.addList("glossary-nest",List.TYPE_GLOSS);
        list.setHead("Glossary list ( nested )");
        list.addLabel("uno");
        list.addItem("one");
        list.addLabel("dos");
        list.addItem("two");
        nest = list.addList("nest5");
        nest.addLabel("dos punto uno");
        nest.addItem("two point one");
        nest.addLabel("dos punto dos");
        nest.addItem("two point two");
        nest.addLabel("dos punto tres");
        nest.addItem("two point three");
        list.addLabel("tres");
        list.addItem("three");
       
        ///////////////////////////////////////////////////
        // Table test
View Full Code Here

            jumpForm.addButton("submit").setValue(T_go);
        }
        else
        {
            // Create a clickable list of the alphabet
            List jumpList = jump.addList("jump-list", List.TYPE_SIMPLE, "alphabet");
           
            // browse params for each letter are all the query params
            // WITHOUT the second-stage browse value, and add STARTS_WITH.
            Map<String, String> letterQuery = new HashMap<String, String>(queryParamsGET);
            for (String valueKey : BrowseParams.FILTER_VALUE)
            {
                letterQuery.remove(valueKey);
            }
            letterQuery.put(BrowseParams.STARTS_WITH, "0");
            jumpList.addItemXref(super.generateURL(BROWSE_URL_BASE, letterQuery), "0-9");
           
            for (char c = 'A'; c <= 'Z'; c++)
            {
                letterQuery.put(BrowseParams.STARTS_WITH, Character.toString(c));
                jumpList.addItemXref(super.generateURL(BROWSE_URL_BASE, letterQuery), Character
                        .toString(c));
            }

            // Create a free text field for the initial characters
            Para jumpForm = jump.addPara();
View Full Code Here

       
        Division login = body.addInteractiveDivision("login", contextPath
                + "/password-login", Division.METHOD_POST, "primary");
        login.setHead(T_head1);
       
        List list = login.addList("password-login",List.TYPE_FORM);

        Text email = list.addItem().addText("login_email");
        email.setRequired();
        email.setLabel(T_email_address);
        if (previousEmail != null)
        {
            email.setValue(previousEmail);
            email.addError(T_error_bad_login);
        }
       

        Item item = list.addItem();
        Password password = item.addPassword("login_password");
        password.setRequired();
        password.setLabel(T_password);
        item.addXref(contextPath + "/forgot", T_forgot_link);

        list.addLabel();
        Item submit = list.addItem("login-in", null);
        submit.addButton("submit").setValue(T_submit);
       
        if (ConfigurationManager.getBooleanProperty("xmlui.user.registration", true))
        {
          Division register = login.addDivision("register");
View Full Code Here

        {
            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 helpful 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 helpful 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 helpful 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 helpful 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

      
       EPersonUtils.forgottProgressList(register,2);
      
       register.addPara(T_para1);
      
       List form = register.addList("form",List.TYPE_FORM);
      
       form.addLabel(T_email_address);
       form.addItem(email);
      
       Field password = form.addItem().addPassword("password");
       password.setRequired();
       password.setAutofocus("autofocus");
       password.setLabel(T_new_password);
       if (errors.contains("password"))
       {
           password.addError(T_error_invalid_password);
       }
      
       Field passwordConfirm = form.addItem().addPassword("password_confirm");
       passwordConfirm.setRequired();
       passwordConfirm.setLabel(T_confirm_password);
       if (errors.contains("password_confirm"))
       {
           passwordConfirm.addError(T_error_unconfirmed_password);
       }
      
       form.addItem().addButton("submit").setValue(T_submit);
      
       register.addHidden("eperson-continue").setValue(knot.getId());
   }
View Full Code Here

      
      
      
      
      
       List form = profile.addList("form",List.TYPE_FORM);
      
       List identity = form.addList("identity",List.TYPE_FORM);
       identity.setHead(T_head_identify);
      
       // Email
       identity.addLabel(T_email_address);
       identity.addItem(email);
      
       // First name
       Text firstName = identity.addItem().addText("first_name");
       firstName.setAutofocus("autofocus");
       firstName.setRequired();
       firstName.setLabel(T_first_name);
       firstName.setValue(defaultFirstName);
       if (errors.contains("first_name"))
       {
           firstName.addError(T_error_required);
       }
       if (!registering && !ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
       {
           firstName.setDisabled();
       }
      
       // Last name
       Text lastName = identity.addItem().addText("last_name");
       lastName.setRequired();
       lastName.setLabel(T_last_name);
       lastName.setValue(defaultLastName);
       if (errors.contains("last_name"))
       {
           lastName.addError(T_error_required);
       }
       if (!registering &&!ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
       {
           lastName.setDisabled();
       }
      
       // Phone
       Text phone = identity.addItem().addText("phone");
       phone.setLabel(T_telephone);
       phone.setValue(defaultPhone);
       if (errors.contains("phone"))
       {
           phone.addError(T_error_required);
       }
       if (!registering && !ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
       {
           phone.setDisabled();
       }
       
       // Language
       Select lang = identity.addItem().addSelect("language");
       lang.setLabel(T_language);
       if (supportedLocales.length > 0)
       {
           for (Locale lc : supportedLocales)
           {
               lang.addOption(lc.toString(), lc.getDisplayName());
           }
       }
       else
       {
           lang.addOption(I18nUtil.DEFAULTLOCALE.toString(), I18nUtil.DEFAULTLOCALE.getDisplayName());
       }
       lang.setOptionSelected((defaultLanguage == null || defaultLanguage.equals("")) ?
                              I18nUtil.DEFAULTLOCALE.toString() : defaultLanguage);
       if (!registering && !ConfigurationManager.getBooleanProperty("xmlui.user.editmetadata", true))
       {
           lang.setDisabled();
       }

       // Subscriptions
       if (!registering)
       {
           List subscribe = form.addList("subscriptions",List.TYPE_FORM);
           subscribe.setHead(T_subscriptions);
          
           subscribe.addItem(T_subscriptions_help);
          
           Collection[] currentList = Subscribe.getSubscriptions(context, context.getCurrentUser());
           Collection[] possibleList = Collection.findAll(context);
          
           Select subscriptions = subscribe.addItem().addSelect("subscriptions");
           subscriptions.setLabel(T_email_subscriptions);
           subscriptions.setHelp("");
           subscriptions.enableAddOperation();
           subscriptions.enableDeleteOperation();
          
           subscriptions.addOption(-1,T_select_collection);
         CollectionDropDown.CollectionPathEntry[] possibleEntries = CollectionDropDown.annotateWithPaths(possibleList);
           for (CollectionDropDown.CollectionPathEntry possible : possibleEntries)
           {
               subscriptions.addOption(possible.collection.getID(), possible.path);
           }

           for (Collection collection: currentList)
           {
               subscriptions.addInstance().setOptionSelected(collection.getID());
           }
       }
      
      
       if (allowSetPassword)
       {
           List security = form.addList("security",List.TYPE_FORM);
           security.setHead(T_head_security);
          
           if (registering)
           {
                   security.addItem().addContent(T_create_password_instructions);
           }
           else
           {
                   security.addItem().addContent(T_update_password_instructions);
           }
          
          
           Field password = security.addItem().addPassword("password");
           password.setLabel(T_password);
           if (registering)
           {
               password.setRequired();
           }
           if (errors.contains("password"))
           {
               password.addError(T_error_invalid_password);
           }
          
           Field passwordConfirm = security.addItem().addPassword("password_confirm");
           passwordConfirm.setLabel(T_confirm_password);
           if (registering)
           {
               passwordConfirm.setRequired();
           }
           if (errors.contains("password_confirm"))
           {
               passwordConfirm.addError(T_error_unconfirmed_password);
           }
       }
      
       Button submit = form.addItem().addButton("submit");
       if (registering)
       {
           submit.setValue(T_submit_update);
       }
       else
       {
           submit.setValue(T_submit_create);
       }
      
       profile.addHidden("eperson-continue").setValue(knot.getId());
      
      
      
       if (!registering)
       {
                // Add a list of groups that this user is apart of.
                        Group[] memberships = Group.allMemberGroups(context, context.getCurrentUser());
               
               
                        // Not a member of any groups then don't do anything.
                        if (!(memberships.length > 0))
                        {
                            return;
                        }
                       
                        List list = profile.addList("memberships");
                        list.setHead(T_head_auth);
                        for (Group group: memberships)
                        {
                                list.addItem(group.getName());
                        }
       }
   }
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.