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

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


    // DIVISION: policies-confirm-delete
      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("...");
      }
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 allready 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

            prevURL = baseURL+"&page="+(page-1);
         
      results.setSimplePagination(resultCount,firstIndex,lastIndex,prevURL, nextURL);
    }
   
        Table table = results.addTable("roup-edit-search-group",groups.length + 1, 1);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_groups_column1);
        header.addCell().addContent(T_groups_column2);
        header.addCell().addContent(T_groups_column3);
        header.addCell().addContent(T_groups_column4);
        header.addCell().addContent(T_groups_column5)
       
        for (Group group : groups)
        {
          String groupID = String.valueOf(group.getID());
          String name = group.getName();
          String url = contextPath+"/admin/groups?administrative-continue="+knot.getId()+"&submit_edit_group&groupID="+groupID;
          int memberCount = group.getMembers().length + group.getMemberGroups().length;
         
          Row row = table.addRow();
           
          row.addCell().addContent(groupID);
          if (AuthorizeManager.isAdmin(context))
            // Only administrators can edit other groups.
            row.addCell().addXref(url,name);
          else
            row.addCell().addContent(name);
         
         
         
          row.addCell().addContent(memberCount == 0 ? "-" : String.valueOf(memberCount));
         
          Cell cell = row.addCell();
          if (FlowGroupUtils.getCollectionId(group.getName()) > -1)
          {
            Collection collection = Collection.find(context, FlowGroupUtils.getCollectionId(group.getName()) );
            if (collection != null)
            {
              String collectionName = collection.getMetadata("name");
             
              if (collectionName == null)
                collectionName = "";
              else if (collectionName.length() > MAX_COLLECTION_NAME)
                collectionName = collectionName.substring(0,MAX_COLLECTION_NAME-3) + "...";
             
              cell.addContent(collectionName+" ");
             
              Highlight highlight = cell.addHighlight("fade");
              highlight.addContent("[");
              highlight.addXref(contextPath+"/handle/"+collection.getHandle(), T_groups_collection_link);
              highlight.addContent("]");
            }
          }
         
         
          // Check if the group is allready a member or would create a cycle.
          if (memberGroupIDs.contains(group.getID()))
          {
            // Check if they really members or just pending members
        if (parent != null && parent.isMember(group))
          row.addCellContent(T_member);
        else
          row.addCell().addHighlight("warn").addContent(T_pending);
          }
          else if (isDescendant(sourceGroup, group, memberGroupIDs))
          {
            row.addCellContent(T_cycle);
          }
          else
          {
            row.addCell().addButton("submit_add_group_"+groupID).setValue(T_submit_add);
          }
           
        }
        if (groups.length <= 0) {
      table.addRow().addCell(1, 4).addContent(T_no_results);
    }
  }
View Full Code Here

        boolean changes = false;
       
        Division members = div.addDivision("group-edit-members");
        members.setHead(T_members_head);
       
        Table table = members.addTable("group-edit-members-table",memberGroupIDs.size() + memberEPeopleIDs.size() + 1, 4);
       
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_members_column1);
        header.addCell().addContent(T_members_column2);
        header.addCell().addContent(T_members_column3);
        header.addCell().addContent(T_members_column4);
       
        // get all group members, pend or actual
        @SuppressWarnings("unchecked") // the cast is correct
        ArrayList<Integer> allMemberGroupIDs = (ArrayList<Integer>) memberGroupIDs.clone();
        for (Group group : parent.getMemberGroups())
        {
          if (!allMemberGroupIDs.contains(group.getID()))
            allMemberGroupIDs.add(group.getID());
        }
        // Sort them to a consistent ordering
        Collections.sort(allMemberGroupIDs);
       
        // Loop through all group ids and display them.
        for (Integer groupID : allMemberGroupIDs)
        {
          Group group = Group.find(context,groupID);
          boolean highlight = (group.getID() == highlightGroupID);
          boolean pendingAddition = !parent.isMember(group);
          boolean pendingRemoval = !memberGroupIDs.contains(groupID);
          addMemberRow(table, group, highlight,pendingAddition,pendingRemoval);  
         
          if (pendingAddition || pendingRemoval)
            changes = true;
        }
       
       
        // get all members, pend or actual
        @SuppressWarnings("unchecked") // the cast is correct
        ArrayList<Integer> allMemberEPeopleIDs = (ArrayList<Integer>) memberEPeopleIDs.clone();
        for (EPerson eperson : parent.getMembers())
        {
          if (!allMemberEPeopleIDs.contains(eperson.getID()))
            allMemberEPeopleIDs.add(eperson.getID());
        }
        // Sort them to a consistent ordering
        Collections.sort(allMemberEPeopleIDs);
       
        for (Integer epersonID : allMemberEPeopleIDs)
        {
          EPerson eperson = EPerson.find(context, epersonID);
          boolean highlight = (eperson.getID() == highlightEPersonID);
          boolean pendingAddition = !parent.isMember(eperson);
          boolean pendingRemoval = !memberEPeopleIDs.contains(epersonID);
          addMemberRow(table,eperson,highlight,pendingAddition,pendingRemoval);
         
          if (pendingAddition || pendingRemoval)
            changes = true;
        }
   
        if (allMemberGroupIDs.size() <= 0 && allMemberEPeopleIDs.size() <= 0)
        {
          table.addRow().addCell(1, 4).addContent(T_members_none);
        }
       
        return changes;
  }
