port pr 1862

This commit is contained in:
Terry W Brady
2018-03-16 12:15:15 -07:00
parent b5f86ebb13
commit 8f689efc4e
5 changed files with 79 additions and 5 deletions

View File

@@ -244,6 +244,12 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
return itemDAO.findAllByCollection(context, collection);
}
@Override
public Iterator<Item> findAllByCollection(Context context, Collection collection, Integer limit, Integer offset)
throws SQLException {
return itemDAO.findAllByCollection(context, collection, limit, offset);
}
@Override
public Iterator<Item> findInArchiveOrWithdrawnDiscoverableModifiedSince(Context context, Date since)
throws SQLException {
@@ -1161,6 +1167,12 @@ prevent the generation of resource policy entry values with null dspace_object a
return itemDAO.countItems(context, collection, true, false);
}
@Override
public int countAllItems(Context context, Collection collection) throws SQLException {
return itemDAO.countItems(context, collection, true, false) + itemDAO.countItems(context, collection,
false, true);
}
@Override
public int countItems(Context context, Community community) throws SQLException {
// First we need a list of all collections under this community in the hierarchy
@@ -1170,6 +1182,16 @@ prevent the generation of resource policy entry values with null dspace_object a
return itemDAO.countItems(context, collections, true, false);
}
@Override
public int countAllItems(Context context, Community community) throws SQLException {
// First we need a list of all collections under this community in the hierarchy
List<Collection> collections = communityService.getAllCollections(context, community);
// Now, lets count unique items across that list of collections
return itemDAO.countItems(context, collections, true, false) + itemDAO.countItems(context, collections,
false, true);
}
@Override
protected void getAuthoritiesAndConfidences(String fieldKey, Collection collection, List<String> values,
List<String> authorities, List<Integer> confidences, int i) {