使用 cmis 1.1 为文档设置次要属性的问题

Issues in setting secondary properties to a document using cmis 1.1

我正在尝试使用 CMIS 1.1 以编程方式将次要属性(标题、说明)添加到 Alfresco 中的文档。

代码片段:

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。

我也试过将标签设置为文档。露天场所的标签也为空。

代码片段

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);

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

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