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

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


    // DIVISION: bitstream-confirm-delete
    Division deleted = body.addInteractiveDivision("bitstreams-confirm-delete",contextPath+"/admin/item",Division.METHOD_POST,"primary administrative item");
    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();
View Full Code Here


        // Table test
        Division tableT = test.addDivision("table");
        tableT.setHead("3) Table Tests");
       
        // Simple table
        Table table = tableT.addTable("table1",3,3);
        table.setHead("Table: simple");
       
        Row row = table.addRow();
        row.addCellContent("1.1");
        row.addCellContent("1.2");
        row.addCellContent("1.3");

        row = table.addRow();
        row.addCellContent("2.1");
        row.addCellContent("2.2");
        row.addCellContent("2.3");
       
        row = table.addRow();
        row.addCellContent("3.1");
        row.addCellContent("3.2");
        row.addCellContent("3.3");
       
       
        // Header vs data rows
        table = tableT.addTable("table1",4,3);
        table.setHead("Table: header vs data roles");
       
        row = table.addRow(Row.ROLE_HEADER);
        row.addCellContent("This whole");
        row.addCellContent("row is a");
        row.addCellContent("Header");

        row = table.addRow();
        row.addCellContent("2.1");
        row.addCellContent("2.2");
        row.addCellContent("2.3");
       
        row = table.addRow();
        row.addCellContent("3.1");
        row.addCell(Cell.ROLE_HEADER).addContent("3.2 - single cell header");
        row.addCellContent("3.3");
       
        row = table.addRow();
        row.addCellContent("4.1");
        row.addCellContent("4.2");
        row.addCellContent("4.3");
       
        // column and row spans
        table = tableT.addTable("table1",6,3);
        table.setHead("Table: column & row spans");
       
        row = table.addRow();
        row.addCellContent("1.1");
        row.addCellContent("1.2");
        row.addCellContent("1.3");
       
        row = table.addRow();
        row.addCell(null,null,0,3,null).addContent("2.1 - spans three columns");

        row = table.addRow();
        row.addCellContent("3.1");
        row.addCell(null,null,3,0,null).addContent("3.2 - spans three rows");
        row.addCellContent("3.3");
       
        row = table.addRow();
        row.addCellContent("4.1");
        //row.addCellContent("3.2"); // Should be missing
        row.addCellContent("4.3");

        row = table.addRow();
        row.addCellContent("5.1");
        //row.addCellContent("5.2"); // Should be missing
        row.addCellContent("5.3");
       
        row = table.addRow();
        row.addCellContent("6.1");
        row.addCellContent("6.2");
        row.addCellContent("6.3");
    }
View Full Code Here

      main.addPara(T_para_withdraw);
    }


    // TABLE: metadata table
    Table table = main.addTable("withdrawValues", values.length+1, 3);
    final Row header = table.addRow(Row.ROLE_HEADER);
    header.addCell().addContent(T_column1);
    header.addCell().addContent(T_column2);
    header.addCell().addContent(T_column3);
    for(final DCValue value:values){
      final String dcValue = value.schema + ". " + value.element + (value.qualifier==null?"":(". " + value.qualifier));
      final Row row = table.addRow();
      row.addCell().addContent(dcValue);
      row.addCell().addContent(value.value);
      row.addCell().addContent(value.language);
    }
View Full Code Here

      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;
     
      // 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 community admins
       */
      // data row
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_admins);
      if (admins != null)
      {
          try
          {
              AuthorizeUtil.authorizeManageAdminGroup(context, thisCommunity);
              tableRow.addCell().addXref(baseURL + "&submit_edit_admin", admins.getName());
          }
          catch (AuthorizeException authex) {
              // add a notice, the user is not authorized to create/edit community's admin group
              tableRow.addCell().addContent(T_sysadmins_only);
          }
          try
          {
              AuthorizeUtil.authorizeRemoveAdminGroup(context, thisCommunity);
              tableRow.addCell().addButton("submit_delete_admin").setValue(T_delete);
          }
          catch (AuthorizeException authex)
          {
              // nothing to add, the user is not allowed to delete the group
          }
      }
      else
      {
        tableRow.addCell().addContent(T_no_role);
        Cell commAdminCell = tableRow.addCell();
        try
            {
                AuthorizeUtil.authorizeManageAdminGroup(context, thisCommunity);
                commAdminCell.addButton("submit_create_admin").setValue(T_create);
            }
            catch (AuthorizeException authex)
            {
                // add a notice, the user is not authorized to create/edit community's admin group
                addAdministratorOnlyButton(commAdminCell, "submit_create_admin", T_create);
            }  
      }
      // help and directions row
      tableRow = rolesTable.addRow(Row.ROLE_DATA);
      tableRow.addCell();
      tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_admins);
     
      try
      {
          AuthorizeUtil.authorizeManageCommunityPolicy(context, thisCommunity);
        // add one last link to edit the raw authorizations
        Cell authCell =rolesTable.addRow().addCell(1,3);
        authCell.addXref(baseURL + "&submit_authorizations", T_edit_authorizations);
      }
      catch (AuthorizeException authex) {
          // nothing to add, the user is not authorized to manage community's policies
      }
