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

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


  private void addMemberRow(Table table,Group group, boolean highlight, boolean pendingAddition, boolean pendingRemoval) throws WingException, SQLException
  {
      String name = group.getName();
      String url = contextPath+"/admin/groups?administrative-continue="+knot.getId()+"&submit_edit_group&groupID="+group.getID();
  
      Row groupData = table.addRow(null,null,highlight ? "highlight" : null);
     
      groupData.addCell().addHighlight("bold").addContent(group.getID());
     
      // Mark if this member is pending or not.
      Cell nameCell = groupData.addCell();
      if (AuthorizeManager.isAdmin(context))
        {
            nameCell.addHighlight("bold").addXref(url, T_members_group_name.parameterize(name));
        }
      else
        {
            nameCell.addHighlight("bold").addContent(T_members_group_name.parameterize(name));
        }
     
      if (pendingAddition)
      {
        nameCell.addContent(" ");
        nameCell.addHighlight("warn").addContent(T_members_pending);
      }
     
      groupData.addCell().addContent("-");
     
      if (pendingRemoval)
        {
            groupData.addCell().addHighlight("warn").addContent(T_pending);
        }
      else
        {
            groupData.addCell().addButton("submit_remove_group_" + group.getID()).setValue(T_submit_remove);
        }
  }
View Full Code Here


      String fullName = eperson.getFullName();
      String email = eperson.getEmail();
      String url = contextPath+"/admin/epeople?administrative-continue="+knot.getId()+"&submit_edit_eperson&epersonID="+eperson.getID();
   
     
      Row personData = table.addRow(null,null,highlight ? "highlight" : null);
     
      personData.addCell().addContent(eperson.getID());
     
    Cell nameCell = personData.addCell();
    nameCell.addXref(url, fullName);
    if (pendingAddition)
    {
      nameCell.addContent(" ");
        nameCell.addHighlight("warn").addContent(T_members_pending);
    }
   
    personData.addCell().addXref(url, email);
   
    if (pendingRemoval)
        {
            personData.addCell().addHighlight("warn").addContent(T_pending);
        }
    else
        {
            personData.addCell().addButton("submit_remove_eperson_" + eperson.getID()).setValue(T_submit_remove);
        }
  }
