1 16 package org.apache.cocoon.components.treeprocessor.sitemap; 17 18 import org.apache.avalon.framework.configuration.Configuration; 19 import org.apache.cocoon.components.treeprocessor.AbstractProcessingNodeBuilder; 20 import org.apache.cocoon.components.treeprocessor.LinkedProcessingNodeBuilder; 21 import org.apache.cocoon.components.treeprocessor.ProcessingNode; 22 import org.apache.cocoon.components.treeprocessor.variables.VariableResolverFactory; 23 import org.apache.cocoon.transformation.Transformer; 24 25 import java.util.Collection ; 26 import java.util.Map ; 27 28 33 34 public class TransformNodeBuilder extends AbstractProcessingNodeBuilder 35 implements LinkedProcessingNodeBuilder { 36 37 private TransformNode node; 38 39 private Collection views; 40 private Map pipelineHints; 41 42 public ProcessingNode buildNode(Configuration config) throws Exception { 43 44 String type = this.treeBuilder.getTypeForStatement(config, Transformer.ROLE + "Selector"); 45 46 this.views = ((SitemapLanguage)this.treeBuilder).getViewsForStatement(Transformer.ROLE, type, config); 47 this.pipelineHints = ((SitemapLanguage)this.treeBuilder).getHintsForStatement(Transformer.ROLE, type, config); 48 49 this.node = new TransformNode( 50 type, 51 VariableResolverFactory.getResolver(config.getAttribute("src", null), this.manager) 52 ); 53 54 this.node.setPipelineHints(this.pipelineHints); 55 return this.treeBuilder.setupNode(node, config); 56 } 57 58 public void linkNode() throws Exception { 59 this.node.setViews( 60 ((SitemapLanguage)this.treeBuilder).getViewNodes(this.views) 61 ); 62 } 63 } 64 | Popular Tags |