chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <>
Subject RE: Best way to create a Document from a QueryResult?
Date Sat, 12 Jun 2010 09:42:34 GMT
Hi Aaron,

I've added a section to the OpenCMIS cookbook that hopefully answers your question. [1]

Please note that the code snippet in the cookbook is the save way that should work with all
CMIS repositories. 
If you know that your repository always returns property ids in the query results (which is
not mandatory), you can simplify the code. In this case, you don't need to determine the query
name of the object id. You can get the object id with this line of code:

String objectId = qResult.getPropertyValueById(PropertyIds.OBJECT_ID);

- Florian


-----Original Message-----
From: Aaron Korver [] 
Sent: Samstag, 12. Juni 2010 00:13
Subject: Best way to create a Document from a QueryResult?

 See the below code.  Note that tcg:contract is my own custom type that
extends the cmis:document with a few added properties.
        String queryString = "SELECT * FROM tcg:contract";
        ItemIterable<QueryResult> results = session.query(queryString,

        assertEquals(1, results.getTotalNumItems());
        for(QueryResult qResult: results)
            //How do I get Documents from QueryResult?

Aaron Korver

View raw message