Search in sources :

Example 11 with ActionMessage

use of org.apache.struts.action.ActionMessage in project head by mifos.

the class EditStatusActionForm method validatePaymentDate.

public ActionErrors validatePaymentDate(String transactionDate, String fieldName) {
    ActionErrors errors = null;
    if (transactionDate != null && !transactionDate.equals("")) {
        try {
            if (lastPaymentDate != null && dateFallsBeforeDate(getDateAsSentFromBrowser(transactionDate), lastPaymentDate)) {
                errors = new ActionErrors();
                errors.add(AccountConstants.ERROR_PAYMENT_DATE_BEFORE_LAST_PAYMENT, new ActionMessage(AccountConstants.ERROR_PAYMENT_DATE_BEFORE_LAST_PAYMENT, fieldName));
            }
        } catch (InvalidDateException ide) {
            errors = new ActionErrors();
            errors.add(AccountConstants.ERROR_INVALIDDATE, new ActionMessage(AccountConstants.ERROR_INVALIDDATE, fieldName));
        }
    }
    return errors;
}
Also used : InvalidDateException(org.mifos.application.admin.servicefacade.InvalidDateException) ActionMessage(org.apache.struts.action.ActionMessage) ActionErrors(org.apache.struts.action.ActionErrors)

Example 12 with ActionMessage

use of org.apache.struts.action.ActionMessage in project head by mifos.

the class BirtReportsUploadAction method isReportInfoNotEdit.

private boolean isReportInfoNotEdit(HttpServletRequest request, BirtReportsUploadActionForm form, ReportsBO report) {
    if (isReportItsSelf(form, report)) {
        if (form.getIsActive().equals(report.getIsActive().toString()) && StringUtils.isBlank(form.getFile().getFileName())) {
            ActionErrors errors = new ActionErrors();
            errors.add(ReportsConstants.ERROR_REPORTINFONOTEDIT, new ActionMessage(ReportsConstants.ERROR_REPORTINFONOTEDIT));
            request.setAttribute(Globals.ERROR_KEY, errors);
            return true;
        }
    }
    return false;
}
Also used : ActionMessage(org.apache.struts.action.ActionMessage) ActionErrors(org.apache.struts.action.ActionErrors)

Example 13 with ActionMessage

use of org.apache.struts.action.ActionMessage in project head by mifos.

the class ReportsCategoryAction method isValidToDelete.

private boolean isValidToDelete(HttpServletRequest request, ReportsCategoryBO reportsCategoryBO) {
    if (!reportsCategoryBO.getReportsSet().isEmpty()) {
        ActionErrors errors = new ActionErrors();
        errors.add(ReportsConstants.ERROR_CATEGORYHASREPORTS, new ActionMessage(ReportsConstants.ERROR_CATEGORYHASREPORTS));
        request.setAttribute(Globals.ERROR_KEY, errors);
        return false;
    }
    return true;
}
Also used : ActionMessage(org.apache.struts.action.ActionMessage) ActionErrors(org.apache.struts.action.ActionErrors)

Example 14 with ActionMessage

use of org.apache.struts.action.ActionMessage in project head by mifos.

the class ReportsCategoryAction method isReportCategoryNameAlreadyExist.

private boolean isReportCategoryNameAlreadyExist(HttpServletRequest request, String inputCategoryName) {
    for (ReportsCategoryBO category : new ReportsPersistence().getAllReportCategories()) {
        if (category.getReportCategoryName().equals(inputCategoryName)) {
            ActionErrors errors = new ActionErrors();
            errors.add(ReportsConstants.ERROR_CATEGORYNAMEALREADYEXIST, new ActionMessage(ReportsConstants.ERROR_CATEGORYNAMEALREADYEXIST));
            request.setAttribute(Globals.ERROR_KEY, errors);
            return true;
        }
    }
    return false;
}
Also used : ReportsPersistence(org.mifos.reports.persistence.ReportsPersistence) ReportsCategoryBO(org.mifos.reports.business.ReportsCategoryBO) ActionMessage(org.apache.struts.action.ActionMessage) ActionErrors(org.apache.struts.action.ActionErrors)

Example 15 with ActionMessage

use of org.apache.struts.action.ActionMessage in project head by mifos.

the class ReportsCategoryAction method isReportCategoryNameNotEdit.

private boolean isReportCategoryNameNotEdit(HttpServletRequest request, String inputCategoryName, ReportsCategoryBO reportCategory) {
    if (inputCategoryName.equals(reportCategory.getReportCategoryName())) {
        ActionErrors errors = new ActionErrors();
        errors.add(ReportsConstants.ERROR_CATEGORYNAMENOTEDIT, new ActionMessage(ReportsConstants.ERROR_CATEGORYNAMENOTEDIT));
        request.setAttribute(Globals.ERROR_KEY, errors);
        return true;
    }
    return false;
}
Also used : ActionMessage(org.apache.struts.action.ActionMessage) ActionErrors(org.apache.struts.action.ActionErrors)

Aggregations

ActionMessage (org.apache.struts.action.ActionMessage)166 ActionErrors (org.apache.struts.action.ActionErrors)70 ActionMessages (org.apache.struts.action.ActionMessages)45 ResourceBundle (java.util.ResourceBundle)29 JspException (javax.servlet.jsp.JspException)22 InvalidDateException (org.mifos.application.admin.servicefacade.InvalidDateException)22 Iterator (java.util.Iterator)21 Locale (java.util.Locale)19 List (java.util.List)9 ActionForward (org.apache.struts.action.ActionForward)9 AbstractContest (cn.edu.zju.acm.onlinejudge.bean.AbstractContest)8 ArrayList (java.util.ArrayList)8 Problem (cn.edu.zju.acm.onlinejudge.bean.Problem)7 DoubleConversionResult (org.mifos.framework.util.helpers.DoubleConversionResult)7 UserProfile (cn.edu.zju.acm.onlinejudge.bean.UserProfile)6 IOException (java.io.IOException)6 Date (java.sql.Date)6 PageExpiredException (org.mifos.framework.exceptions.PageExpiredException)6 ApplicationException (org.mifos.framework.exceptions.ApplicationException)5 UserPersistence (cn.edu.zju.acm.onlinejudge.persistence.UserPersistence)4