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

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


        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();
      buttonList.addButton("submit_save").setValue(T_submit_update);

      if (AuthorizeManager.authorizeActionBoolean(context, thisCommunity, Constants.DELETE))
        {
           buttonList.addButton("submit_delete").setValue(T_submit_delete);
        }
      buttonList.addButton("submit_return").setValue(T_submit_return);
     
      main.addHidden("administrative-continue").setValue(knot.getId());
     
    }
View Full Code Here


        // Add all the query parameters as hidden fields on the form
        for (String key : queryParams.keySet())
            controls.addHidden(key).setValue(queryParams.get(key));

        Para controlsForm = controls.addPara();

        // If we are browsing a list of items
        if (isItemBrowse(info)) //  && info.isSecondLevel()
        {
            try
            {
                // Create a drop down of the different sort columns available
                Set<SortOption> sortOptions = SortOption.getSortOptions();
               
                // Only generate the list if we have multiple columns
                if (sortOptions.size() > 1)
                {
                    controlsForm.addContent(T_sort_by);
                    Select sortSelect = controlsForm.addSelect(BrowseParams.SORT_BY);
   
                    for (SortOption so : sortOptions)
                    {
                        if (so.isVisible())
                        {
                            sortSelect.addOption(so.equals(info.getSortOption()), so.getNumber(),
                                    message("xmlui.ArtifactBrowser.ConfigurableBrowse.sort_by." + so.getName()));
                        }
                    }
                }
            }
            catch (SortException se)
            {
                throw new WingException("Unable to get sort options", se);
            }
        }

        // Create a control to changing ascending / descending order
        controlsForm.addContent(T_order);
        Select orderSelect = controlsForm.addSelect(BrowseParams.ORDER);
        orderSelect.addOption("ASC".equals(params.scope.getOrder()), "ASC", T_order_asc);
        orderSelect.addOption("DESC".equals(params.scope.getOrder()), "DESC", T_order_desc);

        // Create a control for the number of records to display
        controlsForm.addContent(T_rpp);
        Select rppSelect = controlsForm.addSelect(BrowseParams.RESULTS_PER_PAGE);
       
        for (int i : RESULTS_PER_PAGE_PROGRESSION)
        {
            rppSelect.addOption((i == info.getResultsPerPage()), i, Integer.toString(i));
        }

        // Create a control for the number of authors per item to display
        // FIXME This is currently disabled, as the supporting functionality
        // is not currently present in xmlui
        //if (isItemBrowse(info))
        //{
        //    controlsForm.addContent(T_etal);
        //    Select etalSelect = controlsForm.addSelect(BrowseParams.ETAL);
        //
        //    etalSelect.addOption((info.getEtAl() < 0), 0, T_etal_all);
        //    etalSelect.addOption(1 == info.getEtAl(), 1, Integer.toString(1));
        //
        //    for (int i = 5; i <= 50; i += 5)
        //    {
        //        etalSelect.addOption(i == info.getEtAl(), i, Integer.toString(i));
        //    }
        //}

        controlsForm.addButton("update").setValue(T_update);
    }
View Full Code Here

            if (collections.length > 0)
            {
                Division start = division.addDivision("start-submision");
                start.setHead(T_s_head1);
                Para p = start.addPara();
                p.addContent(T_s_info1a);
                p.addXref(contextPath+"/submit",T_s_info1b);
                Para secondP = start.addPara();
                secondP.addContent(T_s_info1c);
                return;
            }
      }

      Division unfinished = division.addDivision("unfinished-submisions");
      unfinished.setHead(T_s_head2);
      Para p = unfinished.addPara();
      p.addContent(T_s_info2a);
      p.addHighlight("bold").addXref(contextPath+"/submit",T_s_info2b);
      p.addContent(T_s_info2c);

      // Calculate the number of rows.
      // Each list pluss the top header and bottom row for the button.
      int rows = unfinishedItems.length + supervisedItems.length + 2;
      if (supervisedItems.length > 0 && unfinishedItems.length > 0)
