Search in sources :

Example 26 with ModelAttribute

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

the class EditProductMixController method showEditForm.

@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("formBean")
public ProductMixFormBean showEditForm(@RequestParam(value = "productId", required = true) Integer productId) {
    List<ProductTypeDto> productTypes = this.adminServiceFacade.retrieveProductTypesApplicableToProductMix();
    ProductMixFormBean formBean = productMixAssembler.createFormBean(productTypes);
    formBean.setProductId(productId.toString());
    formBean.setProductTypeId("1");
    ProductMixDetailsDto productMixDetails = adminServiceFacade.retrieveProductMixDetails(productId.shortValue(), formBean.getProductTypeId());
    Map<String, String> productNameOptions = new LinkedHashMap<String, String>();
    productNameOptions.put(productMixDetails.getPrdOfferingId().toString(), productMixDetails.getPrdOfferingName());
    formBean.setProductNameOptions(productNameOptions);
    populateAllowedNotAllowedOptions(formBean, productMixDetails);
    return formBean;
}
Also used : ProductTypeDto(org.mifos.dto.domain.ProductTypeDto) ProductMixDetailsDto(org.mifos.dto.screen.ProductMixDetailsDto) LinkedHashMap(java.util.LinkedHashMap) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 27 with ModelAttribute

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

the class LatenessDormancyController method showPopulatedForm.

@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("formBean")
public LatenessDormancyFormBean showPopulatedForm() {
    ProductConfigurationDto productConfiguration = adminServiceFacade.retrieveProductConfiguration();
    LatenessDormancyFormBean formBean = new LatenessDormancyFormBean();
    formBean.setLatenessDays(productConfiguration.getLatenessDays());
    formBean.setDormancyDays(productConfiguration.getDormancyDays());
    return formBean;
}
Also used : ProductConfigurationDto(org.mifos.dto.screen.ProductConfigurationDto) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 28 with ModelAttribute

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

the class SavingsProductChangeLogController method showAllAuditLogsForSavingsProducts.

@ModelAttribute("auditLog")
@RequestMapping(method = RequestMethod.GET)
public AuditLogScreenDto showAllAuditLogsForSavingsProducts(@RequestParam(value = "productId", required = true) Integer productId) {
    SavingsProductDto productDetails = adminServiceFacade.retrieveSavingsProductDetails(productId);
    List<AuditLogDto> auditLogRecords = adminServiceFacade.retrieveSavingsProductAuditLogs(productId);
    return new AuditLogScreenDto(productDetails.getProductDetails().getId(), productDetails.getProductDetails().getName(), productDetails.getProductDetails().getCreatedDateFormatted(), auditLogRecords);
}
Also used : SavingsProductDto(org.mifos.dto.domain.SavingsProductDto) AuditLogScreenDto(org.mifos.dto.screen.AuditLogScreenDto) AuditLogDto(org.mifos.dto.domain.AuditLogDto) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 29 with ModelAttribute

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

the class DeleteCoaController method showForm.

@ModelAttribute("formBean")
@RequestMapping(method = RequestMethod.GET)
public CoaFormBean showForm(@RequestParam(value = "id", required = true) Short id) {
    CoaDto coaDto = coaServiceFacade.getCoaDTO(id);
    CoaFormBean formBean = new CoaFormBean();
    formBean.setCoaName(coaDto.getAccountName());
    formBean.setGlCode(coaDto.getGlCodeString());
    formBean.setAccountId(id);
    return formBean;
}
Also used : CoaDto(org.mifos.application.admin.servicefacade.CoaDto) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 30 with ModelAttribute

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

the class MonthClosingController method showPopulatedForm.

@ModelAttribute("monthClosingFormBean")
public MonthClosingFormBean showPopulatedForm() {
    MonthClosingFormBean formBean = new MonthClosingFormBean();
    Date monthClosingDateToSet = monthClosingServiceFacade.getMonthClosingDate();
    if (monthClosingDateToSet == null) {
        monthClosingDateToSet = new DateTime().toDate();
    }
    formBean.setDate(new DateTime(monthClosingDateToSet));
    formBean.setLocale(Locale.getDefault());
    return formBean;
}
Also used : Date(java.util.Date) DateTime(org.joda.time.DateTime) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute)

Aggregations

ModelAttribute (org.springframework.web.bind.annotation.ModelAttribute)35 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)15 ArrayList (java.util.ArrayList)3 LinkedHashMap (java.util.LinkedHashMap)3 Locale (java.util.Locale)3 DBObject (com.mongodb.DBObject)2 ApiOperation (io.swagger.annotations.ApiOperation)2 Method (java.lang.reflect.Method)2 BigDecimal (java.math.BigDecimal)2 List (java.util.List)2 Valid (javax.validation.Valid)2 MongoConstants (org.devgateway.ocds.persistence.mongo.constants.MongoConstants)2 YearFilterPagingRequest (org.devgateway.ocds.web.rest.controller.request.YearFilterPagingRequest)2 LoanProductRequest (org.mifos.dto.domain.LoanProductRequest)2 ReportCategoryDto (org.mifos.dto.domain.ReportCategoryDto)2 LoanProductFormDto (org.mifos.dto.screen.LoanProductFormDto)2 InvocableHandlerMethod (org.springframework.web.method.support.InvocableHandlerMethod)2 JsonProperty (com.fasterxml.jackson.annotation.JsonProperty)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 BasicDBObject (com.mongodb.BasicDBObject)1