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

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


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

                    }
                    else
                    {
                      headerrow.addCellContent(T_new_item);
                    }
                }

                // Show actions
                if (change.isDeleted())
                {
                    Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-delete");

                    Cell cell = mdrow.addCell();
                    cell.addContent(T_item_delete);
                    mdrow.addCellContent("");
                }
                if (change.isWithdrawn())
                {
                    Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-withdraw");

                    Cell cell = mdrow.addCell();
                    cell.addContent(T_item_withdraw);
                    mdrow.addCellContent("");
                }
                if (change.isReinstated())
                {
                    Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-reinstate");

                    Cell cell = mdrow.addCell();
                    cell.addContent(T_item_reinstate);
                    mdrow.addCellContent("");
                }

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


      Division deleted = body.addInteractiveDivision("bitstream-format-confirm-delete",contextPath+"/admin/format-registry",Division.METHOD_POST,"primary administrative format-registry");
      deleted.setHead(T_head);
      deleted.addPara(T_para1);
     
      Table table = deleted.addTable("format-confirm-delete",formats.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);
     
      for (BitstreamFormat format : formats)
      {
        if (format == null)
            {
                continue;
            }
       
        String formatID = String.valueOf(format.getID());
        String mimetype = format.getMIMEType();
        String name = format.getShortDescription();

       
        Row row = table.addRow();
        row.addCell().addContent(formatID);
          row.addCell().addContent(mimetype);
          row.addCell().addContent(name);
      }
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_delete);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
View Full Code Here

      options.addItem().addHighlight("bold").addXref(baseURL+"&submit_roles",T_options_roles);
            options.addItem().addXref(baseURL+"&submit_curate",T_options_curate);

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


        Table table = main.addTable("bitstream-format-registry", formats.length
                + 1, 5);

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

        for (BitstreamFormat format : formats)
        {
            String id = String.valueOf(format.getID());
            String mimeType = format.getMIMEType();
            String name = format.getShortDescription();
            int supportLevel = format.getSupportLevel();
            boolean internal = format.isInternal();

            boolean highlight = false;
            if (format.getID() == highlightID)
            {
                highlight = true;
            }

            String url = contextPath
                    + "/admin/format-registry?administrative-continue="
                    + knot.getId() + "&submit_edit&formatID=" + id;


            Row row;
            if (highlight)
            {
                row = table.addRow(null, null, "highlight");
            }
            else
            {
                row = table.addRow();
            }

            // Select checkbox
            Cell cell = row.addCell();
            if (format.getID() > 1)
            {
                // Do not allow unknown to be removed.
                CheckBox select = cell.addCheckBox("select_format");
                select.setLabel(id);
                select.addOption(id);
            }

            // ID
            row.addCell().addContent(id);

            // Name
            row.addCell().addXref(url, name);

            // Mime type
            cell = row.addCell();
            cell.addXref(url, mimeType);
            if (internal)
            {
                cell.addContent(" ");
                cell.addContent(T_internal);
            }

            // support level
            switch (supportLevel)
            {
                case 0:
                    row.addCell().addXref(url, T_support_0);
                    break;
                case 1:
                    row.addCell().addXref(url, T_support_1);
                    break;
                case 2:
                    row.addCell().addXref(url, T_support_2);
                    break;
            }
        }

        main.addPara().addButton("submit_delete").setValue(T_submit_delete);
