Search in sources :

Example 1 with ActionForwards

use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.

the class MultipleLoanAccountsCreationAction 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.load_success;
    String method = (String) request.getAttribute("methodCalled");
    if (method != null) {
        if (method.equals(Methods.getPrdOfferings.toString()) || method.equals(Methods.load.toString()) || method.equals(Methods.get.toString())) {
            actionForward = ActionForwards.load_success;
        } else if (method.equals(Methods.create.toString())) {
            actionForward = ActionForwards.get_success;
        }
    }
    return mapping.findForward(actionForward.toString());
}
Also used : ActionForwards(org.mifos.application.util.helpers.ActionForwards) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with ActionForwards

use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.

the class GroupCustAction method hierarchyCheck.

@TransactionDemarcate(saveToken = true)
public ActionForward hierarchyCheck(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ActionForwards actionForward = null;
    CenterHierarchySearchDto centerHierarchySearchDto = this.groupServiceFacade.isCenterHierarchyConfigured();
    if (centerHierarchySearchDto.isCenterHierarchyExists()) {
        SessionUtils.setAttribute(GroupConstants.CENTER_SEARCH_INPUT, centerHierarchySearchDto.getSearchInputs(), request.getSession());
        actionForward = ActionForwards.loadCenterSearch;
    } else {
        actionForward = ActionForwards.loadCreateGroup;
    }
    SessionUtils.setAttribute(CustomerConstants.URL_MAP, null, request.getSession(false));
    SessionUtils.setAttribute(GroupConstants.PREVIEW_CREATE_NEW_GROUP_FAILURE, false, request);
    return mapping.findForward(actionForward.toString());
}
Also used : ActionForwards(org.mifos.application.util.helpers.ActionForwards) CenterHierarchySearchDto(org.mifos.dto.screen.CenterHierarchySearchDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 3 with ActionForwards

use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.

the class LookupOptionsAction 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.addEditLookupOption_failure;
    String method = (String) request.getAttribute("method");
    if (method != null) {
        if (method.equals(Methods.load.toString())) {
            actionForward = ActionForwards.load_failure;
        } else if (method.equals(Methods.update.toString())) {
            String entity = request.getParameter(ConfigurationConstants.ENTITY);
            setLookupType(entity, request);
            actionForward = ActionForwards.update_failure;
        }
    }
    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 4 with ActionForwards

use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.

the class CenterCustAction method cancel.

@TransactionDemarcate(validateAndResetToken = true)
public ActionForward cancel(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) {
    CenterCustActionForm actionForm = (CenterCustActionForm) form;
    ActionForwards forward = null;
    if (actionForm.getInput().equals(Methods.create.toString())) {
        forward = ActionForwards.cancel_success;
    } else if (actionForm.getInput().equals(Methods.manage.toString())) {
        forward = ActionForwards.editcancel_success;
    }
    return mapping.findForward(forward.toString());
}
Also used : CenterCustActionForm(org.mifos.customers.center.struts.actionforms.CenterCustActionForm) ActionForwards(org.mifos.application.util.helpers.ActionForwards) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 5 with ActionForwards

use of org.mifos.application.util.helpers.ActionForwards in project head by mifos.

the class MeetingAction method update.

@TransactionDemarcate(validateAndResetToken = true)
@CloseSession
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    MeetingActionForm actionForm = (MeetingActionForm) form;
    MeetingBO meeting = createMeeting(actionForm);
    CustomerBO customerInSession = (CustomerBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    MeetingDto meetingDto = null;
    if (meeting != null) {
        meetingDto = meeting.toDto();
    }
    meetingServiceFacade.updateCustomerMeeting(meetingDto, customerInSession.getCustomerId());
    ActionForwards forward = forwardForUpdate(actionForm.getCustomerLevelValue());
    return mapping.findForward(forward.toString());
}
Also used : ActionForwards(org.mifos.application.util.helpers.ActionForwards) MeetingBO(org.mifos.application.meeting.business.MeetingBO) CustomerBO(org.mifos.customers.business.CustomerBO) MeetingActionForm(org.mifos.application.meeting.struts.actionforms.MeetingActionForm) MeetingDto(org.mifos.dto.domain.MeetingDto) CloseSession(org.mifos.framework.util.helpers.CloseSession) 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