Skip to content

Instantly share code, notes, and snippets.



Last active Dec 24, 2015
What would you like to do?
This is the query example from the OpenCMIS Workbench modified with a query string that shows how to query for properties defined in an Alfresco aspect using a join.
import org.apache.chemistry.opencmis.commons.*
import org.apache.chemistry.opencmis.commons.enums.*
import org.apache.chemistry.opencmis.client.api.*
String cql = "SELECT D.cmis:name, FROM cmis:document as D join cm:titled as T on D.cmis:objectId = T.cmis:objectId"
ItemIterable<QueryResult> results = session.query(cql, false)
results.each { hit -> { println "${it.queryName}: ${it.firstValue}" }
println "--------------------------------------"
println "--------------------------------------"
println "Total number: ${results.totalNumItems}"
println "Has more: ${results.hasMoreItems}"
println "--------------------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment