<?xml version='1.0' encoding='UTF-8'?>

<!--
   This file must be placed in $ALFRESCO/tomcat/shared/classes/alfresco/extension/audit.
-->

<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"/>
        <DataExtractor name="nodeNameValue" registeredName="auditModel.extractor.nodeName"/>
        <DataExtractor name="nodeTypeValue" registeredName="auditModel.extractor.nodeType"/>
    </DataExtractors>

    <PathMappings>
        <!-- Audit the NodeService.createNode method.  The share webapp uses this method to add folders. -->
        <PathMap source="/alfresco-api/post/NodeService/createNode" target="/auditarkcaseextractors"/>
        <!-- Audit the NodeService.deleteNode method.  The share webapp uses this method to delete folders and files. -->
        <PathMap source="/alfresco-api/post/NodeService/deleteNode" target="/auditarkcasedeleteextractors"/>
        <!-- Audit the FileFolderService.create method.  The share webapp uses this method to upload files.  -->
        <PathMap source="/alfresco-api/post/FileFolderService/create" target="/auditarkcasecreate"/>
        <!-- Audit the FileFolderService.moveFrom method.  The share webapp uses this method to move files.  -->
        <PathMap source="/alfresco-api/post/FileFolderService/moveFrom" target="/auditarkcasemovefrom"/>
        <!-- Audit the CopyService.copyAndRename method.  The share webapp uses this method to copy and rename files.  -->
        <PathMap source="/alfresco-api/post/CopyService/copyAndRename" target="/auditarkcasecopy"/>
        <!-- Audit the FileFolderService.rename method.  The share webapp uses this method to rename files and folders.  -->
        <PathMap source="/alfresco-api/post/FileFolderService/rename" target="/auditarkcaserename"/>
        <!-- Audit the NodeService.addProperties method.  The share webapp uses this method to add or update properties to a file or a folder. -->
        <PathMap source="/alfresco-api/post/NodeService/addProperties" target="/auditarkcasemetadata"/>
    </PathMappings>

    <!-- Audit the FileFolderService.create method.  The share webapp uses this method to upload files.  -->
    <Application name="AuditArkCaseCreate" key="auditarkcasecreate">
        <AuditPath key="create">
            <AuditPath key="in">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasecreate/args/parentNodeRef"
                    dataTrigger="/auditarkcasecreate/no-error"/>
                <RecordValue key="b" dataExtractor="simpleValue" dataSource="/auditarkcasecreate/args/name"
                    dataTrigger="/auditarkcasecreate/no-error"/>
                <RecordValue key="c" dataExtractor="simpleValue" dataSource="/auditarkcasecreate/args/typeQName"
                    dataTrigger="/auditarkcasecreate/no-error"/>
                <RecordValue key="d" dataExtractor="simpleValue" dataSource="/auditarkcasecreate/args/assocQNname"
                    dataTrigger="/auditarkcasecreate/no-error"/>
            </AuditPath>
            <AuditPath key="out">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasecreate/result"
                    dataTrigger="/auditarkcasecreate/no-error"/>
            </AuditPath>
            <AuditPath key="derived">
                <RecordValue key="parent-node-null" dataExtractor="nullValue" dataSource="/auditarkcasecreate/args/parentNodeRef"
                    dataTrigger="/auditarkcasecreate/no-error"/>
                <RecordValue key="parent-node-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasecreate/args/parentNodeRef"
                    dataTrigger="/auditarkcasecreate/no-error"/>
                <RecordValue key="parent-node-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasecreate/args/parentNodeRef"
                    dataTrigger="/auditarkcasecreate/no-error"/>
            </AuditPath>
        </AuditPath>
    </Application>

    <!-- Audit the NodeService.createNode method.  The share webapp uses this method to add folders. -->
    <Application name="AuditArkCaseExtractors" key="auditarkcaseextractors">
        <AuditPath key="create">
            <AuditPath key="in">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcaseextractors/args/parentRef"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
                <RecordValue key="b" dataExtractor="simpleValue" dataSource="/auditarkcaseextractors/args/nodeTypeQName"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
                <RecordValue key="c" dataExtractor="simpleValue" dataSource="/auditarkcaseextractors/args/assocTypeQName"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
                <RecordValue key="d" dataExtractor="simpleValue" dataSource="/auditarkcaseextractors/args/assocQName"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
                <RecordValue key="e" dataExtractor="simpleValue" dataSource="/auditarkcaseextractors/args/properties"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
            </AuditPath>
            <AuditPath key="out">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcaseextractors/result"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
            </AuditPath>
            <AuditPath key="derived">
                <RecordValue key="parent-node-null" dataExtractor="nullValue" dataSource="/auditarkcaseextractors/args/parentRef"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
                <RecordValue key="parent-node-name" dataExtractor="nodeNameValue" dataSource="/auditarkcaseextractors/args/parentRef"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
                <RecordValue key="parent-node-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcaseextractors/args/parentRef"
                    dataTrigger="/auditarkcaseextractors/no-error"/>
            </AuditPath>
        </AuditPath>
    </Application>

    <!-- Audit the NodeService.deleteNode method.  The share webapp uses this method to delete folders and files. -->
    <Application name="AuditArkCaseDeleteExtractors" key="auditarkcasedeleteextractors">
        <AuditPath key="delete">
            <AuditPath key="in">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasedeleteextractors/args/nodeRef"
                    dataTrigger="/auditarkcasedeleteextractors/no-error"/>
            </AuditPath>
            <AuditPath key="derived">
                <RecordValue key="node-null" dataExtractor="nullValue" dataSource="/auditarkcasedeleteextractors/args/nodeRef"
                    dataTrigger="/auditarkcasedeleteextractors/no-error"/>
                <RecordValue key="node-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasedeleteextractors/args/nodeRef"
                    dataTrigger="/auditarkcasedeleteextractors/no-error"/>
                <RecordValue key="node-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasedeleteextractors/args/nodeRef"
                    dataTrigger="/auditarkcasedeleteextractors/no-error"/>
            </AuditPath>
        </AuditPath>
    </Application>

    <!-- Audit the FileFolderService.moveFrom method.  The share webapp uses this method to move files.  -->
    <Application name="AuditArkCaseMoveFrom" key="auditarkcasemovefrom">
        <AuditPath key="move">
            <AuditPath key="in">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasemovefrom/args/sourceNodeRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="b" dataExtractor="simpleValue" dataSource="/auditarkcasemovefrom/args/sourceParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="c" dataExtractor="simpleValue" dataSource="/auditarkcasemovefrom/args/targetParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="d" dataExtractor="simpleValue" dataSource="/auditarkcasemovefrom/args/newName"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
            </AuditPath>
            <AuditPath key="out">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasemovefrom/result"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
            </AuditPath>
            <AuditPath key="derived">
                <RecordValue key="source-node-null" dataExtractor="nullValue" dataSource="/auditarkcasemovefrom/args/sourceNodeRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="source-node-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasemovefrom/args/sourceNodeRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="source-node-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasemovefrom/args/sourceNodeRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="source-parent-null" dataExtractor="nullValue" dataSource="/auditarkcasemovefrom/args/sourceParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="source-parent-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasemovefrom/args/sourceParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="source-parent-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasemovefrom/args/sourceParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="target-parent-null" dataExtractor="nullValue" dataSource="/auditarkcasemovefrom/args/targetParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="target-parent-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasemovefrom/args/targetParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
                <RecordValue key="target-parent-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasemovefrom/args/targetParentRef"
                             dataTrigger="/auditarkcasemovefrom/no-error"/>
            </AuditPath>
        </AuditPath>
    </Application>

    <!-- Audit the CopyService.copyAndRename method.  The share webapp uses this method to copy and rename files.  -->
    <Application name="AuditArkCaseCopy" key="auditarkcasecopy">
        <AuditPath key="copy">
            <AuditPath key="in">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasecopy/args/sourceNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="b" dataExtractor="simpleValue" dataSource="/auditarkcasecopy/args/targetParentNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="c" dataExtractor="simpleValue" dataSource="/auditarkcasecopy/args/assocTypeQName"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="d" dataExtractor="simpleValue" dataSource="/auditarkcasecopy/args/assocQName"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="e" dataExtractor="simpleValue" dataSource="/auditarkcasecopy/args/copyChildren"
                             dataTrigger="/auditarkcasecopy/no-error"/>
            </AuditPath>
            <AuditPath key="out">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasecopy/result"
                             dataTrigger="/auditarkcasecopy/no-error"/>
            </AuditPath>
            <AuditPath key="derived">
                <RecordValue key="source-node-null" dataExtractor="nullValue" dataSource="/auditarkcasecopy/args/sourceNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="source-node-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasecopy/args/sourceNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="source-node-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasecopy/args/sourceNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="target-parent-null" dataExtractor="nullValue" dataSource="/auditarkcasecopy/args/targetParentNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="target-parent-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasecopy/args/targetParentNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
                <RecordValue key="target-parent-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasecopy/args/targetParentNodeRef"
                             dataTrigger="/auditarkcasecopy/no-error"/>
            </AuditPath>
        </AuditPath>
    </Application>
    <!-- Audit the FileFolderService.rename method.  The share webapp uses this method to rename files and folders.  -->
    <Application name="AuditArkCaseRename" key="auditarkcaserename">
        <AuditPath key="rename">
            <AuditPath key="in">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcaserename/args/fileFolderRef"
                             dataTrigger="/auditarkcaserename/no-error"/>
                <RecordValue key="b" dataExtractor="simpleValue" dataSource="/auditarkcaserename/args/newName"
                             dataTrigger="/auditarkcaserename/no-error"/>
            </AuditPath>
            <AuditPath key="out">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcaserename/result"
                             dataTrigger="/auditarkcaserename/no-error"/>
            </AuditPath>
            <AuditPath key="derived">
                <RecordValue key="node-null" dataExtractor="nullValue" dataSource="/auditarkcaserename/args/fileFolderRef"
                             dataTrigger="/auditarkcaserename/no-error"/>
                <RecordValue key="node-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcaserename/args/fileFolderRef"
                             dataTrigger="/auditarkcaserename/no-error"/>
            </AuditPath>
        </AuditPath>
    </Application>

    <!-- Audit the NodeService.addProperties method.  The share webapp uses this method to add or update properties to a file or a folder.  -->
    <Application name="AuditArkCaseMetadata" key="auditarkcasemetadata">
        <AuditPath key="update">
            <AuditPath key="in">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasemetadata/args/nodeRef"
                             dataTrigger="/auditarkcasemetadata/no-error"/>
                <RecordValue key="b" dataExtractor="simpleValue" dataSource="/auditarkcasemetadata/args/properties"
                             dataTrigger="/auditarkcasemetadata/no-error"/>
            </AuditPath>
            <AuditPath key="out">
                <RecordValue key="a" dataExtractor="simpleValue" dataSource="/auditarkcasemetadata/result"
                             dataTrigger="/auditarkcasemetadata/no-error"/>
            </AuditPath>
            <AuditPath key="derived">
                <RecordValue key="node-null" dataExtractor="nullValue" dataSource="/auditarkcasemetadata/args/nodeRef"
                             dataTrigger="/auditarkcasemetadata/no-error"/>
                <RecordValue key="node-name" dataExtractor="nodeNameValue" dataSource="/auditarkcasemetadata/args/nodeRef"
                             dataTrigger="/auditarkcasemetadata/no-error"/>
                <RecordValue key="node-type" dataExtractor="nodeTypeValue" dataSource="/auditarkcasemetadata/args/nodeRef"
                             dataTrigger="/auditarkcasemetadata/no-error"/>
            </AuditPath>
        </AuditPath>
    </Application>
</Audit>
