I have to activate 1000 pages from author to 7 publish servers daily .I want to schedule this process.How do we programmatically activate these pages in batches ?
Solved! Go to Solution.
You can create a scheduled cron job to activate the pages programmatically (see code sample for activation shared by @Kautuksahni). You can define the number of pages to activate in one run as configuration property of the job.
Below are some of the example of cron jobs -
http://blogs.adobe.com/experiencedelivers/experience-management/scheduling_jobs_usingsling/
Views
Replies
Total Likes
Hi
Option 1:- Using Curl
Activate
curl -u admin:admin -X POST -F path="/content/path/to/page" -F cmd="activate" http://localhost:4502/bin/replicate.json
Link:- https://gist.github.com/sergeimuller/2916697
Option 2:- Use Replicator OSGi service:
//
@Component public class MyComponent { @Reference private Replicator replicator; private void activatePage(Session session) { //... replicator.replicate(session, ReplicationActionType.ACTIVATE, pathToPage); //... } }
Link:- http://www.sotheanim.com/21-how-to-programmatically-activate-cq-page
I hope this would help you.
Thanks and Regards
Kautuk Sahni
@Sh1ju
The integration Spring batch framework with AEM is the right solution for dealing with batch processing. This isn't hard to integrate because AEM already has spring stuff.
Java Executer Framework for multithreading implementation also fits in your case.
Here is the article to start with https://dzone.com/articles/spring-batch-hello-world-1
Jitendra
Views
Replies
Total Likes
Let me know if you need more information about integrating Sprint batch with AEM.
Jitendra
Views
Replies
Total Likes
Will this code activate these pages in 'batches' ?
Views
Replies
Total Likes
You can create a scheduled cron job to activate the pages programmatically (see code sample for activation shared by @Kautuksahni). You can define the number of pages to activate in one run as configuration property of the job.
Below are some of the example of cron jobs -
http://blogs.adobe.com/experiencedelivers/experience-management/scheduling_jobs_usingsling/
Views
Replies
Total Likes
@Kunal23,
In my opinion, one
Jitendra
Views
Replies
Total Likes
Well, page activation is not a resource intensive task as it just queues the pages for activation in replication agent queue. Also, the cron job is going to run in the background as a separate thread and in my opinion is a simple solution to achieve this.
Views
Replies
Total Likes