public void processAction(ActionRequest request,
ActionResponse actionResponse) throws PortletException, IOException
{
PortletSession session = request.getPortletSession();
StatisticsQueryCriteria criteria = statistics.createStatisticsQueryCriteria();
String user = request.getParameter("user");
criteria.setUser(user);
String timeperiod = request.getParameter("timeperiod");
if (timeperiod == null)
{
timeperiod = "all";
}
String listsizeStr = request.getParameter("listsize");
if(listsizeStr == null)
{
listsizeStr = "5";
} else
{
try
{
Integer.parseInt(listsizeStr);
} catch (NumberFormatException e)
{
// if we can't parse it.. just make it 5
listsizeStr = "5";
}
}
criteria.setListsize(listsizeStr);
criteria.setSorttype("count");
criteria.setSortorder("desc");
criteria.setTimePeriod(timeperiod);
String queryType = request.getParameter("queryType");
criteria.setQueryType(queryType);
AggregateStatistics stats = statistics.getDefaultEmptyAggregateStatistics();
try
{
statistics.forceFlush();
stats = statistics.queryStatistics(criteria);