// By default, only return psml pages for the current user
String defaultSearch = PortletConfigState.getParameter(portlet, rundata, DEFAULT_SEARCH, "true");
//Get the iterator
DatabaseBrowserIterator windowIterator =
(DatabaseBrowserIterator) PortletSessionState.getAttribute(portlet, rundata, PROFILE_ITERATOR);
if (refreshFlag)
{
setRefreshPsmlFlag(rundata, FALSE);
PortletSessionState.clearAttribute(portlet, rundata, PROFILE_ITERATOR);
// Use last used search value to refresh
Integer type = (Integer) PortletSessionState.getAttribute(portlet, rundata, LAST_SEARCH_TYPE);
String value = (String) PortletSessionState.getAttribute(portlet, rundata, LAST_SEARCH_VALUE);
if (type != null && value != null)
{
windowIterator = performSearch(rundata, portlet, type.intValue(), value);
}
}
else if (windowIterator != null)
{
windowIterator.setTop(start);
}
else if (defaultSearch != null && defaultSearch.equals("true"))
{
windowIterator = performSearch(rundata, portlet, QueryLocator.QUERY_USER, rundata.getUser().getUserName());
}
if (windowIterator != null)
{
context.put("psml", windowIterator);
if (start > 0)
{
context.put("prev", String.valueOf(prev + 1));
}
if (next <= windowIterator.getResultSetSize())
{
context.put("next", String.valueOf(next - 1));
}
}