View Full Code Here

        }//end while

        //Display limit text & link to allow user to override this default limit
        if(!displayAll && count == limit)
        {
            Para limitedList = completedSubmissions.addPara();
            limitedList.addContent(T_c_limit);
            limitedList.addXref(contextPath + "/submissions?all", T_c_displayall);
        }   
    }
View Full Code Here

          row.addCell().addContent(group.getName());
          row.addCell().addContent(group.getMembers().length);
          row.addCell().addContent(group.getMemberGroups().length);
      }
     
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_confirm);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
      deleted.addHidden("administrative-continue").setValue(knot.getId());
    }
View Full Code Here

    suited.setHead("Fields suited towards being used inline");
   
    suited.addPara("Below are a list of embedded fields that are normally considered usefully in an inline context.");
   
    // Text field
    Para p = suited.addPara();
    p.addContent("This is a plain 'Text' field, ");
        Text text = p.addText("text");
        text.setLabel("Text");
        if (help)
        {
            text.setHelp("This is helpful text.");
        }
        if (error)
        {
            text.addError("This field is in error.");
        }
        text.setValue("Current raw value");
        p.addContent(", embedded in a paragraph.");
       
        // Single Checkbox field
        p = suited.addPara();
    p.addContent("This is a single 'CheckBox' field, ");
        CheckBox checkBox = p.addCheckBox("yes-or-no");
        if (help)
        {
            checkBox.setHelp("Select either yes or no.");
        }
        if (error)
        {
            checkBox.addError("You are incorrect, try again.");
        }
        checkBox.setLabel("Yes or no");
        checkBox.addOption("yes");
        p.addContent(", embedded in a paragraph.");
       
        // File
        p = suited.addPara();
    p.addContent("This is a 'File' field, ");
        File file = p.addFile("file");
        file.setLabel("File");
        if (help)
        {
            file.setHelp("Upload a file.");
        }
        if (error)
        {
            file.addError("This field is in error.");
        }
        p.addContent(", embedded in a paragraph.");
       
        // Select (single)
        p = suited.addPara();
    p.addContent("This is single 'Select' (aka dropdown) field, ");
        Select select = p.addSelect("select");
        select.setLabel("Select (single)");
        if (help)
        {
            select.setHelp("Select one of the options");
        }
        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");
        select.setOptionSelected("one");
        p.addContent(", embedded in a paragraph.");
       
        // Button
        p = suited.addPara();
    p.addContent("This is a 'Button' field, ");
        Button button = p.addButton("button");
        button.setLabel("Button");
        button.setValue("When you touch me I do things, lots of things");
        if (help)
        {
            button.setHelp("Submit buttons allow the user to submit the form.");
        }
        if (error)
        {
            button.addError("This button is in error.");
        }
        p.addContent(", embedded in a paragraph.");
       
       
       
        Division unsuited = body.addDivision("unsuited");
        unsuited.setHead("Fields typically unsuited towards being used inline");
   
        unsuited.addPara("Below are a list of embedded fields that are normally considered useless in an inline context. This is because there widgets normally cross multiple lines making them hard to render inline. However these are all legal, but perhaps not advisable, and in some circumstances may be needed.");
   
       
        // Text Area Field
        p = unsuited.addPara();
    p.addContent("This is a 'Text Area' field, ");
        TextArea textArea = p.addTextArea("textarea");
        textArea.setLabel("Text Area");
        if (help)
        {
            textArea.setHelp("This is helpful text.");
        }
        if (error)
        {
            textArea.addError("This field is in error.");
        }
        textArea.setValue("This is the raw value");
        p.addContent(", embedded in a paragraph.");
       
        // Multi-option Checkbox field
        p = unsuited.addPara();
    p.addContent("This is a multi-option 'CheckBox' field, ");
        checkBox = p.addCheckBox("fruit");
        if (help)
        {
            checkBox.setHelp("Select all the fruits that you like to eat");
        }
        if (error)
        {
            checkBox.addError("You are incorrect you actually do like Tootse Rolls.");
        }
        checkBox.setLabel("fruits");
        checkBox.addOption("apple","Apples");
        checkBox.addOption(true,"orange","Oranges");
        checkBox.addOption("pear","Pears");
        checkBox.addOption("tootsie","Tootsie Roll");
        checkBox.addOption(true,"cherry","Cherry");
        p.addContent(", embedded in a paragraph.");
       
        // multi-option Radio field
        p = unsuited.addPara();
    p.addContent("This is a multi-option 'Radio' field, ");
        Radio radio = p.addRadio("sex");
        radio.setLabel("Football colors");        
        if (help)
        {
            radio.setHelp("Select the colors of the best (college) football team.");
        }
        if (error)
        {
            radio.addError("Error, Maroon & White is the only acceptable answer.");
        }
        radio.addOption("ut","Burnt Orange & White");
        radio.addOption(true,"tamu","Maroon & White");
        radio.addOption("ttu","Tech Red & Black");
        radio.addOption("baylor","Green & Gold");
        radio.addOption("rice","Blue & Gray");
        radio.addOption("uh","Scarlet Red & Albino White");
        p.addContent(", embedded in a paragraph.");

        // Select (multiple)
        p = unsuited.addPara();
    p.addContent("This is multiple 'Select' field, ");
        select = p.addSelect("multi-select");
        select.setLabel("Select (multiple)");
        select.setMultiple();
        select.setSize(4);
        if (help)
        {
            select.setHelp("Select one or more options");
        }
        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");
        select.setOptionSelected("one");
        select.setOptionSelected("three");
        select.setOptionSelected("five");
        p.addContent(", embedded in a paragraph.");
       
        // Composite
        p = unsuited.addPara();
    p.addContent("This is a 'Composite' field of two text fields, ");
        Composite composite = p.addComposite("composite-2text");
        composite.setLabel("Composite (two text fields)");
        if (help)
        {
            composite.setHelp("I am the help for the entire composite");
        }
        if (error)
        {
            composite.addError("Just the composite is in error");
        }
        text = composite.addText("partA");
        text.setLabel("Part A");
        text.setValue("Value for part A");
        if (help)
        {
            text.setHelp("Part A");
        }
        text = composite.addText("partB");
        text.setLabel("Part B");
        text.setValue("Value for part B");
        if (help)
        {
            text.setHelp("Part B");
        }
        p.addContent(", embedded in a paragraph.");
       
       
       
    }
View Full Code Here

    String loginURL = contextPath+"/login";
    String feedbackURL = contextPath+"/feedback";
   
        Division main = body.addDivision("not-authorized","primary administrative");
    main.setHead(T_head);
    Para para1 = main.addPara();
    para1.addContent(T_para1a);
    para1.addXref(feedbackURL,T_para1b);
    para1.addContent(T_para1c);

    main.addPara().addXref(loginURL,T_para2);
   
  }
View Full Code Here

        }
  
     
      if(collection != null)
      {
        Para para = main.addPara();
        para.addContent(T_collection_para);
        para.addXref(contextPath+"/handle/"+collection.getHandle(), collection.getMetadata("name"));
      }
      else if(community != null)
        {
            Para para = main.addPara();
            para.addContent(T_community_para);
            para.addXref(contextPath+"/handle/"+community.getHandle(), community.getMetadata("name"));
        }
    
      // DIVISION: group-actions
      Division actions = main.addDivision("group-edit-actions");
      Para groupName = actions.addPara();
        groupName.addContent(T_label_name);
        Text groupText = groupName.addText("group_name");
        groupText.setValue(currentName);
        if(collection != null || community != null)
        {
          // If this group is associated with a collection or community then it is special,
          // thus they shouldn't be able to update it.
          groupText.setDisabled();
          groupText.setHelp(T_label_instructions);
        }
        else if (errors.contains("group_name") || errors.contains("group_name_duplicate"))
        {
            groupText.addError("");
        }
       

        Para searchBoxes = actions.addPara();
        searchBoxes.addContent(T_label_search);
        Text queryField = searchBoxes.addText("query");
        queryField.setValue(query);
        queryField.setSize(15);
        searchBoxes.addButton("submit_search_epeople").setValue(T_submit_search_people);
        searchBoxes.addButton("submit_search_groups").setValue(T_submit_search_groups);
   
       
        if (query != null)
        {
          if ("eperson".equals(type))
          {
            searchBoxes.addButton("submit_clear").setValue(T_submit_clear);
            addEPeopleSearch(main,query,page,group,memberEPeopleIDs);
          }
          else if ("group".equals(type))
          {
            searchBoxes.addButton("submit_clear").setValue(T_submit_clear);
            addGroupSearch(main,group,query,page,group,memberGroupIDs);
          }
        }
                    
        boolean changes = false;
        if (group != null)
        {
            changes = addMemberList(main, group, memberGroupIDs, memberEPeopleIDs, highlightEPersonID, highlightGroupID);
        }
       
              
      Para buttons = main.addPara();
      buttons.addButton("submit_save").setValue(T_submit_save);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
      
      if (changes)
        {
            main.addPara().addHighlight("warn").addContent(T_pending_warn);
        }
