Search in sources :

Example 1 with AuditBusinessService

use of org.mifos.framework.components.audit.business.service.AuditBusinessService in project head by mifos.

the class CenterServiceFacadeWebTier method retrieveChangeLogs.

@Override
public List<AuditLogDto> retrieveChangeLogs(Integer centerId) {
    try {
        List<AuditLogDto> auditLogs = new ArrayList<AuditLogDto>();
        Short entityType = EntityType.CENTER.getValue();
        AuditBusinessService auditBusinessService = new AuditBusinessService();
        List<AuditLogView> centerAuditLogs = auditBusinessService.getAuditLogRecords(entityType, centerId);
        for (AuditLogView auditLogView : centerAuditLogs) {
            auditLogs.add(auditLogView.toDto());
        }
        return auditLogs;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 2 with AuditBusinessService

use of org.mifos.framework.components.audit.business.service.AuditBusinessService 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 3 with AuditBusinessService

use of org.mifos.framework.components.audit.business.service.AuditBusinessService in project head by mifos.

the class AdminServiceFacadeWebTier method retrieveLoanProductAuditLogs.

@Override
public List<AuditLogDto> retrieveLoanProductAuditLogs(Integer productId) {
    List<AuditLogDto> auditLogDtos = new ArrayList<AuditLogDto>();
    AuditBusinessService auditBusinessService = new AuditBusinessService();
    try {
        List<AuditLogView> auditLogs = auditBusinessService.getAuditLogRecords(EntityType.LOANPRODUCT.getValue(), productId);
        for (AuditLogView auditLogView : auditLogs) {
            auditLogDtos.add(auditLogView.toDto());
        }
        return auditLogDtos;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 4 with AuditBusinessService

use of org.mifos.framework.components.audit.business.service.AuditBusinessService in project head by mifos.

the class AdminServiceFacadeWebTier method retrieveSavingsProductAuditLogs.

@Override
public List<AuditLogDto> retrieveSavingsProductAuditLogs(Integer productId) {
    List<AuditLogDto> auditLogDtos = new ArrayList<AuditLogDto>();
    AuditBusinessService auditBusinessService = new AuditBusinessService();
    try {
        List<AuditLogView> auditLogs = auditBusinessService.getAuditLogRecords(EntityType.SAVINGSPRODUCT.getValue(), productId);
        for (AuditLogView auditLogView : auditLogs) {
            auditLogDtos.add(auditLogView.toDto());
        }
        return auditLogDtos;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Example 5 with AuditBusinessService

use of org.mifos.framework.components.audit.business.service.AuditBusinessService in project head by mifos.

the class SavingsServiceFacadeWebTier method retrieveSavingsAccountAuditLogs.

@Override
public List<AuditLogDto> retrieveSavingsAccountAuditLogs(Long savingsId) {
    List<AuditLogDto> auditLogDtos = new ArrayList<AuditLogDto>();
    AuditBusinessService auditBusinessService = new AuditBusinessService();
    try {
        List<AuditLogView> auditLogs = auditBusinessService.getAuditLogRecords(EntityType.SAVINGS.getValue(), savingsId.intValue());
        for (AuditLogView auditLogView : auditLogs) {
            auditLogDtos.add(auditLogView.toDto());
        }
        return auditLogDtos;
    } catch (ServiceException e) {
        throw new MifosRuntimeException(e);
    }
}
Also used : AuditBusinessService(org.mifos.framework.components.audit.business.service.AuditBusinessService) ServiceException(org.mifos.framework.exceptions.ServiceException) ArrayList(java.util.ArrayList) AuditLogView(org.mifos.framework.components.audit.util.helpers.AuditLogView) AuditLogDto(org.mifos.dto.domain.AuditLogDto) MifosRuntimeException(org.mifos.core.MifosRuntimeException)

Aggregations

AuditBusinessService (org.mifos.framework.components.audit.business.service.AuditBusinessService)5 ArrayList (java.util.ArrayList)4 MifosRuntimeException (org.mifos.core.MifosRuntimeException)4 AuditLogDto (org.mifos.dto.domain.AuditLogDto)4 AuditLogView (org.mifos.framework.components.audit.util.helpers.AuditLogView)4 ServiceException (org.mifos.framework.exceptions.ServiceException)4 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1