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

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


      main.addHidden("administrative-continue").setValue(knot.getId());

    }

    private void addOriginalWorkflowRoles(Collection thisCollection, String baseURL, Table rolesTable) throws SQLException, WingException {
        Row tableRow;/*
       * Workflow steps 1-3
       */
      // data row
      try
        {
            Group wfStep1 = thisCollection.getWorkflowGroup(1);
            Group wfStep2 = thisCollection.getWorkflowGroup(2);
            Group wfStep3 = thisCollection.getWorkflowGroup(3);
            AuthorizeUtil.authorizeManageWorkflowsGroup(context, thisCollection);
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf_step1);
          if (wfStep1 != null)
          {
            tableRow.addCell().addXref(baseURL + "&submit_edit_wf_step1", wfStep1.getName());
                tableRow.addCell().addButton("submit_delete_wf_step1").setValue(T_delete);
          }
          else
          {
            tableRow.addCell().addContent(T_no_role);
                tableRow.addCell().addButton("submit_create_wf_step1").setValue(T_create);
          }
          // help and directions row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell();
          tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step1);
         
         
          // data row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf_step2);
          if (wfStep2 != null)
          {
            tableRow.addCell().addXref(baseURL + "&submit_edit_wf_step2", wfStep2.getName());
                tableRow.addCell().addButton("submit_delete_wf_step2").setValue(T_delete);
          }
          else
          {
            tableRow.addCell().addContent(T_no_role);
                tableRow.addCell().addButton("submit_create_wf_step2").setValue(T_create);
          }
          // help and directions row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell();
          tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step2);
         
         
          // data row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf_step3);
          if (wfStep3 != null)
          {
            tableRow.addCell().addXref(baseURL + "&submit_edit_wf_step3", wfStep3.getName());
                tableRow.addCell().addButton("submit_delete_wf_step3").setValue(T_delete);
          }
          else
          {
            tableRow.addCell().addContent(T_no_role);
                tableRow.addCell().addButton("submit_create_wf_step3").setValue(T_create);
          }
          // help and directions row
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
          tableRow.addCell();
          tableRow.addCell(1,2).addHighlight("fade offset").addContent(T_help_wf_step3);
        }
      catch (AuthorizeException authex) {
            // add a notice, the user is not allowed to manage workflow group
          tableRow = rolesTable.addRow(Row.ROLE_DATA);
            tableRow.addCell(Cell.ROLE_HEADER).addContent(T_label_wf);
            tableRow.addCell().addContent(T_not_allowed);
        }
    }
View Full Code Here


            tableRow.addCell().addContent(T_not_allowed);
        }
    }

    private void addXMLWorkflowRoles(Collection thisCollection, String baseURL, HashMap<String, Role> roles, Table rolesTable) throws WingException, SQLException {
        Row tableRow;
        if(roles != null){
            //ROLES: show group name instead of role name
            for(String roleId: roles.keySet()){
                Role role = roles.get(roleId);

                if (role.getScope() == Role.Scope.COLLECTION || role.getScope() == Role.Scope.REPOSITORY) {
                    tableRow = rolesTable.addRow(Row.ROLE_DATA);
                    tableRow.addCell(Cell.ROLE_HEADER).addContent(role.getName());
                    Group roleGroup = WorkflowUtils.getRoleGroup(context, thisCollection.getID(), role);
                    if (roleGroup != null) {
                        if(role.getScope() == Role.Scope.REPOSITORY){
                            if(AuthorizeManager.isAdmin(context)){
                                tableRow.addCell().addXref(baseURL + "&submit_edit_wf_role_" + roleId, roleGroup.getName());
                            }else{
                                Cell cell = tableRow.addCell();
                                cell.addContent(roleGroup.getName());
                                cell.addHighlight("fade").addContent(T_sysadmins_only_repository_role);
                            }
                        }else{
                            tableRow.addCell().addXref(baseURL + "&submit_edit_wf_role_" + roleId, roleGroup.getName());
                        }

                        if (role.getScope() == Role.Scope.COLLECTION) {
                            addAdministratorOnlyButton(tableRow.addCell(), "submit_delete_wf_role_" + roleId, T_delete);
                        } else {
                            tableRow.addCell();
                        }
                    } else {
                        tableRow.addCell().addContent(T_no_role);
                        if (role.getScope() == Role.Scope.COLLECTION || role.getScope() == Role.Scope.REPOSITORY) {
                            addAdministratorOnlyButton(tableRow.addCell(), "submit_create_wf_role_" + roleId, T_create);
                        } else {
                            tableRow.addCell();
                        }
                    }
                    // help and directions row
                    tableRow = rolesTable.addRow(Row.ROLE_DATA);
                    tableRow.addCell();
                    if (role.getDescription() != null){
                        tableRow.addCell(1,2).addHighlight("fade offset").addContent(role.getDescription());
                    }

                } else {
                    tableRow = rolesTable.addRow(Row.ROLE_DATA);
                    tableRow.addCell(Cell.ROLE_HEADER).addContent(role.getName());

                    tableRow.addCell().addContent(T_no_role);
                    tableRow.addCell();

                    // help and directions row
                    tableRow = rolesTable.addRow(Row.ROLE_DATA);
                    tableRow.addCell();
                    if (role.getDescription() != null){
                        tableRow.addCell(1,2).addHighlight("fade offset").addContent(role.getDescription());
                    }
                }
            }
        }
    }
