HttpServletResponse response) throws Exception {
MetricsControlForm controlForm = (MetricsControlForm) form;
HttpSession session = request.getSession();
WebUser user = SessionUtils.getWebUser(session);
MeasurementPreferences preferences = user.getMeasurementPreferences();
// See if this is part of a workflow
if (mapping instanceof BaseActionMapping) {
BaseActionMapping smap = (BaseActionMapping) mapping;
String workflow = smap.getWorkflow();
if (workflow != null) {
SessionUtils.pushWorkflow(session, mapping, workflow);
}
}
Map forwardParams = controlForm.getForwardParams();
if (controlForm.isEditRangeClicked()) {
return returnEditRange(request, mapping, forwardParams);
} else if (controlForm.isAdvancedClicked()) {
return returnEditRange(request, mapping, forwardParams);
} else if (controlForm.isRangeClicked()) {
Integer lastN = controlForm.getRn();
Integer unit = controlForm.getRu();
MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();
rangePreferences.lastN = lastN;
rangePreferences.unit = unit;
rangePreferences.readOnly = false;
preferences.setMetricRangePreferences(rangePreferences);
} else if (controlForm.isSimpleClicked()) {
MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();
rangePreferences.readOnly = false;
preferences.setMetricRangePreferences(rangePreferences);
}
// assume the return path has been set- don't use forwardParams
return returnSuccess(request, mapping);
}