Search in sources :

Example 6 with ChkListActionForm

use of org.mifos.customers.checklist.struts.actionforms.ChkListActionForm in project head by mifos.

the class ChkListAction method getEditStates.

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

Example 7 with ChkListActionForm

use of org.mifos.customers.checklist.struts.actionforms.ChkListActionForm in project head by mifos.

the class ChkListAction method get.

@TransactionDemarcate(saveToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ChkListActionForm chkListActionForm = (ChkListActionForm) form;
    Short localeId = getUserContext(request).getLocaleId();
    Short checklistId = getShortValue(chkListActionForm.getCheckListId());
    CheckListBO checkList = new CheckListPersistence().getCheckList(checklistId);
    if (checkList.getCheckListType().equals(CheckListType.CUSTOMER_CHECKLIST)) {
        CustomerCheckListBO customerCheckList = (CustomerCheckListBO) checkList;
        SessionUtils.setAttribute(Constants.BUSINESS_KEY, customerCheckList, request);
        SessionUtils.setAttribute(CheckListConstants.TYPE, CheckListType.CUSTOMER_CHECKLIST.getValue(), request);
    } else {
        AccountCheckListBO accountCheckList = (AccountCheckListBO) checkList;
        SessionUtils.setAttribute(Constants.BUSINESS_KEY, accountCheckList, request);
        SessionUtils.setAttribute(CheckListConstants.TYPE, CheckListType.ACCOUNT_CHECKLIST.getValue(), request);
    }
    SessionUtils.setAttribute(CheckListConstants.CREATED_BY_NAME, new PersonnelBusinessService().getPersonnel(checkList.getCreatedBy()).getDisplayName(), request);
    return mapping.findForward(ActionForwards.get_success.toString());
}
Also used : CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) PersonnelBusinessService(org.mifos.customers.personnel.business.service.PersonnelBusinessService) ChkListActionForm(org.mifos.customers.checklist.struts.actionforms.ChkListActionForm) CheckListPersistence(org.mifos.customers.checklist.persistence.CheckListPersistence) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) CheckListBO(org.mifos.customers.checklist.business.CheckListBO) CustomerCheckListBO(org.mifos.customers.checklist.business.CustomerCheckListBO) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 8 with ChkListActionForm

use of org.mifos.customers.checklist.struts.actionforms.ChkListActionForm in project head by mifos.

the class ChkListAction method getStates.

@TransactionDemarcate(joinToken = true)
public ActionForward getStates(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ChkListActionForm chkListActionForm = (ChkListActionForm) form;
    List<String> details = chkListActionForm.getValidCheckListDetails();
    List<CheckListStatesView> states = retrieveStates(chkListActionForm.getIsCustomer(), chkListActionForm.getMasterTypeId());
    deleteExistingStates(states, chkListActionForm.getIsCustomer(), chkListActionForm.getMasterTypeId(), (short) -1);
    SessionUtils.setCollectionAttribute(CheckListConstants.STATES, states, request);
    SessionUtils.setCollectionAttribute(CheckListConstants.DETAILS, details, request);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : CheckListStatesView(org.mifos.dto.screen.CheckListStatesView) ChkListActionForm(org.mifos.customers.checklist.struts.actionforms.ChkListActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 9 with ChkListActionForm

use of org.mifos.customers.checklist.struts.actionforms.ChkListActionForm in project head by mifos.

the class ChkListAction method previous.

@TransactionDemarcate(joinToken = true)
public ActionForward previous(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.getSession());
    return mapping.findForward(ActionForwards.previous_success.toString());
}
Also used : ChkListActionForm(org.mifos.customers.checklist.struts.actionforms.ChkListActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

ChkListActionForm (org.mifos.customers.checklist.struts.actionforms.ChkListActionForm)9 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)9 AccountCheckListBO (org.mifos.customers.checklist.business.AccountCheckListBO)3 CustomerCheckListBO (org.mifos.customers.checklist.business.CustomerCheckListBO)3 CheckListStatesView (org.mifos.dto.screen.CheckListStatesView)3 CheckListBO (org.mifos.customers.checklist.business.CheckListBO)2 CheckListPersistence (org.mifos.customers.checklist.persistence.CheckListPersistence)2 ArrayList (java.util.ArrayList)1 CheckListDetailEntity (org.mifos.customers.checklist.business.CheckListDetailEntity)1 PersonnelBusinessService (org.mifos.customers.personnel.business.service.PersonnelBusinessService)1 CheckListMasterDto (org.mifos.dto.domain.CheckListMasterDto)1 CloseSession (org.mifos.framework.util.helpers.CloseSession)1