Package org.dspace.statistics.content
Class StatisticsBSAdapter
java.lang.Object
org.dspace.statistics.content.StatisticsBSAdapter
Class that will hold the data needed to show
statistics in the browse and search pages.
- Author:
- Kevin Van de Velde (kevin at atmire dot com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intvisitType is BITSTREAMprotected booleanprotected booleanprotected booleanprotected List<StatisticsFilter>static final intvisitType is ITEMprotected final SolrLoggerServicestatic final intvisitType is TOTAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFilter(StatisticsFilter filter) longgetNumberOfVisits(int visitType, Item item) Returns the number of visits for the item.booleanbooleanbooleanvoidsetDisplayBitstreamViews(boolean displayBitstreamViews) voidsetDisplayItemViews(boolean displayItemViews) voidsetDisplayTotalViews(boolean displayTotalViews) voidsetFilters(List<StatisticsFilter> filters)
-
Field Details
-
displayItemViews
protected boolean displayItemViews -
displayBitstreamViews
protected boolean displayBitstreamViews -
displayTotalViews
protected boolean displayTotalViews -
filters
-
ITEM_VISITS
public static final int ITEM_VISITSvisitType is ITEM- See Also:
-
BITSTREAM_VISITS
public static final int BITSTREAM_VISITSvisitType is BITSTREAM- See Also:
-
TOTAL_VISITS
public static final int TOTAL_VISITSvisitType is TOTAL- See Also:
-
solrLoggerService
-
-
Constructor Details
-
StatisticsBSAdapter
public StatisticsBSAdapter()
-
-
Method Details
-
getNumberOfVisits
public long getNumberOfVisits(int visitType, Item item) throws org.apache.solr.client.solrj.SolrServerException, IOException Returns the number of visits for the item. Depending on the visitType it can either be item, bitstream, total, ...- Parameters:
visitType- the type of visits we want, from the item, bitstream, totalitem- the item from which we need our visits- Returns:
- the number of visits
- Throws:
org.apache.solr.client.solrj.SolrServerException- Exception from the Solr server to the solrj Java client.IOException- passed through.
-
isDisplayTotalViews
public boolean isDisplayTotalViews() -
setDisplayTotalViews
public void setDisplayTotalViews(boolean displayTotalViews) -
isDisplayItemViews
public boolean isDisplayItemViews() -
setDisplayItemViews
public void setDisplayItemViews(boolean displayItemViews) -
isDisplayBitstreamViews
public boolean isDisplayBitstreamViews() -
setDisplayBitstreamViews
public void setDisplayBitstreamViews(boolean displayBitstreamViews) -
getFilters
-
addFilter
-
setFilters
-