svn commit: r1729809 - in /ofbiz/trunk: applications/commonext/webapp/ofbizsetup/organization/ framework/base/config/ framework/base/src/org/ofbiz/base/util/ specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1729809 - in /ofbiz/trunk: applications/commonext/webapp/ofbizsetup/organization/ framework/base/config/ framework/base/src/org/ofbiz/base/util/ specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/

jacopoc
Author: jacopoc
Date: Thu Feb 11 11:24:51 2016
New Revision: 1729809

URL: http://svn.apache.org/viewvc?rev=1729809&view=rev
Log:
OFBIZ-6568 With the implementation of @BaseScript annotations (introduced with Groovy 2.3.0) something was broken in the CompilerConfiguration.setScriptBaseClass method and an error is thrown when our scripts are executed; the workaround is to execute at startup a script containing the @BaseScript annotation.


Added:
    ofbiz/trunk/framework/base/config/GroovyInit.groovy   (with props)
Modified:
    ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/changeOrgPartyId.groovy
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/GroovyUtil.java
    ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy

Modified: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/changeOrgPartyId.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/changeOrgPartyId.groovy?rev=1729809&r1=1729808&r2=1729809&view=diff
==============================================================================
--- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/changeOrgPartyId.groovy (original)
+++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/changeOrgPartyId.groovy Thu Feb 11 11:24:51 2016
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-@BaseScript(org.ofbiz.service.engine.GroovyBaseScript)
-import groovy.transform.BaseScript
 import org.ofbiz.base.util.*;
 
 //partyAcctgPrefAndGroupList

Added: ofbiz/trunk/framework/base/config/GroovyInit.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/config/GroovyInit.groovy?rev=1729809&view=auto
==============================================================================
--- ofbiz/trunk/framework/base/config/GroovyInit.groovy (added)
+++ ofbiz/trunk/framework/base/config/GroovyInit.groovy Thu Feb 11 11:24:51 2016
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@BaseScript(org.ofbiz.service.engine.GroovyBaseScript)
+import groovy.transform.BaseScript

Propchange: ofbiz/trunk/framework/base/config/GroovyInit.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/base/config/GroovyInit.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/framework/base/config/GroovyInit.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/GroovyUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/GroovyUtil.java?rev=1729809&r1=1729808&r2=1729809&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/GroovyUtil.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/GroovyUtil.java Thu Feb 11 11:24:51 2016
@@ -57,6 +57,16 @@ public class GroovyUtil {
             groovyClassLoader = new GroovyClassLoader(GroovyUtil.class.getClassLoader(), conf);
         }
         groovyScriptClassLoader = groovyClassLoader;
+        /*
+         *  With the implementation of @BaseScript annotations (introduced with Groovy 2.3.0) something was broken
+         *  in the CompilerConfiguration.setScriptBaseClass method and an error is thrown when our scripts are executed;
+         *  the workaround is to execute at startup a script containing the @BaseScript annotation.
+         */
+        try {
+            GroovyUtil.runScriptAtLocation("component://base/config/GroovyInit.groovy", null, null);
+        } catch(Exception e) {
+            Debug.logWarning("The following error occurred during the initialization of Groovy: " + e.getMessage(), module);
+        }
     }
 
     /**

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy?rev=1729809&r1=1729808&r2=1729809&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipmentStatus.groovy Thu Feb 11 11:24:51 2016
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-@BaseScript(org.ofbiz.service.engine.GroovyBaseScript)
-import groovy.transform.BaseScript
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.*;