Get opencmis documents by query with all properties without content stream

387 Views Asked by At

At the moment I'm getting Alfresco documents by queries like that:

select cmis:objectId from cmis:document ...

then I get the document itself by the following code:

String objectId = qresult.getPropertyValueByQueryName("d.cmis:objectId");
Document doc = (Document) session.getObject(session.createObjectId(objectId));

The problem is that when I get the document like that it seems to transfer the whole contentStream for every document which is not needed in my use-case.

Then I tried to get all properties by changing the query to:

select * from cmis:document

but this returns only the properties of the document aspect (cmis:name, ...). Is it possible to get all properties of the document without having to add all aspect with a "join" to the query?

Or is there another way to get documents with all properties but without the contentstream?

Thanks in advance

1

There are 1 best solutions below

2
Florian Müller On

getObject() does not transfer the content stream, only metadata.
You can control what is fetched from the repository with an Operation Context.