如何通过Alfresco中的CMIS ChangElog检测重命名



cmis changelog

我正在使用CMIS标准的ChangElog功能来跟踪我的Alfresco服务器上的变化。

例如,当我创建 newfile.txt时,changelog代币(<cmis:latestChangeLogToken>的值)从1713年更改为1735。

问题

当我将newfile.txt重命名为myfile.txt时,ChangElog令牌不会更改。

问题

有没有一种方法可以使Alfresco在重命名时使ChangElog令牌颠簸?

这是我当前的tomcat/shared/classes/alfresco-global.properties

audit.enabled=true
audit.alfresco-access.enabled=true
audit.alfresco-access.sub-actions.enabled=true
audit.cmischangelog.enabled=true
audit.cmischangelog.sub-actions.enabled=true

要实现这一目标,您必须修改alfresco的审核配置文件,该文件负责生成CMIS ChangElog事件。该文件是alfresco-audit-cmis.xml,可以在alfresco-repository-5.2.g.jar(版本号可能会有所不同)内找到,该文件本身在alfresco.warWEB-INF/lib文件夹中。

您必须在该文件中添加一个路径图和一个审核路径,如下所述:

<PathMap source="/alfresco-api/post/FileFolderService/rename"
    target="/CMISChangeLog/UPDATED" />

...在<PathMappings>

<AuditPath key="fileFolderRef">
    <RecordValue key="value" dataExtractor="simpleValue" />
</AuditPath>

...在<AuditPath key="UPDATED"><AuditPath key="args">中。

在此答案的底部,我粘贴了alfresco社区的整个修改后的alfresco-audit-cmis.xml 5.2.0 201707,请注意,您的基本文件可能会有所不同,因此最好将修改应用于Alfresco自己的alfresco-audit-cmis.xml

为了部署该文件,以便实际上由Alfresco使用,请按照以下说明:https://stackoverflow.com/a/48221347/226958

示例:

<?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"/>
       <DataExtractor name="changeLog" registeredName="CMISChangeLogDataExtractor"/>
    </DataExtractors>
    <PathMappings>
        <PathMap source="/CMISChangeLog" target="/CMISChangeLog" />
        <PathMap source="/alfresco-api/post/FileFolderService/create" target="/CMISChangeLog/CREATED" />
        <PathMap source="/alfresco-api/post/NodeService/createNode" target="/CMISChangeLog/CREATED" />
        <PathMap source="/alfresco-api/post/NodeService/setProperties" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/NodeService/addProperties" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/NodeService/setProperty" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/NodeService/removeProperty" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-node/beforeDeleteNode" target="/CMISChangeLog/DELETED" />
        <PathMap source="/alfresco-api/post/PermissionService/setPermission" target="/CMISChangeLog/SECURITY" />
        <PathMap source="/alfresco-api/post/PermissionService/setInheritParentPermissions" target="/CMISChangeLog/SECURITY" />
        <PathMap source="/alfresco-api/post/PermissionService/clearPermission" target="/CMISChangeLog/SECURITY" />
        <PathMap source="/alfresco-api/post/PermissionService/deletePermission" target="/CMISChangeLog/SECURITY" />
        <PathMap source="/alfresco-api/post/NodeService/moveNode" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/FileFolderService/moveFrom" target="/CMISChangeLog/UPDATED" />
        <PathMap source="/alfresco-api/post/FileFolderService/rename" target="/CMISChangeLog/UPDATED" />
    </PathMappings>
    <Application name="CMISChangeLog" key="CMISChangeLog">
        <AuditPath key="CREATED">
            <AuditPath key="result">
                <RecordValue key="value" dataExtractor="changeLog" />
            </AuditPath>
            <AuditPath key="error">
                <RecordValue key="value" dataExtractor="nullValue" />
            </AuditPath>
        </AuditPath>
        <AuditPath key="UPDATED">
            <AuditPath key="args">
                <AuditPath key="nodeRef">
                    <RecordValue key="value" dataExtractor="changeLog" />
                </AuditPath>
                <AuditPath key="nodeToMoveRef">
                    <RecordValue key="value" dataExtractor="changeLog" />
                </AuditPath>
                <AuditPath key="sourceNodeRef">
                    <RecordValue key="value" dataExtractor="changeLog" />
                </AuditPath>
                <AuditPath key="fileFolderRef">
                    <RecordValue key="value" dataExtractor="simpleValue" />
                </AuditPath>
            </AuditPath>
            <AuditPath key="error">
                <RecordValue key="value" dataExtractor="nullValue" />
            </AuditPath>
        </AuditPath>
        <AuditPath key="DELETED">
            <AuditPath key="node">
                <RecordValue key="value" dataExtractor="changeLog" />
            </AuditPath>
        </AuditPath>
        <AuditPath key="SECURITY">
            <AuditPath key="args">
                 <AuditPath key="nodeRef">
                    <RecordValue key="value" dataExtractor="changeLog" />
                 </AuditPath>
            </AuditPath>
            <AuditPath key="error">
                <RecordValue key="value" dataExtractor="nullValue" />
            </AuditPath>
        </AuditPath>        
    </Application>
</Audit>

此"解决方案"非常不便,可能还不完整,因此,如果您知道任何更好的方法,请发布一个新的答案,非常感谢!: - )

相关内容

  • 没有找到相关文章

最新更新