List list = new ArrayList();
List tmpList = null;
List catList = null;
Iterator iterator = null;
int portletCount = 0;
CategoryInfo catInfo = null;
int strtCnt = getStartRow(pageNumber, portletPerPages);
int endCnt = getEndRow(pageNumber, portletPerPages);
try
{
if (category.equalsIgnoreCase("all")) {
tmpList = retrievePortlets(request, filter);
portletCount = tmpList.size();
if (endCnt > portletCount)
endCnt = portletCount;
for (int index = strtCnt; index < endCnt; index++) {
list.add(tmpList.get(index));
}
} else if (category.equalsIgnoreCase("search")) {
tmpList = retrievePortlets(request, filter);
portletCount = tmpList.size();
if (endCnt > portletCount)
endCnt = portletCount;
for (int index = strtCnt; index < endCnt; index++) {
list.add(tmpList.get(index));
}
} else {
tmpList = retrieveCategories(request);
iterator = tmpList.iterator();
while (iterator.hasNext()) {
catInfo = (CategoryInfo) iterator.next();
if (catInfo.getName().equalsIgnoreCase(category)) {
catList = catInfo.getPortlets();
break;
}
}
portletCount = catList.size();
if (endCnt > portletCount)