svn commit: r661274 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java

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

svn commit: r661274 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java

lektran
Author: lektran
Date: Thu May 29 02:54:52 2008
New Revision: 661274

URL: http://svn.apache.org/viewvc?rev=661274&view=rev
Log:
Add support for groovy scripts to form widget actions

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormAction.java

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=661274&r1=661273&r2=661274&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 Thu May 29 02:54:52 2008
@@ -32,6 +32,7 @@
 import org.ofbiz.base.util.BshUtil;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.GroovyUtil;
 import org.ofbiz.base.util.ObjectType;
 import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
@@ -276,6 +277,14 @@
                     Debug.logError(e, errMsg, module);
                     throw new IllegalArgumentException(errMsg);
                 }
+            } else if (location.endsWith(".groovy")) {
+                try {
+                    GroovyUtil.runScriptAtLocation(location, context);
+                } catch (GeneralException e) {
+                    String errMsg = "Error running Groovy script at location [" + location + "]: " + e.toString();
+                    Debug.logError(e, errMsg, module);
+                    throw new IllegalArgumentException(errMsg);
+                }
             } else {
                 throw new IllegalArgumentException("For screen script actions the script type is not yet support for location:" + location);
             }