Iterator psmlIterator = null;
if (StringUtils.isEmpty(filterType)
|| StringUtils.isEmpty(filterValue))
{
psmlIterator =
Profiler.query(new QueryLocator(QueryLocator.QUERY_ALL));
}
else
{
PortletSessionState.setAttribute(
portlet,
rundata,
FILTER_TYPE,
filterType);
PortletSessionState.setAttribute(
portlet,
rundata,
FILTER_VALUE,
filterValue);
context.put(FILTER_TYPE, filterType);
context.put(FILTER_VALUE, filterValue);
QueryLocator ql = null;
if (filterType.equalsIgnoreCase("filter_type_user"))
{
try
{
JetspeedUser user =
JetspeedSecurity.getUser(filterValue);
ql = new QueryLocator(QueryLocator.QUERY_USER);
ql.setUser(user);
psmlIterator = Profiler.query(ql);
}
catch (Exception e)
{
}
}
else if (filterType.equalsIgnoreCase("filter_type_role"))
{
try
{
Role role = JetspeedSecurity.getRole(filterValue);
ql = new QueryLocator(QueryLocator.QUERY_ROLE);
ql.setRole(role);
psmlIterator = Profiler.query(ql);
}
catch (Exception e)
{
}
}
else if (filterType.equalsIgnoreCase("filter_type_group"))
{
try
{
Group group = JetspeedSecurity.getGroup(filterValue);
ql = new QueryLocator(QueryLocator.QUERY_GROUP);
ql.setGroup(group);
psmlIterator = Profiler.query(ql);
}
catch (Exception e)
{
}