AEM : Bulk Sites Creation/Live Copies Automation Using WCMCommand Servlet | AEM Community Blog Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,198 likes

Total Posts

6,383 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,198 likes

Total Posts

6,383 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

03-08-2020

BlogImage.jpg

AEM : Bulk Sites Creation/Live Copies Automation Using WCMCommand Servlet by Sreenivas B

Abstract

The problem
Normally, when we want to create a live copy from a blueprint or a master site, we go to the Sites Console and use the “Create Live Copy” or “Create Site” button. But sometimes there might be a need to automate the creation of sites. For eg:, there might be a requirement to create multi-tenant sites using the blueprint or master site automatically or programmatically, based on some inputs or criteria. Currently there is no Java API which can be directly used to create the live copy.
The Solution
Here is the solution: Call the WCMCommand Servlet using Sling Request Processor.
Implementation Steps
Create a custom OSGi Service
1. Create a custom OSGi Service which can be called from any other class.
2. Declare a method which accepts the arguments required to create a live copy -
-->a. Resource Resolver : required for the WCMCommand Servlet request
-->b. srcPath : the master path from which live copy has to be created
-->c. destPath : the path under which live copy has to be created
-->d. title : the livecopy root page title
-->e. label : the livecopy root page name
-->f. rolloutConfigs : an array of rollout configurations to be included

Read Full Blog

AEM : Bulk Sites Creation/Live Copies Automation Using WCMCommand Servlet

Q&A

Please use this thread to ask the related questions.