use of org.mifos.reports.struts.actionforms.ReportsCategoryActionForm in project head by mifos.
the class ReportsCategoryAction method preview.
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In ReportsCategoryAction:preview Method: ");
ReportsCategoryActionForm defineCategoryForm = (ReportsCategoryActionForm) form;
String categoryName = defineCategoryForm.getCategoryName();
request.setAttribute("categoryName", categoryName);
for (ReportsCategoryBO category : new ReportsPersistence().getAllReportCategories()) {
if (categoryName.equals(category.getReportCategoryName())) {
ActionErrors errors = new ActionErrors();
errors.add(ReportsConstants.ERROR_CATEGORYNAMEALREADYEXIST, new ActionMessage(ReportsConstants.ERROR_CATEGORYNAMEALREADYEXIST));
request.setAttribute(Globals.ERROR_KEY, errors);
return mapping.findForward(ActionForwards.preview_failure.toString());
}
}
return mapping.findForward(ActionForwards.preview_success.toString());
}
use of org.mifos.reports.struts.actionforms.ReportsCategoryActionForm in project head by mifos.
the class ReportsCategoryAction method edit.
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In ReportsCategoryAction:edit Method: ");
ReportsCategoryActionForm reportsCategoryActionForm = (ReportsCategoryActionForm) form;
String reportCategoryId = request.getParameter("categoryId");
ReportsCategoryBO reportCategory = new ReportsPersistence().getReportCategoryByCategoryId(Short.valueOf(reportCategoryId));
reportsCategoryActionForm.setCategoryName(reportCategory.getReportCategoryName());
return mapping.findForward(ActionForwards.edit_success.toString());
}
Aggregations