Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

Groovy Script

Avatar

Level 5

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

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
0 Replies

Avatar

Correct answer by
Community Advisor