Index: hst/src/main/java/org/onehippo/forge/robotstxt/components/RobotstxtComponent.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hst/src/main/java/org/onehippo/forge/robotstxt/components/RobotstxtComponent.java (revision 55531) +++ hst/src/main/java/org/onehippo/forge/robotstxt/components/RobotstxtComponent.java (revision ) @@ -1,5 +1,5 @@ /** - * Copyright 2012-2013 Hippo B.V. (http://www.onehippo.com) + * Copyright 2012-2015 Hippo B.V. (http://www.onehippo.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,10 @@ import java.util.List; import java.util.ArrayList; - import javax.jcr.Node; import javax.jcr.NodeIterator; import javax.jcr.RepositoryException; import javax.jcr.query.QueryManager; - import org.apache.jackrabbit.util.ISO9075; import org.hippoecm.hst.component.support.bean.BaseHstComponent; import org.hippoecm.hst.content.beans.standard.HippoBean; @@ -101,24 +99,44 @@ while (nodeIterator.hasNext()) { Node node = nodeIterator.nextNode(); - HstLink link = linkCreator.create(node, request.getRequestContext()); + if (node.hasNodes() ){ + + NodeIterator facetChildNodesIterator = node.getNodes(); + + + while (facetChildNodesIterator.hasNext()){ + Node facetChildNode = facetChildNodesIterator.nextNode(); + + if (!facetChildNode.isNodeType("hippofacnav:facetsavailablenavigation")){ + continue; + } + + HstLink link = linkCreator.create(facetChildNode, request.getRequestContext()); + - if (link.isNotFound()) { - continue; - } + if (link.isNotFound()) { + continue; + } - if (link.getMount() != mount) { - /** - * Some projects combine the content of multiple sites into the same content tree. - * It may then happen that certain (faceted) content is only available on another - * site than the one for which robots.txt has been requested. In order to avoid that - * robots.txt ends up with links to different sites, we exclude such content here. - */ - continue; - } + if (link.getMount() != mount) { + /** + * Some projects combine the content of multiple sites into the same content tree. + * It may then happen that certain (faceted) content is only available on another + * site than the one for which robots.txt has been requested. In order to avoid that + * robots.txt ends up with links to different sites, we exclude such content here. + */ + continue; + } - // Link is suitable for rendering. - disallowedLinks.add(link); + // Link is suitable for rendering. + disallowedLinks.add(link); + + + } + + + } + } } catch (RepositoryException e) { throw new HstComponentException(e);