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

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


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


        completedSubmissions.setHead(T_c_head);
        completedSubmissions.addPara(T_c_info);

        // Create table, headers
        Table table = completedSubmissions.addTable("completed-submissions",subList.size() + 2,3);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCellContent(T_c_column1); // ISSUE DATE
        header.addCellContent(T_c_column2); // ITEM TITLE (LINKED)
        header.addCellContent(T_c_column3); // COLLECTION NAME (LINKED)

        //Limit to showing just 50 archived submissions, unless overridden
        //(This is a saftey measure for Admins who may have submitted
        // thousands of items under their account via bulk ingest tools, etc.)
        int count = 0;

        // Populate table
        Iterator i = subList.iterator();
        while(i.hasNext())
        {
            count++;
            //exit loop if we've gone over our limit of submissions to display
            if(count>limit && !displayAll)
                break;

            Item published = (Item) i.next();
            String collUrl = contextPath+"/handle/"+published.getOwningCollection().getHandle();
            String itemUrl = contextPath+"/handle/"+published.getHandle();
            Metadatum[] titles = published.getMetadata("dc", "title", null, Item.ANY);
            String collectionName = published.getOwningCollection().getMetadata("name");
            Metadatum[] ingestDate = published.getMetadata("dc", "date", "accessioned", Item.ANY);

            Row row = table.addRow();

            // Item accession date
            if (ingestDate != null && ingestDate.length > 0 &&
                ingestDate[0].value != null)
            {
                String displayDate = ingestDate[0].value.substring(0,10);
                Cell cellDate = row.addCell();
                cellDate.addContent(displayDate);
            }
            else //if no accession date add an empty cell (shouldn't happen, but just in case)
                row.addCell().addContent("");

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

            // Owning Collection
            row.addCell().addXref(collUrl,collectionName);
        }//end while

        //Display limit text & link to allow user to override this default limit
        if(!displayAll && count == limit)
        {
View Full Code Here

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

    }


    // 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 Metadatum 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);
    }

    // LIST: actions, confirm or return
    org.dspace.app.xmlui.wing.element.Item actions = main.addList("actions", List.TYPE_FORM).addItem();
View Full Code Here

      results.setSimplePagination(resultCount,firstIndex,lastIndex,prevURL, nextURL);
    }
   
    /* Set up a table with search results (if there are any). */
    Table table = results.addTable("group-edit-search-eperson",epeople.length + 1, 1);
    Row header = table.addRow(Row.ROLE_HEADER);
    header.addCell().addContent(T_epeople_column1);
    header.addCell().addContent(T_epeople_column2);
    header.addCell().addContent(T_epeople_column3);
    header.addCell().addContent(T_epeople_column4);

    for (EPerson person : epeople)
    {
      String epersonID = String.valueOf(person.getID());
      String fullName = person.getFullName();
      String email = person.getEmail();
      String url = contextPath+"/admin/epeople?administrative-continue="+knot.getId()+"&submit_edit_eperson&epersonID="+epersonID;
     
     
     
      Row personData = table.addRow();

      personData.addCell().addContent(person.getID());
      personData.addCell().addXref(url, fullName);
      personData.addCell().addXref(url, email);
     
      // check if they are already a member of the group
      if (memberEPeopleIDs.contains(person.getID()))
      {
        // Check if they really members or just pending members
        if (group != null && group.isMember(person))
                {
                    personData.addCellContent(T_member);
                }
        else
                {
                    personData.addCell().addHighlight("warn").addContent(T_pending);
                }
      }
      else
      {
        personData.addCell().addButton("submit_add_eperson_"+epersonID).setValue(T_submit_add);
      }
    }

    if (epeople.length <= 0) {
      table.addRow().addCell(1, 4).addContent(T_no_results);
View Full Code Here

        // FIXME: set the correct table size.
        Table table = div.addTable("workflow-actions", 1, 1);
        table.setHead(T_info1);
       
        // Header
        Row row;

        if (state == WFSTATE_STEP1POOL ||
          state == WFSTATE_STEP2POOL ||
          state == WFSTATE_STEP3POOL)
        {
          // Take task
          row = table.addRow();
          row.addCellContent(T_take_help);
          row.addCell().addButton("submit_take_task").setValue(T_take_submit);
      
          // Leave task
          row = table.addRow();
          row.addCellContent(T_leave_help);
          row.addCell().addButton("submit_leave").setValue(T_leave_submit);
        }
       
        if (state == WFSTATE_STEP1 ||
          state == WFSTATE_STEP2)
        {
          // Approve task
          row = table.addRow();
          row.addCellContent(T_approve_help);
          row.addCell().addButton("submit_approve").setValue(T_approve_submit);
        }
       
        if (state == WFSTATE_STEP3)
        {
          // Commit to archive
          row = table.addRow();
          row.addCellContent(T_commit_help);
          row.addCell().addButton("submit_approve").setValue(T_commit_submit);
        }
       
        if (state == WFSTATE_STEP1 ||
          state == WFSTATE_STEP2)
        {
          // Reject item
          row = table.addRow();
          row.addCellContent(T_reject_help);
          row.addCell().addButton("submit_reject").setValue(T_reject_submit);
        }
       
        if (state == WFSTATE_STEP2 ||
          state == WFSTATE_STEP3 )
        {
          // Edit metadata
          row = table.addRow();
          row.addCellContent(T_edit_help);
          row.addCell().addButton("submit_edit").setValue(T_edit_submit);
        }
       
        if (state == WFSTATE_STEP1 ||
            state == WFSTATE_STEP2 ||
            state == WFSTATE_STEP3 )
        {
          // Return to pool
          row = table.addRow();
          row.addCellContent(T_return_help);
          row.addCell().addButton("submit_return").setValue(T_return_submit);
        }
       
       
        // Everyone can just cancel
        row = table.addRow();
        row.addCell(0, 2).addButton("submit_leave").setValue(T_cancel_submit);
       
        div.addHidden("submission-continue").setValue(knot.getId());
    }
