Hello
There are 300 files inside the folder, 100 files have the P:cm:emailed secondary type property.
Following code takes 30 seconds to run, because Im getting all 300 items, asking each item if you have the P:cm:emailed secondary type property or not.
Would it be possible to return only items with P:cm:emailed secondary type property?
How about doing a join on the aspect and then using a contains/path for the folder path:
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:objectId, D.cmis:name FROM cmis:document as D join cm:emailed as E on D.cmis:objectId = E.cmis:objectId where CONTAINS(D, 'PATH:\"/app:company_home/cm:test//*\"')"
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 "--------------------------------------"
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.