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

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


    {
      Group group = Group.find(context,Integer.valueOf(id));
      groups.add(group);
    }
    
      Division deleted = body.addInteractiveDivision("group-confirm-delete",
          contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative groups");
      deleted.setHead(T_head);
      deleted.addPara(T_para);
     
      Table table = deleted.addTable("groups-list",groups.size() + 1, 3);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_column1);
        header.addCell().addContent(T_column2);
        header.addCell().addContent(T_column3);
        header.addCell().addContent(T_column4);
       
      for (Group group : groups)
      { 
        Row row = table.addRow();
        row.addCell().addContent(group.getID());
          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


        String numSearchField = request.getParameter("num_search_field");
        if (numSearchField == null || numSearchField.length() == 0)
          numSearchField = "3";
     
        // Build the DRI Body
        Division search = body.addDivision("advanced-search","primary");
        search.setHead(T_head);
        Division query = search.addInteractiveDivision("search-query",
                "advanced-search",Division.METHOD_POST,"secondary search");
       
        // Use these fields to change the number of search fields, or change the results per page.
        query.addHidden("num_search_field").setValue(numSearchField);
        query.addHidden("results_per_page").setValue(getParameterRpp());
       
        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);
        header.addCellContent(T_conjunction);
        header.addCellContent(T_search_type);
        header.addCellContent(T_search_for);
       
        for (int i = 1; i <= FIELD_DISPLAY_COUNT; i++)
        {
            Row row = queryTable.addRow(Row.ROLE_DATA);
            buildConjunctionField(i, row.addCell());
            buildTypeField(i, row.addCell());
            buildQueryField(i, row.addCell());
        }

        for (SearchField field : fields)
        {
          // Skip over all the fields we've displayed.
          int i = field.getIndex();
          if (i <= FIELD_DISPLAY_COUNT)
            continue;
         
          query.addHidden("conjunction"+i).setValue(field.getConjunction());
          query.addHidden("field"+i).setValue(field.getField());
          query.addHidden("query"+i).setValue(field.getQuery());
        }

        buildSearchControls(query);
        query.addPara(null, "button-list").addButton("submit").setValue(T_go);
       
        // Add the result division
        buildSearchResultsDivision(search);

    }
