April 1, 2020
Estimated Post Reading Time ~

Code Snippet to create page

You can use WCM API to create page in CQ apart from CURL (Form Post) command mentioned here.

Some code example,

Using resource resolver,

import com.day.cq.wcm.api.PageManager;
ResourceResolver resolver = <Get instance of resource resolver>
<If you have request object then request.getResourceResolver()>
PageManager pm = resolver.adaptTo(PageManager.class);
pm.create(String parentPath, String pageName, String template, String title) throws WCMException


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.