use of org.apache.struts.action.ActionMessage in project head by mifos.
the class ViewGlTransactionsActionForm method toTrxnDateValidate.
private ActionErrors toTrxnDateValidate(ActionErrors errors, Locale locale) {
if (StringUtils.isNotBlank(getToTrxnDate()) && !DateUtils.isValidDate(getToTrxnDate())) {
ResourceBundle resources = ResourceBundle.getBundle(FilePaths.SIMPLE_ACCOUNTING_RESOURCE, locale);
String trxnDate = resources.getString(SimpleAccountingConstants.TO_TRXNDATE);
errors.add(SimpleAccountingConstants.INVALID_TRXN_DATE, new ActionMessage(SimpleAccountingConstants.INVALID_TRXN_DATE, trxnDate));
}
return errors;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class ViewStageTransactionActionForm method trxnDateValidate.
private ActionErrors trxnDateValidate(ActionErrors errors, Locale locale) {
if (StringUtils.isNotBlank(getStageTrxnDate()) && !DateUtils.isValidDate(getStageTrxnDate())) {
ResourceBundle resources = ResourceBundle.getBundle(FilePaths.SIMPLE_ACCOUNTING_RESOURCE, locale);
String trxnDate = resources.getString(SimpleAccountingConstants.TRXNDATE);
errors.add(SimpleAccountingConstants.INVALID_TRXN_DATE, new ActionMessage(SimpleAccountingConstants.INVALID_TRXN_DATE, trxnDate));
}
return errors;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class InterOfficeTransferActionForm method trxnDateValidate.
private ActionErrors trxnDateValidate(ActionErrors errors, Locale locale) {
if (StringUtils.isNotBlank(getTrxnDate()) && !DateUtils.isValidDate(getTrxnDate())) {
ResourceBundle resources = ResourceBundle.getBundle(FilePaths.SIMPLE_ACCOUNTING_RESOURCE, locale);
String trxnDate = resources.getString(SimpleAccountingConstants.TRXNDATE);
errors.add(SimpleAccountingConstants.INVALID_TRXN_DATE, new ActionMessage(SimpleAccountingConstants.INVALID_TRXN_DATE, trxnDate));
}
return errors;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class GroupTransferActionForm method validate.
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
String method = request.getParameter(Methods.method.toString());
if (method.equals(Methods.removeGroupMemberShip.toString())) {
errors.add(super.validate(mapping, request));
if (StringUtils.isBlank(getAssignedLoanOfficerId())) {
if (isActive == Constants.YES) {
errors.add(GroupConstants.ASSIGNED_LOAN_OFFICER_REQUIRED, new ActionMessage(GroupConstants.ASSIGNED_LOAN_OFFICER_REQUIRED));
}
}
}
if (!method.equals(Methods.validate.toString())) {
request.setAttribute(GroupConstants.METHODCALLED, method);
}
return errors;
}
use of org.apache.struts.action.ActionMessage in project head by mifos.
the class CustomerActionForm method validateForDuplicatePeriodicFee.
@SuppressWarnings("unchecked")
protected void validateForDuplicatePeriodicFee(HttpServletRequest request, ActionErrors errors) throws ApplicationException {
List<ApplicableAccountFeeDto> additionalFeeList = (List<ApplicableAccountFeeDto>) SessionUtils.getAttribute(CustomerConstants.ADDITIONAL_FEES_LIST, request);
if (additionalFeeList == null) {
additionalFeeList = new ArrayList<ApplicableAccountFeeDto>();
}
Set<Integer> additionalFeeIds = new HashSet<Integer>();
for (ApplicableAccountFeeDto additionalFee : additionalFeeList) {
additionalFeeIds.add(additionalFee.getFeeId());
}
Set<Integer> periodicFeeIds = new HashSet<Integer>();
for (ApplicableAccountFeeDto additionalFee : getAdditionalFees()) {
if (additionalFeeIds.contains(additionalFee.getFeeId())) {
ApplicableAccountFeeDto originalFee = find(additionalFeeList, additionalFee);
if (originalFee.isPeriodic()) {
boolean added = periodicFeeIds.add(additionalFee.getFeeId());
if (!added) {
errors.add(CustomerConstants.FEE, new ActionMessage(CustomerConstants.ERRORS_DUPLICATE_PERIODIC_FEE));
break;
}
}
}
}
}
Aggregations