use of org.mifos.application.admin.servicefacade.BatchjobsSchedulerDto in project head by mifos.
the class BatchjobsServiceFacadeWebTier method getBatchjobsScheduler.
@Override
public BatchjobsSchedulerDto getBatchjobsScheduler(ServletContext context) throws SchedulerException {
MifosScheduler mifosScheduler = (MifosScheduler) context.getAttribute(MifosScheduler.class.getName());
Scheduler scheduler = mifosScheduler.getScheduler();
BatchjobsSchedulerDto batchjobsScheduler = new BatchjobsSchedulerDto(!scheduler.isInStandbyMode());
return batchjobsScheduler;
}
use of org.mifos.application.admin.servicefacade.BatchjobsSchedulerDto in project head by mifos.
the class BatchjobsController method produceModelAndView.
private ModelAndView produceModelAndView(HttpServletRequest request, List<String> errorMessages) {
ServletContext context = request.getSession().getServletContext();
List<BatchjobsDto> batchjobs;
BatchjobsSchedulerDto batchjobsScheduler;
try {
batchjobs = batchjobsServiceFacade.getBatchjobs(context);
} catch (Exception tse) {
errorMessages.add("Error when retrieving batch jobs information: " + tse.getMessage());
batchjobs = new ArrayList<BatchjobsDto>();
}
try {
batchjobsScheduler = batchjobsServiceFacade.getBatchjobsScheduler(context);
} catch (Exception tse) {
errorMessages.add("Error when retrieving batch jobs information: " + tse.getMessage());
batchjobsScheduler = new BatchjobsSchedulerDto(false);
}
Map<String, Object> model = new HashMap<String, Object>();
model.put("request", request);
model.put("batchjobs", batchjobs);
if (batchjobsScheduler == null) {
model.put("scheduler", "");
} else {
model.put("scheduler", batchjobsScheduler.isStatus());
}
model.put("date0", new Date(0));
model.put("executedTasks", rawJobList);
if (rawJobList.length > 0) {
rawJobList = new String[0];
}
Map<String, Object> status = new HashMap<String, Object>();
status.put("errorMessages", errorMessages);
ModelAndView modelAndView = new ModelAndView("batchjobs", "model", model);
modelAndView.addObject("status", status);
return modelAndView;
}
Aggregations