use of freemarker.ext.servlet.IncludePage 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 freemarker.ext.servlet.IncludePage 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;
}
use of freemarker.ext.servlet.IncludePage 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 freemarker.ext.servlet.IncludePage in project head by mifos.
the class ViewLoanAccountDetailsController method showLoanAccountDetails.
@RequestMapping(value = "/viewLoanAccountDetails", method = RequestMethod.GET)
public ModelAndView showLoanAccountDetails(HttpServletRequest request, HttpServletResponse response) throws ApplicationException {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountDetails", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
modelAndView.addObject("loanInformationDto", loanInformationDto);
boolean containsQGForCloseLoan = questionnaireServiceFacade.getQuestionGroupInstances(loanInformationDto.getAccountId(), "Close", "Loan").size() > 0;
modelAndView.addObject("containsQGForCloseLoan", containsQGForCloseLoan);
// for mifostabletag
List<LoanActivityDto> activities = loanInformationDto.getRecentAccountActivity();
for (LoanActivityDto activity : activities) {
activity.setUserPrefferedDate(DateFormatUtils.format(activity.getActionDate(), "dd/MM/yyyy", personnelServiceFacade.getUserPreferredLocale()));
}
request.getSession().setAttribute("recentAccountActivities", loanInformationDto.getRecentAccountActivity());
request.getSession().setAttribute("guarantyInformation", loanAccountServiceFacade.handleGuaranties(loanInformationDto));
//for GLIM
if (configurationServiceFacade.isGlimEnabled() && loanInformationDto.isGroup()) {
List<LoanAccountDetailsDto> loanAccountsDetails = loanAccountServiceFacade.retrieveLoanAccountDetails(loanInformationDto);
addEmptyBuisnessActivities(loanAccountsDetails);
modelAndView.addObject("loanAccountDetailsView");
request.setAttribute("loanAccountDetailsView", loanAccountsDetails);
}
modelAndView.addObject("backPageUrl", UrlHelper.constructCurrentPageUrl(request));
request.getSession().setAttribute("backPageUrl", request.getAttribute("currentPageUrl"));
loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
return modelAndView;
}
use of freemarker.ext.servlet.IncludePage in project head by mifos.
the class ViewLoanAccountDetailsController method showLoanAccountAllActivity.
@RequestMapping(value = "/viewLoanAccountAllActivity", method = RequestMethod.GET)
public ModelAndView showLoanAccountAllActivity(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountAllActivity", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
modelAndView.addObject("loanInformationDto", loanInformationDto);
modelAndView.addObject("currentDate", new Date());
List<LoanActivityDto> allLoanAccountActivities = this.loanAccountServiceFacade.retrieveAllLoanAccountActivities(globalAccountNum);
request.setAttribute("loanAllActivityView", allLoanAccountActivities);
this.loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
return modelAndView;
}
Aggregations