How do I get the subfolders of a subfolder in nuxeo just by iterating in one go using nuxeo client
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 syntaxecm:ancestorId = 'some-doc-id'
orecm:ancestorId <> 'some-doc-id'
. It's an alternative toecm: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'...)
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!!
There is nothing out of the box except all levels or first level. You can however automate your custom need using some JavaScript automation,
Even if it is an open community knowledge base, we would appreciate:
Regards,
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