public static PageFilter getPageFilter() {
PageFilter pf = new PageFilter();
return pf;
}
public static Iterator<Page> getPageIterator(Page page){
Iterator<Page> children = page. listChildren(getPageFilter());
return children;
}
The filter can be changed to restrict child pages e.g Get the child pages created only with the template "/apps/sample/templates/samplePage"
public static PageFilter getPageFilter() {
PageFilter pf = new PageFilter() {
public boolean includes(Page p) {
ValueMap props = p.getProperties();
String templatePath = props.get("cq:template",String.class);
if("/apps/sample/templates/samplePage".equals(templatePath))
{
return true;
} else
{
return false;
}
}
};
return pf;
}
No comments:
Post a Comment
If you have any doubts or questions, please let us know.