View Full Code Here

               

                // TABLE: Metadata
                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(DCValue 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);

View Full Code Here

      Division workflow = division.addDivision("workflow-tasks");
      workflow.setHead(T_w_head1);
      workflow.addPara(T_w_info1);
     
      // Tasks you own
      Table table = workflow.addTable("workflow-tasks",ownedItems.size() + 2,5);
        table.setHead(T_w_head2);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCellContent(T_w_column1);
        header.addCellContent(T_w_column2);
        header.addCellContent(T_w_column3);
        header.addCellContent(T_w_column4);
        header.addCellContent(T_w_column5);
     
        if (ownedItems.size() > 0)
        {
          for (WorkflowItem owned : ownedItems)
          {
            int workflowItemID = owned.getID();
            String url = contextPath+"/handle/"+owned.getCollection().getHandle()+"/workflow?workflowID="+workflowItemID;
            DCValue[] titles = owned.getItem().getDC("title", null, Item.ANY);
            String collectionName = owned.getCollection().getMetadata("name");
            EPerson submitter = owned.getSubmitter();
            String submitterName = submitter.getFullName();
            String submitterEmail = submitter.getEmail();
           
            Message state = getWorkflowStateMessage(owned);

            Row row = table.addRow();
           
            CheckBox remove = row.addCell().addCheckBox("workflowID");
            remove.setLabel("selected");
            remove.addOption(workflowItemID);
           
            // The task description
            row.addCell().addXref(url,state);

            // The item description
            if (titles != null && titles.length > 0)
            {
              String displayTitle = titles[0].value;
              if (displayTitle.length() > 50)
                displayTitle = displayTitle.substring(0,50)+ " ...";
              row.addCell().addXref(url,displayTitle);
            }
            else
              row.addCell().addXref(url,T_untitled);

            // Submitted too
            row.addCell().addXref(url,collectionName);

            // Submitted by
            Cell cell = row.addCell();
            cell.addContent(T_email);
            cell.addXref("mailto:"+submitterEmail,submitterName);
          }
         
          Row row = table.addRow();
         row.addCell(0,5).addButton("submit_return_tasks").setValue(T_w_submit_return);
         
        }
        else
        {
          Row row = table.addRow();
          row.addCell(0,5).addHighlight("italic").addContent(T_w_info2);
        }
      
       
       
       
        // Tasks in the pool
        table = workflow.addTable("workflow-tasks",pooledItems.size()+2,5);
        table.setHead(T_w_head3);
       
        header = table.addRow(Row.ROLE_HEADER);
        header.addCellContent(T_w_column1);
        header.addCellContent(T_w_column2);
        header.addCellContent(T_w_column3);
        header.addCellContent(T_w_column4);
        header.addCellContent(T_w_column5);
       
        if (pooledItems.size() > 0)
        {

          for (WorkflowItem pooled : pooledItems)
          {
            int workflowItemID = pooled.getID();
            String url = contextPath+"/handle/"+pooled.getCollection().getHandle()+"/workflow?workflowID="+workflowItemID;
            DCValue[] titles = pooled.getItem().getDC("title", null, Item.ANY);
            String collectionName = pooled.getCollection().getMetadata("name");
            EPerson submitter = pooled.getSubmitter();
            String submitterName = submitter.getFullName();
            String submitterEmail = submitter.getEmail();

            Message state = getWorkflowStateMessage(pooled);
           
           
            Row row = table.addRow();
           
            CheckBox remove = row.addCell().addCheckBox("workflowID");
            remove.setLabel("selected");
            remove.addOption(workflowItemID);
           
            // The task description
            row.addCell().addXref(url,state);

            // The item description
            if (titles != null && titles.length > 0)
            {
              String displayTitle = titles[0].value;
              if (displayTitle.length() > 50)
                displayTitle = displayTitle.substring(0,50)+ " ...";
             
              row.addCell().addXref(url,displayTitle);
            }
            else
              row.addCell().addXref(url,T_untitled);

            // Submitted too
            row.addCell().addXref(url,collectionName);

            // Submitted by
            Cell cell = row.addCell();
            cell.addContent(T_email);
            cell.addXref("mailto:"+submitterEmail,submitterName);
           
          }
          Row row = table.addRow();
         row.addCell(0,5).addButton("submit_take_tasks").setValue(T_w_submit_take);
        }
        else
        {
          Row row = table.addRow();
          row.addCell(0,5).addHighlight("italic").addContent(T_w_info3);
        }
    }
