use of org.mifos.framework.business.LogUtils in project head by mifos.
the class BaseAction method preExecute.
protected void preExecute(ActionForm actionForm, HttpServletRequest request, TransactionDemarcate annotation) throws SystemException, ApplicationException {
if (null != request.getParameter(Constants.CURRENTFLOWKEY)) {
request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
}
preHandleTransaction(request, annotation);
UserContext userContext = (UserContext) request.getSession().getAttribute(Constants.USER_CONTEXT_KEY);
Locale locale = getLocale(userContext);
if (!skipActionFormToBusinessObjectConversion(request.getParameter("method"))) {
try {
AbstractBusinessObject businessObject = getBusinessObjectFromSession(request);
ConversionUtil.populateBusinessObject(actionForm, businessObject, locale);
} catch (ValueObjectConversionException e) {
logger.debug("Value object conversion exception while validating BusinessObject: " + new LogUtils().getStackTrace(e));
}
}
}
use of org.mifos.framework.business.LogUtils in project head by mifos.
the class BatchjobsController method processFormSubmit.
// for default AccessDeniedException feedback
@SuppressWarnings("PMD.AvoidRethrowingException")
@RequestMapping(method = RequestMethod.POST)
public ModelAndView processFormSubmit(HttpServletRequest request, @RequestParam(value = SUSPEND_PARAM, required = false) String suspend, @RequestParam(value = RUN_PARAM, required = false) String run, SessionStatus status) throws AccessDeniedException {
List<String> errorMessages = new ArrayList<String>();
if (StringUtils.isNotBlank(suspend)) {
ServletContext context = request.getSession().getServletContext();
String[] doSuspend = request.getParameterValues("SUSPEND");
if (doSuspend != null) {
try {
batchjobsServiceFacade.suspend(context, doSuspend[0]);
} catch (AccessDeniedException e) {
throw e;
} catch (Exception e) {
errorMessages.add("Could not change Scheduler status. " + new LogUtils().getStackTrace(e));
}
}
} else if (StringUtils.isNotBlank(run)) {
rawJobList = request.getParameterValues("ONDEMAND");
if (rawJobList == null) {
rawJobList = new String[0];
} else {
ServletContext context = request.getSession().getServletContext();
try {
batchjobsServiceFacade.runSelectedTasks(context, rawJobList);
} catch (AccessDeniedException e) {
throw e;
} catch (Exception e) {
errorMessages.add("Could not run selected Tasks. " + new LogUtils().getStackTrace(e));
}
}
}
status.setComplete();
return produceModelAndView(request, errorMessages);
}
Aggregations