use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class AccountingDataController method generateList.
@RequestMapping("generateExportsList.ftl")
public final ModelAndView generateList(@RequestParam(value = LIST_START_DAY) Integer listStartDay, @RequestParam(value = "type") String type) {
ModelAndView mav = new ModelAndView("generateExportsList");
List<ExportFileInfo> exports = accountingService.getLastTenExports(listStartDay);
mav.addObject("exports", exports);
mav.addObject("size", listStartDay);
return mav;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class AccountingDataController method listAllExports.
@RequestMapping("renderAccountingDataCacheInfo.ftl")
public final ModelAndView listAllExports() {
List<BreadCrumbsLinks> breadcrumbs = new AdminBreadcrumbBuilder().withLink("accounting.viewaccountingexports", "renderAccountingDataCacheInfo.ftl").build();
ModelAndView mav = new ModelAndView("renderAccountingDataCacheInfo");
mav.addObject("breadcrumbs", breadcrumbs);
mav.addObject("numberDaysFromStartOfFinancialTransactions", accountingService.getNumberDaysFromStartOfFinancialTransactions());
return mav;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class QuestionGroupController method getQuestionGroup.
@RequestMapping("/viewQuestionGroupDetail.ftl")
public String getQuestionGroup(ModelMap model, HttpServletRequest httpServletRequest) {
String questionGroupId = httpServletRequest.getParameter("questionGroupId");
try {
if (isInvalidNumber(questionGroupId)) {
model.addAttribute("error_message_code", QuestionnaireConstants.INVALID_QUESTION_GROUP_ID);
} else {
QuestionGroupDetail questionGroupDetail = questionnaireServiceFacade.getQuestionGroupDetail(Integer.valueOf(questionGroupId));
QuestionGroupForm questionGroupForm = new QuestionGroupForm(questionGroupDetail);
model.addAttribute("questionGroupDetail", questionGroupForm);
model.addAttribute("eventSources", getAllQgEventSources());
}
} catch (SystemException e) {
//TODO: move mifosLogManager to common after dependency resolution
//MifosLogManager.getLogger(LoggerConstants.ROOTLOGGER).error(e.getMessage(), e);
model.addAttribute("error_message_code", QuestionnaireConstants.QUESTION_GROUP_NOT_FOUND);
}
return "viewQuestionGroupDetail";
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class CenterRESTController method getCenterChargesByNumber.
@RequestMapping(value = "center/num-{globalCustNum}/charges", method = RequestMethod.GET)
@ResponseBody
public CustomerChargesDetailsDto getCenterChargesByNumber(@PathVariable String globalCustNum) {
CenterBO centerBO = customerDao.findCenterBySystemId(globalCustNum);
CustomerChargesDetailsDto centerCharges = centerServiceFacade.retrieveChargesDetails(centerBO.getCustomerId());
centerCharges.addActivities(centerServiceFacade.retrieveRecentActivities(centerBO.getCustomerId(), 3));
return centerCharges;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class CollectionSheetRESTController method saveCollectionSheet.
@RequestMapping(value = "/collectionsheet/save", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> saveCollectionSheet(@RequestBody JSONSaveCollectionsheet request) throws Throwable {
Map<String, Object> map = new HashMap<String, Object>();
ObjectMapper om = createObjectMapper();
List<InvalidSaveCollectionSheetReason> reasons = new ArrayList<InvalidSaveCollectionSheetReason>();
CollectionSheetErrorsDto errors = null;
SaveCollectionSheetDto saveCollectionSheetDto = null;
try {
saveCollectionSheetDto = om.readValue(request.getJson(), SaveCollectionSheetDto.class);
} catch (JsonMappingException e) {
if (e.getCause() instanceof SaveCollectionSheetException) {
reasons.addAll(((SaveCollectionSheetException) e.getCause()).getInvalidSaveCollectionSheetReasons());
} else {
throw e.getCause();
}
}
if (saveCollectionSheetDto != null) {
try {
errors = collectionSheetServiceFacade.saveCollectionSheet(saveCollectionSheetDto);
map.put("errors", errors != null ? errors.getErrorText() : null);
} catch (MifosRuntimeException e) {
map.put("errors", e.getMessage());
}
}
map.put("invalidCollectionSheet", reasons);
return map;
}
Aggregations