View Full Code Here

        rows++; // Authoring heading row
      if (supervisedItems.length > 0)
        rows++; // Supervising heading row
     
     
      Table table = unfinished.addTable("unfinished-submissions",rows,5);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCellContent(T_s_column1);
        header.addCellContent(T_s_column2);
        header.addCellContent(T_s_column3);
        header.addCellContent(T_s_column4);
       
        if (supervisedItems.length > 0 && unfinishedItems.length > 0)
        {
            header = table.addRow();
            header.addCell(null,Cell.ROLE_HEADER,0,5,null).addContent(T_s_head3);
        }
       
        if (unfinishedItems.length > 0)
        {
          for (WorkspaceItem workspaceItem : unfinishedItems)
          {
            DCValue[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY);
            EPerson submitterEPerson = workspaceItem.getItem().getSubmitter();
           
            int workspaceItemID = workspaceItem.getID();
            String url = contextPath+"/submit?workspaceID="+workspaceItemID;
            String submitterName = submitterEPerson.getFullName();
            String submitterEmail = submitterEPerson.getEmail();
            String collectionName = workspaceItem.getCollection().getMetadata("name");
 
            Row row = table.addRow(Row.ROLE_DATA);
            CheckBox remove = row.addCell().addCheckBox("workspaceID");
            remove.setLabel("remove");
            remove.addOption(workspaceItemID);
           
            if (titles.length > 0)
            {
              String displayTitle = titles[0].value;
              if (displayTitle.length() > 50)
                displayTitle = displayTitle.substring(0,50)+ " ...";
              row.addCell().addXref(url,displayTitle);
            }
            else
              row.addCell().addXref(url,T_untitled);
            row.addCell().addXref(url,collectionName);
            Cell cell = row.addCell();
            cell.addContent(T_email);
            cell.addXref("mailto:"+submitterEmail,submitterName);
          }
        }
        else
        {
          header = table.addRow();
          header.addCell(0,5).addHighlight("italic").addContent(T_s_info3);
        }
       
        if (supervisedItems.length > 0)
        {
            header = table.addRow();
            header.addCell(null,Cell.ROLE_HEADER,0,5,null).addContent(T_s_head4);
        }
       
        for (WorkspaceItem workspaceItem : supervisedItems)
        {
         
          DCValue[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY);
          EPerson submitterEPerson = workspaceItem.getItem().getSubmitter();
         
          int workspaceItemID = workspaceItem.getID();
          String url = contextPath+"/submit?workspaceID="+workspaceItemID;
          String submitterName = submitterEPerson.getFullName();
          String submitterEmail = submitterEPerson.getEmail();
          String collectionName = workspaceItem.getCollection().getMetadata("name");
         
         
          Row row = table.addRow(Row.ROLE_DATA);
          CheckBox selected = row.addCell().addCheckBox("workspaceID");
          selected.setLabel("select");
          selected.addOption(workspaceItemID);
         
          if (titles.length > 0)
          {
            String displayTitle = titles[0].value;
          if (displayTitle.length() > 50)
            displayTitle = displayTitle.substring(0,50)+ " ...";
            row.addCell().addXref(url,displayTitle);
          }
          else
            row.addCell().addXref(url,T_untitled);
          row.addCell().addXref(url,collectionName);
          Cell cell = row.addCell();
          cell.addContent(T_email);
          cell.addXref("mailto:"+submitterEmail,submitterName);
        }
       
       
        header = table.addRow();
        Cell lastCell = header.addCell(0,5);
        if (unfinishedItems.length > 0 || supervisedItems.length > 0)
          lastCell.addButton("submit_submissions_remove").setValue(T_s_submit_remove);
    }
