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.flow.Interpreter; 23 24 32 public class ScriptNodeBuilder 33 extends AbstractProcessingNodeBuilder 34 implements LinkedProcessingNodeBuilder 35 { 36 protected ScriptNode node; 37 38 public ProcessingNode buildNode(Configuration config) 39 throws Exception 40 { 41 String source = config.getAttribute("src"); 42 43 this.node = new ScriptNode(source); 44 this.treeBuilder.setupNode(this.node, config); 45 46 return this.node; 47 } 48 49 53 public void linkNode() 54 throws Exception 55 { 56 FlowNode flowNode = (FlowNode)this.treeBuilder.getRegisteredNode("flow"); 57 Interpreter interpreter = flowNode.getInterpreter(); 58 59 this.node.registerScriptWithInterpreter(interpreter); 60 } 61 } 62 | Popular Tags |