How do I get the subfolders of a subfolder in nuxeo just by iterating in one go using nuxeo client

-1 votes

3 answers

269 views

ANSWER

Hello,

Even if it is an open community knowledge base, we would appreciate:

  • Polite forms
  • More context on your issue
  • Sample code you've tried to show where your investigations were going
  • Nuxeo version

Regards,

10/16/2019

hi Gregory Gregory Carlin ,

i am trying to develop the cms application using angular as frontend and java client sdk of nuxeo 3.2.0 version . so question is whether we can do or not only by using java client sdk without using nuxeo studio ? i want to manage multi tenant with tenant administrator and all kind of manipulation, and create my own role and permission create document with own custom schema . and sso login also . could you please help me in this thanks Bhagat Singh

01/22/2020

a c
Hello Bhagat Singh, sorry but I believe that the comment section is not the right place to ask your question. You should post a new question instead. Regards.
01/29/2020



A guess of answer from https://doc.nuxeo.com/nxdoc/nxql/ :

ecm:ancestorId: the id of an ancestor of the document (parent, grand-parent, etc., up to the root). This is only useable in a WHERE clause with the syntax ecm:ancestorId = 'some-doc-id' or ecm:ancestorId <> 'some-doc-id'. It's an alternative to ecm:path STARTSWITH '/some/doc/path' if you know the id instead of the path. See also ecm:path. (Since Nuxeo 5.9.6)

So If you're looking for a NXQL query to be used in a Nuxeo client, SELECT * FROM Folder WHERE ecm:ancestorId = <top folder id> or SELECT * FROM Document WHERE ecm:ancestorId = <top folder id> AND ecm:primaryType IN ('Folder', 'your custom type'...) might look like an answer to your question.

Would you want only first level subfolders, the NXQL query would look like: SELECT * FROM Folder WHERE ecm:parentId= <top folder id> or SELECT * FROM Document WHERE ecm:parentId = <top folder id> AND ecm:primaryType IN ('Folder', 'your custom type'...)

2 votes



Hi, It worked. Thanks
10/18/2019

Hi Patrick,

Getting all the sub-folders of a folder worked. Is there any way I can get sub-folders only till required level. I mean if I need only till second level or third level. Can we control how many levels to get?

Thanks in advance!!

10/18/2019

There is nothing out of the box except all levels or first level. You can however automate your custom need using some JavaScript automation,
10/18/2019


There is nothing out of the box except all levels or first level. You can however automate your custom need using some JavaScript automation,

0 votes



I'm working on the backend only with java client I have no idea about java script. Is there a way we can do it on backend
10/18/2019


Hi Patrick,

Getting all the sub-folders of a folder worked. Is there any way I can get sub-folders only till required level. I mean if I need only till second level or third level. Can we control how many levels to get?

Thanks in advance!!

0 votes