Jetspeed-2 provides a mechanism for aggregating portal statistics for reporting purpose.
            The PortalStatistics component exposes a queryStatistics method that given
            a StatisticsQueryCriteria will return AggregateStatistics.
        	
    
    AggregateStatistics queryStatistics(StatisticsQueryCriteria criteria)AggregateStatistics can then be used for reporting purpose.
             
			
			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);