Search in sources :

Example 51 with ModelAndView

use of org.springframework.web.servlet.ModelAndView in project head by mifos.

the class DashboardDetailsController method showActiveGroups.

@RequestMapping(value = "/viewActiveGroupsDBDetails", method = RequestMethod.GET)
public ModelAndView showActiveGroups(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView modelAndView = getCustomerModelAndView();
    List<DashboardDetailDto> loans = (List<DashboardDetailDto>) dashboardServiceFacade.getActiveGroups(0, 10, null);
    modelAndView.addObject("totalSize", dashboardServiceFacade.countOfActiveGroups());
    modelAndView.addObject("dashboardDetails", loans);
    modelAndView.addObject("ajaxUrl", "activeGroupsDBDetailsAjax.ftl");
    return modelAndView;
}
Also used : DashboardDetailDto(org.mifos.dto.domain.DashboardDetailDto) ModelAndView(org.springframework.web.servlet.ModelAndView) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 52 with ModelAndView

use of org.springframework.web.servlet.ModelAndView in project head by mifos.

the class DashboardDetailsController method getAjaxCustomerModelAndView.

private ModelAndView getAjaxCustomerModelAndView(String sEcho, Integer iDisplayStart, Integer iDisplayLength) {
    ModelAndView modelAndView = getCustomerModelAndView();
    modelAndView.setViewName("viewDashboardDetailsAjax");
    modelAndView.setViewName("viewDashboardDetailsAjax");
    if (sEcho != null) {
        modelAndView.addObject("sEcho", sEcho);
    }
    modelAndView.addObject("iDisplayStart", iDisplayStart);
    modelAndView.addObject("iDisplayLength", iDisplayLength);
    modelAndView.addObject("iLength", iDisplayLength);
    return modelAndView;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView)

Example 53 with ModelAndView

use of org.springframework.web.servlet.ModelAndView in project head by mifos.

the class DashboardDetailsController method showTotalBorowers.

@RequestMapping(value = "/viewTotalBorrowersDBDetails", method = RequestMethod.GET)
public ModelAndView showTotalBorowers(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView modelAndView = getCustomerModelAndView();
    List<DashboardDetailDto> loans = (List<DashboardDetailDto>) dashboardServiceFacade.getBorrowers(0, 10, null);
    modelAndView.addObject("totalSize", dashboardServiceFacade.countBorrowers());
    modelAndView.addObject("dashboardDetails", loans);
    modelAndView.addObject("ajaxUrl", "totalBorrowersDBDetailsAjax.ftl");
    return modelAndView;
}
Also used : DashboardDetailDto(org.mifos.dto.domain.DashboardDetailDto) ModelAndView(org.springframework.web.servlet.ModelAndView) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 54 with ModelAndView

use of org.springframework.web.servlet.ModelAndView in project head by mifos.

the class DashboardDetailsController method getActiveClientsAjax.

@RequestMapping(value = "/activeClientsDBDetailsAjax", method = RequestMethod.GET)
public ModelAndView getActiveClientsAjax(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false) String sEcho, @RequestParam Integer iDisplayStart, @RequestParam Integer iDisplayLength, @RequestParam Integer iSortCol_0, @RequestParam String sSortDir_0) {
    ModelAndView modelAndView = getAjaxCustomerModelAndView(sEcho, iDisplayStart, iDisplayLength);
    modelAndView.addObject("dashboardDetails", dashboardServiceFacade.getActiveClients(iDisplayStart, iDisplayLength, getCustomerOrdering(iSortCol_0, sSortDir_0)));
    modelAndView.addObject("totalSize", dashboardServiceFacade.countOfActiveClients());
    return modelAndView;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 55 with ModelAndView

use of org.springframework.web.servlet.ModelAndView in project head by mifos.

the class DashboardDetailsController method getActiveCentersAjax.

@RequestMapping(value = "/activeCentersDBDetailsAjax", method = RequestMethod.GET)
public ModelAndView getActiveCentersAjax(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false) String sEcho, @RequestParam Integer iDisplayStart, @RequestParam Integer iDisplayLength, @RequestParam Integer iSortCol_0, @RequestParam String sSortDir_0) {
    ModelAndView modelAndView = getAjaxCustomerModelAndView(sEcho, iDisplayStart, iDisplayLength);
    modelAndView.addObject("dashboardDetails", dashboardServiceFacade.getActiveCenters(iDisplayStart, iDisplayLength, getCustomerOrdering(iSortCol_0, sSortDir_0)));
    modelAndView.addObject("totalSize", dashboardServiceFacade.countOfActiveCenters());
    return modelAndView;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ModelAndView (org.springframework.web.servlet.ModelAndView)1576 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)669 Test (org.junit.jupiter.api.Test)195 Test (org.junit.Test)188 HashMap (java.util.HashMap)166 ArrayList (java.util.ArrayList)140 RedirectView (org.springframework.web.servlet.view.RedirectView)90 Map (java.util.Map)85 List (java.util.List)69 IOException (java.io.IOException)62 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)60 Date (java.util.Date)57 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)50 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)49 MockHttpServletResponse (org.springframework.web.testfixture.servlet.MockHttpServletResponse)49 MockHttpServletRequest (org.springframework.web.testfixture.servlet.MockHttpServletRequest)47 GetMapping (org.springframework.web.bind.annotation.GetMapping)45 HandlerMethod (org.springframework.web.method.HandlerMethod)45 IPerson (org.apereo.portal.security.IPerson)43 ExceptionHandler (org.springframework.web.bind.annotation.ExceptionHandler)35