Search in sources :

Example 16 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class CenterCustAction method chooseOffice.

@TransactionDemarcate(saveToken = true)
public ActionForward chooseOffice(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    OnlyBranchOfficeHierarchyDto officeHierarchy = customerServiceFacade.retrieveBranchOnlyOfficeHierarchy();
    SessionUtils.setAttribute(OnlyBranchOfficeHierarchyDto.IDENTIFIER, officeHierarchy, request);
    SessionUtils.setAttribute(CustomerConstants.URL_MAP, null, request.getSession(false));
    return mapping.findForward(ActionForwards.chooseOffice_success.toString());
}
Also used : OnlyBranchOfficeHierarchyDto(org.mifos.dto.screen.OnlyBranchOfficeHierarchyDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 17 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class ChkListAction method create.

@TransactionDemarcate(validateAndResetToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ChkListActionForm chkListActionForm = (ChkListActionForm) form;
    Short stateId = getShortValue(chkListActionForm.getStateId());
    String checklistName = chkListActionForm.getChecklistName();
    List<String> checklistDetails = chkListActionForm.getValidCheckListDetails();
    if (chkListActionForm.getIsCustomer()) {
        Short levelId = getShortValue(chkListActionForm.getMasterTypeId());
        this.checkListServiceFacade.createCustomerChecklist(levelId, stateId, checklistName, checklistDetails);
    } else {
        Short productId = getShortValue(chkListActionForm.getMasterTypeId());
        this.checkListServiceFacade.createAccountChecklist(productId, stateId, checklistName, checklistDetails);
    }
    return mapping.findForward(ActionForwards.create_success.toString());
}
Also used : ChkListActionForm(org.mifos.customers.checklist.struts.actionforms.ChkListActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 18 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class ChkListAction method managePreview.

@TransactionDemarcate(joinToken = true)
public ActionForward managePreview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ChkListActionForm chkListActionForm = (ChkListActionForm) form;
    List<String> details = chkListActionForm.getValidCheckListDetails();
    SessionUtils.setCollectionAttribute(CheckListConstants.DETAILS, details, request);
    return mapping.findForward(ActionForwards.managepreview_success.toString());
}
Also used : ChkListActionForm(org.mifos.customers.checklist.struts.actionforms.ChkListActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 19 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class ChkListAction method update.

@CloseSession
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ChkListActionForm chkListActionForm = (ChkListActionForm) form;
    Short stateId = getShortValue(chkListActionForm.getStateId());
    String checklistName = chkListActionForm.getChecklistName();
    Short checklistStatus = getShortValue(chkListActionForm.getChecklistStatus());
    List<String> details = chkListActionForm.getValidCheckListDetails();
    if (chkListActionForm.getIsCustomer()) {
        CustomerCheckListBO customerCheckList = (CustomerCheckListBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
        Short levelId = getShortValue(chkListActionForm.getMasterTypeId());
        this.checkListServiceFacade.updateCustomerChecklist(customerCheckList.getChecklistId(), levelId, stateId, checklistStatus, checklistName, details);
    } else {
        AccountCheckListBO accountCheckList = (AccountCheckListBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
        Short productId = getShortValue(chkListActionForm.getMasterTypeId());
        this.checkListServiceFacade.updateAccountChecklist(accountCheckList.getChecklistId(), productId, stateId, checklistStatus, checklistName, details);
    }
    return mapping.findForward(ActionForwards.update_success.toString());
}
Also used : CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) ChkListActionForm(org.mifos.customers.checklist.struts.actionforms.ChkListActionForm) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 20 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate in project head by mifos.

the class ChkListAction method preview.

@TransactionDemarcate(joinToken = true)
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ChkListActionForm chkListActionForm = (ChkListActionForm) form;
    List<String> details = chkListActionForm.getValidCheckListDetails();
    SessionUtils.setCollectionAttribute(CheckListConstants.DETAILS, details, request);
    Short masterTypeId = getShortValue(chkListActionForm.getMasterTypeId());
    Short stateId = getShortValue(chkListActionForm.getStateId());
    boolean isCustomer = chkListActionForm.getIsCustomer();
    this.checkListServiceFacade.validateIsValidCheckListState(masterTypeId, stateId, isCustomer);
    return mapping.findForward(ActionForwards.preview_success.toString());
}
Also used : ChkListActionForm(org.mifos.customers.checklist.struts.actionforms.ChkListActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)259 UserContext (org.mifos.security.util.UserContext)72 ArrayList (java.util.ArrayList)41 CloseSession (org.mifos.framework.util.helpers.CloseSession)35 LoanBO (org.mifos.accounts.loan.business.LoanBO)26 ClientCustActionForm (org.mifos.customers.client.struts.actionforms.ClientCustActionForm)21 CustomerBO (org.mifos.customers.business.CustomerBO)20 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)19 AccountBO (org.mifos.accounts.business.AccountBO)18 ApplicationException (org.mifos.framework.exceptions.ApplicationException)17 ActionErrors (org.apache.struts.action.ActionErrors)14 LocalDate (org.joda.time.LocalDate)14 AccountApplyPaymentActionForm (org.mifos.accounts.struts.actionforms.AccountApplyPaymentActionForm)14 ClientBO (org.mifos.customers.client.business.ClientBO)14 CustomFieldDto (org.mifos.dto.domain.CustomFieldDto)13 List (java.util.List)12 AccountPaymentEntity (org.mifos.accounts.business.AccountPaymentEntity)12 CustomFieldDefinitionEntity (org.mifos.application.master.business.CustomFieldDefinitionEntity)12 MeetingBO (org.mifos.application.meeting.business.MeetingBO)12 ActionForward (org.apache.struts.action.ActionForward)11