Hi, I am having trouble applying this past script to ALL the sub-nodes of a DMS
directory (eg: including other files and other sub-directories)
Would anyone gently post the recursive code to do that?
(giving a DMS directory rename all the .title with the .name string value)
I would really appreciate!
I've tried a recursive like this but no way out =/
[code]recursive( content.getJCRNode() );
public void ricorri( Node node ) throws Exception {
System.out.println( node.getPath() );
recursive( node.getNodes() );
}
public void recursive( NodeIterator nodes ) {
try {
while( nodes.hasNext() ) {
Node node = nodes.nextNode();
System.out.println( node.getPath() );
if ( node.hasNodes() ) {
recursive( node.getNodes() );
}
}
} catch( Exception e ) {
e.printStackTrace();
}
}
[/code]
It should be a 3-4 lines of smart Groovy code using another "each" inside the
initial code i posted.
Thank you all in advance
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=d8cfcc65-b6b0-4c19-903b-9e4cd8396892
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------