mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 05:53: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);
|
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
|
@Override
|
||||||
protected void getAuthoritiesAndConfidences(String fieldKey, Collection collection, List<String> values, List<String> authorities, List<Integer> confidences, int i) {
|
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);
|
Choices c = choiceAuthorityService.getBestMatch(fieldKey, values.get(i), collection, null);
|
||||||
|
@@ -449,4 +449,11 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
|||||||
*/
|
*/
|
||||||
public Iterator<Item> findByLastModifiedSince(Context context, Date last)
|
public Iterator<Item> findByLastModifiedSince(Context context, Date last)
|
||||||
throws SQLException;
|
throws SQLException;
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* counts items in the given community
|
||||||
|
*
|
||||||
|
* @return total items
|
||||||
|
*/
|
||||||
|
public int countItems(Context context, Community community) throws SQLException;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user