I am trying to modify the PathMappings of the "CMISChangeLog" audit application bundled out-of-the-box in Alfresco 5.
I have found these PathMappings in alfresco-audit-cmis.xml
which can be found in Alfresco's source code, so I modified this XML file and put it into tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-cmis.xml
(thinking that would override the out-of-the-box application) before restarting Alfresco. Problem:
ERROR [audit.model.AuditModelRegistryImpl] Failed to load audit model: file:/home/nico/alfresco/tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-cmis.xml
org.alfresco.repo.audit.model.AuditModelException: 00120000 Audit application key 'CMISChangeLog' is used by: AuditApplication[ name=CMISChangeLog, id=3, disabledPathsId=381]
at org.alfresco.repo.audit.model.AuditModelRegistryImpl$AuditModelRegistryState.cacheAuditElements(AuditModelRegistryImpl.java:646)
How to override this out-of-the-box audit application?
Grepping through my server I found out that the default audit application's XML file is stored at alf_data/contentstore/2017/12/22/18/23/82dfdccd-6ab9-4091-8b7c-d37d4bcf1627.bin
but I haven't found it in the Node Browser:
Note: I don't want to create a new audit application. I must modify the existing one (because I want Alfresco's CMIS ChangeLog to take into account more events).
The XML file is actually in
alfresco-repository-5.2.g.jar
, which itself can be found in Alfresco's WAR file.So, if you have an already running Alfresco server, here is the procedure:
mkdir -p /tmp/unjar
cd /tmp/unjar
unzip $ALFRESCO/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.2.g.jar
(adapt for another version number if necessary)alfresco/audit/alfresco-audit-cmis.xml
zip -r ../alfresco-repository-5.2.g-custom.jar *
cp ../alfresco-repository-5.2.g-custom.jar ALFRESCO/tomcat/webapps/alfresco/WEB-INF/lib/