Package org.dspace.browse
Class ItemCounter
- java.lang.Object
-
- org.dspace.browse.ItemCounter
-
public class ItemCounter extends Object
This class provides a standard interface to all item counting operations for communities and collections. In the event that the data cache is not being used, this class will return direct real time counts of content.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationServiceconfigurationServiceprotected ItemServiceitemService
-
Constructor Summary
Constructors Modifier Constructor Description protectedItemCounter()Construct a new item counter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCount(Context context, DSpaceObject dso)Get the count of the items in the given container.
-
-
-
Field Detail
-
itemService
@Autowired protected ItemService itemService
-
configurationService
@Autowired protected ConfigurationService configurationService
-
-
Method Detail
-
getCount
public int getCount(Context context, DSpaceObject dso)
Get the count of the items in the given container. If the configuration value webui.strengths.show is equal to 'true' this method will return all archived items. If the configuration value webui.strengths.show is equal to 'false' this method will return -1. If the configuration value webui.strengths.cache is equal to 'true' this will return the cached value if it exists. If it is equal to 'false' it will count the number of items in the container in real time.- Parameters:
context- DSpace Contextdso- DSpaceObject- Returns:
- count (-1 is returned if count could not be determined or is disabled)
-
-