Automating Page Generation in AEM | Community
Skip to main content
April 23, 2020
Solved

Automating Page Generation in AEM

  • April 23, 2020
  • 3 replies
  • 7137 views

Here is my use case,

 

I have thousand text article content

I need to create pages with same structure and layout for these 1000 articles

I don't want to create each page manually

How do I automate creating those 1000 pages ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Deepikaa_Nagesh

Hi,

 

It depends on how you want to create,i have put down in simple way here.

 

1.you first create a template for your article page -  as you know the layout .

2. Feed you articles data through excel or xml or any structured format.

3.you can even have this file uploaded in dam

4.write a servlet which can read data from this excel and create pages.

5. Pagemanager api helps you to create pages . ( as suggested by @ruchim71073425  ) & update components after page is created.

6.you can hit this servlet in browser, to create pages.

 

Note :  I hope this is one time creation of articles , you can run in batches rather than creating 1000 articles in one go.

 

3 replies

ruchim71073425
Level 2
April 23, 2020

You can use the Page Manager API to create pages programmatically.

April 23, 2020
Thanks for the response. Appreciate if you could explain little details on this, like what are the pre-requisites etc ?
Deepikaa_Nagesh
Deepikaa_NageshAccepted solution
Level 3
April 23, 2020

Hi,

 

It depends on how you want to create,i have put down in simple way here.

 

1.you first create a template for your article page -  as you know the layout .

2. Feed you articles data through excel or xml or any structured format.

3.you can even have this file uploaded in dam

4.write a servlet which can read data from this excel and create pages.

5. Pagemanager api helps you to create pages . ( as suggested by @ruchim71073425  ) & update components after page is created.

6.you can hit this servlet in browser, to create pages.

 

Note :  I hope this is one time creation of articles , you can run in batches rather than creating 1000 articles in one go.

 

April 23, 2020
Thanks Deepika, this helps.
BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
April 23, 2020

@17378384,

One other way is to create a Sling Servlet in AEM where it accepts a JSON object (by file upload). The Servlet will accept a POST request, where you can use a JSON parser in JAVA (like the Jackson Object Mapper) to parse the JSON Object; or other file format of your choice, but you need to select a correct parser.

The servlet will programmatically create cq:Page nodes as required (how to create cq:Page programmatically) using the PageManager OR you can create a generic page with pre-configured components in AEM first, then use the PageManager to copy the generic page, and update properties and components for that given page.

Note: Migrate pages by batches, try to categories each migration by the unique templates.

After pages are created, you create a content package to deploy to live environments.

I hope this helps!