In statistics.xml file it is possible to configure one or many generators to be used to extract statistics data for a given DSpace object or objects associated to it by mean of DSpace-CRIS inverse relations mechanism.
Currently available generators, all implementations of org.dspace.app.rest.statistics.UsageReportGenerator, are:
Java Class | Extracted Data |
|---|---|
| List of cities from where DSpace Object, or its related Objects, visits are coming, sorted by number of visits in decreasing order |
| List of countries from where DSpace Object, or its related Objects, visits are coming, sorted by number of visits in decreasing order |
| Usage report of the items most popular over the entire site or a specific community, collection |
| Number of times a DSpace Object, or its related Objects, have been visited and its attachments have been downloaded |
| Number of times a DSpace Object, or its related Objects, attachments have been downloaded |
| Number of times a DSpace Object, or its related Objects, attachments have been visited |
| Number of times a DSpace Object, or its related Objects, attachments have been visited in a period of time, grouped by a period duration (month by month, year by year, etc.) |
For each generator, following properties are provided:
viewMode: rendering of data, possible values are: table (default) , chart.line, chart.bar, map (geographical map)
maxResults: maximum number of statistical data to be returned
relation: If defined, it instructs the generator to extract data related to DSpaceObject received in input by mean of this inverse relation. This value, should match to one of inverse relations defined in discovery.xml file, for the type of DSpaceObject for which generator will provide data.
For org.dspace.app.rest.statistics.TotalVisitPerPeriodGenerator implementation, “periodType” and “increment” fields are provided and will be used by solr query responsible of extracting period related statistics. “periodType” specifies period granularity (“year”, “month” or “day”), “increment” is used to define period steps, for example, an increment of 1 for a “month” periodType will extract visits grouped 1 month per time. This configuration
<bean id="totalVisitPerPeriodGenerator" class="org.dspace.app.rest.statistics.TotalVisitPerPeriodGenerator">
<property name="viewMode" value="chart.line"/>
<property name="maxResults" value="6"/>
<property name="periodType" value="month"/>
<property name="increment" value="1"/>
</bean> |
extracts item visits of last 6 months, grouped by single month.
An simple generator, which extracts usage data for item received in input is configured in this way:
<bean id="totalVisitGenerator" class="org.dspace.app.rest.statistics.TotalVisitGenerator">
<property name="viewMode" value="table"/>
</bean> |
while this other generator will extract data related to objects related to item received in input by mean of inverse relation “RELATION.Person.researchoutputs“ defined in discovery.xml file:
<bean id="totalVisitGeneratorRelationPersonResearchoutputs" class="org.dspace.app.rest.statistics.TotalVisitGenerator">
<property name="viewMode" value="table"/>
<property name="relation" value="RELATION.Person.researchoutputs"/>
</bean> |
statistics.xml file entry point to define generators mapping is the bean of type org.dspace.app.rest.statistics.StatisticsReportsConfiguration. Its “mapping” property contains a map between DSpaceObject instance types and a list of org.dspace.app.rest.model.UsageReportCategoryRest instances. For each of those instances, following properties are set:
categoryType: keyword identifying generated report(s) category
reports: a List of org.dspace.app.rest.statistics.UsageReportGenerator instances (see above), which will be used to extract usage data and statistics for a given DSpaceObject and/or other DSpace Objects related to it.
DSpaceObject instance types defined as “key” in “mapping” map could be:
site
community
collection
item
item of a specific type (i.e. “item-Person”, “item-Publication”, etc.)
REST contracts to obtain statistics data are defined at https://github.com/4Science/Rest7Contract/blob/dspace-cris-2024_02_x/statistics-reports.md and https://github.com/4Science/Rest7Contract/blob/dspace-cris-2024_02_x/statistics-categories.md
On DSpace-CRIS, statistics are available to logged users at link
http(s)://<dspace-cris-base-url>/statistics/items/<dspace-object-id>
By mean of “store-metrics” process, which can be triggered via processes UI section or CLI, it is possible to generate view and download usage statistics for each item part of DSpace-CRIS repository, and have them stored as Item’s metric in cris_metrics table. In this way, view and download data can be made available within a DSpace-CRIS Item metrics box.