mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Refactor ItemCounter and ItemCountDAO to act like other DSpace beans. Also ensure they do not cache a Context object.
This commit is contained in:
@@ -31,7 +31,6 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.ResourcePolicy;
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.authorize.service.ResourcePolicyService;
|
||||
import org.dspace.browse.ItemCountException;
|
||||
import org.dspace.browse.ItemCounter;
|
||||
import org.dspace.content.dao.CollectionDAO;
|
||||
import org.dspace.content.service.BitstreamService;
|
||||
@@ -122,6 +121,9 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
@Autowired(required = true)
|
||||
protected ConfigurationService configurationService;
|
||||
|
||||
@Autowired
|
||||
protected ItemCounter itemCounter;
|
||||
|
||||
protected CollectionServiceImpl() {
|
||||
super();
|
||||
}
|
||||
@@ -1112,12 +1114,12 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
/**
|
||||
* Returns total collection archived items
|
||||
*
|
||||
* @param context DSpace Context
|
||||
* @param collection Collection
|
||||
* @return total collection archived items
|
||||
* @throws ItemCountException
|
||||
*/
|
||||
@Override
|
||||
public int countArchivedItems(Collection collection) throws ItemCountException {
|
||||
return ItemCounter.getInstance().getCount(collection);
|
||||
public int countArchivedItems(Context context, Collection collection) {
|
||||
return itemCounter.getCount(context, collection);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user