Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

create page programmatically by servlet

Avatar

Level 5

Hi ,

Please suggest how to create pages by hitting servlet in AEM6.1

 

Regards,

1 Accepted Solution

Avatar

Correct answer by
Administrator

As mentioned by Peter, please use PageManager APIs.

Example:- 

Link:- https://helpx.adobe.com/experience-manager/using/ecommerce62.html

// Creating custom Adobe Experience Manager 6.2 ecommerce providers

Option 2: Using Curl Commands

Link:- https://hashimkhan.in/2015/05/27/aem-with-curl/

//

Create a Page (Although its not recommended to do with cURL, as we have Page Manager API for this.)


curl -u admin:admin -F "jcr:primaryType=cq:Page" -F "jcr:content/jcr:primaryType=cq:PageContent" -F "jcr:content/jcr:title=Curl Page" -F "jcr:content/sling:resourceType=geometrixx/components/contentpage" http://localhost:4502/content/geometrixx/en/curlPage
 

I hope this would help you.

~kautuk



Kautuk Sahni

View solution in original post

2 Replies

Avatar

Community Advisor

Hi,

You can try and use the PageManager[1] API from your Servlet.

Please note that instance of PageManager[1] is instantiated via the PageManagerfactory[2]

[1] https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/api/PageManager.html

[2] https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/api/PageManagerFactory.html

Regards,

Peter

Avatar

Correct answer by
Administrator

As mentioned by Peter, please use PageManager APIs.

Example:- 

Link:- https://helpx.adobe.com/experience-manager/using/ecommerce62.html

// Creating custom Adobe Experience Manager 6.2 ecommerce providers

Option 2: Using Curl Commands

Link:- https://hashimkhan.in/2015/05/27/aem-with-curl/

//

Create a Page (Although its not recommended to do with cURL, as we have Page Manager API for this.)


curl -u admin:admin -F "jcr:primaryType=cq:Page" -F "jcr:content/jcr:primaryType=cq:PageContent" -F "jcr:content/jcr:title=Curl Page" -F "jcr:content/sling:resourceType=geometrixx/components/contentpage" http://localhost:4502/content/geometrixx/en/curlPage
 

I hope this would help you.

~kautuk



Kautuk Sahni