Last active
December 24, 2015 14:09
-
-
Save jpotts/6810785 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.chemistry.opencmis.commons.* | |
import org.apache.chemistry.opencmis.commons.data.* | |
import org.apache.chemistry.opencmis.commons.enums.* | |
import org.apache.chemistry.opencmis.client.api.* | |
String cql = "SELECT D.cmis:name, T.cm:title 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 -> | |
hit.properties.each { 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