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

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


       
        List queryList = query.addList("search-query",List.TYPE_FORM);
       
        if (variableScope())
        {
            Select scope = queryList.addItem().addSelect("scope");
            scope.setLabel(T_search_scope);
            scope.setHelp(T_search_scope_help);
            buildScopeList(scope);
        }
       
        Table queryTable = query.addTable("search-query", 4, 3);
        Row header = queryTable.addRow(Row.ROLE_HEADER);
View Full Code Here


        // default to AND if nothing specified.
        if (current == null || current.length() == 0)
            current = "AND";
       
        Select select = cell.addSelect("conjunction" + row);

        select.addOption("AND".equals(current), "AND").addContent(T_and);
        select.addOption("OR".equals(current), "OR").addContent(T_or);
        select.addOption("NOT".equals(current), "NOT").addContent(T_not);
    }
View Full Code Here

    private void buildTypeField(int row, Cell cell) throws WingException
    {
        Request request = ObjectModelHelper.getRequest(objectModel);
        String current = request.getParameter("field" + row);
       
        Select select = cell.addSelect("field" + row);

        Map<String, Message> searchTypes = new HashMap<String, Message>();
       
        int i = 1;
        String sindex = ConfigurationManager.getProperty("search.index." + i);
        while(sindex != null)
        {
            String field = sindex.split(":")[0];              
            searchTypes.put(field, message("xmlui.ArtifactBrowser.AdvancedSearch.type_" + field));
           
            sindex = ConfigurationManager.getProperty("search.index." + ++i);
        }
           
       
       
        // Special case ANY
        select.addOption((current == null), "ANY").addContent(
                message("xmlui.ArtifactBrowser.AdvancedSearch.type_ANY"));

        for (String key : searchTypes.keySet())
        {
            select.addOption(key.equals(current), key).addContent(
                    searchTypes.get(key));
        }
    }
View Full Code Here

          edit.addLabel(T_format_detected);
          edit.addItem(guessedFormat.getShortDescription());
        }
       
        // System supported formats
        Select format = edit.addItem().addSelect("format");
        format.setLabel(T_format_selected);
       
        format.addOption(-1,T_format_default);
        for (BitstreamFormat bitstreamFormat : bitstreamFormats)
        {
          String supportLevel = "Unknown";
          if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN)
            supportLevel = "known";
          else if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED)
            supportLevel = "Supported";
          String name = bitstreamFormat.getShortDescription()+" ("+supportLevel+")";
          int id = bitstreamFormat.getID();
      
          format.addOption(id,name);
        }
        if (currentFormat != null)
        {
          format.setOptionSelected(currentFormat.getID());
        }
        else if (guessedFormat != null)
        {
          format.setOptionSelected(guessedFormat.getID());
        }
        else
        {
          format.setOptionSelected(-1);
        }
       
        edit.addItem(T_info2);
       
        // User supplied format
View Full Code Here

        {
            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;
View Full Code Here

                // 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)
                    {
                        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 = 5; i <= 100; i += 5)
        {
            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
View Full Code Here

    TextArea description = form.addItem().addTextArea("description");
    description.setLabel(T_description);
    description.setValue(descriptionValue);
    description.setSize(3, 35);
   
    Select supportLevel = form.addItem().addSelect("support_level");
    supportLevel.setLabel(T_support);
    supportLevel.setHelp(T_support_help);
    supportLevel.addOption(0,T_support_0);
    supportLevel.addOption(1,T_support_1);
    supportLevel.addOption(2,T_support_2);
    supportLevel.setOptionSelected(supportLevelValue);
   
    CheckBox internal = form.addItem().addCheckBox("internal");
    internal.setLabel(T_internal);
    internal.setHelp(T_internal_help);
    internal.addOption((internalValue != null),"true");
View Full Code Here

        List queryList = query.addList("search-query",List.TYPE_FORM);
       
        if (variableScope())
        {
            Select scope = queryList.addItem().addSelect("scope");
            scope.setLabel(T_search_scope);
            buildScopeList(scope);
        }
       
        Text text = queryList.addItem().addText("query");
        text.setLabel(T_full_text_search);
View Full Code Here

        Division div = body.addInteractiveDivision("select-collection",actionURL,Division.METHOD_POST,"primary submission");
    div.setHead(T_submission_head);
       
        List list = div.addList("select-collection", List.TYPE_FORM);
        list.setHead(T_head);      
        Select select = list.addItem().addSelect("handle");
        select.setLabel(T_collection);
        select.setHelp(T_collection_help);
       
        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.getHandle(),name);
        }
       
        Button submit = list.addItem().addButton("submit");
        submit.setValue(T_submit_next);
    }
View Full Code Here

          actionSelect.addError(T_error_no_action);       
       
       
        // currently set group
        actionsList.addLabel(T_policy_currentGroup);
      Select groupSelect = actionsList.addItem().addSelect("group_id");
      groupSelect.setSize(5);
      for (Group group : Group.findAll(context, Group.NAME))
      {
        if (group == currentGroup)
          groupSelect.addOption(true, group.getID(), group.getName());
        else
          groupSelect.addOption(group.getID(), group.getName());
      }
      if (errors.contains("group_id"))
        groupSelect.addError(T_error_no_group);
     
       
        // the search function
        actionsList.addLabel(T_label_search);
        Item searchItem = actionsList.addItem();
View Full Code Here

TOP

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

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.