Automating Page Generation in AEM | Community
Skip to main content
Apr 23, 2020 6:38 AM UTC
Solved

Automating Page Generation in AEM

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.
Deepikaa_Nagesh
Deepikaa_NageshAccepted solution
Level 3
Apr 23, 2020 8:35 AM UTC

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.

 

6 replies

BrianKasingli
New Participant
Apr 23, 2020 8:39 AM UTC

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

 

Translate
Deepikaa_Nagesh
Deepikaa_NageshAccepted solution
Level 3
Apr 23, 2020 8:35 AM UTC

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.

 

Translate
Apr 23, 2020 8:39 AM UTC
Thanks Deepika, this helps.
Translate
ruchim71073425
Level 2
Apr 23, 2020 6:49 AM UTC

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

Translate
Apr 23, 2020 7:55 AM UTC
Thanks for the response. Appreciate if you could explain little details on this, like what are the pre-requisites etc ?
Translate