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");
}
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");
}
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);
}
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;
}
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);
}
Aggregations