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.generation.Generator; 24 25 import java.util.Collection ; 26 import java.util.Map ; 27 28 33 34 public class GenerateNodeBuilder extends AbstractProcessingNodeBuilder 35 implements LinkedProcessingNodeBuilder { 36 37 private GenerateNode 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, Generator.ROLE + "Selector"); 45 46 this.views = ((SitemapLanguage)this.treeBuilder).getViewsForStatement(Generator.ROLE, type, config); 47 this.pipelineHints = ((SitemapLanguage)this.treeBuilder).getHintsForStatement(Generator.ROLE, type, config); 48 49 this.node = new GenerateNode( 50 type, 51 VariableResolverFactory.getResolver(config.getAttribute("src", null), this.manager) 52 ); 53 this.node.setPipelineHints(this.pipelineHints); 54 return this.treeBuilder.setupNode(this.node, config); 55 } 56 57 public void linkNode() throws Exception { 58 this.node.setViews( 59 ((SitemapLanguage)this.treeBuilder).getViewNodes(this.views) 60 ); 61 } 62 } 63 | Popular Tags |