View Full Code Here

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

    protected void buildSearchControls(Division div)
            throws WingException
    {
        Table controlsTable = div.addTable("search-controls", 1, 3);
        Row controlsRow = controlsTable.addRow(Row.ROLE_DATA);

        // Create a control for the number of records to display
        Cell rppCell = controlsRow.addCell();
        rppCell.addContent(T_rpp);
        Select rppSelect = rppCell.addSelect("rpp");
        for (int i : RESULTS_PER_PAGE_PROGRESSION)
        {
            rppSelect.addOption((i == getParameterRpp()), i, Integer.toString(i));
        }

        Cell sortCell = controlsRow.addCell();
        try
        {
            // Create a drop down of the different sort columns available
            sortCell.addContent(T_sort_by);
            Select sortSelect = sortCell.addSelect("sort_by");
            sortSelect.addOption(false, 0, T_sort_by_relevance);
            for (SortOption so : SortOption.getSortOptions())
            {
                if (so.isVisible())
                {
                    sortSelect.addOption((so.getNumber() == getParameterSortBy()), so.getNumber(),
                            message("xmlui.ArtifactBrowser.AbstractSearch.sort_by." + so.getName()));
                }
            }
        }
        catch (SortException se)
        {
            throw new WingException("Unable to get sort options", se);
        }

        // Create a control to changing ascending / descending order
        Cell orderCell = controlsRow.addCell();
        orderCell.addContent(T_order);
        Select orderSelect = orderCell.addSelect("order");
        orderSelect.addOption(SortOption.ASCENDING.equals(getParameterOrder()), SortOption.ASCENDING, T_order_asc);
        orderSelect.addOption(SortOption.DESCENDING.equals(getParameterOrder()), SortOption.DESCENDING, T_order_desc);
View Full Code Here

      Division deleted = body.addInteractiveDivision("policies-confirm-delete",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
      deleted.setHead(T_confirm_head);
      deleted.addPara(T_confirm_para);
     
      Table table = deleted.addTable("policies-confirm-delete",policies.size() + 1, 4);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_head_id);
        header.addCell().addContent(T_head_action);
        header.addCell().addContent(T_head_group);
     
      for (ResourcePolicy policy : policies)
      {
        Row row = table.addRow();
        row.addCell().addContent(policy.getID());
          row.addCell().addContent(policy.getActionText());
          if (policy.getGroup() != null)
            {
                row.addCell().addContent(policy.getGroup().getName());
            }
          else
            {
                row.addCell().addContent("...");
            }
      }
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_confirm);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
View Full Code Here

       
        // 4) Display the results Table
        // TABLE: activeUsers
        Table activeUsers = div.addTable("users",1,1);
        activeUsers.setHead(T_activity_head.parameterize(CurrentActivityAction.MAX_EVENTS));
        Row row = activeUsers.addRow(Row.ROLE_HEADER);
        if (sortBy == EventSort.TIME)
        {
            row.addCell().addHighlight("bold").addXref("?activity&sortBy=" + EventSort.TIME).addContent(T_activity_sort_time);
        }
        else
        {
            row.addCell().addXref("?activity&sortBy=" + EventSort.TIME).addContent(T_activity_sort_time);
        }
       
        if (sortBy == EventSort.SESSION)
        {
            row.addCell().addHighlight("bold").addXref("?activity&sortBy=" + EventSort.SESSION).addContent(T_activity_sort_user);
        }
        else
        {
            row.addCell().addXref("?activity&sortBy=" + EventSort.SESSION).addContent(T_activity_sort_user);
        }
       
        if (sortBy == EventSort.IP)
        {
            row.addCell().addHighlight("bold").addXref("?activity&sortBy=" + EventSort.IP).addContent(T_activity_sort_ip);
        }
        else
        {
            row.addCell().addXref("?activity&sortBy=" + EventSort.IP).addContent(T_activity_sort_ip);
        }
       
        if (sortBy == EventSort.URL)
        {
            row.addCell().addHighlight("bold").addXref("?activity&sortBy=" + EventSort.URL).addContent(T_activity_sort_url);
        }
        else
        {
            row.addCell().addXref("?activity&sortBy=" + EventSort.URL).addContent(T_activity_sort_url);
        }
       
        if (sortBy == EventSort.AGENT)
        {
            row.addCell().addHighlight("bold").addXref("?activity&sortBy=" + EventSort.AGENT).addContent(T_activity_sort_agent);
        }
        else
        {
            row.addCell().addXref("?activity&sortBy=" + EventSort.AGENT).addContent(T_activity_sort_agent);
        }
  
        // Keep track of how many individual anonymous users there are, each unique anonymous
        // user is assigned an index based upon the servlet session id.
        HashMap<String,Integer> anonymousHash = new HashMap<String,Integer>();
        int anonymousCount = 1;
   
        int shown = 0;
        for (CurrentActivityAction.Event event : events)
        { 
            if (event == null)
            {
                continue;
            }
     
            shown++;
     
            Message timeStampMessage = null;
            long ago = System.currentTimeMillis() - event.getTimeStamp();

            if (ago > 2*60*60*1000)
            {
                timeStampMessage = T_hours.parameterize((ago / (60 * 60 * 1000)));
            }
            else if (ago > 60*1000)
            {
                timeStampMessage = T_minutes.parameterize((ago / (60 * 1000)));
            }
            else
            {
                timeStampMessage = T_seconds.parameterize((ago / (1000)));
            }
         
         
            Row eventRow = activeUsers.addRow();

            eventRow.addCellContent(timeStampMessage);
            int eid = event.getEPersonID();
            EPerson eperson = EPerson.find(context, eid);
            if (eperson != null)
            {
                String name = eperson.getFullName();
                eventRow.addCellContent(name);
            }
            else
            {
                // Is this a new anonymous user?
                if (!anonymousHash.containsKey(event.getSessionID()))
                {
                    anonymousHash.put(event.getSessionID(), anonymousCount++);
                }
       
                eventRow.addCellContent(T_activity_anonymous.parameterize(anonymousHash.get(event.getSessionID())));
            }
            eventRow.addCellContent(event.getIP());
            eventRow.addCell().addXref(contextPath+"/"+event.getURL()).addContent("/"+event.getURL());
            eventRow.addCellContent(event.getDectectedBrowser());
        }
   
        if (shown == 0)
        {
            activeUsers.addRow().addCell(1, 5).addContent(T_activity_none);
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.