View Full Code Here

      Division inprogress = division.addDivision("submissions-inprogress");
      inprogress.setHead(T_p_head1);
      inprogress.addPara(T_p_info1);
     
     
      Table table = inprogress.addTable("submissions-inprogress",inprogressItems.length+1,3);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCellContent(T_p_column1);
        header.addCellContent(T_p_column2);
        header.addCellContent(T_p_column3);
       
       
        for (WorkflowItem workflowItem : inprogressItems)
        {
          DCValue[] titles = workflowItem.getItem().getDC("title", null, Item.ANY);
          String collectionName = workflowItem.getCollection().getMetadata("name");
          Message state = getWorkflowStateMessage(workflowItem);
         
         
          Row row = table.addRow();
         
          // Add the title column
          if (titles.length > 0)
          {
            String displayTitle = titles[0].value;
View Full Code Here

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

                // Iterate each result
                for (String[] singleEntry : browseInfo.getStringResults())
                {
                    // Create a Map of the query parameters for the link
                    Map<String, String> queryParams = new HashMap<String, String>();
                    queryParams.put(BrowseParams.TYPE, URLEncode(type));
                    if (singleEntry[1] != null)
                    {
                        queryParams.put(BrowseParams.FILTER_VALUE[1], URLEncode(
                            singleEntry[1]));
                    }
                    else
                    {
                        queryParams.put(BrowseParams.FILTER_VALUE[0], URLEncode(
                            singleEntry[0]));
                    }

                    // Create an entry in the table, and a linked entry
                    Cell cell = singleTable.addRow().addCell();
                    cell.addXref(super.generateURL(BROWSE_URL_BASE, queryParams),
                          singleEntry[0]);
               
            }
        }
View Full Code Here

      if (supervisedItems.length > 0)
        {
            rows++; // Supervising heading row
        }

      Table table = unfinished.addTable("unfinished-submissions",rows,5);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCellContent(T_s_column1);
        header.addCellContent(T_s_column2);
        header.addCellContent(T_s_column3);
        header.addCellContent(T_s_column4);

        if (supervisedItems.length > 0 && unfinishedItems.length > 0)
        {
            header = table.addRow();
            header.addCell(null,Cell.ROLE_HEADER,0,5,null).addContent(T_s_head3);
        }

        if (unfinishedItems.length > 0)
        {
            for (WorkspaceItem workspaceItem : unfinishedItems)
            {
                Metadatum[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY);
                EPerson submitterEPerson = workspaceItem.getItem().getSubmitter();

                int workspaceItemID = workspaceItem.getID();
                String url = contextPath+"/submit?workspaceID="+workspaceItemID;
                String submitterName = submitterEPerson.getFullName();
                String submitterEmail = submitterEPerson.getEmail();
                String collectionName = workspaceItem.getCollection().getMetadata("name");

                Row row = table.addRow(Row.ROLE_DATA);
                CheckBox remove = row.addCell().addCheckBox("workspaceID");
                remove.setLabel("remove");
                remove.addOption(workspaceItemID);

                if (titles.length > 0)
                {
                    String displayTitle = titles[0].value;
                    if (displayTitle.length() > 50)
                        displayTitle = displayTitle.substring(0, 50) + " ...";
                    row.addCell().addXref(url,displayTitle);
                }
                else
                    row.addCell().addXref(url,T_untitled);
                row.addCell().addXref(url,collectionName);
                Cell cell = row.addCell();
                cell.addContent(T_email);
                cell.addXref("mailto:"+submitterEmail,submitterName);
            }
        }
        else
        {
            header = table.addRow();
            header.addCell(0,5).addHighlight("italic").addContent(T_s_info3);
        }

        if (supervisedItems.length > 0)
        {
            header = table.addRow();
            header.addCell(null,Cell.ROLE_HEADER,0,5,null).addContent(T_s_head4);
        }

        for (WorkspaceItem workspaceItem : supervisedItems)
        {

            Metadatum[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY);
            EPerson submitterEPerson = workspaceItem.getItem().getSubmitter();

            int workspaceItemID = workspaceItem.getID();
            String url = contextPath+"/submit?workspaceID="+workspaceItemID;
            String submitterName = submitterEPerson.getFullName();
            String submitterEmail = submitterEPerson.getEmail();
            String collectionName = workspaceItem.getCollection().getMetadata("name");

            Row row = table.addRow(Row.ROLE_DATA);
            CheckBox selected = row.addCell().addCheckBox("workspaceID");
            selected.setLabel("select");
            selected.addOption(workspaceItemID);

            if (titles.length > 0)
            {
                String displayTitle = titles[0].value;
                if (displayTitle.length() > 50)
                {
                    displayTitle = displayTitle.substring(0, 50) + " ...";
                }
                row.addCell().addXref(url,displayTitle);
            }
            else
            {
                row.addCell().addXref(url, T_untitled);
            }
            row.addCell().addXref(url,collectionName);
            Cell cell = row.addCell();
            cell.addContent(T_email);
            cell.addXref("mailto:"+submitterEmail,submitterName);
        }

        header = table.addRow();
        Cell lastCell = header.addCell(0,5);
        if (unfinishedItems.length > 0 || supervisedItems.length > 0)
        {
            lastCell.addButton("submit_submissions_remove").setValue(T_s_submit_remove);
        }
View Full Code Here

TOP

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

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.