ovidiu 2002/09/24 01:31:48 Modified: src/java/org/apache/cocoon/components/treeprocessor/sitemap ScriptNodeBuilder.java Log: Modified to work with the new data model for the control flow. Revision Changes Path 1.4 +18 -12 xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ScriptNodeBuilder.java Index: ScriptNodeBuilder.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ScriptNodeBuilder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ScriptNodeBuilder.java 8 Sep 2002 00:35:47 -0000 1.3 +++ ScriptNodeBuilder.java 24 Sep 2002 08:31:47 -0000 1.4 @@ -45,19 +45,11 @@ */ package org.apache.cocoon.components.treeprocessor.sitemap; -import org.apache.avalon.excalibur.component.ExcaliburComponentSelector; -import org.apache.avalon.framework.component.ComponentManager; -import org.apache.avalon.framework.component.ComponentSelector; -import org.apache.avalon.framework.component.Composable; import org.apache.avalon.framework.configuration.Configuration; -import org.apache.avalon.framework.configuration.ConfigurationException; -import org.apache.cocoon.components.flow.Interpreter; -import org.apache.cocoon.components.language.generator.GeneratorSelector; import org.apache.cocoon.components.treeprocessor.AbstractProcessingNodeBuilder; -import org.apache.cocoon.components.treeprocessor.CategoryNode; -import org.apache.cocoon.components.treeprocessor.CategoryNodeBuilder; import org.apache.cocoon.components.treeprocessor.LinkedProcessingNodeBuilder; import org.apache.cocoon.components.treeprocessor.ProcessingNode; +import org.apache.cocoon.components.flow.Interpreter; /** * Builder class for creating a {@link ScriptNode} instance @@ -66,7 +58,9 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Ovidiu Predescu</a> * @since March 13, 2002 */ -public class ScriptNodeBuilder extends AbstractProcessingNodeBuilder +public class ScriptNodeBuilder + extends AbstractProcessingNodeBuilder + implements LinkedProcessingNodeBuilder { protected ScriptNode node; @@ -74,11 +68,23 @@ throws Exception { String source = config.getAttribute("src"); - String language = config.getAttribute("language", "JavaScript"); - this.node = new ScriptNode(source, language); + this.node = new ScriptNode(source); this.treeBuilder.setupNode(this.node, config); return this.node; + } + + /** + * Call the built node to register the script it contains with the + * flow interpreter. + */ + public void linkNode() + throws Exception + { + FlowNode flowNode = (FlowNode)this.treeBuilder.getRegisteredNode("flow"); + Interpreter interpreter = flowNode.getInterpreter(); + + this.node.registerScriptWithInterpreter(interpreter); } }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]