use of com.xpn.xwiki.criteria.impl.Range in project xwiki-platform by xwiki.
the class Document method getCurrentMonthRefStats.
/**
* Get referer statistics for the current document during the current month.
*
* @return a list of referer statistics for the document's space
*/
public List<RefererStats> getCurrentMonthRefStats() {
Scope scope = ScopeFactory.createPageScope(this.getFullName());
Range range = RangeFactory.ALL;
Period period = PeriodFactory.getCurrentMonth();
XWikiStatsService statisticsService = getXWikiContext().getWiki().getStatsService(getXWikiContext());
List<RefererStats> stats = statisticsService.getRefererStatistics("", scope, period, range, this.context);
return stats;
}
use of com.xpn.xwiki.criteria.impl.Range in project xwiki-platform by xwiki.
the class Document method getCurrentMonthPageStats.
/**
* Get statistics about the number of request for the current page during the current month.
*
* @param action the type of request for which to retrieve statistics: view, edit...
* @return the statistics object holding information for this document and the current month
*/
public DocumentStats getCurrentMonthPageStats(String action) {
Scope scope = ScopeFactory.createPageScope(this.getFullName());
Range range = RangeFactory.ALL;
Period period = PeriodFactory.getCurrentMonth();
XWikiStatsService statisticsService = getXWikiContext().getWiki().getStatsService(getXWikiContext());
List<DocumentStats> stats = statisticsService.getDocumentStatistics(action, scope, period, range, this.context);
if (stats.size() > 0) {
return stats.get(0);
}
return new DocumentStats();
}
use of com.xpn.xwiki.criteria.impl.Range in project xwiki-platform by xwiki.
the class Document method getCurrentMonthSpaceStats.
/**
* Get statistics about the number of request for the current space during the current month.
*
* @param action the type of request for which to retrieve statistics: view, edit...
* @return the statistics object holding information for the document's space and the current month
*/
public DocumentStats getCurrentMonthSpaceStats(String action) {
Scope scope = ScopeFactory.createSpaceScope(this.doc.getSpace(), false);
Range range = RangeFactory.ALL;
Period period = PeriodFactory.getCurrentMonth();
XWikiStatsService statisticsService = getXWikiContext().getWiki().getStatsService(getXWikiContext());
List<DocumentStats> stats = statisticsService.getDocumentStatistics(action, scope, period, range, this.context);
if (stats.size() > 0) {
return stats.get(0);
}
return new DocumentStats();
}
Aggregations