View Full Code Here

        int itemID = submissionInfo.getSubmissionItem().getItem().getID();
      String fileUrl = contextPath + "/bitstream/item/" + itemID + "/" + bitstream.getName();
      String fileName = bitstream.getName();
     
      // Build the form that describes an item.
      Division div = body.addInteractiveDivision("submit-edit-file", actionURL, Division.METHOD_POST, "primary submission");
      div.setHead(T_submission_head);
      addSubmissionProgressList(div);
     
      List edit = div.addList("submit-edit-file", List.TYPE_FORM);
        edit.setHead(T_head);   
       
        edit.addLabel(T_file);
        edit.addItem().addXref(fileUrl, fileName);
       
        Text description = edit.addItem().addText("description");
        description.setLabel(T_description);
        description.setHelp(T_description_help);
        description.setValue(bitstream.getDescription());
       
        edit.addItem(T_info1);
        if (guessedFormat != null)
        {
          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
        Text userFormat = edit.addItem().addText("format_description");
        userFormat.setLabel(T_format_user);
        userFormat.setHelp(T_format_user_help);
        userFormat.setValue(bitstream.getUserFormatDescription());
       
        // add ID of bitstream we're editing
        div.addHidden("bitstream_id").setValue(bitstream.getID());
       
        // Note, not standard control actions, this page just goes back to the upload step.
        org.dspace.app.xmlui.wing.element.Item actions = edit.addItem();
        actions.addButton("submit_save").setValue(T_submit_save);
    actions.addButton("submit_edit_cancel").setValue(T_submit_cancel);
View Full Code Here

        BrowseInfo info = getBrowseInfo();

        String type = "withdrawn";

        // Build the DRI Body
        Division div = body.addDivision("browse-by-" + type, "primary");

        div.setHead(getTitleMessage(info));

        // Build the internal navigation (jump lists)
        addBrowseJumpNavigation(div, info, params);

        // Build the sort and display controls
        addBrowseControls(div, info, params);

        // This div will hold the browsing results
        Division results = div.addDivision("browse-by-" + type + "-results", "primary");

        // Add the pagination
        if (info.getTotal() <= 0)
        {
            results.setSimplePagination(0, 0, 0, null, null);

        }
        else
        {
            results.setSimplePagination(info.getTotal(), browseInfo.getOverallPosition() + 1,
                    browseInfo.getOverallPosition() + browseInfo.getResultCount(), getPreviousPageURL(
                            params, info), getNextPageURL(params, info));
        }

        // Reference all the browsed items
        ReferenceSet referenceSet = results.addReferenceSet("browse-by-" + type,
                ReferenceSet.TYPE_SUMMARY_LIST, type, null);

        // Are we browsing items, or unique metadata?
        if (isItemBrowse(info))
        {
            // Add the items to the browse results
            for (BrowseItem item : (java.util.List<BrowseItem>) info.getResults())
            {
                referenceSet.addReference(item);
            }
        }
        else    // browsing a list of unique metadata entries
        {
            // Create a table for the results
            Table singleTable = results.addTable("browse-by-" + type + "-results",
                    browseInfo.getResultCount() + 1, 1);

            // Add the column heading
            singleTable.addRow(Row.ROLE_HEADER).addCell().addContent(
                    message("xmlui.ArtifactBrowser.ConfigurableBrowse." + type + ".column_heading"));
View Full Code Here

        Map<String, String> queryParams = new HashMap<String, String>();
        queryParams.putAll(params.getCommonParameters());
        queryParams.putAll(params.getControlParameters());

        // Navigation aid (really this is a poor version of pagination)
        Division jump = div.addInteractiveDivision("browse-navigation", WITHDRAWN_URL_BASE,
                Division.METHOD_POST, "secondary navigation");

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

        // 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(WITHDRAWN_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

        // Prepare a Map of query parameters required for all links
        Map<String, String> queryParams = new HashMap<String, String>();

        queryParams.putAll(params.getCommonParameters());

        Division controls = div.addInteractiveDivision("browse-controls", WITHDRAWN_URL_BASE,
                Division.METHOD_POST, "browse controls");

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

 
    public void addBody(Body body) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {
        Division contact = body.addDivision("contact","primary");
    
        contact.setHead(T_head);
       
        String name = ConfigurationManager.getProperty("dspace.name");
        contact.addPara(T_para1.parameterize(name));
       
        List list = contact.addList("contact");
       
        list.addLabel(T_feedback_label);
        list.addItem().addXref(contextPath+"/feedback",T_feedback_link);
       
        list.addLabel(T_email);
View Full Code Here

    public void addBody(Body body) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {

        // Build the item viewer division.
        Division feedback = body.addInteractiveDivision("feedback-form",
                contextPath+"/feedback",Division.METHOD_POST,"primary");
       
        feedback.setHead(T_head);
       
        feedback.addPara(T_para1);
       
        List form = feedback.addList("form",List.TYPE_FORM);
       
        Text email = form.addItem().addText("email");
        email.setLabel(T_email);
        email.setHelp(T_email_help);
        email.setValue(parameters.getParameter("email",""));
       
        TextArea comments = form.addItem().addTextArea("comments");
        comments.setLabel(T_comments);
        comments.setValue(parameters.getParameter("comments",""));
       
        form.addItem().addButton("submit").setValue(T_submit);
       
        feedback.addHidden("page").setValue(parameters.getParameter("page","unknown"));
    }
View Full Code Here

 
     
     
      // Division 1:
      //  Global division
    Division div = body.addDivision("submit-cclicense", "primary submission");
    div.setHead(T_submission_head);
       
        // Division 2:
    //Progress bar division
        Division progressDiv = div.addInteractiveDivision("submit-cclicense-progress", actionURL, Division.METHOD_POST);
        addSubmissionProgressList(progressDiv);
        //need 'submission-continue' in order to keep current state
        progressDiv.addHidden("submission-continue").setValue(knot.getId());
       
    // Division 3:
    //  Creative commons offsite division
      Division offsiteDiv = div.addInteractiveDivision("submit-cclicense-offsite", CREATIVE_COMMONS_URL, Division.METHOD_POST);
        offsiteDiv.setHead(T_head);
      offsiteDiv.addPara(T_info1);
   
      offsiteDiv.addHidden("submission-continue").setValue(knot.getId());
      offsiteDiv.addHidden("partner").setValue("dspace");
      offsiteDiv.addHidden("exit_url").setValue(exitURL);

        String jurisdiction = ConfigurationManager.getProperty("webui.submit.cc-jurisdiction");
        if ((jurisdiction != null) && (!"".equals(jurisdiction)))
        {
            offsiteDiv.addHidden("jurisdiction").setValue(jurisdiction.trim());
        }

      Para ccPara = offsiteDiv.addPara("creative-commons-button","creative-commons-button");
      ccPara.addButton("submit_to_creative_commons").setValue(T_submit_to_creative_commons);
 
      // Division 4:
    //  Local onsite division
    Division onsiteDiv = div.addInteractiveDivision("submit-cclicense-offsite", actionURL, Division.METHOD_POST);
    List form = onsiteDiv.addList("submit-review", List.TYPE_FORM);
 
    form.addLabel(T_license);
    if (CreativeCommons.hasLicense(context, item))
    {
      String url = CreativeCommons.getLicenseURL(item);
View Full Code Here

            UIException, SQLException, IOException, AuthorizeException
    {
        String queryString = getQuery();

        // Build the DRI Body
        Division search = body.addDivision("search","primary");
        search.setHead(T_head);
        Division query = search.addInteractiveDivision("general-query",
                "search",Division.METHOD_GET,"secondary search");

        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);
        text.setValue(queryString);
       
        buildSearchControls(query);
        query.addPara(null, "button-list").addButton("submit").setValue(T_go);

        // Add the result division
        buildSearchResultsDivision(search);

    }
View Full Code Here

TOP

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

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.