Search in sources :

Example 91 with RequestMapping

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;
}
Also used : PenaltyDto(org.mifos.dto.domain.PenaltyDto) ModelAndView(org.springframework.web.servlet.ModelAndView) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 92 with RequestMapping

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;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 93 with RequestMapping

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;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 94 with RequestMapping

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;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) IncludePage(freemarker.ext.servlet.IncludePage) SavingsAccountDetailDto(org.mifos.dto.domain.SavingsAccountDetailDto) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 95 with RequestMapping

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;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) IncludePage(freemarker.ext.servlet.IncludePage) SavingsRecentActivityDto(org.mifos.dto.screen.SavingsRecentActivityDto) SavingsAccountDetailDto(org.mifos.dto.domain.SavingsAccountDetailDto) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1964 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)459 ModelAndView (org.springframework.web.servlet.ModelAndView)413 ApiOperation (io.swagger.annotations.ApiOperation)305 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)234 ArrayList (java.util.ArrayList)197 HashMap (java.util.HashMap)155 WebMessageException (org.hisp.dhis.dxf2.webmessage.WebMessageException)124 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)124 IOException (java.io.IOException)97 ResponseEntity (org.springframework.http.ResponseEntity)92 Date (java.util.Date)83 Aggregation (org.springframework.data.mongodb.core.aggregation.Aggregation)80 DBObject (com.mongodb.DBObject)71 BasicDBObject (com.mongodb.BasicDBObject)67 InputStream (java.io.InputStream)66 Aggregation.newAggregation (org.springframework.data.mongodb.core.aggregation.Aggregation.newAggregation)64 HttpServletResponse (javax.servlet.http.HttpServletResponse)59 User (org.hisp.dhis.user.User)59 List (java.util.List)53