Search in sources :

Example 6 with ActionForwards

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());
}
Also used : LoanAccountActionForm(org.mifos.accounts.loan.struts.actionforms.LoanAccountActionForm) ActionForwards(org.mifos.application.util.helpers.ActionForwards) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 7 with ActionForwards

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());
}
Also used : ActionForwards(org.mifos.application.util.helpers.ActionForwards) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 8 with ActionForwards

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());
}
Also used : ActionForwards(org.mifos.application.util.helpers.ActionForwards) GroupCustActionForm(org.mifos.customers.group.struts.actionforms.GroupCustActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 9 with ActionForwards

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());
}
Also used : CustomerAccountActionForm(org.mifos.customers.struts.actionforms.CustomerAccountActionForm) CustomerAccountBO(org.mifos.customers.business.CustomerAccountBO) ActionForwards(org.mifos.application.util.helpers.ActionForwards) CustomerBO(org.mifos.customers.business.CustomerBO) CustomerRecentActivityDto(org.mifos.dto.screen.CustomerRecentActivityDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 10 with ActionForwards

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());
}
Also used : ActionForwards(org.mifos.application.util.helpers.ActionForwards) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

ActionForwards (org.mifos.application.util.helpers.ActionForwards)10 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)10 CustomerBO (org.mifos.customers.business.CustomerBO)2 LoanAccountActionForm (org.mifos.accounts.loan.struts.actionforms.LoanAccountActionForm)1 MeetingBO (org.mifos.application.meeting.business.MeetingBO)1 MeetingActionForm (org.mifos.application.meeting.struts.actionforms.MeetingActionForm)1 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)1 CenterCustActionForm (org.mifos.customers.center.struts.actionforms.CenterCustActionForm)1 GroupCustActionForm (org.mifos.customers.group.struts.actionforms.GroupCustActionForm)1 CustomerAccountActionForm (org.mifos.customers.struts.actionforms.CustomerAccountActionForm)1 MeetingDto (org.mifos.dto.domain.MeetingDto)1 CenterHierarchySearchDto (org.mifos.dto.screen.CenterHierarchySearchDto)1 CustomerRecentActivityDto (org.mifos.dto.screen.CustomerRecentActivityDto)1 CloseSession (org.mifos.framework.util.helpers.CloseSession)1