public class StatsService extends Api
Constructor and Description |
---|
StatsService(XWikiContext context)
Create new StatsService instance.
|
Modifier and Type | Method and Description |
---|---|
Map<?,?> |
getActionStatistics(String action,
Scope scope,
Period period,
Duration step)
Shows how the statistics for the specified action have evolved over the specified period of time.
|
List<?> |
getBackLinkStatistics(String domain,
Scope scope,
Period period,
Range range)
Retrieves back-link statistics.
|
List<?> |
getDocumentStatistics(String action,
Scope scope,
Period period,
Range range)
Retrieves document statistics.
|
Collection<?> |
getRecentActions(String action,
int size)
Returns the recently visited pages for a specific action.
|
List<?> |
getRefererStatistics(String domain,
Scope scope,
Period period,
Range range)
Retrieves referrer statistics.
|
List<?> |
getVisitStatistics(String action,
Period period,
Range range)
Retrieves visit statistics.
|
boolean |
isEnabled()
Deprecated.
|
boolean |
isEnabledForCurrentWiki()
Indicate if statistics service is enabled for the current wiki.
|
boolean |
isEnabledGlobally()
Indicate if statistics service is globally enabled.
|
convert, convert, convert, convertAttachments, getAuthorizationManager, getContextualAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
public StatsService(XWikiContext context)
context
- the XWiki context.public boolean isEnabledGlobally()
isEnabledForCurrentWiki()
.
To be true the xwiki.stats
setting in xwiki.cfg has to be 1
.
true
if the statistics module is enabledpublic boolean isEnabledForCurrentWiki()
To be true the xwiki.stats
in xwiki.cfg has to be 1
and
xwiki.stats.default
too.
xwiki.stats.default
can be overwritten by statistics
in XWikiPreferences
.
@Deprecated public boolean isEnabled()
isEnabledForCurrentWiki()
To be true the xwiki.stats
in xwiki.cfg has to be 1
and
xwiki.stats.default
too.
xwiki.stats.default
can be overwritten by statistics
in XWikiPreferences
.
public List<?> getDocumentStatistics(String action, Scope scope, Period period, Range range)
action
- The action the results should be ordered by. It can be one of: "view", "save" or "download". If the
action is "view" then the documents are ordered by the number of times they have been viewed so far.scope
- The set of documents for which to retrieve statisticsperiod
- The period of timerange
- The sub-range to return from the entire result set. Use this parameter for paginationpublic List<?> getVisitStatistics(String action, Period period, Range range)
action
- The action the results should be ordered by. It can be one of: "view", "save" or "download". If the
action is "view" then the visitors are ordered by the number of pages they have viewed so far.period
- The period of timerange
- The sub-range to return from the entire result set. Use this parameter for paginationpublic List<?> getRefererStatistics(String domain, Scope scope, Period period, Range range)
domain
- The domain for which to retrieve statistics. To retrieve statistics for all domains use the empty
string.scope
- The scope of referred documents to use for filtering the results.period
- The period of timerange
- The sub-range to return from the entire result set. Use this parameter for paginationpublic List<?> getBackLinkStatistics(String domain, Scope scope, Period period, Range range)
domain
- the domain used for filtering the resultsscope
- the scope of referred documents for which to retrieve statistics.period
- the period of timerange
- the sub-range to return from the entire result set. Use this parameter for paginationpublic Map<?,?> getActionStatistics(String action, Scope scope, Period period, Duration step)
action
- the action for which to retrieve statistics.scope
- the set of documents to consider.period
- the period of time.step
- the step used for sampling the period.public Collection<?> getRecentActions(String action, int size)
action
- ("view" or "edit").size
- how many recent actions to retrieve.Copyright © 2004–2022 XWiki. All rights reserved.