diff --git a/LICENSE b/LICENSE index 85f9978856..283beb93d8 100644 --- a/LICENSE +++ b/LICENSE @@ -505,6 +505,7 @@ The following libraries distributed with Apache OFBiz are licensed under the BSD License: ofbiz/trunk/applications/content/lib/dom4j-1.6.1.jar ofbiz/trunk/framework/base/lib/antisamy-bin.1.2.jar +ofbiz/trunk/framework/base/lib/bsh-engine-modified.jar ofbiz/trunk/framework/base/lib/freemarker-2.3.10.jar ofbiz/trunk/framework/base/lib/hamcrest-all-1.2.jar ofbiz/trunk/framework/base/lib/httpunit.jar diff --git a/framework/base/lib/bsh-engine-modified.jar b/framework/base/lib/bsh-engine-modified.jar new file mode 100644 index 0000000000..d44231366a Binary files /dev/null and b/framework/base/lib/bsh-engine-modified.jar differ diff --git a/framework/base/src/META-INF/services/javax.script.ScriptEngineFactory b/framework/base/src/META-INF/services/javax.script.ScriptEngineFactory new file mode 100644 index 0000000000..88b36449e5 --- /dev/null +++ b/framework/base/src/META-INF/services/javax.script.ScriptEngineFactory @@ -0,0 +1 @@ +bsh.engine.BshScriptEngineFactory diff --git a/framework/base/src/org/ofbiz/base/util/ScriptUtil.java b/framework/base/src/org/ofbiz/base/util/ScriptUtil.java index 8c78748f86..64b0e9d09b 100644 --- a/framework/base/src/org/ofbiz/base/util/ScriptUtil.java +++ b/framework/base/src/org/ofbiz/base/util/ScriptUtil.java @@ -190,10 +190,6 @@ public final class ScriptUtil { if (scriptClass != null) { return InvokerHelper.createScript(scriptClass, GroovyUtil.getBinding(inputMap)).run(); } - // TODO: Remove beanshell check when all beanshell code has been removed. - if ("bsh".equals(language)) { - return BshUtil.eval(script, UtilMisc.makeMapWritable(inputMap)); - } try { CompiledScript compiledScript = compileScriptString(language, script); if (compiledScript != null) { @@ -311,11 +307,6 @@ public final class ScriptUtil { public static Object executeScript(String filePath, String functionName, Map context, Object[] args) { Assert.notNull("filePath", filePath, "context", context); try { - String fileExtension = getFileExtension(filePath); - // TODO: Remove beanshell check when all beanshell code has been removed. - if ("bsh".equals(fileExtension)) { - return BshUtil.runBshAtLocation(filePath, context); - } return executeScript(filePath, functionName, createScriptContext(context), args); } catch (Exception e) { String errMsg = "Error running script at location [" + filePath + "]: " + e.toString(); diff --git a/framework/common/servicedef/services_test.xml b/framework/common/servicedef/services_test.xml index 0ca37016ac..6afeac76a7 100644 --- a/framework/common/servicedef/services_test.xml +++ b/framework/common/servicedef/services_test.xml @@ -160,12 +160,6 @@ under the License. - - Test BeanShell Script Service - - - - Test Groovy Script Service @@ -178,6 +172,12 @@ under the License. + + Test BeanShell Script Service + + + + Test Script Engine With Groovy Script @@ -196,13 +196,11 @@ under the License. - Test JMS Queue service