07-06-2018 02:10 AM
Hi All,
Is there a possible way to get all data using the CMIS Workbench QUERY?
based on my testing I've just get only 100 data instead of 100,000+ data in our production.
How?
Thanks,
Cyrus Nhiel
07-08-2018 08:40 PM
any ideas?
07-09-2018 07:00 AM
Simple answer is: NO
Alternatives: https://angelborroy.wordpress.com/2018/05/30/alfresco-counting-more-than-1000-elements/
07-09-2018 08:50 PM
Angel Borroy Hi borry I've already found a solution for this and I've gather more than 100,000 data from my query. Thanks for the response
07-10-2018 02:37 AM
And can you share your findings with us?
07-10-2018 03:04 AM
Angel Borroy Sure, First before entering the WORKBENCH , in the url http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom?maxItems=100000 add the maxItems you want , then in the groovy script
just add
String cql = "SELECT * FROM cmis:document"
OperationContext opCon = session.createOperationContext();
opCon.setLoadSecondaryTypeProperties(true);
opCon.setMaxItemsPerPage(100000);
ItemIterable<QueryResult> results = session.query(cql, false, opCon)
Then u can get the data you want
07-10-2018 03:17 AM
No more configurations?
This does not work for me.
07-10-2018 08:13 PM
Angel Borroy in our case there's no configuration and we're using modified db table.
07-10-2018 09:29 PM
Angel Borroy in our case here's my full code, I've extracted it and download it to csv file
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.*
import org.apache.chemistry.opencmis.client.util.*
String cql = "SELECT ap:apXxX FROM ap:apXXX where ap:apxxx <> 'POSTED'"
OperationContext opCon = session.createOperationContext();
opCon.setLoadSecondaryTypeProperties(true);
opCon.setMaxItemsPerPage(100000);
ItemIterable<QueryResult> results = session.query(cql, false, opCon)
File file = new File("C:/xxx/xxx/xxx/xxx/PONum.csv");
for(QueryResult hit: results) {
for(PropertyData<?> property: hit.getProperties()) {
String queryName = property.getQueryName();
Object value = property.getFirstValue();
file.append(value+"\n");
}
}
Explore our Alfresco products with the links below. Use labels to filter content by product module.