mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 13:33:08 +00:00
Add itemService.countItems(Context, Community)
A convenience method to get community item count
This commit is contained in:
@@ -1109,6 +1109,16 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
return itemDAO.countItems(context, collection, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countItems(Context context, Community community) throws SQLException {
|
||||
List<Collection> collections = communityService.getAllCollections(context, community);
|
||||
int itemCount = 0;
|
||||
for(Collection collection : collections) {
|
||||
itemCount += countItems(context, collection);
|
||||
}
|
||||
return itemCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getAuthoritiesAndConfidences(String fieldKey, Collection collection, List<String> values, List<String> authorities, List<Integer> confidences, int i) {
|
||||
Choices c = choiceAuthorityService.getBestMatch(fieldKey, values.get(i), collection, null);
|
||||
|
Reference in New Issue
Block a user