use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class ReportsCategoryDeleteController method showEmptyForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("reportCategory")
public ReportCategoryFormBean showEmptyForm(@RequestParam(value = "categoryId", required = true) Integer reportCategoryId) {
ReportCategoryDto reportCategoryDetails = adminServiceFacade.retrieveReportCategory(reportCategoryId);
ReportCategoryFormBean bean = new ReportCategoryFormBean();
bean.setName(reportCategoryDetails.getName());
return bean;
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class ReportsCategoryEditController method showEmptyForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("reportCategory")
public ReportCategoryFormBean showEmptyForm(@RequestParam(value = "categoryId", required = true) Integer reportCategoryId) {
ReportCategoryDto reportCategoryDetails = adminServiceFacade.retrieveReportCategory(reportCategoryId);
ReportCategoryFormBean bean = new ReportCategoryFormBean();
bean.setName(reportCategoryDetails.getName());
return bean;
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class HomePageController method showPopulatedForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("customerSearch")
public ModelAndView showPopulatedForm(HttpServletRequest request, HttpServletResponse response, @ModelAttribute("customerSearch") CustomerSearchFormBean customerSearchFormBean) throws MifosException, PersistenceException {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "home", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
Short userId = (short) user.getUserId();
UserDetailDto userDetails = this.centerServiceFacade.retrieveUsersDetails(userId);
modelAndView.addObject("customerSearch", customerSearchFormBean);
boolean isCenterHierarchyExists = configurationServiceFacade.getBooleanConfig("ClientRules.CenterHierarchyExists");
modelAndView.addObject("isCenterHierarchyExists", isCenterHierarchyExists);
if (sitePreferenceHelper.isMobile(request)) {
List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
modelAndView.addObject("availibleClientGenders", availibleClientGenders);
HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
modelAndView.addObject("availibleCustomerStates", customerStates);
}
if (userDetails.isLoanOfficer()) {
loadLoanOfficerCustomersHierarchyForSelectedDay(userId, modelAndView, customerSearchFormBean);
modelAndView.addObject("isLoanOfficer", true);
} else {
modelAndView.addObject("isLoanOfficer", false);
}
return modelAndView;
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class LoanProductChangeLogController method showAllAuditLogsForSavingsProducts.
@ModelAttribute("auditLog")
@RequestMapping(method = RequestMethod.GET)
public AuditLogScreenDto showAllAuditLogsForSavingsProducts(@RequestParam(value = "productId", required = true) Integer productId) {
LoanProductRequest productDetails = adminServiceFacade.retrieveLoanProductDetails(productId);
List<AuditLogDto> auditLogRecords = adminServiceFacade.retrieveLoanProductAuditLogs(productId);
return new AuditLogScreenDto(productDetails.getProductDetails().getId(), productDetails.getProductDetails().getName(), productDetails.getProductDetails().getCreatedDateFormatted(), auditLogRecords);
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class AcceptedPaymentTypesController method showPopulatedForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("acceptedPaymentTypesBean")
public AcceptedPaymentTypesBean showPopulatedForm() {
AcceptedPaymentTypeDto acceptedPaymentTypeDto = adminServiceFacade.retrieveAcceptedPaymentTypes();
AcceptedPaymentTypesBean paymentTypes = populateAcceptedPaymentTypesBean(acceptedPaymentTypeDto);
return paymentTypes;
}
Aggregations