reinhard 2003/09/12 11:16:37
Modified:
src/blocks/scratchpad/java/org/apache/cocoon/components/flow/javascript/fom
AO_FOM_Cocoon.java
Log:
- add a dummy function jsFunction_apply( String script ) to make it
easier to switch between the differnet interpreters in the future
Revision Changes Path
1.2 +25 -13
cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_Cocoon.java
Index: AO_FOM_Cocoon.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/flow/javascript/fom/AO_FOM_Cocoon.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AO_FOM_Cocoon.java 6 Sep 2003 13:23:30 -0000 1.1
+++ AO_FOM_Cocoon.java 12 Sep 2003 18:16:37 -0000 1.2
@@ -78,6 +78,7 @@
import org.mozilla.javascript.Undefined;
import org.mozilla.javascript.Wrapper;
import org.mozilla.javascript.continuations.Continuation;
+
/**
* Implementation of FOM (Flow Object Model).
*
@@ -201,30 +202,25 @@
environment.redirect(false, uri);
}
-/*
-
- NOTE (SM): These are the hooks to the future FOM Event Model that will be
- designed in the future. It has been postponed because we think
- there are more important things to do at the moment, but these
- are left here to indicate that they are planned.
+ /*
+ NOTE (SM): These are the hooks to the future FOM Event Model that will be
+ designed in the future. It has been postponed because we think
+ there are more important things to do at the moment, but these
+ are left here to indicate that they are planned.
public void jsFunction_addEventListener(String eventName,
Object function) {
- // what is this?
}
public void jsFunction_removeEventListener(String eventName,
Object function) {
- // what is this?
}
-
-*/
+ */
/**
* Access components.
*
- * TODO: Do we want to restrict the access of sitemap components? (RP)
- * TODO: Do we want to raise an error or return null? (RP)
+ * @param id - role name of the component
*/
public Object jsFunction_getComponent(String id)
throws Exception {
@@ -244,6 +240,22 @@
throw new JavaScriptException( "Only components can be
released!" );
}
}
+
+ // (RPO) added by interception layer
+ /**
+ * Dummy function for apply methods which does nothing - only necessary
+ * to make it easy to switch between the interception aware interpreter
+ * (intercepted-javascript) and the other (javascript). See cocoon.xconf
+ * for details.
+ */
+ public void jsFunction_apply( String script ) {
+ if( logger.isWarnEnabled() ) {
+ logger.warn( "In order to apply interceptions to your Javascript
functions " +
+ "you have to use the interceptions aware Javascript
interpreter. " +
+ "Check your settings in cocoon.xconf!" );
+ }
+ }
+ // --end
/**
* Load the script file specified as argument.