@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<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; }
Community[] comms = communities[com].getSubcommunities(); commMap.put(comID, comms);
List<org.dspace.content.Community> dspaceCommunities = dspaceCommunity.getSubcommunities(); for (int i = offset; (i < (offset + limit)) && (i < dspaceCommunities.size()); i++) { if (authorizeService
/** * @param c context * @param parent parent Community * @param child child community * @throws SQLException if database error * @throws AuthorizeException if authorize error * @throws IOException if IO error */ public void defiliate(Context c, Community parent, Community child) throws SQLException, AuthorizeException, IOException { // verify that child is indeed a child of parent List<Community> parentKids = parent.getSubcommunities(); if (!parentKids.contains(child)) { System.out.println("Error, child community not a child of parent community"); System.exit(1); } // OK remove the mappings - but leave the community, which will become // top-level child.removeParentCommunity(parent); parent.removeSubCommunity(child); communityService.update(c, child); communityService.update(c, parent); // complete the pending transaction c.complete(); System.out.println("Defiliation complete. Community: '" + child.getID() + "' is no longer a child of community: '" + parent.getID() + "'"); }
List<Community> communities = community.getSubcommunities(); for (Community subCommunity : communities) { for (int i = 0; i < indent; i++) {
for (Community subcommunity : community.getSubcommunities())
@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; }
processCommunity(context, mycomm, comm.getSubcommunities());
@Override public void addSubcommunity(Context context, Community parentCommunity, Community childCommunity) throws SQLException, AuthorizeException { // Check authorisation authorizeService.authorizeAction(context, parentCommunity, Constants.ADD); log.info(LogManager.getHeader(context, "add_subcommunity", "parent_comm_id=" + parentCommunity.getID() + ",child_comm_id=" + childCommunity .getID())); if (!parentCommunity.getSubcommunities().contains(childCommunity)) { parentCommunity.addSubCommunity(childCommunity); childCommunity.addParentCommunity(parentCommunity); } context.addEvent(new Event(Event.ADD, Constants.COMMUNITY, parentCommunity.getID(), Constants.COMMUNITY, childCommunity.getID(), parentCommunity.getHandle(), getIdentifiers(context, parentCommunity))); }
List<org.dspace.content.Community> communities = community.getSubcommunities(); subcommunities = new ArrayList<Community>(); for (org.dspace.content.Community subCommunity : communities) {
Iterator<Community> subCommunities = community.getSubcommunities().iterator();
for (Community subcomm : comm.getSubcommunities()) { distribute(subcomm);
Iterator<Community> subcommunities = community.getSubcommunities().iterator(); while (subcommunities.hasNext()) { Community subCommunity = subcommunities.next();
validity.add(community); Community[] subCommunities = community.getSubcommunities(); Collection[] collections = community.getCollections();
for (Community subComs : currentCommunity.getSubcommunities())
final Community community = (Community) dso; final String communityHandle = community.getHandle(); for (final Community subcommunity : community.getSubcommunities()) { count += indexAll(indexingService, itemService, context, subcommunity);
for (DSpaceObject child : ((Community)dso).getSubcommunities())