public ActionForward search( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ReportTrackingLookupForm lookupForm = (ReportTrackingLookupForm) form; Lookupable kualiLookupable = lookupForm.getLookupable(); if (kualiLookupable == null) { LOG.error("Lookupable is null."); throw new RuntimeException("Lookupable is null."); } // validate search parameters kualiLookupable.validateSearchParameters(lookupForm.getFields()); if (lookupForm.isViewRawResults()) { return super.search(mapping, lookupForm, request, response); } else { LookupUtils.preProcessRangeFields(lookupForm.getFields()); List<ReportTracking> groupedResults = getReportTrackingDao() .getResultsGroupedBy( lookupForm.getFields(), lookupForm.getGroupedByFields(), lookupForm.getGroupedByDisplayFields()); lookupForm.setGroupedByResults(groupedResults); return mapping.findForward(Constants.MAPPING_BASIC); } }
public ActionForward moveGroupByColumns( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ReportTrackingLookupForm lookupForm = (ReportTrackingLookupForm) form; String fieldName = lookupForm.getMoveField(); Integer newIndex = lookupForm.getNewColumnIndex() - 1; Integer oldIndex = lookupForm.getGroupedByDisplayFields().indexOf(fieldName); if (newIndex >= 0 && oldIndex >= 0) { lookupForm.getGroupedByDisplayFields().remove(fieldName); if (newIndex > oldIndex) { newIndex--; } lookupForm.getGroupedByDisplayFields().add(newIndex, fieldName); String origItem = lookupForm.getGroupedByFields().get(oldIndex); lookupForm.getGroupedByFields().remove(origItem); lookupForm.getGroupedByFields().add(newIndex, origItem); } return mapping.findForward(Constants.MAPPING_BASIC); }
public ActionForward getDetails( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ReportTrackingLookupForm lookupForm = (ReportTrackingLookupForm) form; LookupUtils.preProcessRangeFields(lookupForm.getFields()); Map<String, String> allFields = new HashMap<String, String>(lookupForm.getFields()); populateAggregateValues( lookupForm.getGroupedByResults().get(lookupForm.getGroupByResultIndex()), allFields, lookupForm.getGroupedByFields()); List<ReportTracking> detailResults = getReportTrackingDao().getDetailResults(allFields, lookupForm.getDetailFields()); lookupForm.setDetailResults(detailResults); return mapping.findForward("ajaxDetails"); }