05-16-2013 03:37 PM
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>
05-17-2013 10:15 AM
05-20-2013 02:22 AM
05-05-2019 01:43 AM
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"?>According to the above configuration, my custom audit does not work, is there a problem with my configuration file? Still what steps I missed.
<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>
I will be very grateful for any reply.
@saruqui @AxelAxel Faust
05-05-2019 01:17 AM
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"?>According to the above configuration, my custom audit does not work, is there a problem with my configuration file? Still what steps I missed.
<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>
I will be very grateful for any reply.
@saruqui @AxelAxel Faust
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.