cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: rev 57489 - in cocoon/branches/BRANCH_2_1_X: . src/java/org/apache/cocoon/components/flow/javascript/fom
Date Fri, 12 Nov 2004 02:17:15 GMT
Author: vgritsenko
Date: Thu Nov 11 18:17:15 2004
New Revision: 57489

Modified:
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
   cocoon/branches/BRANCH_2_1_X/status.xml
Log:
     Flowscript: Deprecated support for passing sitemap parameters into flowscript
     function as positional arguments. Use cocoon.parameters instead. Support will
     be removed completely in Cocoon 2.2.



Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
Thu Nov 11 18:17:15 2004
@@ -15,29 +15,13 @@
  */
 package org.apache.cocoon.components.flow.javascript.fom;
 
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
 import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.avalon.framework.activity.Initializable;
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.service.ServiceManager;
+
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.ResourceNotFoundException;
 import org.apache.cocoon.components.ContextHelper;
@@ -52,11 +36,13 @@
 import org.apache.cocoon.environment.Redirector;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.Session;
+
 import org.apache.commons.jxpath.JXPathIntrospector;
 import org.apache.commons.jxpath.ri.JXPathContextReferenceImpl;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.source.SourceValidity;
+import org.mozilla.javascript.BaseFunction;
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.EcmaError;
 import org.mozilla.javascript.EvaluatorException;
@@ -76,6 +62,23 @@
 import org.mozilla.javascript.tools.debugger.Main;
 import org.mozilla.javascript.tools.shell.Global;
 
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
 /**
  * Interface with the JavaScript interpreter.
  *
@@ -707,6 +710,14 @@
                     Object fun = ScriptableObject.getProperty(thrScope, funName);
                     if (fun == Scriptable.NOT_FOUND) {
                         throw new ResourceNotFoundException("Function \"javascript:" + funName
+ "()\" not found");
+                    }
+
+                    // Check count of arguments
+                    if (fun instanceof BaseFunction) {
+                        if (((BaseFunction)fun).getArity() != 0) {
+                            getLogger().error("Function '" + funName + "' must have no declared
arguments! " +
+                                              "Use cocoon.parameters to reach parameters
passed from the sitemap into the function.");
+                        }
                     }
 
                     thrScope.setLock(true);

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml	(original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml	Thu Nov 11 18:17:15 2004
@@ -201,6 +201,11 @@
 
   <changes>
  <release version="@version@" date="@date@">
+   <action dev="VG" type="remove">
+     Flowscript: Deprecated support for passing sitemap parameters into flowscript
+     function as positional arguments. Use cocoon.parameters instead. Support will
+     be removed completely in Cocoon 2.2.
+   </action>
    <action dev="RG" type="fix" fixes-bug="32159" due-to="Michal Durdina" due-to-email="durdina@asset.sk">
      Portal: Request content length and content type are required in portlet ActionRequest

      for custom upload handling.     

Mime
View raw message