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

Automating Page Generation in AEM

Avatar

Avatar
Level 1
wasimzen
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
wasimzen
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
wasimzen
Level 1

22-04-2020

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
Deepikaa_Nagesh
Level 2

Likes

14 likes

Total Posts

46 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
Deepikaa_Nagesh
Level 2

Likes

14 likes

Total Posts

46 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
Deepikaa_Nagesh
Level 2

23-04-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.

 

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 1
ruchim71073425
Level 1

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ruchim71073425
Level 1

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 1
View profile
ruchim71073425
Level 1

22-04-2020

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

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

644 likes

Total Posts

605 posts

Correct Reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

644 likes

Total Posts

605 posts

Correct Reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

23-04-2020

@wasimzen,

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!