View Full Code Here

        main.addPara(T_para1);

        Table table = main.addTable("metadata-registry-main-table", schemas.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);

        for (MetadataSchema schema : schemas)
        {
            int schemaID = schema.getSchemaID();
            String namespace = schema.getNamespace();
            String name = schema.getName();
            String url = contextPath
                    + "/admin/metadata-registry?administrative-continue="
                    + knot.getId() + "&submit_edit&schemaID=" + schemaID;

            Row row = table.addRow();
            if (schemaID > 1)
            {
                // If the schema is not in the required DC schema allow the user to delete it. 
                CheckBox select = row.addCell().addCheckBox("select_schema");
                select.setLabel(String.valueOf(schemaID));
                select.addOption(String.valueOf(schemaID));
            }
            else
            {
                // The DC schema can not be removed.
                row.addCell();
            }

            row.addCell().addContent(schemaID);
            row.addCell().addXref(url, namespace);
            row.addCell().addXref(url, name);
        }
        if (schemas.length > 1)
        {
            // Only give the delete option if there are more schema's than the required dublin core.
            main.addPara().addButton("submit_delete").setValue(T_submit_delete);
View Full Code Here

      Division deleted = body.addInteractiveDivision("epeople-confirm-delete",contextPath+"/admin/epeople",Division.METHOD_POST,"primary administrative eperson");
      deleted.setHead(T_confirm_head);
      deleted.addPara(T_confirm_para);
     
      Table table = deleted.addTable("epeople-confirm-delete",epeople.size() + 1, 1);
        Row header = table.addRow(Row.ROLE_HEADER);
        header.addCell().addContent(T_head_id);
        header.addCell().addContent(T_head_name);
        header.addCell().addContent(T_head_email);
     
      for (EPerson eperson : epeople)
      {
        Row row = table.addRow();
        row.addCell().addContent(eperson.getID());
          row.addCell().addContent(eperson.getFullName());
          row.addCell().addContent(eperson.getEmail());
      }
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_confirm);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
View Full Code Here

            search.setSimplePagination(resultCount,firstIndex,lastIndex,prevURL, nextURL);
        }

        Table table = search.addTable("eperson-search-table", epeople.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);

        CheckBox selectEPerson;
        for (EPerson person : epeople)
        {
            String epersonID = String.valueOf(person.getID());
            String fullName = person.getFullName();
            String email = person.getEmail();
            String url = baseURL+"&submit_edit&epersonID="+epersonID;
            java.util.List<String> deleteConstraints = person.getDeleteConstraints();

            Row row;
            if (person.getID() == highlightID)
            {
                // This is a highlighted eperson
                row = table.addRow(null, null, "highlight");
            }
            else
            {
                row = table.addRow();
            }

            selectEPerson = row.addCell().addCheckBox("select_eperson");
            selectEPerson.setLabel(epersonID);
            selectEPerson.addOption(epersonID);
            if (deleteConstraints != null && deleteConstraints.size() > 0)
            {
                selectEPerson.setDisabled();
            }

            row.addCellContent(epersonID);
            row.addCell().addXref(url, fullName);
            row.addCell().addXref(url, email);
        }

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

      Para warning = deleted.addPara();
      warning.addHighlight("bold").addContent(T_warning);
      warning.addContent(T_para2);
     
      Table table = deleted.addTable("field-confirm-delete",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)
      {
        if (field == null)
            {
                continue;
            }
       
        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);
      }
      Para buttons = deleted.addPara();
      buttons.addButton("submit_confirm").setValue(T_submit_delete);
      buttons.addButton("submit_cancel").setValue(T_submit_cancel);
     
