use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class EditPenaltyController method showForm.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView showForm(@RequestParam Integer penaltyId) {
ModelAndView modelAndView = new ModelAndView("editPenalty");
PenaltyDto dto = this.penaltyServiceFacade.getPenalty(penaltyId);
parametersDto = this.penaltyServiceFacade.getPenaltyParameters();
configurationDto = this.configurationServiceFacade.getAccountingConfiguration();
PenaltyFormBean bean = new PenaltyFormBean(dto);
modelAndView.addObject("formBean", bean);
modelAndView.addObject("param", parametersDto);
modelAndView.addObject("GLCodeMode", configurationDto.getGlCodeMode());
return modelAndView;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class EditProductCategoryController method processFormSubmit.
@edu.umd.cs.findbugs.annotations.SuppressWarnings
@RequestMapping(method = RequestMethod.POST)
public ModelAndView processFormSubmit(@RequestParam(value = CANCEL_PARAM, required = false) String cancel, @ModelAttribute("formBean") @Valid ProductCategoryFormBean formBean, BindingResult result) {
ModelAndView modelAndView = new ModelAndView();
if (StringUtils.isNotBlank(cancel)) {
modelAndView.setViewName(REDIRECT_TO_ADMIN_SCREEN);
} else if (result.hasErrors()) {
modelAndView.setViewName("editCategoryInformation");
modelAndView.addObject("formBean", formBean);
} else {
modelAndView.setViewName("categoryPreview");
modelAndView.addObject("formBean", formBean);
}
modelAndView.addObject("breadcrumbs", new AdminBreadcrumbBuilder().withLink("admin.viewproductcategories", "viewProductCategories.ftl").withLink(formBean.getProductCategoryName(), "").build());
return modelAndView;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class EditSavingsProductsFormController method processFormSubmit.
@RequestMapping(method = RequestMethod.POST)
public ModelAndView processFormSubmit(@RequestParam(value = CANCEL_PARAM, required = false) String cancel, @ModelAttribute("savingsProduct") @Valid SavingsProductFormBean savingsProductFormBean, BindingResult result, SessionStatus status) {
ModelAndView modelAndView = new ModelAndView("redirect:/previewSavingsProducts.ftl?editFormview=editSavingsProduct");
configurationDto = this.configurationServiceFacade.getAccountingConfiguration();
modelAndView.addObject("GLCodeMode", configurationDto.getGlCodeMode());
if (StringUtils.isNotBlank(cancel)) {
modelAndView.setViewName(REDIRECT_TO_ADMIN_SCREEN);
status.setComplete();
} else if (result.hasErrors()) {
new SavingsProductValidator().validateGroup(savingsProductFormBean, result);
modelAndView.setViewName("editSavingsProduct");
} else {
new SavingsProductValidator().validateGroup(savingsProductFormBean, result);
if (result.hasErrors()) {
modelAndView.setViewName("editSavingsProduct");
}
}
return modelAndView;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class SavingsAccountController method showSavingsAccountDetails.
@RequestMapping(value = "/viewSavingsAccountDetails", method = RequestMethod.GET)
public ModelAndView showSavingsAccountDetails(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewSavingsAccountDetails", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
SavingsAccountDetailDto savingsAccountDetailDto = savingsServiceFacade.retrieveSavingsAccountDetails(globalAccountNum);
modelAndView.addObject("savingsAccountDetailDto", savingsAccountDetailDto);
boolean containsQGForCloseSavings = false;
containsQGForCloseSavings = questionnaireServiceFacade.getQuestionGroupInstances(savingsAccountDetailDto.getAccountId(), "Close", "Savings").size() > 0;
modelAndView.addObject("containsQGForCloseSavings", containsQGForCloseSavings);
modelAndView.addObject("backPageUrl", UrlHelper.constructCurrentPageUrl(request));
savingsServiceFacade.putSavingsBusinessKeyInSession(globalAccountNum, request);
// for mifostabletag
request.getSession().setAttribute("recentActivityForDetailPage", savingsAccountDetailDto.getRecentActivity());
return modelAndView;
}
use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.
the class SavingsAccountController method showSavingsAccountRecentActivity.
@RequestMapping(value = "/viewSavingsAccountRecentActivity", method = RequestMethod.GET)
public ModelAndView showSavingsAccountRecentActivity(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewSavingsAccountRecentActivity", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
SavingsAccountDetailDto savingsAccountDetailDto = savingsServiceFacade.retrieveSavingsAccountDetails(globalAccountNum);
modelAndView.addObject("savingsAccountDetailDto", savingsAccountDetailDto);
modelAndView.addObject("currentDate", new Date());
List<SavingsRecentActivityDto> recentActivity = this.savingsServiceFacade.retrieveRecentSavingsActivities(savingsAccountDetailDto.getAccountId().longValue());
request.setAttribute("recentActivityList", recentActivity);
savingsServiceFacade.putSavingsBusinessKeyInSession(globalAccountNum, request);
return modelAndView;
}
Aggregations