As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public interface WfService { @Auditable(parameters="node") WorkflowPath initWf(NodeRef node) throws Exception; } – wfAudit.xml – <Audit xmlns="http://www.alfresco.org/repo/audit/model/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"> <DataExtractors> <DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue" /> <DataExtractor name="nullValue" registeredName="auditModel.extractor.nullValue" /> </DataExtractors> <DataGenerators> <DataGenerator name="currentUser" registeredName="auditModel.generator.user" /> </DataGenerators> <PathMappings> <PathMap source="/alfresco-api/post/WfService/initWf" target="/InitWf" /> </PathMappings> <Application name="InitWf" key="InitWf"> <AuditPath key="in"> <RecordValue key="node" dataExtractor="simpleValue" dataSource="/InitWf/args/node" /> </AuditPath> <AuditPath key="out"> <RecordValue key="value" dataExtractor="simpleValue" dataSource="/InitWf/result" /> </AuditPath> </Application> </Audit>
Hello, I have encountered the same problem, I need to record the ip of the logged in user.
I defined the IpRecordService interface and its implementation class IpRecordServiceImpl
@AlfrescoPublicApi public interface IpRecordService{ @Auditable(parameters = {"userName", "ip"}, recordable = {true}) void recordIp(String userName, String ip); }
@Service("ipRecordService")public class IpRecordServiceImpl implements IpRecordService {@Override @Auditable(parameters = {"userName", "ip"}, recordable = {true, true})public void recordIp(String userName, String ip) { System.out.println("recording---------------------------"); }}I defined service beans in service-context.xml.
<bean id="IpRecordService" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="proxyInterfaces"> <list> <value>cn.alfresco.jingtai.service.IpRecordService</value> </list> </property> <property name="target"> <ref bean="ipRecordService"/> </property> <property name="interceptorNames"> <list> <idref bean="AuditMethodInterceptor"/> </list> </property> </bean> and Below is the ipRecord.xml <?xml version="1.0" encoding="UTF-8"?> <Audit xmlns="http://www.alfresco.org/repo/audit/model/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"> <DataExtractors> <DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue" /> <DataExtractor name="nullValue" registeredName="auditModel.extractor.nullValue" /> </DataExtractors> <DataGenerators> <DataGenerator name="currentUser" registeredName="auditModel.generator.user" /> </DataGenerators> <PathMappings> <PathMap source="/alfresco-api/post/IpRecordService/recordIp" target="/ipRecordService/recordIp" /> </PathMappings> <Application name="ipRecordService" key="ipRecordService"> <AuditPath key="recordIp"> <RecordValue key="userName" dataExtractor="simpleValue" dataSource="/ipRecordService/recordIp/args/userName"/> <RecordValue key="ip" dataExtractor="simpleValue" dataSource="/ipRecordService/recordIp/args/ip"/> </AuditPath> </Application> </Audit>According to the above configuration, my custom audit does not work, is there a problem with my configuration file? Still what steps I missed. I will be very grateful for any reply. @saruqui @AxelAxel Faust
@Service("ipRecordService")public class IpRecordServiceImpl implements IpRecordService {@Override@Auditable(parameters = {"userName", "ip"}, recordable = {true, true})public void recordIp(String userName, String ip) {System.out.println("recording---------------------------");}}I defined service beans in service-context.xml.