// get the records from the database
Collection sqlResults = cfremote.getEmployeeListCollection(individualId);
// now create a DisplayList out of those records
IndividualList employeeList = new IndividualList();
// ok, now that we have the results from the database,
// we need to generate a DisplayList object to pass
// to the List View code (List.jsp)
Iterator iter = sqlResults.iterator();
while (iter.hasNext()) {
HashMap sqlRow = (HashMap)iter.next();
String individualName = (String)sqlRow.get("Name");
int individualID = ((Number)sqlRow.get("IndividualID")).intValue();
IntMember individualIDfield = new IntMember("IndividualID", individualID, 10, "", 'T', false, 10);
StringMember nameField = new StringMember("Name", individualName, 10, "/centraview/ViewHandler.do?" + Constants.TYPEOFCONTACT + "=" + Constants.INDIVIDUAL + "&rowId=" + individualID, 'T', true);
if (moduleName.equals(Constants.ACTIVITYMODULE)) {
if ((vecView != null) && vecView.contains(new Integer(individualID))) {
colview.add(new DDNameValue("" + individualID, nameField.getDisplayString()));
} else if ((vecSchedule != null) && vecSchedule.contains(new Integer(individualID))) {
colschedule.add(new DDNameValue("" + individualID, nameField.getDisplayString()));
} else if ((vecAll != null) && vecAll.contains(new Integer(individualID))) {
colAll.add(new DDNameValue("" + individualID, nameField.getDisplayString()));
}
} else if (moduleName.equals(Constants.EMAILMODULE)) {
if ((vecView != null) && vecView.contains(new Integer(individualID))) {
colview.add(new DDNameValue("" + individualID, nameField.getDisplayString()));
} else if ((vecSend != null) && vecSend.contains(new Integer(individualID))) {
colsend.add(new DDNameValue("" + individualID, nameField.getDisplayString()));
} else if ((vecAll != null) && vecAll.contains(new Integer(individualID))) {
colAll.add(new DDNameValue("" + individualID, nameField.getDisplayString()));
}
}
IndividualListElement ele = new IndividualListElement(individualID);
ele.put("IndividualID", individualIDfield);
ele.put("Name", nameField);
employeeList.put(individualName + individualID, ele);
}
String searchStr = request.getParameter("search");
if (searchStr != null && (searchStr.trim()).length() > 0) {
searchStr = searchStr.trim();
employeeList.setSearchString(searchStr);
employeeList.search();
}
employeeList.setTotalNoOfRecords(employeeList.size());
request.setAttribute("employeelist", employeeList);
request.setAttribute("list", "Individual");
request.setAttribute("typeofmodule", typeofModule);