use of org.mifos.application.servicefacade.CollectionSheetDataViewAssembler in project head by mifos.
the class CollectionSheetEntryAction method preview.
@TransactionDemarcate(joinToken = true)
public ActionForward preview(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
logTrackingInfo("preview", request, form);
request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
final CollectionSheetEntryGridDto previousCollectionSheetEntryDto = retrieveFromRequestCollectionSheetEntryDto(request);
final CollectionSheetDataDto dataView = new CollectionSheetDataViewAssembler().toDto(request, previousCollectionSheetEntryDto);
final CollectionSheetEntryGridDto collectionSheetEntry = collectionSheetServiceFacade.previewCollectionSheetEntry(previousCollectionSheetEntryDto, dataView);
storeOnRequestCollectionSheetEntryDto(request, collectionSheetEntry);
final ActionErrors errors = new ActionErrors();
final ActionErrors errorsFromValidation = new CollectionSheetEntryDtoPostPreviewValidator().validate(collectionSheetEntry.getBulkEntryParent(), errors, getUserContext(request).getPreferredLocale());
if (errorsFromValidation.size() > 0) {
this.addErrors(request, errorsFromValidation);
return mapping.findForward(CollectionSheetEntryConstants.PREVIEWFAILURE);
}
return mapping.findForward(CollectionSheetEntryConstants.PREVIEWSUCCESS);
}
Aggregations