cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS count folder and document

sintextsrl
Champ in-the-making
Champ in-the-making
Hi,

I want know a number of the documents and file in a root folder. I do a simple query and retrieve a property getTotalNumItems of ItemIterable<QueryResult> query. I think that this solution is no better solution to count a item of specific root folder. My code is:

         String query = "SELECT * FROM cmis:document D WHERE IN_TREE (D, '"+workSpace+"') ";
         
         ItemIterable<QueryResult> q = session.query(query, false);
         
          q.getTotalNumItems();
Is there another mode to retrieve a number of item of root folder from CMIS protocol?

thanks a lot.


1 REPLY 1

angelborroy
Community Manager Community Manager
Community Manager
I think is the only way: look at Florian comment in this post https://angelborroy.wordpress.com/2014/07/15/alfresco-·-counting-elements-by-cmis-queries/
Hyland Developer Evangelist