HashMap moduleList = new HashMap();
if (globalMasterLists.get("moduleList") != null)
moduleList = (HashMap)globalMasterLists.get("moduleList");
ListPreference listPreference = userObject.getListPreference("Note");
ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));
ValueListParameters listParameters = null;
ValueListParameters requestListParameters = (ValueListParameters)request.getAttribute("listParameters");
if (requestListParameters == null) { // build up new Parameters
listParameters = new ValueListParameters(ValueListConstants.NOTE_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
} else { // paging or sorting or something, use the parameters from the request.
listParameters = requestListParameters;
}
if (listParameters.getSortColumn() == 0) {
FieldDescriptor sortField = (FieldDescriptor)ValueListConstants.noteViewMap.get(listPreference.getSortElement());
listParameters.setSortColumn(sortField.getQueryIndex());
if (listPreference.getsortOrder())
listParameters.setSortDirection("ASC");
else
listParameters.setSortDirection("DESC");
}
String listScope = request.getParameter("listScope");
if (listScope != null && listScope.equals("all")) {
finalForward = ".view.notes.list.all";
listScope = "all";
} else {
finalForward = ".view.notes.list.my";
listScope = "my";
}
// Search handling
String filter = null;
String filterParameter = request.getParameter("filter");
if (filterParameter != null) {
filter = (String)session.getAttribute("listFilter");
if (listScope.equals("my")) {
filter += " AND Owner = " + individualId;
session.setAttribute("listFilter", filter);
}
request.setAttribute("appliedSearch", filterParameter);
} else {
if (listScope.equals("my"))
filter = "SELECT NoteID FROM note WHERE Owner = " + individualId;
session.removeAttribute("listFilter");
}
listParameters.setFilter(filter);
Vector viewColumns = view.getColumns();
ArrayList columns = new ArrayList();
ActionUtil.mapOldView(columns, viewColumns, ValueListConstants.NOTE_LIST_TYPE);
listParameters.setColumns(columns);
// Get the list!