Groovy Script | Community
Skip to main content
Level 5
October 22, 2020
Solved

Groovy Script

  • October 22, 2020
  • 1 reply
  • 1270 views

Hi Team,

 

We have come across following requirement: 

 

1) We have two sites siteA and siteB.

2) in siteB, at compoent level and page level, we have many references of siteA pages.

3) Now we need to correct references i.e. replace any node property in siteB which has value like /content/siteA to /content/siteB .

 

In order to achieve above requirement, we thought to use groovy script.

 

Could someone please help me with groovy script which does following:

 

  • Traverse all nodes (all nodes, not only jcr:content nodes) under any given path
  • and check each property value if it has /content/siteA, replace it with /content/siteB.

 

Regards,

Ap

 

 

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

1 reply

Shashi_Mulugu
Community Advisor
Shashi_MuluguCommunity AdvisorAccepted solution
Community Advisor
October 23, 2020