When using Apache Sling and CRX/CQ5 and JCR etc...
is it possible to iterate over the CQ5 page nodes in the JCR and rename the pages.
I currently have a script that can change properties within all child pages at a specific path.
I am desperately looking for a way to use the NodeIterator and Node classes to rename each page (not only the title and an arbitrary property but the name that forms the path) at the the specific path.
Example:
-content/xproject/shared/cars/a/abegro-assam
-content/xproject/shared/cars/m/motofuel-iss
I want to do something equivalent to:
while(cars.hasNext()) {
Node node = cars.nextNode();
//this is the functionality I want somehow...
node.setName("some-other-name");
//similar to how we would set JCR properties
node.setProperty("someProperty", "someValue");
}
Please advise as to somewhere where I can find this functionality within the CQ5/Sling/Apache/CRX stacks as this will be very helpful.
I am aware that I may be able to adaptTo() some other class other that node - but am desperately unsure as to how to proceed.