String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(servletContext)).getDataSource();
HttpSession session = request.getSession(true);
UserObject userObject = (UserObject)session.getAttribute("userobject");
GlobalMasterLists globalMasterLists = GlobalMasterLists.getGlobalMasterLists(dataSource);
Boolean showAdvancedSearch = (request.getAttribute("showAdvancedSearch") == null) ? new Boolean(true) : ((Boolean)request.getAttribute("showAdvancedSearch"));
request.setAttribute("showAdvancedSearch", showAdvancedSearch);
Boolean showSimpleSearch = (request.getAttribute("showSimpleSearch") == null) ? new Boolean(true) : ((Boolean)request.getAttribute("showSimpleSearch"));
request.setAttribute("showSimpleSearch", showSimpleSearch);
Boolean showCustomViews = (request.getAttribute("showCustomViews") == null) ? new Boolean(true) : ((Boolean)request.getAttribute("showCustomViews"));
request.setAttribute("showCustomViews", showCustomViews);
Boolean showComposeButton = (request.getAttribute("showComposeButton") == null) ? new Boolean(false) : ((Boolean)request.getAttribute("showComposeButton"));
request.setAttribute("showComposeButton", showComposeButton);
String searchButtonDescription = (request.getAttribute("searchButtonDescription") == null) ? "" : ((String)request.getAttribute("searchButtonDescription"));
request.setAttribute("searchButtonDescription", searchButtonDescription);
Boolean showNewButton = (request.getAttribute("showNewButton") == null) ? new Boolean(true) : ((Boolean)request.getAttribute("showNewButton"));
request.setAttribute("showNewButton", showNewButton);
Boolean showPrintButton = (request.getAttribute("showPrintButton") == null) ? new Boolean(true) : ((Boolean)request.getAttribute("showPrintButton"));
request.setAttribute("showPrintButton", showPrintButton);
// allow the request to change the text on the new button.
String newButtonValue = (request.getAttribute("newButtonValue") == null) ? "New" : (String)request.getAttribute("newButtonValue");
request.setAttribute("newButtonValue", newButtonValue);
int individualId = userObject.getIndividualID();
// Hopefully listType and the name of the Module match up.
String moduleId = (String)request.getAttribute("moduleId");
if (moduleId == null) {
moduleId = "0";
}
request.setAttribute("moduleId", moduleId);
// temporary hack to make advanced only show up in the working modules
if (showAdvancedSearch.booleanValue()) {
try {
ArrayList searchList = AdvancedSearchUtil.getSavedSearchList(individualId, (Integer.valueOf(moduleId)).intValue(), dataSource);
request.setAttribute("searchList", searchList);
} catch (Exception e) {
throw new ServletException(e);
}
}
String listType = (String)request.getAttribute("listType");
request.setAttribute("listType", listType);
if (showCustomViews != null && showCustomViews.booleanValue()) {
ListPreference listPreference = userObject.getListPreference(listType);
if (listPreference != null) {
Vector viewData = globalMasterLists.getViewComboData(listPreference);
int sizeOfViewDataVector = viewData.size();
String viewName = "";
int userDefaultViewID = 0;
if (sizeOfViewDataVector > 0) {
userDefaultViewID = listPreference.getDefaultView();