View Full Code Here

      Division moved = body.addInteractiveDivision("metadata-field-move",contextPath+"/admin/metadata-registry",Division.METHOD_POST,"primary administrative metadata-registry");
      moved.setHead(T_head1);
      moved.addPara(T_para1);
     
      Table table = moved.addTable("metadata-field-move",fields.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);
     
      for (MetadataField field : fields)
      {
        String fieldID = String.valueOf(field.getFieldID());
      String fieldEelement = field.getElement();
      String fieldQualifier = field.getQualifier();
     
      MetadataSchema schema = MetadataSchema.find(context, field.getSchemaID());
      String schemaName = schema.getName();
     
      StringBuilder fieldName = new StringBuilder()
                                            .append(schemaName)
                                            .append(".")
                                            .append(fieldEelement);

      if (fieldQualifier != null && fieldQualifier.length() > 0)
            {
        fieldName.append(".").append(fieldQualifier);
            }
       
      String fieldScopeNote = field.getScopeNote();
       
        Row row = table.addRow();
        row.addCell().addContent(fieldID);
          row.addCell().addContent(fieldName.toString());
          row.addCell().addContent(fieldScopeNote);
      }

      Row row = table.addRow();
      Cell cell = row.addCell(1,3);
      cell.addContent(T_para2);
      Select toSchema = cell.addSelect("to_schema");
      for (MetadataSchema schema : schemas)
      {
        toSchema.addOption(schema.getSchemaID(), schema.getNamespace());
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);
    header.addCellContent(T_column6);
    header.addCellContent(T_column7);

    Bundle[] bundles = item.getBundles();

        boolean showBitstreamUpdateOrderButton = false;
    for (Bundle bundle : bundles)
    {

      Cell bundleCell = files.addRow("bundle_head_" + bundle.getID(), Row.ROLE_DATA, "").addCell(1, 5);
      bundleCell.addContent(T_bundle_label.parameterize(bundle.getName()));

      Bitstream[] bitstreams = bundle.getBitstreams();
            ArrayList<Integer> bitstreamIdOrder = new ArrayList<Integer>();
            for (Bitstream bitstream : bitstreams) {
                bitstreamIdOrder.add(bitstream.getID());
            }

            for (int bitstreamIndex = 0; bitstreamIndex < bitstreams.length; bitstreamIndex++) {
                Bitstream bitstream = bitstreams[bitstreamIndex];
                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("bitstream_row_" + bitstream.getID(), Row.ROLE_DATA, "");
                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, bundle, Constants.WRITE)) {
                    Cell cell = row.addCell("bitstream_order_" + bitstream.getID(), Cell.ROLE_DATA, "");
                    //Add the +1 to make it more human readable
                    cell.addHidden("order_" + bitstream.getID()).setValue(String.valueOf(bitstreamIndex + 1));
                    showBitstreamUpdateOrderButton = true;
                    Button upButton = cell.addButton("submit_order_" + bundle.getID() + "_" + bitstream.getID() + "_up", ((bitstreamIndex == 0) ? "disabled" : "") + " icon-button arrowUp ");
                    if((bitstreamIndex == 0)){
                        upButton.setDisabled();
                    }
                    upButton.setValue(T_order_up);
                    upButton.setHelp(T_order_up);
                    Button downButton = cell.addButton("submit_order_" + bundle.getID() + "_" + bitstream.getID() + "_down", (bitstreamIndex == (bitstreams.length - 1) ? "disabled" : "") + " icon-button arrowDown ");
                    if(bitstreamIndex == (bitstreams.length - 1)){
                        downButton.setDisabled();
                    }
                    downButton.setValue(T_order_down);
                    downButton.setHelp(T_order_down);

                    //These values will only be used IF javascript is disabled or isn't working
                    cell.addHidden(bundle.getID() + "_" + bitstream.getID() + "_up_value").setValue(retrieveOrderUpButtonValue((java.util.List<Integer>) bitstreamIdOrder.clone(), bitstreamIndex));
                    cell.addHidden(bundle.getID() + "_" + bitstream.getID() + "_down_value").setValue(retrieveOrderDownButtonValue((java.util.List<Integer>) bitstreamIdOrder.clone(), bitstreamIndex));
                }else{
                    row.addCell().addContent(String.valueOf(bitstreamIndex));
                }
            }
    }

    if (AuthorizeManager.authorizeActionBoolean(context, item, Constants.ADD))
View Full Code Here

                        if ((adds.size() > 0) || (removes.size() > 0) ||
                            (newCollections.size() > 0) || (oldCollections.size() > 0) ||
                            (change.getNewOwningCollection() != null) || (change.getOldOwningCollection() != null) ||
                            (change.isDeleted()) || (change.isWithdrawn()) || (change.isReinstated()))
                        {
                            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();
                        }

                        // Show actions
                        if (change.isDeleted())
                        {
                            Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-delete");

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_deleted);
                            mdrow.addCellContent("");
                        }
                        if (change.isWithdrawn())
                        {
                            Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-withdraw");

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_withdrawn);
                            mdrow.addCellContent("");
                        }
                        if (change.isReinstated())
                        {
                            Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-reinstate");

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_reinstated);
                            mdrow.addCellContent("");
                        }

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

      Para warning = deleted.addPara();
      warning.addHighlight("bold").addContent(T_warning);
      warning.addContent(T_para2);
     
      Table table = deleted.addTable("schema-confirm-delete",schemas.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);
     
      for (MetadataSchema schema : schemas)
      {
        Row row = table.addRow();
        row.addCell().addContent(schema.getSchemaID());
          row.addCell().addContent(schema.getNamespace());
          row.addCell().addContent(schema.getName());
      }
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_delete);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
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 already 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
        List<Integer> allMemberGroupIDs = new ArrayList<Integer>(memberGroupIDs);
        for (Group group : parent.getMemberGroups())
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.