cancel
Showing results for 
Search instead for 
Did you mean: 

get children of subfolder

nancyaggarwal
Champ in-the-making
Champ in-the-making
Hi All,


I have below folder structure in my repository:

rootfolder(test)
   |
   ———-subfolder1(test1)
   |               |
   |               |
   |               ————subfolder1child1(test2)
   |               |
   |               ————–subfolder1child2(test3)
   |
   |
    ———-subfolder2(testing)
                 |
                 |————-subfolder2child1(testing1)
 

Now i want to populate all subfolders in a dropdown i.e. the folder below root folder and its subfolders(subfolder1 and 2 and all its child).

How i can achieve this?
 

Regards,
Nancy
3 REPLIES 3

darkredd
Star Contributor
Star Contributor
Hi,

I am not clear as to in what context you want that dropdown; nonetheless here is what I think you should do:

use the node.children method in a loop. Have an array collecting everything that is a folder.

e.g.

var nodes = rootFolder.children;
for each(node in nodes)
{
   if(node.isContainer)
   {
      //further conditional loop to check for more children
   }
}


Hope this will get you started.

Thanks DarkRedd for your reply.

I want this dropdown for uploading documents in a folder using CMIS from my client application. I will try this approach and get back to you with the result.


Thanks
Nancy

muralidharand
Star Contributor
Star Contributor
Does serachService / lucene will help here?