@Override public List<Collection> findGroupMapped(Context context, int actionID) throws SQLException { List<Community> communities = communityService .findAuthorized(context, Arrays.asList(Constants.ADD, Constants.ADMIN)); List<Collection> collections = new ArrayList<>(); for (Community community : communities) { collections.addAll(community.getCollections()); } return collections; }
@Override public List<Collection> findGroup2CommunityMapped(Context context) throws SQLException { List<Community> communities = communityService .findAuthorizedGroupMapped(context, Arrays.asList(Constants.ADD, Constants.ADMIN)); List<Collection> collections = new ArrayList<>(); for (Community community : communities) { collections.addAll(community.getCollections()); } return collections; }
@Override public List<Collection> getAllCollections(Context context, Community community) throws SQLException { List<Collection> collectionList = new ArrayList<Collection>(); List<Community> subCommunities = community.getSubcommunities(); for (Community subCommunity : subCommunities) { addCollectionList(subCommunity, collectionList); } List<Collection> collections = community.getCollections(); for (Collection collection : collections) { collectionList.add(collection); } return collectionList; }
/** * Internal method to process subcommunities recursively * * @param community community * @param collectionList list of collections * @throws SQLException if database error */ protected void addCollectionList(Community community, List<Collection> collectionList) throws SQLException { for (Community subcommunity : community.getSubcommunities()) { addCollectionList(subcommunity, collectionList); } for (Collection collection : community.getCollections()) { collectionList.add(collection); } }
@Override public List<Collection> findAuthorized(Context context, Community community, int actionID) throws SQLException { List<Collection> myResults = new ArrayList<>(); List<Collection> myCollections; if (community != null) { myCollections = community.getCollections(); } else { myCollections = findAll(context); } // now build a list of collections you have authorization for for (Collection myCollection : myCollections) { if (authorizeService.authorizeActionBoolean(context, myCollection, actionID)) { myResults.add(myCollection); } } return myResults; }
@Override public List<UUID> getAllSubCollections(ContextService contextService, UUID communityId) throws SQLException { Queue<Community> comqueue = new LinkedList<>(); List<UUID> list = new ArrayList<>(); try { comqueue.add(communityService.find(contextService.getContext(), communityId)); } catch (ContextServiceException e) { throw new SQLException(e); } while (!comqueue.isEmpty()) { Community c = comqueue.poll(); for (Community sub : c.getSubcommunities()) { comqueue.add(sub); } for (Collection col : c.getCollections()) { if (!list.contains(col.getID())) { list.add(col.getID()); } } } return list; }
Collection[] colls = communities[com].getCollections(); colMap.put(comID, colls);
throws SQLException { List<Collection> collections = community.getCollections(); Iterator<Item> result = null; for (Collection collection : collections) {
for (Collection collection : community.getCollections())
@Override public void applyFiltersCommunity(Context context, Community community) throws Exception { //only apply filters if community not in skip-list if (!inSkipList(community.getHandle())) { List<Community> subcommunities = community.getSubcommunities(); for (Community subcommunity : subcommunities) { applyFiltersCommunity(context, subcommunity); } List<Collection> collections = community.getCollections(); for (Collection collection : collections) { applyFiltersCollection(context, collection); } } }
/** * Run task for Community along with all sub-communities and collections. * * @param tr TaskRunner * @param comm Community * @return true if successful, false otherwise * @throws IOException if IO error */ protected boolean doCommunity(TaskRunner tr, Community comm) throws IOException { if (!tr.run(comm)) { return false; } for (Community subcomm : comm.getSubcommunities()) { if (!doCommunity(tr, subcomm)) { return false; } } for (Collection coll : comm.getCollections()) { if (!doCollection(tr, coll)) { return false; } } return true; }
comm.getHandle()); parentComms.add(mycomm); List<Collection> colls = comm.getCollections(); if (colls.size() > 0) { List<HierarchyCollection> myColls = new ArrayList<HierarchyCollection>();
@Override public void addCollection(Context context, Community community, Collection collection) throws SQLException, AuthorizeException { // Check authorisation authorizeService.authorizeAction(context, community, Constants.ADD); log.info(LogManager.getHeader(context, "add_collection", "community_id=" + community.getID() + ",collection_id=" + collection.getID())); if (!community.getCollections().contains(collection)) { community.addCollection(collection); collection.addCommunity(community); } context.addEvent( new Event(Event.ADD, Constants.COMMUNITY, community.getID(), Constants.COLLECTION, collection.getID(), community.getHandle(), getIdentifiers(context, community))); }
Iterator<Collection> collections = community.getCollections().iterator();
distribute(subcomm); for (Collection coll : comm.getCollections()) { distribute(coll);
Collection[] collections = community.getCollections();
currentCommunity.getMetadata("name")); List containerSubList = null; for (Collection subCols : currentCommunity.getCollections())
.resolveToObject(context, communityHandle); for (final Collection collection : reloadedCommunity.getCollections()) { count++; indexingService.indexContent(context, collection, true, true);
for (DSpaceObject child : ((Community)dso).getCollections())
scope.setOptionSelected(community.getHandle()); for (Collection collection : community.getCollections()) { scope.addOption(collection.getHandle(), collection.getMetadata("name"));