Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

AEM - Create pages via a servlet

Avatar

Level 1

Hello, I want to create a servlet that will use the PageManager API to create a new page based off of a template. Basically whenever a new language is added to our site, I'd like a new page to be created automatically of the same template every time under that language.

 

Is this possible/advised?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi GRVYbb,

 

PREVIEW
i agreed with AvinashGupta01 .So you can check MSM than creating servlet file .
 
Multi Site Manager (MSM) enables us to easily manage multiple web sites that share common content. MSM lets you define relations between the sites so that content changes in one site are automatically replicated in other sites.

MSM reduces the time it takes to manage us websites and increases the re-use of common content:

  • Efficiently manage different language versions of a website.
  • Automatically update one or more sites based on a source site:
    • Enforce a common base structure and use common content across multiple sites.
    • Maximize the use of available resources.
    • Focus efforts on managing the content that differs between the sites.
    • Maintain a common look and feel.

Ref : https://experienceleague.adobe.com/docs/experience-manager-64/administering/introduction/msm.html?la...

 

Thanks

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @GRVYbb Instead of creating a servlet to generate a new page, why don't you leverage the multisite manager functionality of AEM and generate the live copies of the new language pages. This is all OOB and you don't have write any custom logic. 

 

Refer to the below link:- 

https://experienceleague.adobe.com/docs/experience-manager-65/administering/introduction/msm-livecop... 

 

Hope this helps.

Avatar

Employee Advisor

hi @GRVYbb ,

 

For this requirement you can write a launcher which will trigger a workflow for the specific event. 

 

In the workflow, use process step to create page using pagemanager API and dont forget to save the session or commit the ResourceResolver to save your changes in JCR repository.

 

Hope this helps

 

Thanks,

Nikita Garg

Avatar

Correct answer by
Community Advisor

Hi GRVYbb,

 

PREVIEW
i agreed with AvinashGupta01 .So you can check MSM than creating servlet file .
 
Multi Site Manager (MSM) enables us to easily manage multiple web sites that share common content. MSM lets you define relations between the sites so that content changes in one site are automatically replicated in other sites.

MSM reduces the time it takes to manage us websites and increases the re-use of common content:

  • Efficiently manage different language versions of a website.
  • Automatically update one or more sites based on a source site:
    • Enforce a common base structure and use common content across multiple sites.
    • Maximize the use of available resources.
    • Focus efforts on managing the content that differs between the sites.
    • Maintain a common look and feel.

Ref : https://experienceleague.adobe.com/docs/experience-manager-64/administering/introduction/msm.html?la...

 

Thanks

Avatar

Level 1

Thank you, I'll check this out. For sanity check reasons though - it is possible for a servlet to listen for a page creation then have it automatically create the page I want correct?