CMIS WORKBENCH QUERY LIMIT

cancel
Showing results for 
Search instead for 
Did you mean: 
cyrose22
Active Member II

CMIS WORKBENCH QUERY LIMIT

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

8 Replies
cyrose22
Active Member II

Re: CMIS WORKBENCH QUERY LIMIT

any ideas?

angelborroy
Alfresco Employee

Re: CMIS WORKBENCH QUERY LIMIT

Simple answer is: NO

Alternatives: https://angelborroy.wordpress.com/2018/05/30/alfresco-counting-more-than-1000-elements/

Hyland Developer Evangelist
cyrose22
Active Member II

Re: CMIS WORKBENCH QUERY LIMIT

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

angelborroy
Alfresco Employee

Re: CMIS WORKBENCH QUERY LIMIT

And can you share your findings with us?

Hyland Developer Evangelist
cyrose22
Active Member II

Re: CMIS WORKBENCH QUERY LIMIT

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

angelborroy
Alfresco Employee

Re: CMIS WORKBENCH QUERY LIMIT

No more configurations?

This does not work for me.

Hyland Developer Evangelist
cyrose22
Active Member II

Re: CMIS WORKBENCH QUERY LIMIT

Angel Borroy‌ in our case there's no configuration and we're using modified db table.

cyrose22
Active Member II

Re: CMIS WORKBENCH QUERY LIMIT

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");
      }
}