Search in sources :

Example 31 with TransactionDemarcate

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

the class MeetingAction method load.

@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    MeetingActionForm form1 = (MeetingActionForm) form;
    MeetingBO meeting = (MeetingBO) SessionUtils.getAttribute(CustomerConstants.CUSTOMER_MEETING, request);
    clearActionForm(form1);
    if (meeting != null) {
        setValuesInActionForm(form1, meeting);
    }
    List<WeekDay> workingDays = getLocalizedWorkingDays();
    SessionUtils.setCollectionAttribute(MeetingConstants.WEEKDAYSLIST, workingDays, request);
    SessionUtils.setCollectionAttribute(MeetingConstants.WEEKRANKLIST, RankOfDay.getRankOfDayList(), request);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : WeekDay(org.mifos.application.meeting.util.helpers.WeekDay) MeetingBO(org.mifos.application.meeting.business.MeetingBO) MeetingActionForm(org.mifos.application.meeting.struts.actionforms.MeetingActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 32 with TransactionDemarcate

use of org.mifos.framework.util.helpers.TransactionDemarcate 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)

Example 33 with TransactionDemarcate

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

the class BirtAdminDocumentUploadAction method preview.

@TransactionDemarcate(joinToken = true)
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    BirtAdminDocumentUploadActionForm uploadForm = (BirtAdminDocumentUploadActionForm) form;
    if (uploadForm.getAccountTypeId().equals(ProductType.LOAN.getValue().toString())) {
        uploadForm.setAccountTypeName("LOAN");
    } else if (uploadForm.getAccountTypeId().equals(ProductType.SAVINGS.getValue().toString())) {
        uploadForm.setAccountTypeName("SAVINGS");
    } else {
        uploadForm.setAccountTypeName("TRANSACTIONS PAYMENTS");
    }
    updateSelectedStatus(request, uploadForm);
    return mapping.findForward(ActionForwards.preview_success.toString());
}
Also used : BirtAdminDocumentUploadActionForm(org.mifos.reports.admindocuments.struts.actionforms.BirtAdminDocumentUploadActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 34 with TransactionDemarcate

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

the class LoginAction method cancel.

@TransactionDemarcate(validateAndResetToken = true)
public ActionForward cancel(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    String username = ((LoginActionForm) form).getUserName();
    PersonnelBO personnelBO = this.personnelDao.findPersonnelByUsername(username);
    String actionForward = getCancelForward(personnelBO.getPasswordChanged());
    return mapping.findForward(actionForward);
}
Also used : PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) LoginActionForm(org.mifos.security.login.struts.actionforms.LoginActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 35 with TransactionDemarcate

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

the class RolesPermissionsAction method delete.

@TransactionDemarcate(validateAndResetToken = true)
public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    RoleBO role = (RoleBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    rolesPermissionServiceFacade.deleteRole(role.getVersionNo(), role.getId());
    role = null;
    return mapping.findForward(ActionForwards.delete_success.toString());
}
Also used : RoleBO(org.mifos.security.rolesandpermission.business.RoleBO) 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