chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Guillaume ...@nuxeo.com>
Subject Re: Best way to create a Document from a QueryResult?
Date Thu, 17 Jun 2010 09:40:53 GMT
In the spec we should have standardized property query names, in the
same way that we did for standard object types. This would avoid these
contortions for standard properties.
I opened http://tools.oasis-open.org/issues/browse/CMIS-658 for this.

Florent


On Sat, Jun 12, 2010 at 11:42 AM, Florian Müller <fmueller@opentext.com> wrote:
> 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
>
>
> [1] https://cwiki.apache.org/CMIS/opencmis-cookbook.html#OpenCMISCookbook-RetrievingDocumentobjectsfromqueryresults
>
> -----Original Message-----
> From: Aaron Korver [mailto:aaron.korver@gmail.com]
> Sent: Samstag, 12. Juni 2010 00:13
> To: chemistry-dev@incubator.apache.org
> 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,
> false);
>
>        assertEquals(1, results.getTotalNumItems());
>        for(QueryResult qResult: results)
>        {
>            //How do I get Documents from QueryResult?
>        }
>
> Thanks,
> Aaron Korver
>



-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

Mime
View raw message