deathangel908
deathangel908

Reputation: 9709

Get document's attachments via alfresco opencmis

I want to get attached to object another object via OpenCmis from alfresco.

To receive the object I use:

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

I also see that doc has attached aspect. I see that file does have attachment in /share web-gui.

I want to get all attachments from this object: enter image description here

How do I get this file from opencmis? Should I use some specific query? enter image description here

The association in alfresco's table is the following:

enter image description here

Upvotes: 0

Views: 305

Answers (1)

deathangel908
deathangel908

Reputation: 9709

Ok, it's possible!

  • You should use session.getObject() method
  • You should pass Operation context with IncludeRelationships.BOTH
OperationContextImpl op = new OperationContextImpl();
op.setIncludeRelationships(IncludeRelationships.BOTH);
AlfrescoDocumentImpl doc = session.getObject("id", op);
doc.getRelationships();

Upvotes: 1

Related Questions