View Full Code Here

                main.addHidden("scope").setValue("*");
                int index = 1;
                Table table = main.addTable("editItemMetadata",1,1);
                table.setHead(T_head2);

                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);

                ChoiceAuthorityManager cmgr = ChoiceAuthorityManager.getManager();
                for(Metadatum value : values)
                {
                        String name = value.schema + "_" + value.element;
                        if (value.qualifier != null)
                        {
                            name += "_" + value.qualifier;
                        }

                        Row row = table.addRow(name,Row.ROLE_DATA,"metadata-value");

                        CheckBox remove = row.addCell().addCheckBox("remove_"+index);
                        remove.setLabel("remove");
                        remove.addOption(index);

                        Cell cell = row.addCell();
                        cell.addContent(name.replaceAll("_", ". "));
                        cell.addHidden("name_"+index).setValue(name);

                        // value entry cell:
                        Cell mdCell = row.addCell();
                        String fieldKey = MetadataAuthorityManager.makeFieldKey(value.schema, value.element, value.qualifier);

                        // put up just a selector when preferred choice presentation is select:
                        if (cmgr.isChoicesConfigured(fieldKey) &&
                            Params.PRESENTATION_SELECT.equals(cmgr.getPresentation(fieldKey)))
                        {
                            Select mdSelect = mdCell.addSelect("value_"+index);
                            mdSelect.setSize(1);
                            Choices cs = cmgr.getMatches(fieldKey, value.value, collectionID, 0, 0, null);
                            if (cs.defaultSelected < 0)
                            {
                                mdSelect.addOption(true, value.value, value.value);
                            }
                            for (int i = 0; i < cs.values.length; ++i)
                            {
                                mdSelect.addOption(i == cs.defaultSelected, cs.values[i].value, cs.values[i].label);
                            }
                        }
                        else
                        {
                            TextArea mdValue = mdCell.addTextArea("value_"+index);
                        mdValue.setSize(4,35);
                        mdValue.setValue(value.value);
                            boolean isAuth = MetadataAuthorityManager.getManager().isAuthorityControlled(fieldKey);
                            if (isAuth)
                            {
                                mdValue.setAuthorityControlled();
                                mdValue.setAuthorityRequired(MetadataAuthorityManager.getManager().isAuthorityRequired(fieldKey));
                                Value authValue =  mdValue.setAuthorityValue((value.authority == null)?"":value.authority, Choices.getConfidenceText(value.confidence));
                                // add the "unlock" button to auth field
                                Button unlock = authValue.addButton("authority_unlock_"+index,"ds-authority-lock");
                                unlock.setHelp(T_unlock);
                            }
                            if (ChoiceAuthorityManager.getManager().isChoicesConfigured(fieldKey))
                            {
                                mdValue.setChoices(fieldKey);
                                if(Params.PRESENTATION_AUTHORLOOKUP.equals(cmgr.getPresentation(fieldKey))){
                                    mdValue.setChoicesPresentation(Params.PRESENTATION_AUTHORLOOKUP);
                                }else{
                                    mdValue.setChoicesPresentation(Params.PRESENTATION_LOOKUP);
                                }
                                mdValue.setChoicesClosed(ChoiceAuthorityManager.getManager().isClosed(fieldKey));
                            }
                        }
                        Text mdLang = row.addCell().addText("language_"+index);
                        mdLang.setSize(6);
                        mdLang.setValue(value.language);

                        // Tick the index counter;
                        index++;
View Full Code Here

        }


        Table table = search.addTable("groups-search-table", groups.length + 1,
                1);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_search_column1);
        header.addCell().addContent(T_search_column2);
        header.addCell().addContent(T_search_column3);
        header.addCell().addContent(T_search_column4);
        header.addCell().addContent(T_search_column5);

        for (Group group : groups)
        {
            Row row;
            if (group.getID() == highlightID)
            {
                row = table.addRow(null, null, "highlight");
            }
            else
            {
                row = table.addRow();
            }

            if (group.getID() > 1)
            {
                CheckBox select = row.addCell().addCheckBox("select_group");
                select.setLabel(Integer.valueOf(group.getID()).toString());
                select.addOption(Integer.valueOf(group.getID()).toString());
            }
            else
            {
                // Don't allow the user to remove the administrative (id:1) or
                // anonymous group (id:0)
                row.addCell();
            }

            row.addCell().addContent(group.getID());
            row.addCell().addXref(baseURL + "&submit_edit&groupID="
                    + group.getID(), group.getName());

            int memberCount = group.getMembers().length
                    + group.getMemberGroups().length;
            row.addCell().addContent(memberCount == 0 ? "-" : String.valueOf(
                    memberCount));

            Cell cell = row.addCell();
            String groupName = group.getName();
            DSpaceObject collectionOrCommunity = null;
            String collectionOrCommunityName = null;
            int id;
            id = FlowGroupUtils.getCollectionId(groupName);
View Full Code Here

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

    Table table = deleted.addTable("bitstreams-confirm-delete",bitstreams.size() + 1, 1);

    Row header = table.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);

    for (Bitstream bitstream : bitstreams)
    {
      String format = null;
      BitstreamFormat bitstreamFormat = bitstream.getFormat();
      if (bitstreamFormat != null)
            {
                format = bitstreamFormat.getShortDescription();
            }

      Row row = table.addRow();
      row.addCell().addContent(bitstream.getName());
      row.addCell().addContent(bitstream.getDescription());
      row.addCell().addContent(format);
    }
    Para buttons = deleted.addPara();
    buttons.addButton("submit_confirm").setValue(T_submit_delete);
    buttons.addButton("submit_cancel").setValue(T_submit_cancel);
