mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Item counters added to Communities and Collections REST API
This commit is contained in:
@@ -24,6 +24,8 @@ import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.ResourcePolicy;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.browse.ItemCountException;
|
||||
import org.dspace.browse.ItemCounter;
|
||||
import org.dspace.content.dao.CommunityDAO;
|
||||
import org.dspace.content.service.BitstreamService;
|
||||
import org.dspace.content.service.CollectionService;
|
||||
@@ -76,9 +78,9 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
||||
protected IdentifierService identifierService;
|
||||
@Autowired(required = true)
|
||||
protected SubscribeService subscribeService;
|
||||
|
||||
protected CommunityServiceImpl() {
|
||||
super();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -708,4 +710,11 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
||||
public int countTotal(Context context) throws SQLException {
|
||||
return communityDAO.countRows(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArchivedItems(Community community) throws ItemCountException {
|
||||
//TODO load ItemCounter on bean creation
|
||||
Context context = new Context();
|
||||
return new ItemCounter(context).getCount(community);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user