Sunday, March 1, 2015

How to find a Page has child Pages thorough Java API - AEM/Adobe CQ5

How to find a Page has child Pages thorough Java API - AEM/Adobe CQ5

This post will explain how to find a Page has child Pages thorough Java API in Adobe Experience Manager(AEM)

public static boolean hasPageChildren(Page rootPage) {
          boolean isTrue = false;
          if (rootPage != null&& rootPage.listChildren(getPageFilter()).hasNext()) {
       isTrue = true;
          }
        return isTrue;
}

public static PageFilter getPageFilter() {
PageFilter pf = new PageFilter();
return pf;
}


No comments:

Post a Comment