public Object doWork() throws Exception { String applicationName = "alfresco-access"; AuditQueryParameters pathParams = new AuditQueryParameters(); pathParams.setApplicationName(applicationName); pathParams.addSearchKey("/alfresco-access/transaction/path", nodePath); // unfortunately, the getAuditTrail API forces us to get them all services.getAuditService().auditQuery(callback, pathParams, Integer.MAX_VALUE); AuditQueryParameters copyFromPathParams = new AuditQueryParameters(); copyFromPathParams.setApplicationName(applicationName); copyFromPathParams.addSearchKey("/alfresco-access/transaction/copy/from/path", nodePath); // unfortunately, the getAuditTrail API forces us to get them all services.getAuditService().auditQuery(callback, copyFromPathParams, Integer.MAX_VALUE); AuditQueryParameters moveFromPathParams = new AuditQueryParameters(); moveFromPathParams.setApplicationName(applicationName); moveFromPathParams.addSearchKey("/alfresco-access/transaction/move/from/path", nodePath); // unfortunately, the getAuditTrail API forces us to get them all services.getAuditService().auditQuery(callback, moveFromPathParams, Integer.MAX_VALUE); return null; } }, AuthenticationUtil.getAdminUserName());
public Object doWork() throws Exception { String applicationName = "alfresco-access"; AuditQueryParameters pathParams = new AuditQueryParameters(); pathParams.setApplicationName(applicationName); pathParams.addSearchKey("/alfresco-access/transaction/path", nodePath); // unfortunately, the getAuditTrail API forces us to get them all services.getAuditService().auditQuery(callback, pathParams, Integer.MAX_VALUE); AuditQueryParameters copyFromPathParams = new AuditQueryParameters(); copyFromPathParams.setApplicationName(applicationName); copyFromPathParams.addSearchKey("/alfresco-access/transaction/copy/from/path", nodePath); // unfortunately, the getAuditTrail API forces us to get them all services.getAuditService().auditQuery(callback, copyFromPathParams, Integer.MAX_VALUE); AuditQueryParameters moveFromPathParams = new AuditQueryParameters(); moveFromPathParams.setApplicationName(applicationName); moveFromPathParams.addSearchKey("/alfresco-access/transaction/move/from/path", nodePath); // unfortunately, the getAuditTrail API forces us to get them all services.getAuditService().auditQuery(callback, moveFromPathParams, Integer.MAX_VALUE); return null; } }, AuthenticationUtil.getAdminUserName());
@SuppressWarnings("deprecation") @Override public void setUp() throws Exception { auditModelRegistry = (AuditModelRegistryImpl) ctx.getBean("auditModel.modelRegistry"); serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); auditComponent = (AuditComponent) ctx.getBean("auditComponent"); auditService = serviceRegistry.getAuditService(); transactionService = serviceRegistry.getTransactionService(); transactionServiceImpl = (TransactionServiceImpl) ctx.getBean("transactionService"); nodeService = serviceRegistry.getNodeService(); searchService = serviceRegistry.getSearchService(); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName()); nodeRef = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE); // Register the models URL modelUrlMnt11072 = ResourceUtils.getURL("classpath:alfresco/testaudit/alfresco-audit-test-mnt-11072.xml"); URL modelUrlMnt16748 = ResourceUtils.getURL("classpath:alfresco/testaudit/alfresco-audit-test-mnt-16748.xml"); auditModelRegistry.registerModel(modelUrlMnt11072); auditModelRegistry.registerModel(modelUrlMnt16748); auditModelRegistry.loadAuditModels(); }
auditComponent.setUserAuditFilter(userAuditFilter); serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); auditService = serviceRegistry.getAuditService(); transactionService = serviceRegistry.getTransactionService(); transactionServiceImpl = (TransactionServiceImpl) ctx.getBean("transactionService");