View Full Code Here

    Division existingFields = main.addDivision("metadata-schema-edit-existing-fields");
    existingFields.setHead(T_head2);
   
    Table table = existingFields.addTable("metadata-schema-edit-existing-fields", fields.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);
   
    for (MetadataField field : fields)
    {
      String id = String.valueOf(field.getFieldID());
      String fieldElement = field.getElement();
      String fieldQualifier = field.getQualifier();
     
      String fieldName = schemaName +"."+ fieldElement;
      if (fieldQualifier != null && fieldQualifier.length() > 0)
            {
                fieldName += "." + fieldQualifier;
            }
       
      boolean highlight = false;
      if (field.getFieldID() == highlightID)
            {
                highlight = true;
            }
     
      String fieldScopeNote = field.getScopeNote();
     
      String url = contextPath + "/admin/metadata-registry?administrative-continue="+knot.getId()+"&submit_edit&fieldID="+id;
     
      Row row;
      if (highlight)
            {
                row = table.addRow(null, null, "highlight");
            }
      else
            {
                row = table.addRow();
            }
     
      CheckBox select = row.addCell().addCheckBox("select_field");
      select.setLabel(id);
      select.addOption(id);
     
      row.addCell().addContent(id);
      row.addCell().addXref(url,fieldName);
      row.addCell().addContent(fieldScopeNote);
    }
   
    if (fields.length == 0)
    {
      // No fields, let the user know.
View Full Code Here

      div.addPara().addHighlight("fade").addContent(T_no_remove);
    }
   
    Table table = div.addTable("browse-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 = "unknown";
      Metadatum[] dcAuthors = item.getDC("contributor",Item.ANY,Item.ANY);
      if (dcAuthors != null && dcAuthors.length >= 1)
            {
                author = dcAuthors[0].value;
            }
     
      String title = "untitled";
      Metadatum[] 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();
     
      CheckBox select = row.addCell().addCheckBox("itemID");
      select.setLabel("Select");
      select.addOption(itemID);
     
      row.addCellContent(owning);
      row.addCell().addXref(url,author);
      row.addCell().addXref(url,title);
    }
   
    if (AuthorizeManager.authorizeActionBoolean(context, collection, Constants.REMOVE))
    {
      Para actions = div.addPara();
View Full Code Here

    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 = "unknown";
      if (owningCollection != null)
        owning = owningCollection.getMetadata("name");
      String author = "unknown";
      Metadatum[] dcCreators = item.getDC("creator",Item.ANY,Item.ANY);
      if (dcCreators != null && dcCreators.length >= 1)
            {
                author = dcCreators[0].value;
            } else {
              // Do a fallback look for contributors
        Metadatum[] dcContributors = item.getDC("contributor",Item.ANY,Item.ANY);
        if (dcContributors != null && dcContributors.length >= 1)
              {
                  author = dcContributors[0].value;
              }
      }
     
      String title = "untitled";
      Metadatum[] 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

        if (bitstreams.length > 0 || disableFileEditing)
        {
            Table summary = div.addTable("submit-upload-summary",(bitstreams.length * 2) + 2,7);
            summary.setHead(T_head2);

            Row header = summary.addRow(Row.ROLE_HEADER);
            header.addCellContent(T_column0); // primary bitstream
            header.addCellContent(T_column1); // select checkbox
            header.addCellContent(T_column2); // file name
            header.addCellContent(T_column3); // size
            header.addCellContent(T_column4); // description
            header.addCellContent(T_column5); // format
            header.addCellContent(T_column6); // edit button

            for (Bitstream bitstream : bitstreams)
            {
                int id = bitstream.getID();
                String name = bitstream.getName();
                String url = makeBitstreamLink(item, bitstream);
                long bytes = bitstream.getSize();
                String desc = bitstream.getDescription();
                String algorithm = bitstream.getChecksumAlgorithm();
                String checksum = bitstream.getChecksum();


                Row row = summary.addRow();

                // Add radio-button to select this as the primary bitstream
                Radio primary = row.addCell().addRadio("primary_bitstream_id");
                primary.addOption(String.valueOf(id));

                // If this bitstream is already marked as the primary bitstream
                // mark it as such.
                if(bundles[0].getPrimaryBitstreamID() == id) {
                    primary.setOptionSelected(String.valueOf(id));
                }

                if (!disableFileEditing)
                {
                    // Workflow users can not remove files.
                    CheckBox remove = row.addCell().addCheckBox("remove");
                    remove.setLabel("remove");
                    remove.addOption(id);
                }
                else
                {
                    row.addCell();
                }

                row.addCell().addXref(url,name);
                row.addCellContent(bytes + " bytes");
                if (desc == null || desc.length() == 0)
                {
                    row.addCellContent(T_unknown_name);
                }
                else
                {
                    row.addCellContent(desc);
                }

                BitstreamFormat format = bitstream.getFormat();
                if (format == null)
                {
                    row.addCellContent(T_unknown_format);
                }
                else
                {
                    int support = format.getSupportLevel();
                    Cell cell = row.addCell();
                    cell.addContent(format.getMIMEType());
                    cell.addContent(" ");
                    switch (support)
                    {
                        case 1:
                            cell.addContent(T_supported);
                            break;
                        case 2:
                            cell.addContent(T_known);
                            break;
                        case 3:
                            cell.addContent(T_unsupported);
                            break;
                    }
                }

                Button edit = row.addCell().addButton("submit_edit_"+id);
                edit.setValue(T_submit_edit);

                Row checksumRow = summary.addRow();
                checksumRow.addCell();
                Cell checksumCell = checksumRow.addCell(null, null, 0, 6, null);
                checksumCell.addHighlight("bold").addContent(T_checksum);
                checksumCell.addContent(" ");
                checksumCell.addContent(algorithm + ":" + checksum);
            }

            if (!disableFileEditing)
            {
                // Workflow users can not remove files.
                Row actionRow = summary.addRow();
                actionRow.addCell();
                Button removeSeleceted = actionRow.addCell(null, null, 0, 6, null).addButton("submit_remove_selected");
                removeSeleceted.setValue(T_submit_remove);
            }

            upload = div.addList("submit-upload-new-part2", List.TYPE_FORM);
        }
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.