Merge branch 'main' into 1787-coll-comm-item-counts

# Conflicts:
#	dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
#	dspace-api/src/main/java/org/dspace/content/service/CollectionService.java
This commit is contained in:
damian
2023-06-09 12:18:38 +02:00
270 changed files with 6936 additions and 7367 deletions

View File

@@ -1049,6 +1049,26 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
return (int) resp.getTotalSearchResults();
}
@Override
@SuppressWarnings("rawtypes")
public List<Collection> findAllCollectionsByEntityType(Context context, String entityType)
throws SearchServiceException {
List<Collection> collectionList = new ArrayList<>();
DiscoverQuery discoverQuery = new DiscoverQuery();
discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE);
discoverQuery.addFilterQueries("dspace.entity.type:" + entityType);
DiscoverResult discoverResult = searchService.search(context, discoverQuery);
List<IndexableObject> solrIndexableObjects = discoverResult.getIndexableObjects();
for (IndexableObject solrCollection : solrIndexableObjects) {
Collection c = ((IndexableCollection) solrCollection).getIndexedObject();
collectionList.add(c);
}
return collectionList;
}
@Override
public int countArchivedItem(Collection collection) throws ItemCountException {
return ItemCounter.getInstance().getCount(collection);