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

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


        // Set up the major variables
        Community community = (Community) dso;

        // Build the community viewer division.
        Division home = body.addDivision("community-home", "primary repository community");


        performSearch(dso);

        Division lastSubmittedDiv = home
                .addDivision("community-recent-submission", "secondary recent-submission");

        lastSubmittedDiv.setHead(T_head_recent_submissions);

        ReferenceSet lastSubmitted = lastSubmittedDiv.addReferenceSet(
                "community-last-submitted", ReferenceSet.TYPE_SUMMARY_LIST,
                null, "recent-submissions");

        for (SolrDocument doc : queryResults.getResults()) {
            lastSubmitted.addReference(SearchUtils.findDSpaceObject(context, doc));
View Full Code Here


        errors.add(error);
     
   
     
      //DIVISION: group-edit
      Division main = body.addInteractiveDivision("group-edit",contextPath+"/admin/groups",Division.METHOD_POST,"primary administrative groups");
      if (group == null)
        main.setHead(T_main_head_new);
      else
        main.setHead(T_main_head.parameterize(group.getName(),groupID));
  
     
      if(collection != null)
      {
        Para para = main.addPara();
        para.addContent(T_collection_para);
        para.addXref(contextPath+"/handle/"+collection.getHandle(), collection.getMetadata("name"));
      }
      else if(community != null)
        {
            Para para = main.addPara();
            para.addContent(T_community_para);
            para.addXref(contextPath+"/handle/"+community.getHandle(), community.getMetadata("name"));
        }
    
      // DIVISION: group-actions
      Division actions = main.addDivision("group-edit-actions");
      Para groupName = actions.addPara();
        groupName.addContent(T_label_name);
        Text groupText = groupName.addText("group_name");
        groupText.setValue(currentName);
        if(collection != null || community != null)
        {
          // If this group is associated with a collection or community then it is special,
          // thus they shouldn't be able to update it.
          groupText.setDisabled();
          groupText.setHelp(T_label_instructions);
        }
        else if (errors.contains("group_name") || errors.contains("group_name_duplicate"))
          groupText.addError("");
       

        Para searchBoxes = actions.addPara();
        searchBoxes.addContent(T_label_search);
        Text queryField = searchBoxes.addText("query");
        queryField.setValue(query);
        queryField.setSize(15);
        searchBoxes.addButton("submit_search_epeople").setValue(T_submit_search_people);
View Full Code Here

  private void addEPeopleSearch(Division div, String query, int page, Group group, ArrayList<Integer> memberEPeopleIDs) throws SQLException, WingException
  {
    int resultCount = EPerson.searchResultCount(context, query);
        EPerson[] epeople = EPerson.search(context, query, page*RESULTS_PER_PAGE, RESULTS_PER_PAGE);
   
    Division results = div.addDivision("results");
   
    if (resultCount > RESULTS_PER_PAGE)
    {
          // If there are enough results then paginate the results
          String baseURL = contextPath +"/admin/groups?administrative-continue="+knot.getId();
          int firstIndex = page*RESULTS_PER_PAGE+1;
          int lastIndex = page*RESULTS_PER_PAGE + epeople.length;
      
          String nextURL = null, prevURL = null;
          if (page < (resultCount / RESULTS_PER_PAGE))
            nextURL = baseURL+"&page="+(page+1);
          if (page > 0)
            prevURL = baseURL+"&page="+(page-1);
         
      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);
View Full Code Here

  private void addGroupSearch(Division div, Group sourceGroup, String query, int page, Group parent, ArrayList<Integer> memberGroupIDs) throws WingException, SQLException
  {
    int resultCount = Group.searchResultCount(context, query);
        Group[] groups = Group.search(context, query, page*RESULTS_PER_PAGE, RESULTS_PER_PAGE);
   
    Division results = div.addDivision("results");
   
    if (resultCount > RESULTS_PER_PAGE)
    {
          // If there are enough results then paginate the results
          String baseURL = contextPath +"/admin/groups?administrative-continue="+knot.getId();
          int firstIndex = page*RESULTS_PER_PAGE+1;
          int lastIndex = page*RESULTS_PER_PAGE + groups.length;
      
          String nextURL = null, prevURL = null;
          if (page < (resultCount / RESULTS_PER_PAGE))
            nextURL = baseURL+"&page="+(page+1);
          if (page > 0)
            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);
View Full Code Here

  private boolean addMemberList(Division div, Group parent, ArrayList<Integer> memberGroupIDs, ArrayList<Integer> memberEPeopleIDs, int highlightEPersonID, int highlightGroupID) throws WingException, SQLException
  {
    // Flag to remember if there are any pending changes.
        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);
View Full Code Here

        Group[] groups  = Group.search(context, query, page*PAGE_SIZE, PAGE_SIZE);
   
   
   
    // DIVISION: groups-main
    Division main = body.addInteractiveDivision("groups-main",contextPath +"/admin/groups",Division.METHOD_POST,"primary administrative groups");
    main.setHead(T_main_head);
   
   
   
   
    // DIVISION: group-actions
        Division actions = main.addDivision("group-actions");
        actions.setHead(T_actions_head);
       
        // Browse Epeople
        List actionsList = actions.addList("actions");
        actionsList.addLabel(T_actions_create);
        actionsList.addItemXref(baseURL+"&submit_add", T_actions_create_link);
        actionsList.addLabel(T_actions_browse);
        actionsList.addItemXref(baseURL+"&query&submit_search",T_actions_browse_link);
     
        actionsList.addLabel(T_actions_search);
        org.dspace.app.xmlui.wing.element.Item actionItem = actionsList.addItem();
        Text queryField = actionItem.addText("query");
        if (query != null)
          queryField.setValue(query);
        queryField.setHelp(T_search_help);
        actionItem.addButton("submit_search").setValue(T_go);
       
       
       
       
       
       
       
        // DIVISION: group-search
        Division search = main.addDivision("group-search");
    search.setHead(T_search_head);
       

        if (resultCount > PAGE_SIZE)
    {
          // If there are enough results then paginate the results
          int firstIndex = page*PAGE_SIZE+1;
          int lastIndex = page*PAGE_SIZE + groups.length;
      
          String nextURL = null, prevURL = null;
          if (page < (resultCount / PAGE_SIZE))
            nextURL = baseURL+"&page="+(page+1);
          if (page > 0)
            prevURL = baseURL+"&page="+(page-1);
         
      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)
        }
       
        search.addHidden("administrative-continue").setValue(knot.getId());
   }
View Full Code Here

            num_changes = changes.size();
        }


    // DIVISION: metadata-import
    Division div = body.addInteractiveDivision("metadata-import",contextPath + "/admin/metadataimport", Division.METHOD_MULTIPART,"primary administrative");
    div.setHead(T_head1);
 
        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;
                    }
                    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);
            Button cancel = actions.addButton("submit_return");
            cancel.setValue(T_submit_return);
        }
        else
        {
            Para nochanges = div.addPara();
            nochanges.addContent(T_no_changes);
            Para actions = div.addPara();
            Button cancel = actions.addButton("submit_return");
            cancel.setValue(T_submit_return);
        }



        div.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

        {
            changes = ((ArrayList<BulkEditChange>)request.getAttribute("changes"));
        }

    // DIVISION: metadata-import
    Division div = body.addInteractiveDivision("metadata-import",contextPath + "/admin/metadataimport", Division.METHOD_MULTIPART,"primary administrative");
    div.setHead(T_head1);
                Para para = div.addPara();
                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;
                            }
                            if (dcv.language != null)
                            {
                                md += "[" + dcv.language + "]";
                            }

                            Cell cell = mdrow.addCell();
                            cell.addContent(T_item_deletion);
                            cell.addContent(" (" + md + ")");
                            mdrow.addCellContent(dcv.value);
                        }
                    }
                }
                else
                {
                    Para nochanges = div.addPara();
                    nochanges.addContent(T_no_changes);
                }
                Para actions = div.addPara();
                Button cancel = actions.addButton("submit_return");
                cancel.setValue(T_submit_return);

   
    div.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

 
  public void addBody(Body body) throws SAXException, WingException, SQLException
  {

    // DIVISION: metadata-import
    Division div = body.addInteractiveDivision("metadata-import",contextPath + "/admin/metadataimport", Division.METHOD_MULTIPART,"primary administrative");
    div.setHead(T_head1);

                Para file = div.addPara();
                file.addFile("file");

                Para actions = div.addPara();
                Button button = actions.addButton("submit_upload");
                button.setValue(T_submit_upload);

    div.addHidden("administrative-continue").setValue(knot.getId());
  }
View Full Code Here

      pageMeta.addTrail().addContent(T_trail_forgot_password);
  }
 
    public void addBody(Body body) throws WingException
    {
        Division reset = body.addDivision("password-reset", "primary");
       
        reset.setHead(T_head);
       
        EPersonUtils.forgottProgressList(reset, 3);
       
        reset.addPara(T_para1);
       
        reset.addPara().addXref(contextPath, T_go_home);
    }
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.wing.element.Division

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.