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
BedrockMission!

Learn More

View all

Sign in to view all badges

Programmatic publishing a AEM page

Avatar

Avatar
Validate 1
Level 1
shubhankits2041
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
shubhankits2041
Level 1

Like

1 like

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
shubhankits2041
Level 1

26-11-2019

Hi All,

I have more then 100 pages in my AEM site with the name containing lots of '_-' together so for sanitizing the page name i have written a java servlet which will compare the page title of the page with the sanitized title and if it does not match it will copy the page with correct title to the same location and delete the old page.

Question- Is there any way so that i can publish all the pages programmatic which are going through title change.

I am using pageManager.copy() and pageManager.delete().

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

200 likes

Total Posts

264 posts

Correct Reply

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

Avatar
Springboard
MVP
Shashi_Mulugu
MVP

Likes

200 likes

Total Posts

264 posts

Correct Reply

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

26-11-2019

You can use Replicator to make your job:

@Reference private Replicator replicator;

String path = "PATH OF THE RESOURCE HERE";

Session session = //Get the session from eg. a the request

try

{

replicator.replicate(session, "ACTIVATE", path);

}

catch(ReplicationException replicationException)

{

//Handle the replication exception

}

Answers (0)