View Full Code Here

   
    /* Adding a new policy link */
    main.addPara().addXref(baseURL + "&submit_add", T_add_link);
   
      Table table = main.addTable("container-policy-list",policies.size() + 1, 4);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell();
        header.addCell().addContent(T_head_id);
        header.addCell().addContent(T_head_action);
        header.addCell().addContent(T_head_group);

        if (policies != null)
        {
            for (ResourcePolicy policy : policies)
            {
                Row row;
                if (policy.getID() == highlightID)
                {
                    row = table.addRow(null, null, "highlight");
                }
                else
                {
                    row = table.addRow();
                }

                CheckBox select = row.addCell().addCheckBox("select_policy");
                select.setLabel(String.valueOf(policy.getID()));
                select.addOption(String.valueOf(policy.getID()));

                // Accounting for the funky case of an empty policy
                Group policyGroup = policy.getGroup();

                row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID(), String.valueOf(policy.getID()));
                row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID(), policy.getActionText());
                if (policyGroup != null) {
                    Cell groupCell = row.addCell();
                    groupCell.addContent(policyGroup.getName());
                    Highlight groupHigh = groupCell.addHighlight("fade");
                    groupHigh.addContent(" [");
                    groupHigh.addXref(baseURL + "&submit_edit_group&group_id=" + policyGroup.getID(), T_group_edit);
                    groupHigh.addContent("]");
                }
                else {
                    row.addCell().addContent("...");
                }
            }
        }
       
      Para buttons = main.addPara();
View Full Code Here

    main.setHead(T_main_head.parameterize(item.getHandle(),item.getID()));
    main.addPara().addHighlight("italic").addContent(T_main_para1);
    main.addPara().addHighlight("italic").addContent(T_main_para2);
   
      Table table = main.addTable("policies-confirm-delete",itemPolicies.size() + 3, 8);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell();
        header.addCell().addContent(T_head_id);
        header.addCell().addContent(T_head_name);
        header.addCell().addContent(T_head_action);
        header.addCell().addContent(T_head_group);
        header.addCell();
        header.addCell().addContent(T_head_start_date);
        header.addCell().addContent(T_head_end_date);


        // First, the item's policies are listed
        Row subheader = table.addRow(null,Row.ROLE_HEADER,"subheader");
        subheader.addCell(1, 7).addHighlight("bold").addContent(T_subhead_item);
        subheader.addCell().addHighlight("bold").addXref(baseURL + "&submit_add_item", T_add_itemPolicy_link);
       
        this.rowBuilder(baseURL, table, itemPolicies, item.getID(), Constants.ITEM, highlightID);
     
      // Next, one by one, we get the bundles
      for (Bundle bundle : bundles) {
        subheader = table.addRow(null,Row.ROLE_HEADER,"subheader");
        subheader.addCell(null, null, 1, 7, "indent").addHighlight("bold").addContent(T_subhead_bundle.parameterize(bundle.getName(),bundle.getID()));
        subheader.addCell().addHighlight("bold").addXref(baseURL + "&submit_add_bundle_" + bundle.getID(), T_add_bundlePolicy_link);

        ArrayList<ResourcePolicy> bundlePolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bundle);
        this.rowBuilder(baseURL, table, bundlePolicies, bundle.getID(), Constants.BUNDLE, highlightID);
       
        // And eventually to the bundle's bitstreams
        bitstreams = bundle.getBitstreams();
        for (Bitstream bitstream : bitstreams) {
          subheader = table.addRow(null,Row.ROLE_HEADER,"subheader");
            subheader.addCell(null, null, 1, 7, "doubleIndent").addContent(T_subhead_bitstream.parameterize(bitstream.getName(),bitstream.getID()));
            subheader.addCell().addXref(baseURL + "&submit_add_bitstream_" + bitstream.getID(), T_add_bitstreamPolicy_link);

            ArrayList<ResourcePolicy> bitstreamPolicies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, bitstream);
            this.rowBuilder(baseURL, table, bitstreamPolicies, bitstream.getID(), Constants.BITSTREAM, highlightID);         
        }
      }
