Search in sources :

Example 56 with RequestMapping

use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.

the class AccountingDataController method confirmExportsDelete.

@RequestMapping("confirmExportsDelete.ftl")
public final ModelAndView confirmExportsDelete() {
    ModelAndView mav = new ModelAndView("confirmExportsDelete");
    List<BreadCrumbsLinks> breadcrumbs = new AdminBreadcrumbBuilder().withLink("accounting.viewaccountingexports", "confirmExportsDelete.ftl").build();
    mav.addObject("breadcrumbs", breadcrumbs);
    return mav;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) BreadCrumbsLinks(org.mifos.ui.core.controller.BreadCrumbsLinks) AdminBreadcrumbBuilder(org.mifos.ui.core.controller.AdminBreadcrumbBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 57 with RequestMapping

use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.

the class AccountingDataController method showAccountingDataFor.

@RequestMapping("renderAccountingData.ftl")
public final ModelAndView showAccountingDataFor(@RequestParam(value = FROM_DATE) String paramFromDate, @RequestParam(value = TO_DATE) String paramToDate) {
    DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd");
    LocalDate fromDate = fmt.parseDateTime(paramFromDate).toLocalDate();
    LocalDate toDate = fmt.parseDateTime(paramToDate).toLocalDate();
    Boolean hasAlreadyRanQuery = Boolean.FALSE;
    String fileName = null;
    List<AccountingDto> accountingData = new ArrayList<AccountingDto>();
    try {
        fileName = accountingService.getExportOutputFileName(fromDate, toDate).replace(".xml", "");
        hasAlreadyRanQuery = accountingService.hasAlreadyRanQuery(fromDate, toDate);
        accountingData = accountingService.getExportDetails(fromDate, toDate);
    } catch (Exception e) {
        LOGGER.error(e.getMessage(), e);
    }
    ModelAndView mav = new ModelAndView("renderAccountingData");
    List<BreadCrumbsLinks> breadcrumbs = new AdminBreadcrumbBuilder().withLink("accounting.viewaccountingexports", "renderAccountingDataCacheInfo.ftl").withLink(fileName, "").build();
    mav.addObject("breadcrumbs", breadcrumbs);
    mav.addObject("accountingData", accountingData);
    mav.addObject("hasAlreadyRanQuery", hasAlreadyRanQuery);
    mav.addObject("fileName", fileName);
    mav.addObject("fromDate", fromDate);
    mav.addObject("toDate", toDate);
    return mav;
}
Also used : ArrayList(java.util.ArrayList) ModelAndView(org.springframework.web.servlet.ModelAndView) BreadCrumbsLinks(org.mifos.ui.core.controller.BreadCrumbsLinks) AccountingDto(org.mifos.platform.accounting.AccountingDto) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) LocalDate(org.joda.time.LocalDate) AdminBreadcrumbBuilder(org.mifos.ui.core.controller.AdminBreadcrumbBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 58 with RequestMapping

use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.

the class AccountingDataController method generateList.

@RequestMapping("generateExportsList.ftl")
public final ModelAndView generateList(@RequestParam(value = LIST_START_DAY) Integer listStartDay, @RequestParam(value = "type") String type) {
    ModelAndView mav = new ModelAndView("generateExportsList");
    List<ExportFileInfo> exports = accountingService.getLastTenExports(listStartDay);
    mav.addObject("exports", exports);
    mav.addObject("size", listStartDay);
    return mav;
}
Also used : ExportFileInfo(org.mifos.platform.accounting.service.ExportFileInfo) ModelAndView(org.springframework.web.servlet.ModelAndView) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 59 with RequestMapping

use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.

the class AccountingDataController method listAllExports.

@RequestMapping("renderAccountingDataCacheInfo.ftl")
public final ModelAndView listAllExports() {
    List<BreadCrumbsLinks> breadcrumbs = new AdminBreadcrumbBuilder().withLink("accounting.viewaccountingexports", "renderAccountingDataCacheInfo.ftl").build();
    ModelAndView mav = new ModelAndView("renderAccountingDataCacheInfo");
    mav.addObject("breadcrumbs", breadcrumbs);
    mav.addObject("numberDaysFromStartOfFinancialTransactions", accountingService.getNumberDaysFromStartOfFinancialTransactions());
    return mav;
}
Also used : BreadCrumbsLinks(org.mifos.ui.core.controller.BreadCrumbsLinks) ModelAndView(org.springframework.web.servlet.ModelAndView) AdminBreadcrumbBuilder(org.mifos.ui.core.controller.AdminBreadcrumbBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 60 with RequestMapping

use of org.springframework.web.bind.annotation.RequestMapping in project head by mifos.

the class QuestionGroupController method getQuestionGroup.

@RequestMapping("/viewQuestionGroupDetail.ftl")
public String getQuestionGroup(ModelMap model, HttpServletRequest httpServletRequest) {
    String questionGroupId = httpServletRequest.getParameter("questionGroupId");
    try {
        if (isInvalidNumber(questionGroupId)) {
            model.addAttribute("error_message_code", QuestionnaireConstants.INVALID_QUESTION_GROUP_ID);
        } else {
            QuestionGroupDetail questionGroupDetail = questionnaireServiceFacade.getQuestionGroupDetail(Integer.valueOf(questionGroupId));
            QuestionGroupForm questionGroupForm = new QuestionGroupForm(questionGroupDetail);
            model.addAttribute("questionGroupDetail", questionGroupForm);
            model.addAttribute("eventSources", getAllQgEventSources());
        }
    } catch (SystemException e) {
        //TODO: move mifosLogManager to common after dependency resolution
        //MifosLogManager.getLogger(LoggerConstants.ROOTLOGGER).error(e.getMessage(), e);
        model.addAttribute("error_message_code", QuestionnaireConstants.QUESTION_GROUP_NOT_FOUND);
    }
    return "viewQuestionGroupDetail";
}
Also used : QuestionGroupDetail(org.mifos.platform.questionnaire.service.QuestionGroupDetail) SystemException(org.mifos.framework.exceptions.SystemException) QuestionGroupForm(org.mifos.platform.questionnaire.ui.model.QuestionGroupForm) 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