I have a completely set-up CQ5/AEM application and am supposed to generate a sitemap.xml. So far, so good.
I have a list of all the pages, but some of those pages are actually images. My question: How can I find out if a page is actually an image? Both have jcr:primaryType=cq:Page
public void getMoreChildren(HttpServletRequest request, JspWriter out, Page incomingChildPage) {
Iterator<Page> childPageChildren = incomingChildPage.listChildren();
while (childPageChildren.hasNext()) {
Page childPage = childPageChildren.next();
String pagePath = childPage.getPath();
SlingHttpServletRequest slingRequest = (SlingHttpServletRequest)request;
ResourceResolver resourceResolver = slingRequest.getResourceResolver();
Externalizer externalizer = resourceResolver.adaptTo(Externalizer.class);
String externalUrl = externalizer.publishLink(resourceResolver,pagePath) + ".html";
//do things with data so far
getMoreChildren(request, out, childPage);
}
}
All of this runs within a JSP and does what it's supposed to do so far, except that it treats images as pages and I want to ignore image files. What do I need to do?