use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.
the class LoanAccountAction method validate.
@TransactionDemarcate(joinToken = true)
public ActionForward validate(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response) throws Exception {
LoanAccountActionForm loanAccountForm = (LoanAccountActionForm) form;
String perspective = loanAccountForm.getPerspective();
if (perspective != null) {
setPerspective(request, perspective);
}
ActionForwards actionForward = null;
String method = (String) request.getAttribute(METHODCALLED);
if (method.equals(Methods.getPrdOfferings.toString())) {
actionForward = ActionForwards.getPrdOfferigs_failure;
} else if (method.equals(Methods.load.toString())) {
actionForward = ActionForwards.getPrdOfferigs_success;
} else if (method.equals(Methods.schedulePreview.toString())) {
actionForward = ActionForwards.load_success;
} else if (method.equals(Methods.managePreview.toString())) {
actionForward = ActionForwards.managepreview_failure;
} else if (method.equals(Methods.preview.toString())) {
actionForward = ActionForwards.preview_failure;
}
return mapping.findForward(actionForward.toString());
}
use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.
the class ReverseLoanDisbursalAction method validate.
@TransactionDemarcate(joinToken = true)
public ActionForward validate(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("Inside validate method");
ActionForwards actionForward = ActionForwards.search_success;
String method = (String) request.getAttribute("methodCalled");
if (method != null) {
if (method.equals(Methods.search.toString()) || method.equals(Methods.load.toString())) {
actionForward = ActionForwards.search_success;
} else if (method.equals(Methods.preview.toString())) {
actionForward = ActionForwards.load_success;
} else if (method.equals(Methods.update.toString())) {
actionForward = ActionForwards.preview_success;
}
}
logger.debug("outside validate method");
return mapping.findForward(actionForward.toString());
}
use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.
the class GroupCustAction method cancel.
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward cancel(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ActionForwards forward = null;
GroupCustActionForm actionForm = (GroupCustActionForm) form;
String fromPage = actionForm.getInput();
if (fromPage.equals(GroupConstants.MANAGE_GROUP) || fromPage.equals(GroupConstants.PREVIEW_MANAGE_GROUP)) {
forward = ActionForwards.cancelEdit_success;
} else if (fromPage.equals(GroupConstants.CREATE_GROUP)) {
forward = ActionForwards.cancelCreate_success;
}
return mapping.findForward(forward.toString());
}
use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.
the class CustomerAccountAction method load.
@TransactionDemarcate(saveToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
String globalCustNum = ((CustomerAccountActionForm) form).getGlobalCustNum();
if (StringUtils.isBlank(globalCustNum)) {
// NOTE: see CustomerAction.getAllActivity for explanation of this craziness
globalCustNum = (String) SessionUtils.getAttribute("customerGlobalNum", request.getSession());
}
CustomerBO customerBO = this.customerDao.findCustomerBySystemId(globalCustNum);
CustomerAccountBO customerAccount = customerBO.getCustomerAccount();
SessionUtils.setAttribute(Constants.BUSINESS_KEY, customerAccount, request);
List<CustomerRecentActivityDto> recentActivities = this.centerServiceFacade.retrieveRecentActivities(customerBO.getCustomerId(), 3);
SessionUtils.setCollectionAttribute(CustomerConstants.RECENT_ACTIVITIES, recentActivities, request);
ActionForwards forward = getForward(customerBO);
return mapping.findForward(forward.toString());
}
use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.
the class RolesPermissionsAction method validate.
@TransactionDemarcate(joinToken = true)
public ActionForward validate(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ActionForwards actionForward = ActionForwards.viewRoles_success;
String method = (String) request.getAttribute("methodCalled");
if (method != null) {
if (Methods.update.toString().equals(method)) {
actionForward = ActionForwards.manage_success;
} else if (Methods.create.toString().equals(method)) {
actionForward = ActionForwards.load_success;
} else {
actionForward = ActionForwards.valueOf(method + "_success");
}
}
return mapping.findForward(actionForward.toString());
}
Aggregations