Hi,
I want to loop through sub-folders of a certain folder via javascript. My code looks like this:
function processNodes(myNodes) {
for (i = 0; i < myNodes.length; i++) {
doSomething(myNodes[i]);
if (recursive)
{
childNodes = myNodes[i].childFileFolders(false, true);
if (childNodes.length) {
processNodes(childNodes);
}
}
}
}
var referenceType = "node";
var reference = ["workspace", "SpacesStore", "e2686b75-7ebf-45a3-8364-7613001c6e14"];
foundNode = search.findNode(referenceType, reference);
nodes = foundNode.childFileFolders(false, true);
processNodes(nodes);The nodes = foundNode.childFileFolders(false, true); returns two folders. But the function processNodes only handles the first one. I would expect that it also handles the second one because recursive = true. But it does not. What am I doding wrong?
Thanks,
Patrick