View Full Code Here

         
      search.setSimplePagination(resultCount,firstIndex,lastIndex,prevURL, nextURL);
    }
       
       
        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(new Integer(group.getID()).toString());
            select.addOption(new Integer(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);
            if (id > -1)
            {
                Collection collection = Collection.find(context, id);
                if (collection != null)
                {
                    collectionOrCommunityName = collection.getMetadata("name");
                    collectionOrCommunity = collection;
                }
            }
            else
            {
                id = FlowGroupUtils.getCommunityId(groupName);
                if (id > -1)
                {
                    Community community = Community.find(context, id);
                    if (community != null)
                    {
                        collectionOrCommunityName = community.getMetadata("name");
                        collectionOrCommunity = community;
                    }
                }
            }
            if (collectionOrCommunity != null)
            {
                if (collectionOrCommunityName == null)
                    collectionOrCommunityName = "";
                else if (collectionOrCommunityName.length() > MAX_COLLECTION_OR_COMMUNITY_NAME)
                    collectionOrCommunityName = collectionOrCommunityName.substring(0,MAX_COLLECTION_OR_COMMUNITY_NAME-3) + "...";
             
                cell.addContent(collectionOrCommunityName + " ");
             
            Highlight highlight = cell.addHighlight("fade");

                highlight.addContent("[");
                highlight.addXref(contextPath+"/handle/"+collectionOrCommunity.getHandle(), T_collection_link);
            highlight.addContent("]");
          }
         
        }
       
        if (groups.length <= 0)
        {
          Cell cell = table.addRow().addCell(1,5);
          cell.addHighlight("italic").addContent(T_no_results);
        }
        else
        {
          search.addPara().addButton("submit_delete").setValue(T_submit_delete)
View Full Code Here

        if(num_changes > 0)
        {

            div.addPara(T_para);

            Table mdchanges = div.addTable("metadata-changes", num_changes, 2);

            // Display the changes
            int changeCounter = 0;
            for (BulkEditChange change : changes)
            {
                // Get the changes
                ArrayList<DCValue> adds = change.getAdds();
                ArrayList<DCValue> removes = change.getRemoves();
                ArrayList<Collection> newCollections = change.getNewMappedCollections();
                ArrayList<Collection> oldCollections = change.getOldMappedCollections();

                if ((adds.size() > 0) || (removes.size() > 0) ||
                    (newCollections.size() > 0) || (oldCollections.size() > 0) ||
                    (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null))
                {
                    Row headerrow = mdchanges.addRow(Row.ROLE_HEADER);
                    // Show the item
                    if (!change.isNewItem())
                    {
                        Item i = change.getItem();
                        Cell cell = headerrow.addCell();
                        cell.addContent(T_changes_pending);
                        cell.addContent(" " + i.getID() + " (" + i.getHandle() + ")");

                    }
                    else
                    {
                      headerrow.addCellContent(T_new_item);
                    }
                    headerrow.addCell();
                    changeCounter++;
                }

                // Show new owning collection
                if (change.getNewOwningCollection() != null)
                {
                    Collection c = change.getNewOwningCollection();
                    if (c != null)
                    {
                        String cHandle = c.getHandle();
                        String cName = c.getName();
                        Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                        colrow.addCellContent(T_collection_newowner);
                        colrow.addCellContent(cHandle + " (" + cName + ")");
                    }
                }

                // Show old owning collection
                if (change.getOldOwningCollection() != null)
                {
                    Collection c = change.getOldOwningCollection();
                    if (c != null)
                    {
                        String cHandle = c.getHandle();
                        String cName = c.getName();
                        Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                        colrow.addCellContent(T_collection_oldowner);
                        colrow.addCellContent(cHandle + " (" + cName + ")");
                    }
                }

                // Show new mapped collections
                for (Collection c : newCollections)
                {
                    String cHandle = c.getHandle();
                    String cName = c.getName();
                    Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                    colrow.addCellContent(T_collection_mapped);
                    colrow.addCellContent(cHandle + " (" + cName + ")");
                }

                // Show old mapped collections
                for (Collection c : oldCollections)
                {
                    String cHandle = c.getHandle();
                    String cName = c.getName();
                    Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                    colrow.addCellContent(T_collection_unmapped);
                    colrow.addCellContent(cHandle + " (" + cName + ")");
                }

                // Show additions
                for (DCValue dcv : adds)
                {
                    Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                    String md = dcv.schema + "." + dcv.element;
                    if (dcv.qualifier != null)
                    {
                        md += "." + dcv.qualifier;
                    }
                    if (dcv.language != null)
                    {
                        md += "[" + dcv.language + "]";
                    }

                    Cell cell = mdrow.addCell();
                    cell.addContent(T_item_addition);
                    cell.addContent(" (" + md + ")");
                    mdrow.addCellContent(dcv.value);
                }

                // Show removals
                for (DCValue dcv : removes)
                {
                    Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                    String md = dcv.schema + "." + dcv.element;
                    if (dcv.qualifier != null)
                    {
                        md += "." + dcv.qualifier;
                    }
View Full Code Here

                para.addContent(T_success);
                para.addContent(" " + changes.size() + " ");
                para.addContent(T_changes);

                if(changes.size() > 0) {
                    Table mdchanges = div.addTable("metadata-changes", changes.size(), 2);


                    // Display the changes
                    int changeCounter = 0;
                    for (BulkEditChange change : changes)
                    {
                        // Get the changes
                        ArrayList<DCValue> adds = change.getAdds();
                        ArrayList<DCValue> removes = change.getRemoves();
                        ArrayList<Collection> newCollections = change.getNewMappedCollections();
                        ArrayList<Collection> oldCollections = change.getOldMappedCollections();

                        if ((adds.size() > 0) || (removes.size() > 0) ||
                            (newCollections.size() > 0) || (oldCollections.size() > 0) ||
                            (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null))
                        {
                            Row headerrow = mdchanges.addRow(Row.ROLE_HEADER);

                            // Show the item
                            if (!change.isNewItem())
                            {
                                Item i = change.getItem();
                                Cell cell = headerrow.addCell();
                                cell.addContent(T_changes_committed);
                                cell.addContent(" " + i.getID() + " (" + i.getHandle() + ")");

                            }
                            else
                            {
                              headerrow.addCellContent(T_new_item);
                            }
                            headerrow.addCell();
                            changeCounter++;
                        }

                        // Show new owning collection
                        if (change.getNewOwningCollection() != null)
                        {
                            Collection c = change.getNewOwningCollection();
                            if (c != null)
                            {
                                String cHandle = c.getHandle();
                                String cName = c.getName();
                                Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                                colrow.addCellContent(T_collection_newowner);
                                colrow.addCellContent(cHandle + " (" + cName + ")");
                            }
                        }

                        // Show old owning collection
                        if (change.getOldOwningCollection() != null)
                        {
                            Collection c = change.getOldOwningCollection();
                            if (c != null)
                            {
                                String cHandle = c.getHandle();
                                String cName = c.getName();
                                Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                                colrow.addCellContent(T_collection_oldowner);
                                colrow.addCellContent(cHandle + " (" + cName + ")");
                            }
                        }

                        // Show new mapped collections
                        for (Collection c : newCollections)
                        {
                            String cHandle = c.getHandle();
                            String cName = c.getName();
                            Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                            colrow.addCellContent(T_collection_mapped);
                            colrow.addCellContent(cHandle + " (" + cName + ")");
                        }

                        // Show old mapped collections
                        for (Collection c : oldCollections)
                        {
                            String cHandle = c.getHandle();
                            String cName = c.getName();
                            Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                            colrow.addCellContent(T_collection_unmapped);
                            colrow.addCellContent(cHandle + " (" + cName + ")");
                        }

                        // Show additions
                        for (DCValue dcv : adds)
                        {
                            Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
                            String md = dcv.schema + "." + dcv.element;
                            if (dcv.qualifier != null)
                            {
                                md += "." + dcv.qualifier;
                            }
                            if (dcv.language != null)
                            {
                                md += "[" + dcv.language + "]";
                            }

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_addition);
                            cell.addContent(" (" + md + ")");
                            mdrow.addCellContent(dcv.value);
                        }

                        // Show removals
                        for (DCValue dcv : removes)
                        {
                            Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
                            String md = dcv.schema + "." + dcv.element;
                            if (dcv.qualifier != null)
                            {
                                md += "." + dcv.qualifier;
                            }
View Full Code Here

    options.addItem().addXref(baseURL + "&view_item", T_option_view);

   
   
    // TABLE: Bitstream summary
    Table files = main.addTable("editItemBitstreams", 1, 1);

    files.setHead(T_head1);

    Row header = files.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
    header.addCellContent(T_column4);
    header.addCellContent(T_column5);

    Bundle[] bundles = item.getBundles();

    for (Bundle bundle : bundles)
    {

      Cell bundleCell = files.addRow().addCell(1, 5);
      bundleCell.addContent(T_bundle_label.parameterize(bundle.getName()));



      Bitstream[] bitstreams = bundle.getBitstreams();

      for (Bitstream bitstream : bitstreams)
      {
        boolean primary = (bundle.getPrimaryBitstreamID() == bitstream.getID());
        String name = bitstream.getName();
   
        if (name != null && name.length() > 50)
        {
          // If the fiel name is too long the shorten it so that it will display nicely.
          String shortName = name.substring(0,15);
          shortName += " ... ";
          shortName += name.substring(name.length()-25,name.length());
          name = shortName;
        }
       
        String description = bitstream.getDescription();
        String format = null;
        BitstreamFormat bitstreamFormat = bitstream.getFormat();
        if (bitstreamFormat != null)
          format = bitstreamFormat.getShortDescription();
        String editURL = contextPath + "/admin/item?administrative-continue="+knot.getId()+"&bitstreamID="+bitstream.getID()+"&submit_edit";
        String viewURL = contextPath + "/bitstream/id/"+bitstream.getID()+"/"+bitstream.getName();


        Row row = files.addRow();
        CheckBox remove = row.addCell().addCheckBox("remove");
        remove.setLabel("remove");
        remove.addOption(bundle.getID() + "/" +bitstream.getID() );
        if (!AuthorizeManager.authorizeActionBoolean(context, item, Constants.REMOVE))
        {
          remove.setDisabled();
        }

        if (AuthorizeManager.authorizeActionBoolean(context, bitstream, Constants.WRITE))
        {
          // The user can edit the bitstream give them a link.
          Cell cell = row.addCell();
          cell.addXref(editURL,name);
          if (primary)
            cell.addXref(editURL,T_primary_label);
         
          row.addCell().addXref(editURL,description);
          row.addCell().addXref(editURL,format);
        }
        else
        {
          // The user can't edit the bitstream just show them it.
          Cell cell = row.addCell();
          cell.addContent(name);
          if (primary)
            cell.addContent(T_primary_label);
         
          row.addCell().addContent(description);
          row.addCell().addContent(format);
        }
       
        Highlight highlight = row.addCell().addHighlight("fade");
        highlight.addContent("[");
        highlight.addXref(viewURL,T_view_link);
        highlight.addContent("]");
      }
    }

    if (AuthorizeManager.authorizeActionBoolean(context, item, Constants.ADD))
    {
      Cell cell = files.addRow().addCell(1, 5);
      cell.addXref(contextPath+"/admin/item?administrative-continue="+knot.getId()+"&submit_add",T_submit_add);
    }
    else
    {
      Cell cell = files.addRow().addCell(1, 5);
      cell.addHighlight("fade").addContent(T_no_upload);
    }

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

          div.addPara().addXref("?activity&sortBy="+sortBy+"&recordbots=ON").addContent(T_start_bot);
        
       
    // 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.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.