通过 alfresco opencmis 获取文档的附件

Get document's attachments via alfresco opencmis

我想通过来自 alfresco 的 OpenCmis 附加到另一个对象。

接收我使用的对象:

import org.apache.chemistry.opencmis.client.util.FileUtils;
AfrescoDocumentImpl doc = FileUtils.getObject("myID", session);

我也看到 docattached 方面。我在 /share web-gui 中看到该文件确实有附件。

我想从这个对象中获取所有附件:

如何从 opencmis 获取此文件?我应该使用一些特定的查询吗?

露天table中的关联如下:

好的,有可能!

  • 你应该使用session.getObject()方法
  • 您应该使用 IncludeRelationships.BOTH
  • 传递操作上下文
OperationContextImpl op = new OperationContextImpl();
op.setIncludeRelationships(IncludeRelationships.BOTH);
AlfrescoDocumentImpl doc = session.getObject("id", op);
doc.getRelationships();