ValueList valueList = null;
try {
valueList = valueListHome.create();
} catch (CreateException e) {
logger.error("[execute] Exception thrown.", e);
throw new ServletException(e);
}
valueList.setDataSource(dataSource);
ValueListVO listObject = valueList.getValueList(individualId, listParameters);
ArrayList buttonList = new ArrayList();
ValueListDisplay displayParameters = null;
if (actionType != null && actionType.equals("lookup")) {
// When we select the lookup then we should add the Select button to the
// valueList
buttonList.add(new Button("Select", "select", "lu_selectList('Entity');", false, "label.select", request.getLocale()));
buttonList.add(new Button("New Entity", "new", "c_newButton('Entity', 14)", false, "label.contact.newentity", request.getLocale()));
displayParameters = new ValueListDisplay(buttonList, false, false);
displayParameters.setRadio(true);
listObject.setLookup(true);
listObject.setLookupType(actionType);
request.setAttribute("dynamicTitle", "Entity");
request.setAttribute("lookupType", "Entity");
} else {
listObject.setMoveTo(true);
buttonList.add(new Button("View", "view", "vl_viewList();", false, "label.view", request.getLocale()));
buttonList.add(new Button("Delete", "delete", "vl_deleteList();", false, "label.delete", request.getLocale()));
displayParameters = new ValueListDisplay(buttonList, true, true);
}
displayParameters.setSortable(true);
displayParameters.setPagingBar(true);
displayParameters.setLink(true);
listObject.setDisplay(displayParameters);
// Stick the list on the request and then the custom list tag will handle
// it.
if (logger.isDebugEnabled()) {
long debugTime = (System.currentTimeMillis() - start);
logger.debug("[execute] End to End: " + debugTime + " ms");
listObject.getParameters().setDebugTime(debugTime);
}
request.setAttribute("valueList", listObject);
// Put the MarketingList names on the request so the dropdown on the left
// can be rendered
ContactFacadeHome cfh = (ContactFacadeHome)CVUtility.getHomeObject(
"com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
ContactFacade remote = null;
try {
remote = cfh.create();
} catch (CreateException e) {
logger.error("[execute] Exception thrown.", e);
throw new ServletException(e);
}
remote.setDataSource(dataSource);
Vector allDBList = remote.getDBList(individualId);
request.setAttribute("AllDBList", allDBList);
// For the searchBar