user2423989
user2423989

Reputation: 15

Get opencmis documents by query with all properties without content stream

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

Upvotes: 0

Views: 487

Answers (1)

Florian Müller
Florian Müller

Reputation: 3235

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

Upvotes: 3

Related Questions