Search in sources :

Example 71 with TransactionDemarcate

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

the class ApplyAdjustment method editAdjustment.

@TransactionDemarcate(joinToken = true)
public ActionForward editAdjustment(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ApplyAdjustmentActionForm appAdjustActionForm = (ApplyAdjustmentActionForm) form;
    boolean isRevert = Boolean.parseBoolean(request.getParameter(Constants.ADJUSTMENT_IS_REVERT));
    appAdjustActionForm.setAdjustcheckbox(isRevert);
    request.setAttribute("method", "loadAdjustment");
    return mapping.findForward("loadadjustment_success");
}
Also used : ApplyAdjustmentActionForm(org.mifos.accounts.struts.actionforms.ApplyAdjustmentActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 72 with TransactionDemarcate

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

the class ApplyAdjustment method divide.

@TransactionDemarcate(joinToken = true)
public ActionForward divide(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ApplyAdjustmentActionForm applyAdjustmentActionForm = (ApplyAdjustmentActionForm) form;
    Integer parentAccountId = getBizService().findBySystemId(applyAdjustmentActionForm.getGlobalAccountNum()).getAccountId();
    Integer parentPaymentId = applyAdjustmentActionForm.getPaymentId();
    BigDecimal newAmount = new BigDecimal(applyAdjustmentActionForm.getAmount());
    if (applyAdjustmentActionForm.getAdjustcheckbox()) {
        newAmount = BigDecimal.ZERO;
    }
    List<GroupLoanMemberAdjustmentDto> memberAdjustmentDtoList = this.groupLoanService.retrieveMemberAdjustmentDtos(parentAccountId, parentPaymentId, newAmount);
    applyAdjustmentActionForm.setMemberAdjustmentDtoList(memberAdjustmentDtoList);
    return mapping.findForward("divideadjustment_success");
}
Also used : ApplyAdjustmentActionForm(org.mifos.accounts.struts.actionforms.ApplyAdjustmentActionForm) BigDecimal(java.math.BigDecimal) GroupLoanMemberAdjustmentDto(org.mifos.dto.screen.GroupLoanMemberAdjustmentDto) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 73 with TransactionDemarcate

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

the class BaseAction method loadChangeLog.

@TransactionDemarcate(joinToken = true)
public ActionForward loadChangeLog(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    Short entityType = EntityType.getEntityValue(request.getParameter(AuditConstants.ENTITY_TYPE).toUpperCase());
    Integer entityId = Integer.valueOf(request.getParameter(AuditConstants.ENTITY_ID));
    // FIXME - keithw - when replacing BaseActions loadChangeLog functionality for given entity when doing spring/ftl
    // see CenterServiceFacade.retrieveChangeLogs for example.
    AuditBusinessService auditBusinessService = new AuditBusinessService();
    request.getSession().setAttribute(AuditConstants.AUDITLOGRECORDS, auditBusinessService.getAuditLogRecords(entityType, entityId));
    return mapping.findForward(AuditConstants.VIEW + request.getParameter(AuditConstants.ENTITY_TYPE) + AuditConstants.CHANGE_LOG);
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 74 with TransactionDemarcate

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

the class BaseAction method getTransaction.

@SuppressWarnings("unchecked")
protected TransactionDemarcate getTransaction(@SuppressWarnings("unused") ActionForm actionForm, HttpServletRequest request) {
    TransactionDemarcate annotation = null;
    try {
        String methodName = request.getParameter(MethodNameConstants.METHOD);
        Method methodToExecute = this.clazz.getMethod(methodName, new Class[] { ActionMapping.class, ActionForm.class, HttpServletRequest.class, HttpServletResponse.class });
        annotation = methodToExecute.getAnnotation(TransactionDemarcate.class);
    } catch (NoSuchMethodException e) {
        throw new RuntimeException(e);
    }
    return annotation;
}
Also used : TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate) Method(java.lang.reflect.Method)

Example 75 with TransactionDemarcate

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

the class LoanDisbursementAction method captureQuestionResponses.

@TransactionDemarcate(joinToken = true)
public ActionForward captureQuestionResponses(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response) throws Exception {
    request.setAttribute(METHODCALLED, "captureQuestionResponses");
    ActionErrors errors = createGroupQuestionnaire.validateResponses(request, (LoanDisbursementActionForm) form);
    if (errors != null && !errors.isEmpty()) {
        addErrors(request, errors);
        return mapping.findForward(ActionForwards.captureQuestionResponses.toString());
    }
    return createGroupQuestionnaire.rejoinFlow(mapping);
}
Also used : ActionErrors(org.apache.struts.action.ActionErrors) 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