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

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


    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


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

    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

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

    }


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

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

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

      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

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

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

      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;
          if (displayTitle.length() > 50)
            displayTitle = displayTitle.substring(0,50)+ " ...";
            row.addCellContent(displayTitle);
          }
          else
            row.addCellContent(T_untitled);
         
          // Collection name column
          row.addCellContent(collectionName);
         
          // Status column
          row.addCellContent(state);
        }
    }
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.