Package org.dspace.browse
Class ItemCounter
java.lang.Object
org.dspace.browse.ItemCounter
This class provides a standard interface to all item counting
operations for communities and collections. It can be run from the
command line to prepare the cached data if desired, simply by
running:
java org.dspace.browse.ItemCounter
It can also be invoked via its standard API. In the event that
the data cache is not being used, this class will return direct
real time counts of content.
- Author:
- Richard Jones
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionItemCounter(Context context) Construct a new item counter which will use the given DSpace Context -
Method Summary
Modifier and TypeMethodDescriptionintgetCount(DSpaceObject dso) Get the count of the items in the given container.static ItemCounterGet the singular instance of a class.
-
Field Details
-
itemService
-
configurationService
-
-
Constructor Details
-
ItemCounter
Construct a new item counter which will use the given DSpace Context- Parameters:
context- current context- Throws:
ItemCountException- if count error
-
-
Method Details
-
getInstance
Get the singular instance of a class. It creates a new instance at the first usage of this method.- Returns:
- instance af a class
- Throws:
ItemCountException- when error occurs
-
getCount
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:
dso- DSpaceObject- Returns:
- count
- Throws:
ItemCountException- when error occurs
-