Author: adrianc
Date: Wed Mar 24 20:23:58 2010 New Revision: 927173 URL: http://svn.apache.org/viewvc?rev=927173&view=rev Log: Restored the original Binding setup used for Groovy scripts. Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java?rev=927173&r1=927172&r2=927173&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java Wed Mar 24 20:23:58 2010 @@ -21,7 +21,6 @@ package org.ofbiz.service.engine; import java.util.Map; import org.codehaus.groovy.runtime.InvokerHelper; -import groovy.lang.Binding; import groovy.lang.Script; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.GroovyUtil; @@ -65,7 +64,7 @@ public final class GroovyEngine extends } context.put("dctx", dispatcher.getLocalContext(localName)); try { - Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(this.getLocation(modelService)), new Binding(context)); + Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(this.getLocation(modelService)), GroovyUtil.getBinding(context)); Object resultObj = null; if (UtilValidate.isEmpty(modelService.invoke)) { resultObj = script.run(); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java?rev=927173&r1=927172&r2=927173&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java Wed Mar 24 20:23:58 2010 @@ -31,8 +31,6 @@ import java.util.regex.PatternSyntaxExce import javolution.util.FastList; import javolution.util.FastMap; -import groovy.lang.Binding; - import org.codehaus.groovy.runtime.InvokerHelper; import org.ofbiz.base.util.BshUtil; import org.ofbiz.base.util.Debug; @@ -294,7 +292,7 @@ public abstract class ModelFormAction { } } else if (location.endsWith(".groovy")) { try { - groovy.lang.Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(location), new Binding(context)); + groovy.lang.Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(location), GroovyUtil.getBinding(context)); if (UtilValidate.isEmpty(method)) { script.run(); } else { Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java?rev=927173&r1=927172&r2=927173&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java Wed Mar 24 20:23:58 2010 @@ -31,7 +31,6 @@ import javax.servlet.http.HttpSession; import javolution.util.FastList; import javolution.util.FastMap; -import groovy.lang.Binding; import org.codehaus.groovy.runtime.InvokerHelper; import org.ofbiz.base.util.BshUtil; @@ -351,7 +350,7 @@ public abstract class ModelMenuAction { } } else if (location.endsWith(".groovy")) { try { - groovy.lang.Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(location), new Binding(context)); + groovy.lang.Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(location), GroovyUtil.getBinding(context)); if (UtilValidate.isEmpty(method)) { script.run(); } else { Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java?rev=927173&r1=927172&r2=927173&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java Wed Mar 24 20:23:58 2010 @@ -33,7 +33,6 @@ import javax.servlet.http.HttpSession; import javolution.util.FastList; import javolution.util.FastMap; -import groovy.lang.Binding; import org.codehaus.groovy.runtime.InvokerHelper; import org.ofbiz.base.util.BshUtil; @@ -417,7 +416,7 @@ public abstract class ModelScreenAction } } else if (location.endsWith(".groovy")) { try { - groovy.lang.Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(location), new Binding(context)); + groovy.lang.Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(location), GroovyUtil.getBinding(context)); if (UtilValidate.isEmpty(method)) { script.run(); } else { |
Free forum by Nabble | Edit this page |