Search in sources :

Example 6 with XWikiStatsService

use of com.xpn.xwiki.stats.api.XWikiStatsService in project xwiki-platform by xwiki.

the class StatsService method getBackLinkStatistics.

/**
 * Retrieves back-link statistics.
 *
 * @param domain the domain used for filtering the results
 * @param scope the scope of referred documents for which to retrieve statistics.
 * @param period the period of time
 * @param range the sub-range to return from the entire result set. Use this parameter for pagination
 * @return a list of DocumentStats objects
 */
public List<?> getBackLinkStatistics(String domain, Scope scope, Period period, Range range) {
    List<?> stats = Collections.emptyList();
    XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext());
    if (statsService != null) {
        stats = statsService.getBackLinkStatistics(domain, scope, period, range, getXWikiContext());
    }
    return stats;
}
Also used : XWikiStatsService(com.xpn.xwiki.stats.api.XWikiStatsService)

Example 7 with XWikiStatsService

use of com.xpn.xwiki.stats.api.XWikiStatsService in project xwiki-platform by xwiki.

the class StatsService method getDocumentStatistics.

/**
 * Retrieves document statistics.
 *
 * @param 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.
 * @param scope The set of documents for which to retrieve statistics
 * @param period The period of time
 * @param range The sub-range to return from the entire result set. Use this parameter for pagination
 * @return A list of DocumentStats objects
 */
public List<?> getDocumentStatistics(String action, Scope scope, Period period, Range range) {
    List<?> stats = Collections.emptyList();
    XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext());
    if (statsService != null) {
        stats = statsService.getDocumentStatistics(action, scope, period, range, getXWikiContext());
    }
    return stats;
}
Also used : XWikiStatsService(com.xpn.xwiki.stats.api.XWikiStatsService)

Example 8 with XWikiStatsService

use of com.xpn.xwiki.stats.api.XWikiStatsService in project xwiki-platform by xwiki.

the class StatsService method getActionStatistics.

/**
 * Shows how the statistics for the specified action have evolved over the specified period of time.
 *
 * @param action the action for which to retrieve statistics.
 * @param scope the set of documents to consider.
 * @param period the period of time.
 * @param step the step used for sampling the period.
 * @return a map of (date, actionCount) pairs.
 */
public Map<?, ?> getActionStatistics(String action, Scope scope, Period period, Duration step) {
    Map<?, ?> stats = Collections.emptyMap();
    XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext());
    if (statsService != null) {
        stats = statsService.getActionStatistics(action, scope, period, step, getXWikiContext());
    }
    return stats;
}
Also used : XWikiStatsService(com.xpn.xwiki.stats.api.XWikiStatsService)

Example 9 with XWikiStatsService

use of com.xpn.xwiki.stats.api.XWikiStatsService in project xwiki-platform by xwiki.

the class StatsService method getRecentActions.

/**
 * Returns the recently visited pages for a specific action.
 *
 * @param action ("view" or "edit").
 * @param size how many recent actions to retrieve.
 * @return a ArrayList of document names.
 */
public java.util.Collection<?> getRecentActions(String action, int size) {
    java.util.Collection<?> stats = Collections.emptyList();
    XWikiStatsService statsService = getXWikiContext().getWiki().getStatsService(getXWikiContext());
    if (statsService != null) {
        stats = statsService.getRecentActions(action, size, getXWikiContext());
    }
    return stats;
}
Also used : XWikiStatsService(com.xpn.xwiki.stats.api.XWikiStatsService)

Aggregations

XWikiStatsService (com.xpn.xwiki.stats.api.XWikiStatsService)9 Period (com.xpn.xwiki.criteria.impl.Period)3 Range (com.xpn.xwiki.criteria.impl.Range)3 Scope (com.xpn.xwiki.criteria.impl.Scope)3 DocumentStats (com.xpn.xwiki.stats.impl.DocumentStats)2 RefererStats (com.xpn.xwiki.stats.impl.RefererStats)1