org.apache.cocoon.components.treeprocessor.sitemap
public class: SitemapNodeBuilder [javadoc |
source]
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.treeprocessor.AbstractProcessingNodeBuilder
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNodeBuilder
org.apache.cocoon.components.treeprocessor.sitemap.SitemapNodeBuilder
All Implemented Interfaces:
org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.configuration.Configurable, ProcessingNodeBuilder, org.apache.avalon.framework.component.Recomposable
Builds all nodes below the top-level <sitemap> element, and returns the
<pipelines> node. There is no node for >sitemap< since no processing
occurs at this level.
- author:
< - a href="mailto:sylvain@apache.org">Sylvain Wallez
- version:
CVS - $Id: SitemapNodeBuilder.java 433543 2006-08-22 06:22:54Z crossley $
| Method from org.apache.cocoon.components.treeprocessor.sitemap.SitemapNodeBuilder Summary: |
|---|
|
buildNode |
| Method from org.apache.cocoon.components.treeprocessor.sitemap.SitemapNodeBuilder Detail: |
public ProcessingNode buildNode(Configuration config) throws Exception {
// Start by explicitely ordered children
for (int i = 0; i < orderedNames.length; i++) {
Configuration childConfig = config.getChild(orderedNames[i], false);
if (childConfig != null) {
ProcessingNodeBuilder builder = this.treeBuilder.createNodeBuilder(childConfig);
// Don't build them since "pipelines" is not present in this list
builder.buildNode(childConfig);
}
}
ProcessingNode pipelines = null;
// Now build all those that have no particular order
Configuration[] childConfigs = config.getChildren();
loop: for (int i = 0; i < childConfigs.length; i++) {
Configuration childConfig = childConfigs[i];
if (isChild(childConfig)) {
// Is it in the ordered list ?
for (int j = 0; j < orderedNames.length; j++) {
if (orderedNames[j].equals(childConfig.getName())) {
// yep : already built above
continue loop;
}
}
ProcessingNodeBuilder builder = this.treeBuilder.createNodeBuilder(childConfig);
ProcessingNode node = builder.buildNode(childConfig);
if (node instanceof PipelinesNode) {
if (pipelines != null) {
String msg = "Only one 'pipelines' is allowed, at " + childConfig.getLocation();
throw new ConfigurationException(msg);
}
pipelines = node;
}
}
}
if (pipelines == null) {
String msg = "Invalid sitemap : there must be a 'pipelines' at " + config.getLocation();
throw new ConfigurationException(msg);
}
return pipelines;
}
|