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

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

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

hans_bakker
woow....that is really quick!

On Thu, 2008-08-28 at 10:25 +0000, [hidden email] 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

Reply | Threaded
Open this post in threaded view
|

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

Jacques Le Roux
Administrator
Yes impressive ! Can the same be done for minilang ? I thought it was more work...

Jacques

From: "Hans Bakker" <[hidden email]>

> woow....that is really quick!
>
> On Thu, 2008-08-28 at 10:25 +0000, [hidden email] 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
>