Groovy Script

Avatar

Avatar
Boost 5
Level 2
arvind
Level 2

Likes

7 likes

Total Posts

34 posts

Correct reply

0 solutions
Top badges earned
Boost 5
Give Back
Ignite 1
Boost 3
Validate 1
View profile

Avatar
Boost 5
Level 2
arvind
Level 2

Likes

7 likes

Total Posts

34 posts

Correct reply

0 solutions
Top badges earned
Boost 5
Give Back
Ignite 1
Boost 3
Validate 1
View profile
arvind
Level 2

22-10-2020

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

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

234 likes

Total Posts

295 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

234 likes

Total Posts

295 posts

Correct reply

67 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Applaud 100
Establish
View profile
Shashi_Mulugu
MVP

22-10-2020

Answers (0)