View Full Code Here

    }
    // Otherwise, iterate over the given policies, creating a new table row for each one
    else {
      for (ResourcePolicy policy : policies)
        {
        Row row;
        if (policy.getID() == highlightID)
                {
                    row = table.addRow(null, null, "highlight");
                }
        else
                {
                    row = table.addRow();
                }
       
        Cell cell;
        if (objectType == Constants.BUNDLE)
                {
                    cell = row.addCell(null, null, "indent");
                }
        else if (objectType == Constants.BITSTREAM)
                {
                    cell = row.addCell(null, null, "doubleIndent");
                }
        else
                {
                    cell = row.addCell();
                }
         
       
          CheckBox select = cell.addCheckBox("select_policy");
         
            select.setLabel(String.valueOf(policy.getID()));
            select.addOption(String.valueOf(policy.getID()));
           
            // Accounting for the funky case of an empty policy
            Group policyGroup = policy.getGroup();
           
            row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID() +
                "&object_id=" + objectID + "&object_type=" + objectType, String.valueOf(policy.getID()));

                // name
                String name = "";
                if(policy.getRpName() != null)
                    name=policy.getRpName();
                row.addCell().addContent(name);

            row.addCell().addXref(baseURL + "&submit_edit&policy_id=" + policy.getID() +
                "&object_id=" + objectID + "&object_type=" + objectType, policy.getActionText());
            if (policyGroup != null) {
              Cell groupCell = row.addCell(1,2);
              groupCell.addContent(policyGroup.getName());
              Highlight groupHigh = groupCell.addHighlight("fade");
              groupHigh.addContent(" [");
              groupHigh.addXref(baseURL + "&submit_edit_group&group_id=" + policyGroup.getID(), T_group_edit);
              groupHigh.addContent("]");
            }
            else {
                row.addCell(1,2).addContent("...");
            }

                // startDate
                if(policy.getStartDate()!=null){
                    row.addCell().addContent(DateFormatUtils.format(policy.getStartDate(), "yyyy-MM-dd"));
                }
                else{
                    row.addCell().addContent("");
                }

                // endDate
                if(policy.getEndDate()!=null){
                    row.addCell().addContent(DateFormatUtils.format(policy.getEndDate(), "yyyy-MM-dd"));
                }
                else{
                    row.addCell().addContent("");
                }
            }
    }
  }
View Full Code Here

    private void renderMainPage(Division div) throws WingException {
        Table table = div.addTable("workflow-actions", 1, 1);
        table.setHead(T_info1);

        // Approve task
        Row row = table.addRow();
        row.addCellContent(T_approve_help);
        row.addCell().addButton("submit_approve").setValue(T_approve_submit);

        // Edit metadata
        row = table.addRow();
        row.addCellContent(T_edit_help);
        row.addCell().addButton("submit_edit").setValue(T_edit_submit);


        // Everyone can just cancel
        row = table.addRow();
        row.addCell(0, 2).addButton("submit_leave").setValue(T_submit_cancel);

        div.addHidden("page").setValue(ReviewAction.MAIN_PAGE);
    }
View Full Code Here

      options.addItem().addXref(baseURL+"&submit_harvesting",T_options_harvest);
            options.addItem().addXref(baseURL+"&submit_curate",T_options_curate);
           
      // The table of admin roles
      Table rolesTable = main.addTable("roles-table", 6, 5);
      Row tableRow;
     
      // The header row
      Row tableHeader = rolesTable.addRow(Row.ROLE_HEADER);
      tableHeader.addCell().addContent(T_role_name);
      tableHeader.addCell().addContent(T_role_group);
      tableHeader.addCell().addContent(T_role_buttons);
      rolesTable.addRow();
           
     
      /*
       * The collection admins
View Full Code Here

TOP

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

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.