traverse node in jcr;content | Community
Skip to main content
October 16, 2015
Solved

traverse node in jcr;content

  • October 16, 2015
  • 4 replies
  • 1697 views

Hi for migration project . I extracted the zip files in content/dam/dcl/migration now I need to move the extracted  files  in jcr-content add metadata using xml file, create versions, etc..

I am having difficult time traversing the jcr:content. to accomplish the move this is  a gatekeeper class in my workflow launcher.

resource - is dam/dcl/migration..i have attached the screen shot of the node structure i need to traverse.

Please help me this is an urgent issue that needs to be fixed.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Lokesh_Shivalingaiah

Use Asset API [1] to get the metadata, renditions etc

[1] https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/api/Asset.html

4 replies

kautuk_sahni
Community Manager
Community Manager
October 16, 2015

Hi

The Links mentioned by Bsloki will definitely solve your problem.

Few more reference links for deeper knowledge and expanding our knowledge spectrum are mentioned below:- 

Link:- http://cq-ops.tumblr.com/post/43179911102/how-to-efficiently-copy-large-amounts-of-content  (How to efficiently copy large amount of content between CQ repositories).

Link:- https://helpx.adobe.com/experience-manager/using/graniteAPI.html (Moving DAM Assets using the Adobe Experience Manager Granite AssetManager API)

Link:- https://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html (Traversing all the JCR nodes)

//

javax.jcr.NodeIterator nodeIter = result.getNodes();

while ( nodeIter.hasNext() ) {
 
  //For each node-- create a customer instance
cust = new Customer();
         
 javax.jcr.Node node = nodeIter.nextNode();
           
 //Set all Customer object fields
 cust.setCustFirst(node.getProperty("firstName").getString());
 cust.setCustLast(node.getProperty("lastName").getString());
 cust.setCustAddress(node.getProperty("address").getString());
 cust.setCustDescription(node.getProperty("desc").getString());
           
  //Push Customer to the list
  custList.add(cust);
  }

 

 

I hope this would help you.

 

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
October 16, 2015

Use Asset API [1] to get the metadata, renditions etc

[1] https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/api/Asset.html

smacdonald2008
October 16, 2015
Lokesh_Shivalingaiah
October 16, 2015