ovidiu 02/03/17 14:11:40
Modified:
src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap
ScriptNode.java
Log:
Register the loaded script file with the interpreter, instead of
calling readScript. The interpreter will delay loading the file until
a request which calls a function is made. This will properly load
files from the Web application.
Revision Changes Path
1.5 +5 -1
xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap/ScriptNode.java
Index: ScriptNode.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap/ScriptNode.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ScriptNode.java 15 Mar 2002 23:41:32 -0000 1.4
+++ ScriptNode.java 17 Mar 2002 22:11:40 -0000 1.5
@@ -14,6 +14,7 @@
import org.apache.avalon.framework.context.Contextualizable;
import org.apache.cocoon.Constants;
import org.apache.cocoon.components.flow.Interpreter;
+import org.apache.cocoon.components.flow.AbstractInterpreter;
import org.apache.cocoon.components.treeprocessor.AbstractProcessingNode;
import org.apache.cocoon.components.treeprocessor.CategoryNode;
import org.apache.cocoon.components.treeprocessor.InvokeContext;
@@ -76,7 +77,10 @@
= (ComponentSelector)manager.lookup(Interpreter.ROLE);
// Obtain the Interpreter instance for this language
Interpreter interpreter = (Interpreter)selector.select(language);
- interpreter.readScript(source);
+ if (interpreter instanceof AbstractInterpreter)
+ ((AbstractInterpreter)interpreter).register(source);
+ // else FIXME: what to do if interpreter doesn't inherit from
+ // AbstractInterpreter
}
catch (Exception ex) {
ex.printStackTrace();
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]