We are using Alfresco as a repository and querying it using Apache CMIS api.
We use below code to connect it.
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom?maxItems=1000");
Querying alfresco...
OperationContext opCon = session.createOperationContext();
opCon.setLoadSecondaryTypeProperties(true);
opCon.setMaxItemsPerPage(1000);
session.query(queryStr);
But the CMIS always returns 100 records only. But when I use standalone CMIS workbench program and give the above URL to connect to Alfresco with maxItems=1000, it returns 1000 records.
The maxItems parameter is not working when I use my JAVA CMIS api.
Please help.
Thank you
I got it working...
While querying to Alfresco, I was not passing the OperationContext where I set the page size.
OperationContext opCon = session.createOperationContext();
opCon.setLoadSecondaryTypeProperties(true);
opCon.setMaxItemsPerPage(1000);
session.query(queryStr, false); // wrong....
session.query(queryStr, false, opCon); // right
Now when I iterate to the ItemIterable, I am getting more than 100 results.
Thanks to everyone for their time and help!
I don't think you can get around this issue.
https://issues.alfresco.com/jira/browse/ALF-20766?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With