int requestCategoryID = 1;
HttpSession session = request.getSession(true);
UserObject userobjectd = (UserObject)session.getAttribute("userobject");
int individualID = userobjectd.getIndividualID();
ListPreference listpreference = userobjectd.getListPreference("Knowledgebase");
KnowledgebaseList displaylistSession = null;
try
{
displaylistSession = (KnowledgebaseList)session.getAttribute("displaylist");
//System.out.println(" displaylistSession "+displaylistSession);
} catch (Exception e) {
System.out.println("[Exception] KnowledgebaseListHandler.execute: " + e.toString());
}
// After performing the logic in the DeleteHanlder, we are generat a new
// request for the list
// So we will not be carrying the old error. So that we will try to collect
// the error from the Session variable
// Then destory it after getting the Session value
if (session.getAttribute("listErrorMessage") != null)
{
ActionErrors allErrors = (ActionErrors)session.getAttribute("listErrorMessage");
saveErrors(request, allErrors);
session.removeAttribute("listErrorMessage");
}
KnowledgebaseList displaylist = null;
try
{
displaylist = (KnowledgebaseList)request.getAttribute("displaylist");
} catch (Exception e) {
System.out.println("[Exception] KnowledgebaseListHandler.execute: " + e.toString());
}
if (request.getParameter("rowId") != null)
{
String rowID = (String)request.getParameter("rowId");
int indexRowID = rowID.indexOf("#");
if (indexRowID == -1)
{
requestCategoryID = (Integer.parseInt((String)request.getParameter("rowId")));
}
else if (displaylistSession != null) {
requestCategoryID = displaylistSession.getCurrentCategoryID();
} else {
requestCategoryID = Integer.parseInt(rowID.substring(0, indexRowID));
}
} else if (displaylistSession != null) {
requestCategoryID = displaylistSession.getCurrentCategoryID();
}
KnowledgebaseList DL = null;
if (displaylist == null)
{
ListGenerator lg = ListGenerator.getListGenerator(dataSource);
int records = listpreference.getRecordsPerPage();
String sortelement = listpreference.getSortElement();
// If we are not coming from customer View List handler than we must have
// to set the as false.
// Otherwise true.
boolean customerViewFlag = false;
DL = (KnowledgebaseList)lg.getKnowledgebaseList(individualID, 1, records, "", sortelement, requestCategoryID, customerViewFlag);