use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class BulkEntryActionForm method validate.
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
logger.debug("BulkEntryActionForm.validate");
request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
ActionErrors errors = new ActionErrors();
if (request.getParameter(CollectionSheetEntryConstants.METHOD).equalsIgnoreCase(CollectionSheetEntryConstants.GETMETHOD)) {
java.sql.Date meetingDate = null;
try {
Object lastMeetingDate = SessionUtils.getAttribute("LastMeetingDate", request);
if (lastMeetingDate != null) {
meetingDate = new java.sql.Date(((java.util.Date) lastMeetingDate).getTime());
}
short isCenterHierarchyExists = (Short) SessionUtils.getAttribute(CollectionSheetEntryConstants.ISCENTERHIERARCHYEXISTS, request);
return mandatoryCheck(meetingDate, getUserContext(request), isCenterHierarchyExists);
} catch (PageExpiredException e) {
errors.add(ExceptionConstants.PAGEEXPIREDEXCEPTION, new ActionMessage(ExceptionConstants.PAGEEXPIREDEXCEPTION));
}
}
return errors;
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class BulkEntryTag method doStartTag.
@SuppressWarnings("unchecked")
@Override
public int doStartTag() throws JspException {
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
JspWriter out = pageContext.getOut();
StringBuilder builder = new StringBuilder();
CollectionSheetEntryGridDto bulkEntry = null;
try {
bulkEntry = (CollectionSheetEntryGridDto) SessionUtils.getAttribute(CollectionSheetEntryConstants.BULKENTRY, request);
} catch (PageExpiredException e) {
logger.error("Page expired getting BulkEntryBO.");
}
if (null != bulkEntry) {
List<ProductDto> loanProducts = bulkEntry.getLoanProducts();
List<ProductDto> savingsProducts = bulkEntry.getSavingProducts();
try {
final List<CustomValueListElementDto> custAttTypes = (List<CustomValueListElementDto>) SessionUtils.getAttribute(CollectionSheetEntryConstants.CUSTOMERATTENDANCETYPES, request);
String method = request.getParameter(CollectionSheetEntryConstants.METHOD);
generateTagData(bulkEntry, loanProducts, savingsProducts, custAttTypes, method, builder);
} catch (ApplicationException ae) {
throw new JspException(ae);
} catch (SystemException se) {
throw new JspException(se);
}
}
try {
out.write(builder.toString());
} catch (IOException ioe) {
throw new JspException(ioe);
}
return SKIP_BODY;
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class LoanPrdActionForm method setSelectedFeesPenaltiesAndFundsAndValidateForFrequency.
private void setSelectedFeesPenaltiesAndFundsAndValidateForFrequency(HttpServletRequest request, ActionErrors errors) {
logger.debug("start setSelectedFeesPenaltiesAndFundsAndValidateForFrequency method " + "of Loan Product Action form method :");
request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
List<FeeDto> feeDtos = new ArrayList<FeeDto>();
try {
if (getPrdOfferinFees() != null && getPrdOfferinFees().length > 0) {
List<FeeBO> fees = getAllLoanPrdFee(request);
for (String selectedFee : getPrdOfferinFees()) {
FeeBO fee = getFeeFromList(fees, selectedFee);
if (fee != null) {
isFrequencyMatchingOfferingFrequency(fee, errors);
if (AccountingRules.isMultiCurrencyEnabled()) {
isValidForCurrency(fee, errors, request);
}
feeDtos.add(getFeeDto(request, fee));
}
}
}
setSelectedFeeDtoOnSession(request, feeDtos);
} catch (PageExpiredException e) {
}
List<FundBO> selectedFunds = new ArrayList<FundBO>();
try {
if (getLoanOfferingFunds() != null && getLoanOfferingFunds().length > 0) {
List<FundBO> funds = (List<FundBO>) SessionUtils.getAttribute(ProductDefinitionConstants.SRCFUNDSLIST, request);
for (String selectedFund : getLoanOfferingFunds()) {
FundBO fund = getFundFromList(funds, selectedFund);
if (fund != null) {
selectedFunds.add(fund);
}
}
}
SessionUtils.setCollectionAttribute(ProductDefinitionConstants.LOANPRDFUNDSELECTEDLIST, selectedFunds, request);
} catch (PageExpiredException e) {
}
List<PenaltyDto> selectedPenalties = new ArrayList<PenaltyDto>();
try {
if (getPrdOfferinPenalties() != null && getPrdOfferinPenalties().length > 0) {
List<PenaltyBO> penalties = getAllLoanPrdPenalty(request);
for (String selectedPenalty : getPrdOfferinPenalties()) {
PenaltyBO penalty = getPenaltyFromList(penalties, selectedPenalty);
if (penalty != null) {
selectedPenalties.add(penalty.toDto());
}
}
}
setSelectedPenaltyDtoOnSession(request, selectedPenalties);
} catch (PageExpiredException e) {
}
logger.debug("setSelectedFeesPenaltiesAndFundsAndValidateForFrequency method " + "of Loan Product Action form method called :");
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class LoanPrdActionForm method validateStartDateForEditPreview.
private void validateStartDateForEditPreview(HttpServletRequest request, ActionErrors errors) {
logger.debug("start validateStartDateForEditPreview method of Loan Product Action form method :" + startDate);
request.setAttribute(Constants.CURRENTFLOWKEY, request.getParameter(Constants.CURRENTFLOWKEY));
java.util.Date oldStartDate = null;
Date changedStartDate = null;
try {
oldStartDate = (java.util.Date) SessionUtils.getAttribute(ProductDefinitionConstants.LOANPRDSTARTDATE, request);
} catch (PageExpiredException e) {
}
try {
changedStartDate = getStartDateValue(getUserContext(request).getPreferredLocale());
} catch (InvalidDateException ide) {
addError(errors, "startdate", ProductDefinitionConstants.STARTDATEUPDATEEXCEPTION);
}
if (oldStartDate != null && changedStartDate != null) {
if (LoanOfferingBO.isBackDatedLoanProductCreationAllowed() && DateUtils.getDateWithoutTimeStamp(oldStartDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(changedStartDate.getTime())) != 0) {
addError(errors, "startDate", ProductDefinitionConstants.STARTDATEUPDATEEXCEPTION);
} else if (!LoanOfferingBO.isBackDatedLoanProductCreationAllowed() && DateUtils.getDateWithoutTimeStamp(oldStartDate.getTime()).compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) <= 0 && (DateUtils.getDateWithoutTimeStamp(oldStartDate.getTime()).compareTo(DateUtils.getDateWithoutTimeStamp(changedStartDate.getTime())) != 0)) {
addError(errors, "startDate", ProductDefinitionConstants.STARTDATEUPDATEEXCEPTION);
}
} else if (changedStartDate != null && DateUtils.getDateWithoutTimeStamp(changedStartDate.getTime()).compareTo(DateUtils.getCurrentDateWithoutTimeStamp()) > 0) {
validateStartDate(request, errors);
}
logger.debug("validateStartDateForEditPreview method of Loan Product Action form method called :" + startDate + "---" + oldStartDate);
}
use of org.mifos.framework.exceptions.PageExpiredException in project head by mifos.
the class LoanAccountActionForm method validateRedoLoanPayments.
private void validateRedoLoanPayments(HttpServletRequest request, ActionErrors errors, MifosCurrency currency) {
Locale locale = getUserContext(request).getPreferredLocale();
try {
CustomerBO customer = getCustomer(request);
List<PaymentDataHtmlBean> validPaymentBeans = getValidatablePaymentBeans();
for (PaymentDataHtmlBean bean : validPaymentBeans) {
validatePaymentDataHtmlBean(errors, currency, locale, customer, bean);
}
validatePaymentDatesOrdering(validPaymentBeans, errors);
validateMaxPayableAmount(request, errors);
} catch (InvalidDateException invalidDate) {
errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATE, new ActionMessage(LoanExceptionConstants.INVALIDTRANSACTIONDATE));
} catch (FrameworkRuntimeException invalidDate) {
errors.add(LoanExceptionConstants.INVALIDTRANSACTIONDATE, new ActionMessage(LoanExceptionConstants.INVALIDTRANSACTIONDATE));
} catch (MeetingException e) {
errors.add(ExceptionConstants.FRAMEWORKRUNTIMEEXCEPTION, new ActionMessage(ExceptionConstants.FRAMEWORKRUNTIMEEXCEPTION));
} catch (PageExpiredException e) {
errors.add(ExceptionConstants.PAGEEXPIREDEXCEPTION, new ActionMessage(ExceptionConstants.PAGEEXPIREDEXCEPTION));
} catch (PersistenceException e) {
errors.add(ExceptionConstants.FRAMEWORKRUNTIMEEXCEPTION, new ActionMessage(ExceptionConstants.FRAMEWORKRUNTIMEEXCEPTION));
}
}
Aggregations