@Override public List<Collection> getAvailableSubscriptions(Context context, EPerson eperson) throws SQLException { List<Collection> collections; if (eperson != null) { context.setCurrentUser(eperson); } collections = collectionService.findAuthorized(context, null, Constants.ADD); return collections; }
private static void checkSelectCollectionForUser(EPerson person) throws SQLException { context.setCurrentUser(person); StopWatch stopWatch = new StopWatch("SelectCollectionStep Optimization (" + person.getEmail() + ")"); System.out.println("User: " + person.getEmail()); stopWatch.start("findAuthorized"); List<Collection> collections = collectionService.findAuthorized(context, null, Constants.ADD); stopWatch.stop(); Long defaultMS = stopWatch.getLastTaskTimeMillis(); stopWatch.start("ListingCollections"); System.out.println("Legacy Find Authorized"); reportCollections(collections); stopWatch.stop(); stopWatch.start("findAuthorizedOptimized"); List<Collection> collectionsOptimized = collectionService.findAuthorizedOptimized(context, Constants.ADD); stopWatch.stop(); Long optimizedMS = stopWatch.getLastTaskTimeMillis(); timeSavedMS += defaultMS - optimizedMS; stopWatch.start("ListingCollectionsWithOptimizedCollections"); System.out.println("Find Authorized Optimized"); reportCollections(collectionsOptimized); stopWatch.stop(); if (collections.size() == collectionsOptimized.size()) { System.out.println("Number of collections matches - Good"); } else { System.out.println("Number of collections doesn't match -- Bad"); brokenPeople.add(person); } System.out.println(stopWatch.prettyPrint()); }
List<Collection> cols = collectionService.findAuthorized( authContext, community, Constants.ADD); List<org.dspace.content.Collection> allowed = new ArrayList<>();
List<Collection> cols = collectionService.findAuthorized( authContext, community, Constants.ADD); List<org.dspace.content.Collection> allowed = new ArrayList<>();