mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 13:33:08 +00:00
Level up counting items methods - both now use the same flags from Item model (discoverable, archived, withdrawn)
This commit is contained in:
@@ -1631,13 +1631,13 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
|
||||
@Override
|
||||
public int countItems(Context context, Collection collection) throws SQLException {
|
||||
return itemDAO.countItems(context, collection, true, false);
|
||||
return itemDAO.countItems(context, collection, true, false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countAllItems(Context context, Collection collection) throws SQLException {
|
||||
return itemDAO.countItems(context, collection, true, false) + itemDAO.countItems(context, collection,
|
||||
false, true);
|
||||
return itemDAO.countItems(context, collection, true, false, true) + itemDAO.countItems(context, collection,
|
||||
false, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1646,7 +1646,7 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
List<Collection> collections = communityService.getAllCollections(context, community);
|
||||
|
||||
// Now, lets count unique items across that list of collections
|
||||
return itemDAO.countItems(context, collections, true, false);
|
||||
return itemDAO.countItems(context, collections, true, false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1655,8 +1655,8 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
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);
|
||||
return itemDAO.countItems(context, collections, true, false, true) + itemDAO.countItems(context, collections,
|
||||
false, false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1699,19 +1699,19 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
@Override
|
||||
public int countNotArchivedItems(Context context) throws SQLException {
|
||||
// return count of items not in archive and also not withdrawn
|
||||
return itemDAO.countItems(context, false, false);
|
||||
return itemDAO.countItems(context, false, false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countArchivedItems(Context context) throws SQLException {
|
||||
// return count of items in archive and also not withdrawn
|
||||
return itemDAO.countItems(context, true, false);
|
||||
return itemDAO.countItems(context, true, false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countWithdrawnItems(Context context) throws SQLException {
|
||||
// return count of items that are not in archive and withdrawn
|
||||
return itemDAO.countItems(context, false, true);
|
||||
return itemDAO.countItems(context, false, true, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user