Package org.dspace.statistics.content
Class StatisticsDataVisits
java.lang.Object
org.dspace.statistics.content.StatisticsData
org.dspace.statistics.content.StatisticsDataVisits
Query factory associated with a DSpaceObject.
Encapsulates the raw data, independent of rendering.
To use:
- Instantiate, passing a reference to the interesting DSO.
- Add a
DatasetDSpaceObjectGeneratorfor the appropriate object type. - Add other generators as required to get the statistic you want.
- Add
filtersas required. createDataset(Context, int)will run the query and return a result matrix. Subsequent calls skip the query and return the same matrix.
- Author:
- kevinvandevelde at atmire.com Date: 23-feb-2009 Time: 12:25:20
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BitstreamServiceprotected final CollectionServiceprotected final CommunityServiceprotected final ConfigurationServiceprotected DSpaceObjectCurrent DSpaceObject for which to generate the statistics.protected final HandleServiceprotected final ItemServiceprotected final SolrLoggerService -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a completely uninitialized query.Construct an empty query concerning a given DSpaceObject.StatisticsDataVisits(DSpaceObject currentDso, Dataset dataset) Construct an unconfigured query around a given DSO and Dataset.StatisticsDataVisits(Dataset dataset) Construct an unconfigured query around a given Dataset. -
Method Summary
Modifier and TypeMethodDescriptioncreateDataset(Context context, int facetMinCount) Run the accumulated query and return its results.getAttributes(String value, StatisticsDataVisits.DatasetQuery datasetQuery, Context context) protected StringgetResultName(String value, StatisticsDataVisits.DatasetQuery datasetQuery, Context context) Gets the name of the DSO (example for collection: ((Collection) dso).getname();protected voidprocessAxis(Context context, DatasetGenerator datasetGenerator, List<StatisticsDataVisits.DatasetQuery> queries) protected ObjectCount[]queryFacetField(StatisticsDataVisits.DatasetQuery dataset, String query, String filterQuery, int facetMinCount) Methods inherited from class org.dspace.statistics.content.StatisticsData
addDatasetGenerator, addFilters, getDataset, getDatasetGenerators, getFilters, setDataset
-
Field Details
-
currentDso
Current DSpaceObject for which to generate the statistics. -
handleService
-
solrLoggerService
-
bitstreamService
-
itemService
-
collectionService
-
communityService
-
configurationService
-
-
Constructor Details
-
StatisticsDataVisits
public StatisticsDataVisits()Construct a completely uninitialized query. -
StatisticsDataVisits
Construct an empty query concerning a given DSpaceObject.- Parameters:
dso- the target DSpace object
-
StatisticsDataVisits
Construct an unconfigured query around a given DSO and Dataset.- Parameters:
currentDso- the target DSpace objectdataset- the target dataset
-
StatisticsDataVisits
Construct an unconfigured query around a given Dataset.- Parameters:
dataset- the target dataset
-
-
Method Details
-
createDataset
public Dataset createDataset(Context context, int facetMinCount) throws SQLException, org.apache.solr.client.solrj.SolrServerException, ParseException, IOException Description copied from class:StatisticsDataRun the accumulated query and return its results.- Specified by:
createDatasetin classStatisticsData- Parameters:
context- The relevant DSpace Context.facetMinCount- Minimum count of results facet must have to return a result- Returns:
- accumulated query results
- Throws:
SQLException- An exception that provides information on a database access error or other errors.org.apache.solr.client.solrj.SolrServerException- Exception from the Solr server to the solrj Java client.ParseException- if the dataset cannot be parsedIOException- A general class of exceptions produced by failed or interrupted I/O operations.
-
processAxis
protected void processAxis(Context context, DatasetGenerator datasetGenerator, List<StatisticsDataVisits.DatasetQuery> queries) throws SQLException - Throws:
SQLException
-
getResultName
protected String getResultName(String value, StatisticsDataVisits.DatasetQuery datasetQuery, Context context) throws SQLException Gets the name of the DSO (example for collection: ((Collection) dso).getname();- Parameters:
value- UUID (or legacy record ID) of the DSO in question.datasetQuery- FIXME: PLEASE DOCUMENT.context- The relevant DSpace Context.- Returns:
- the name of the given DSO
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getAttributes
protected Map<String,String> getAttributes(String value, StatisticsDataVisits.DatasetQuery datasetQuery, Context context) throws SQLException - Throws:
SQLException
-
queryFacetField
protected ObjectCount[] queryFacetField(StatisticsDataVisits.DatasetQuery dataset, String query, String filterQuery, int facetMinCount) throws org.apache.solr.client.solrj.SolrServerException, IOException - Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-