cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r267170 - in /cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms: resources/forms-advanced-field-styling.xsl util/JavaScriptHelper.java
Date Fri, 02 Sep 2005 09:56:06 GMT
Author: lgawron
Date: Fri Sep  2 02:55:56 2005
New Revision: 267170

URL: http://svn.apache.org/viewcvs?rev=267170&view=rev
Log:
it is not thread-safe to use a static rhino scope
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=111705601106644&w=2
JavaScriptHelper depends on TemplateObjectModelHelper now. I think it's ok because TOMH is
in core.

whitespace

Modified:
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/JavaScriptHelper.java

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl?rev=267170&r1=267169&r2=267170&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
(original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
Fri Sep  2 02:55:56 2005
@@ -24,7 +24,7 @@
       | The very specific advanced stylings as the calendar or htmlarea (both
       | also need additional JS files) are separated out of this file.
       +-->
-       
+
   <xsl:import href="resource://org/apache/cocoon/forms/resources/forms-field-styling.xsl"/>
   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-calendar-styling.xsl"/>
   <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-htmlarea-styling.xsl"/>
@@ -97,7 +97,7 @@
             </th>
             <th> </th>
             <th>
-              <xsl:copy-of select="fi:styling/fi:selected-label/node()"/>    
+              <xsl:copy-of select="fi:styling/fi:selected-label/node()"/>
             </th>
           </tr>
         </xsl:if>
@@ -114,7 +114,7 @@
                     <xsl:copy-of select="fi:label/node()"/>
                   </option>
                 </xsl:if>
-              </xsl:for-each>  
+              </xsl:for-each>
             </select>
           </td>
           <td>
@@ -123,7 +123,7 @@
             <xsl:text>&#160;</xsl:text>
             <input type="button" value="&gt;" onclick="opt{generate-id()}.forms_transferRight()">
               <xsl:if test="@state='disabled'">
-                <xsl:attribute name="disabled">disabled</xsl:attribute> 
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
               </xsl:if>
             </input>
             <xsl:text>&#160;</xsl:text>

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/JavaScriptHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/JavaScriptHelper.java?rev=267170&r1=267169&r2=267170&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/JavaScriptHelper.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/JavaScriptHelper.java Fri
Sep  2 02:55:56 2005
@@ -23,6 +23,7 @@
 import org.apache.avalon.framework.CascadingRuntimeException;
 import org.apache.cocoon.components.flow.FlowHelper;
 import org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptFlowHelper;
+import org.apache.cocoon.environment.TemplateObjectModelHelper;
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.JavaScriptException;
@@ -38,12 +39,6 @@
  * @version $Id$
  */
 public class JavaScriptHelper {
-
-    /**
-     * A shared root scope, avoiding to recreate a new one each time.
-     */
-    private static Scriptable _rootScope = null;
-
     /**
      * Build a script with the content of a DOM element.
      * 
@@ -116,16 +111,7 @@
      * @return an appropriate root scope
      */
     public static Scriptable getRootScope() {
-        if (_rootScope == null) {
-            // Create it if never used up to now
-            Context ctx = Context.enter();
-            try {
-                _rootScope = ctx.initStandardObjects(null);
-            } finally {
-                Context.exit();
-            }
-        }
-        return _rootScope;
+        return TemplateObjectModelHelper.getScope();
     }
 
     /**



Mime
View raw message