Hello everyone,
since I was not able to gather nodeRef (a), nodeid (b) or nodeuuid (c) from the database (thread) I opted to use the alfresco-access api. I need to relate nodes to audit-log entries.
1. But as far as I understand there is also no way to get a/b/c for every entry? This information is only stored for some entries. How can I get a/b/c for every existing audit-log entry?
2. If there is absolutely no way to relate these items ootb. Can I modify the audit log so that the noderef is stored for every entry?
regards
Muffex
Solved! Go to Solution.
I have been able to realize a solution.
1. Create xml for a custom audit-application (c.f. Audit Log Config)
<?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"/> </DataExtractors> <PathMappings> <PathMap source="/alfresco-access" target="/custom-audit" /> </PathMappings> <Application name="custom-audit" key="custom-audit"> <RecordValue key="action" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/action" dataTrigger="/custom-audit/transaction/action" /> <RecordValue key="sub-actions" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/sub-actions" dataTrigger="/custom-audit/transaction/sub-actions" /> <RecordValue key="user" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/user" dataTrigger="/custom-audit/transaction/user" /> <RecordValue key="node" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/node" dataTrigger="/custom-audit/transaction/node" /> <RecordValue key="type" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/type" dataTrigger="/custom-audit/transaction/type" /> <RecordValue key="path" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/path" dataTrigger="/custom-audit/transaction/path" /> </Application> </Audit>
2. Add xml-File to /usr/local/tomcat/shared/classes/alfresco/extension/audit/ on docker container (alfresco-ce-7_alfresco_1)
3. Restart Container
4. Access all the information you need (via curl: https://[host]:[port]/alfresco/service/api/audit/query/custom-audit?verbose=true)
best
Muffex
You could override / replace Alfresco's default alfresco-audit-access.xml configuration (via WEB-INF/classes/alfresco/audit/ - AFAIK the extension classpath won't work as it would try to load a second alfresco-access audit application, running into an error with the already defined default application) to always record the node, since the node is actually always provided in the audit data generated by the producer - it is just not recorded via a RecordValue config.
I have been able to realize a solution.
1. Create xml for a custom audit-application (c.f. Audit Log Config)
<?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"/> </DataExtractors> <PathMappings> <PathMap source="/alfresco-access" target="/custom-audit" /> </PathMappings> <Application name="custom-audit" key="custom-audit"> <RecordValue key="action" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/action" dataTrigger="/custom-audit/transaction/action" /> <RecordValue key="sub-actions" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/sub-actions" dataTrigger="/custom-audit/transaction/sub-actions" /> <RecordValue key="user" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/user" dataTrigger="/custom-audit/transaction/user" /> <RecordValue key="node" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/node" dataTrigger="/custom-audit/transaction/node" /> <RecordValue key="type" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/type" dataTrigger="/custom-audit/transaction/type" /> <RecordValue key="path" dataExtractor="simpleValue" dataSource="/custom-audit/transaction/path" dataTrigger="/custom-audit/transaction/path" /> </Application> </Audit>
2. Add xml-File to /usr/local/tomcat/shared/classes/alfresco/extension/audit/ on docker container (alfresco-ce-7_alfresco_1)
3. Restart Container
4. Access all the information you need (via curl: https://[host]:[port]/alfresco/service/api/audit/query/custom-audit?verbose=true)
best
Muffex
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.