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

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


    actions.addButton("submit_map").setValue(T_submit_map);
    actions.addButton("submit_cancel").setValue(T_submit_cancel);
   
    Table table = div.addTable("search-items-table",1,1);
   
    Row header = table.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
    header.addCellContent(T_column4);
   
    for (Item item : items)
    {
      String itemID = String.valueOf(item.getID());
      Collection owningCollection = item.getOwningCollection();
      String owning = owningCollection.getMetadata("name");
      String author = "unkown";
      DCValue[] dcAuthors = item.getDC("contributor",Item.ANY,Item.ANY);
      if (dcAuthors != null && dcAuthors.length >= 1)
        author = dcAuthors[0].value;
     
      String title = "untitled";
      DCValue[] dcTitles = item.getDC("title",null,Item.ANY);
      if (dcTitles != null && dcTitles.length >= 1)
        title = dcTitles[0].value;

      String url = contextPath+"/handle/"+item.getHandle();
     
      Row row = table.addRow();

            boolean canBeMapped = true;
            Collection[] collections = item.getCollections();
            for (Collection c : collections)
            {
                if (c.getID() == collectionID)
                {
                    canBeMapped = false;
                }
            }

            if (canBeMapped)
            {
                CheckBox select = row.addCell().addCheckBox("itemID");
                select.setLabel("Select");
                select.addOption(itemID);
            }
            else
            {
                row.addCell().addContent("");
            }

      row.addCellContent(owning);
      row.addCell().addXref(url,author);
      row.addCell().addXref(url,title);
    }
   
    actions = div.addPara();
    actions.addButton("submit_map").setValue(T_submit_map);
    actions.addButton("submit_cancel").setValue(T_submit_cancel);
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

         
      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

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

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

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

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

                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;
                    }
                    if (dcv.language != null)
                    {
                        md += "[" + dcv.language + "]";
                    }

                    Cell cell = mdrow.addCell();
                    cell.addContent(T_item_deletion);
                    cell.addContent(" (" + md + ")");
                    mdrow.addCellContent(dcv.value);
                }
            }
            Para actions = div.addPara();
            Button applychanges = actions.addButton("submit_confirm");
            applychanges.setValue(T_submit_confirm);
View Full Code Here

                        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;
                            }
                            if (dcv.language != null)
                            {
                                md += "[" + dcv.language + "]";
                            }

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_deletion);
                            cell.addContent(" (" + md + ")");
                            mdrow.addCellContent(dcv.value);
                        }
                    }
                }
                else
                {
View Full Code Here

    // 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("]");
      }
    }
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.