Java Client - get sub folders

Hello,

Is there a method to get the subfolder list of a folder by its id ? I found the repository().fetchChildrenById(id) method but it returns all documents (documents and folders). In the UI, nuxeo is calling this url when we disclose a node in the tree :

http://localhost:8080/nuxeo/api/v1/search/pp/tree_children/execute?currentPageIndex=0&pageSize=-1&sortBy=&sortOrder=&queryParams=FODER_ID

with this enricher in the request header : X-NXenrichers.document : hasFolderishChild

May be I can use the Java Client API to make this call ?

0 votes

1 answers

119 views

ANSWER



Hello,

The fetchChildrenById is designed to return all kind of documents, it calls the @children web adapter server side.

The url you give is a call to the tree_children page provider. You can request a page provider with the java client with Repository#queryByProvider API. In your context, the call to do would be something like below:

repository().enrichersForDocument("hasFolderishChild")
            .queryByProvider("tree_children", "-1", "0", "", "", "", "FOLDER_ID");

Note: the java client is still using the query endpoint API which has been deprecated. We've planned to use search endpoint instead JAVACLIENT-178.

1 votes