如何使用 CMIS 在 ECM / alfresco 中创建自定义内容类型?

How to create custom content type in ECM / alfresco using CMIS?

CMIS 1.1 允许我们创建自定义文档类型。我试过 [https://chemistry.apache.org/java/examples/example-create-type.html]session.createType()。但我无法弄清楚。是否有任何其他教程或示例代码使用 CMIS 1.1

在 Alfresco 中创建类型

我认为这是创建自定义类型的一个很好的例子:http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html#creating-content-with-opencmis

我猜你还没有真正阅读教程。

-- 更新--

估计教程里没写清楚。所以基本上 CMIS 中有 2 种主要类型:

  • cmis:document
  • 继承属性的文档类型
  • cmis:folder
  • 继承属性的文件夹类型

所以假设我们的模型被称为 cntz 作为前缀,我们继承的 cm:content 类型被称为 cntz:document 并且等效文件夹称为 cntz:folder

文档类型写在这种情况下"D:cntz:document" 文件夹类型写在这种情况下 "F:cntz:folder"

因此您的 CMIS 代码将如下所示:

Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "F:cntz:folder");
properties.put(PropertyIds.NAME, "Chackde");
Folder folder = session.getRootFolder().createFolder(properties);