cancel
Showing results for 
Search instead for 
Did you mean: 

Get all Childs of a Node

toze
Champ in-the-making
Champ in-the-making
How can i get all childs off a node?
Must i do a Recursive call to .getChildAssocs(nodeRef)  ?

Thanks in advance
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
It depends upon what you want!  

For example do  you want the assoc or the nodes themselves,  do you want deep listing, or do you only want nodes of certain types or with certain assocs.

The following two services are full of many methods that may be useful.
Node Service
FileFolderService

toze
Champ in-the-making
Champ in-the-making
I want the deep listing!
For example i have a folder who have 5 sub-folders and some files. That 5 sub-folders have sub-folders, and files; and so on!

NodeService dont have methods who give the deep listing, for what i could see in the Api.

Going to check the other service.

Thanks for the tips

mrogers
Star Contributor
Star Contributor
FileFolderService has a listDeepFolders method.    It was (in my opinion) over hastily "deprecated".  It does however work since imap is dependent upon it.

Deep listing is problematic due to the sheer number of records that could be returned.    Not quite sure what the correct solution is here.    At minimum it needs to have paging.

lotharmärkle
Champ in-the-making
Champ in-the-making
Please: +1 for a general getChild Method of the NodeService which supports paging. FileFolderService is tied to cm:content etc. Not usable for archiveStore or version2Store e.g.