【问题标题】:Issues in setting secondary properties to a document using cmis 1.1使用 cmis 1.1 为文档设置辅助属性的问题
【发布时间】:2017-11-09 14:21:21
【问题描述】:

我正在尝试使用 CMIS 1.1 以编程方式将辅助属性(标题、描述)添加到 Alfresco 中的文档。

代码sn-p:

properties.put(PropertyIds.NAME, fileName);
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:cm:titled"); 
properties.put(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, "P:cm:titled");
properties.put("cm:title", "test title");
properties.put("cm:description", "description of document");

代码成功将文档上传到 Alfresco 站点,没有任何问题,但在 Alfresco UI 中标题和描述为空。

我也尝试将标签设置为文档。露天网站中的标签也是空的。

代码sn-p

document = parentFolder.createDocument(properties, contentStream, null);
AlfrescoDocument alfDoc = (AlfrescoDocument) document;
Map<String, Object> properties1 = new HashMap<String, Object>();
List<String> tags = new ArrayList<String>();
tags.add("cmisTag");
tags.add("testTag");
properties1.put("cm:taggable",tags);
alfDoc.updateProperties(properties1);

【问题讨论】:

    标签: alfresco cmis


    【解决方案1】:

    乍一看,我认为您可能将辅助对象类型 IDs 属性设置为单个值而不是数组,但后来我查看了my gist,我也使用了字符串而不是字符串数组。

    现在我注意到您正在使用 AlfrescoDocument,这意味着您正在使用 OpenCMIS 扩展。如果您使用的是 CMIS 1.1,您不想使用 OpenCMIS 扩展。只需使用没有它的常规 OpenCMIS 库。使用 Document 而不是 AlfrescoDocument。

    【讨论】:

    • 嘿,杰夫,我已经从我的代码中删除了 cmis 扩展部分,现在我可以为我的文件夹和文档设置标题、描述 :) 现在我有一个问题是否可以添加标签我的文件通过 cmis 1.1。请解释一下标记在 cmis 1.1 中的工作原理。
    • 标签不能通过 CMIS 工作。您必须为标签使用 Alfresco REST API。
    • 谢谢 Jeff..我使用 Rest API 实现了标记。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-23
    相关资源
    最近更新 更多