mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 11:33:11 +00:00
Remove old CommunityService item count methods, which were inaccurate & slow. ItemService now handles this
This commit is contained in:
@@ -570,22 +570,6 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
|||||||
authorizeService.authorizeAction(context, community, Constants.WRITE);
|
authorizeService.authorizeAction(context, community, Constants.WRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int countItems(Context context, Community community) throws SQLException {
|
|
||||||
int total = 0;
|
|
||||||
// add collection counts
|
|
||||||
List<Collection> cols = community.getCollections();
|
|
||||||
for (Collection col : cols) {
|
|
||||||
total += itemService.countItems(context, col);
|
|
||||||
}
|
|
||||||
// add sub-community counts
|
|
||||||
List<Community> comms = community.getSubcommunities();
|
|
||||||
for (int j = 0; j < comms.size(); j++) {
|
|
||||||
total += countItems(context, comms.get(j));
|
|
||||||
}
|
|
||||||
return total;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Community findByAdminGroup(Context context, Group group) throws SQLException {
|
public Community findByAdminGroup(Context context, Group group) throws SQLException {
|
||||||
return communityDAO.findByAdminGroup(context, group);
|
return communityDAO.findByAdminGroup(context, group);
|
||||||
|
@@ -243,13 +243,6 @@ public interface CommunityService extends DSpaceObjectService<Community>, DSpace
|
|||||||
|
|
||||||
public void canEdit(Context context, Community community) throws AuthorizeException, SQLException;
|
public void canEdit(Context context, Community community) throws AuthorizeException, SQLException;
|
||||||
|
|
||||||
/**
|
|
||||||
* counts items in this community
|
|
||||||
*
|
|
||||||
* @return total items
|
|
||||||
*/
|
|
||||||
public int countItems(Context context, Community community) throws SQLException;
|
|
||||||
|
|
||||||
public Community findByAdminGroup(Context context, Group group) throws SQLException;
|
public Community findByAdminGroup(Context context, Group group) throws SQLException;
|
||||||
|
|
||||||
public List<Community> findAuthorized(Context context, List<Integer> actions) throws SQLException;
|
public List<Community> findAuthorized(Context context, List<Integer> actions) throws SQLException;
|
||||||
|
Reference in New Issue
Block a user