Package org.dspace.statistics.content
Class StatisticsDataVisits
- java.lang.Object
-
- org.dspace.statistics.content.StatisticsData
-
- org.dspace.statistics.content.StatisticsDataVisits
-
public class StatisticsDataVisits extends StatisticsData
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)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 Classes Modifier and Type Class Description static classStatisticsDataVisits.DatasetQueryclassStatisticsDataVisits.Query
-
Field Summary
Fields Modifier and Type Field Description protected BitstreamServicebitstreamServiceprotected CollectionServicecollectionServiceprotected CommunityServicecommunityServiceprotected DSpaceObjectcurrentDsoCurrent DSpaceObject for which to generate the statistics.protected HandleServicehandleServiceprotected ItemServiceitemServiceprotected SolrLoggerServicesolrLoggerService
-
Constructor Summary
Constructors Constructor Description StatisticsDataVisits()Construct a completely uninitialized query.StatisticsDataVisits(DSpaceObject dso)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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatasetcreateDataset(Context context)Run the accumulated query and return its results.protected Map<String,String>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)-
Methods inherited from class org.dspace.statistics.content.StatisticsData
addDatasetGenerator, addFilters, getDataset, getDatasetGenerators, getFilters, setDataset
-
-
-
-
Field Detail
-
currentDso
protected DSpaceObject currentDso
Current DSpaceObject for which to generate the statistics.
-
handleService
protected final HandleService handleService
-
solrLoggerService
protected final SolrLoggerService solrLoggerService
-
bitstreamService
protected final BitstreamService bitstreamService
-
itemService
protected final ItemService itemService
-
collectionService
protected final CollectionService collectionService
-
communityService
protected final CommunityService communityService
-
-
Constructor Detail
-
StatisticsDataVisits
public StatisticsDataVisits()
Construct a completely uninitialized query.
-
StatisticsDataVisits
public StatisticsDataVisits(DSpaceObject dso)
Construct an empty query concerning a given DSpaceObject.- Parameters:
dso- the target DSpace object
-
StatisticsDataVisits
public StatisticsDataVisits(DSpaceObject currentDso, Dataset dataset)
Construct an unconfigured query around a given DSO and Dataset.- Parameters:
currentDso- the target DSpace objectdataset- the target dataset
-
StatisticsDataVisits
public StatisticsDataVisits(Dataset dataset)
Construct an unconfigured query around a given Dataset.- Parameters:
dataset- the target dataset
-
-
Method Detail
-
createDataset
public Dataset createDataset(Context context) 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.- 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) throws org.apache.solr.client.solrj.SolrServerException, IOException
- Throws:
org.apache.solr.client.solrj.SolrServerExceptionIOException
-
-