View Full Code Here

      
       invalid.setHead(T_head);
      
       invalid.addPara(T_para1);

       Para example1 = invalid.addPara("invalid-token-example","code");
       example1.addContent(ConfigurationManager.getProperty("dspace.url") + "/register?token=ABCDEFGHIJK");
       Para example2 = invalid.addPara("invalid-token-example","code");
       example2.addContent("LMNOP");
      
       invalid.addPara(T_para2);

       Para example3 = invalid.addPara("valid-token-example","code");
       example3.addContent(ConfigurationManager.getProperty("dspace.url") + "/register?token=ABCDEFGHIJKLMNOP");

   }
View Full Code Here

        }

        // If this is a date based browse, render the date navigation
        if (isSortedByDate(info))
        {
            Para jumpForm = jump.addPara();

            // Create a select list to choose a month
            jumpForm.addContent(T_jump_select);
            Select month = jumpForm.addSelect(BrowseParams.MONTH);
            month.addOption(false, "-1", T_choose_month);
            for (int i = 1; i <= 12; i++)
            {
                month.addOption(false, String.valueOf(i), DCDate.getMonthName(i, Locale
                        .getDefault()));
            }

            // Create a select list to choose a year
            Select year = jumpForm.addSelect(BrowseParams.YEAR);
            year.addOption(false, "-1", T_choose_year);
            int currentYear = DCDate.getCurrent().getYear();
            int i = currentYear;

            // Calculate where to move from 1, 5 to 10 year jumps
            int oneYearBreak = ((currentYear - ONE_YEAR_LIMIT) / 5) * 5;
            int fiveYearBreak = ((currentYear - FIVE_YEAR_LIMIT) / 10) * 10;
            int tenYearBreak = (currentYear - TEN_YEAR_LIMIT);
            do
            {
                year.addOption(false, String.valueOf(i), String.valueOf(i));

                if (i <= fiveYearBreak)
                {
                    i -= 10;
                }
                else if (i <= oneYearBreak)
                {
                    i -= 5;
                }
                else
                {
                    i--;
                }
            }
            while (i > tenYearBreak);

            // Create a free text entry box for the year
            jumpForm = jump.addPara();
            jumpForm.addContent(T_jump_year);
            jumpForm.addText(BrowseParams.STARTS_WITH).setHelp(T_jump_year_help);

            jumpForm.addButton("submit").setValue(T_go);
        }
        else
        {
            // Create a clickable list of the alphabet
            List jumpList = jump.addList("jump-list", List.TYPE_SIMPLE, "alphabet");
            for (char c = 'A'; c <= 'Z'; c++)
            {
                Map<String, String> cQuery = new HashMap<String, String>(queryParams);
                cQuery.put(BrowseParams.STARTS_WITH, Character.toString(c));
                jumpList.addItemXref(super.generateURL(PRIVATE_URL_BASE, cQuery), Character
                        .toString(c));
            }

            // Create a free text field for the initial characters
            Para jumpForm = jump.addPara();
            jumpForm.addContent(T_starts_with);
            jumpForm.addText(BrowseParams.STARTS_WITH).setHelp(T_starts_with_help);

            jumpForm.addButton("submit").setValue(T_go);
        }
    }
View Full Code Here

TOP

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

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.