You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2008/08/28 12:25:15 UTC

svn commit: r689776 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java

Author: lektran
Date: Thu Aug 28 03:25:14 2008
New Revision: 689776

URL: http://svn.apache.org/viewvc?rev=689776&view=rev
Log:
Add groovy support to menu actions

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java

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=689776&r1=689775&r2=689776&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 Thu Aug 28 03:25:14 2008
@@ -31,6 +31,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.UtilGenerics;
 import org.ofbiz.base.util.UtilFormatOut;
@@ -337,6 +338,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);
             }



Re: svn commit: r689776 -/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java

Posted by Jacques Le Roux <ja...@les7arts.com>.
Yes impressive ! Can the same be done for minilang ? I thought it was more work...

Jacques

From: "Hans Bakker" <ma...@antwebsystems.com>
> woow....that is really quick!
>
> On Thu, 2008-08-28 at 10:25 +0000, lektran@apache.org wrote:
>> Author: lektran
>> Date: Thu Aug 28 03:25:14 2008
>> New Revision: 689776
>>
>> URL: http://svn.apache.org/viewvc?rev=689776&view=rev
>> Log:
>> Add groovy support to menu actions
>>
>> Modified:
>>     ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java
>>
>> 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=689776&r1=689775&r2=689776&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 Thu Aug 28 03:25:14 2008
>> @@ -31,6 +31,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.UtilGenerics;
>>  import org.ofbiz.base.util.UtilFormatOut;
>> @@ -337,6 +338,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);
>>              }
>>
>>
> -- 
> Antwebsystems.com: Quality OFBiz services for competitive prices
> 


Re: svn commit: r689776 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java

Posted by Hans Bakker <ma...@antwebsystems.com>.
woow....that is really quick!

On Thu, 2008-08-28 at 10:25 +0000, lektran@apache.org wrote:
> Author: lektran
> Date: Thu Aug 28 03:25:14 2008
> New Revision: 689776
> 
> URL: http://svn.apache.org/viewvc?rev=689776&view=rev
> Log:
> Add groovy support to menu actions
> 
> Modified:
>     ofbiz/trunk/framework/widget/src/org/ofbiz/widget/menu/ModelMenuAction.java
> 
> 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=689776&r1=689775&r2=689776&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 Thu Aug 28 03:25:14 2008
> @@ -31,6 +31,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.UtilGenerics;
>  import org.ofbiz.base.util.UtilFormatOut;
> @@ -337,6 +338,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);
>              }
> 
> 
-- 
Antwebsystems.com: Quality OFBiz services for competitive prices