Data Aggregation Overview

Jetspeed-2 provides a mechanism for aggregating portal statistics for reporting purpose.

Retrieving Aggregate Statistics

The PortalStatistics component exposes a queryStatistics method that given a StatisticsQueryCriteria will return AggregateStatistics.

    AggregateStatistics queryStatistics(StatisticsQueryCriteria criteria)
The AggregateStatistics can then be used for reporting purpose.

Using Aggregate Statistics

As illustrated in viewing statistics, Jetspeed-2 provides a default reporting portlet for view statistics. To query statistics, a StatisticsQueryCriteria must be set. According to this criteria the PortalStatistics queryStatistics() method will return an AggregateStatistics.

        StatisticsQueryCriteria criteria = statistics.createStatisticsQueryCriteria();
        ...
        criteria.setUser(user);
        criteria.setListsize("5");
        criteria.setSorttype("count");
        criteria.setSortorder("desc");
        criteria.setTimePeriod(timeperiod);
        criteria.setQueryType(queryType);
        AggregateStatistics stats = statistics.getDefaultEmptyAggregateStatistics();
        ...
        statistics.forceFlush();
        stats = statistics.queryStatistics(criteria);