You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/04/05 00:01:07 UTC
svn commit: r1464779 - in /ofbiz/trunk:
applications/accounting/script/org/ofbiz/accounting/fixedasset/
applications/accounting/script/org/ofbiz/accounting/invoice/
applications/accounting/script/org/ofbiz/accounting/ledger/
applications/accounting/scr...
Author: adrianc
Date: Thu Apr 4 22:01:07 2013
New Revision: 1464779
URL: http://svn.apache.org/r1464779
Log:
Converted Mini-language bsh: scripts to groovy: scripts.
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
ofbiz/trunk/specialpurpose/googlecheckout/script/org/ofbiz/googleCheckout/PrepareXMLTemplate.xml
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml?rev=1464779&r1=1464778&r2=1464779&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml Thu Apr 4 22:01:07 2013
@@ -366,7 +366,7 @@ under the License.
</if-compare-field>
</if-not-empty>
</iterate>
- <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
+ <set field="nextIntervalQty" value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
<if-not-empty field="meterValue.meterValue">
<if-compare-field field="nextIntervalQty" operator="less-equals" to-field="meterValue.meterValue" type="BigDecimal">
<set field="maintDue" value="false"/>
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=1464779&r1=1464778&r2=1464779&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Thu Apr 4 22:01:07 2013
@@ -480,7 +480,7 @@ under the License.
<else>
<!-- if new status is paid check if the complete invoice is applied. -->
<if-compare field="parameters.statusId" operator="equals" value="INVOICE_PAID">
- <set field="notApplied" type="BigDecimal" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"/>
+ <set field="notApplied" type="BigDecimal" value="${groovy:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"/>
<if-compare field="notApplied" operator="not-equals" value="0.00" type="BigDecimal">
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingInvoiceCannotChangeStatusToPaid"/>
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml?rev=1464779&r1=1464778&r2=1464779&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml Thu Apr 4 22:01:07 2013
@@ -385,7 +385,7 @@ under the License.
<get-related-one relation-name="GlAccountClass" value-field="glAccount" to-value-field="glAccountClass"/>
<get-related-one relation-name="ParentGlAccountClass" value-field="glAccountClass" to-value-field="parentGlAccountClass"/>
<!-- test if the account is a DEBIT account -->
- <set field="isDebit" value="${bsh:org.ofbiz.accounting.util.UtilAccounting.isDebitAccount(glAccount)}"/>
+ <set field="isDebit" value="${groovy:org.ofbiz.accounting.util.UtilAccounting.isDebitAccount(glAccount)}"/>
<if-compare field="isDebit" operator="equals" value="true">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<set from-field="acctgTransEntry.amount" field="postingAmount"/>
@@ -399,7 +399,7 @@ under the License.
</if-compare>
<else>
<!-- otherwise, test if the account is credit -->
- <set field="isCredit" value="${bsh:org.ofbiz.accounting.util.UtilAccounting.isCreditAccount(glAccount)}"/>
+ <set field="isCredit" value="${groovy:org.ofbiz.accounting.util.UtilAccounting.isCreditAccount(glAccount)}"/>
<if-compare field="isCredit" operator="equals" value="true">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<set from-field="acctgTransEntry.amount" field="postingAmount"/>
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=1464779&r1=1464778&r2=1464779&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Thu Apr 4 22:01:07 2013
@@ -311,7 +311,7 @@ under the License.
<!-- check if the payment fully applied when set to confirmed-->
<if-compare field="parameters.statusId" operator="equals" value="PMNT_CONFIRMED">
- <set field="notYetApplied" value="${bsh:org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment)}"/>
+ <set field="notYetApplied" value="${groovy:org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment)}"/>
<if-compare field="notYetApplied" operator="greater" value="0.00" type="BigDecimal">
<add-error>
<fail-property resource="AccountingUiLabels" property="AccountingPSNotConfirmedNotFullyApplied"/>
Modified: ofbiz/trunk/specialpurpose/googlecheckout/script/org/ofbiz/googleCheckout/PrepareXMLTemplate.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlecheckout/script/org/ofbiz/googleCheckout/PrepareXMLTemplate.xml?rev=1464779&r1=1464778&r2=1464779&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlecheckout/script/org/ofbiz/googleCheckout/PrepareXMLTemplate.xml (original)
+++ ofbiz/trunk/specialpurpose/googlecheckout/script/org/ofbiz/googleCheckout/PrepareXMLTemplate.xml Thu Apr 4 22:01:07 2013
@@ -120,7 +120,7 @@
<call-object-method method-name="render" obj-field="xscreens">
<field field="screenUri" type="String"/>
</call-object-method>
- <set field="content" value="${bsh:XMLWriter.toString()}"/>
+ <set field="content" value="${groovy:XMLWriter.toString()}"/>
</simple-method>
<!-- Step 3 -->
<simple-method method-name="setupContent" short-description="" login-required="false">
@@ -159,7 +159,7 @@
}
return org.ofbiz.base.util.UtilMisc.toMap("buffer", buffer);
]]></call-bsh>
- <set field="response" value="${bsh:buffer.toString()}"/>
+ <set field="response" value="${groovy:buffer.toString()}"/>
</simple-method>
<!-- Step 5 -->
<simple-method method-name="getReDirectFromXmlDoc" short-description="" login-required="false">
Re: svn commit: r1464779 - in /ofbiz/trunk: applications/accounting/script/org/ofbiz/accounting/fixedasset/
applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/ledger/
applications/accounting/scr...
Posted by Adrian Crum <ad...@sandglass-software.com>.
I think the only bsh: scriptlets left are in the screen widgets. Also, I
think the "use-when" attribute uses bsh. So I would need to take a look
at it.
But yes, this task should be completed. We've been talking about it for
years.
-Adrian
On 4/6/2013 9:18 AM, Jacopo Cappellato wrote:
> I think we should complete the migration from bsh scripts: to groovy: scripts and then we could remove the Beanshell specific code and jars from the trunk.
> What do you think?
>
> Jacopo
>
> On Apr 5, 2013, at 10:11 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
>
>> Oh! Thanks for the clarification.
>>
>> -Adrian
>>
>> On 4/5/2013 8:45 AM, Jacopo Cappellato wrote:
>>> Adrian,
>>>
>>> I think that Nicolas was proposing to replace " with ' to increase readability: this was not possible with Beanshell but it is now possible after we switch to groovy.
>>>
>>> Jacopo
>>>
>>>
>>>
>>> On Apr 5, 2013, at 9:26 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
>>>
>>>> We will see if anyone reports a problem. I ran unit tests after the replacement (the unit tests used the bsh: scriptlets a lot) and there were no errors reported.
>>>>
>>>> -Adrian
>>>>
>>>> On 4/5/2013 7:59 AM, Nicolas Malin wrote:
>>>>> Hi adrian,
>>>>>
>>>>> There is a risk to change " by ' when we change bsh by groovy engine on flexible string ?
>>>>> When I convert old customer specific code as you did, I replace also the string " .
>>>>>
>>>>> productMaintValue.getBigDecimal('intervalQuantity') is really more readable than productMaintValue.getBigDecimal("intervalQuantity")
>>>>>
>>>>> Just to be sure that I didn't to take a wrong way.
>>>>>
>>>>> Cheers,
>>>>> Nicolas
>>>>>
>>>>> Le 05/04/2013 00:01, adrianc@apache.org a écrit :
>>>>>> - <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>>>>> + <set field="nextIntervalQty" value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
Re: svn commit: r1464779 - in /ofbiz/trunk:
applications/accounting/script/org/ofbiz/accounting/fixedasset/
applications/accounting/script/org/ofbiz/accounting/invoice/
applications/accounting/script/org/ofbiz/accounting/ledger/
applications/accounting/scr
Posted by Jacques Le Roux <ja...@les7arts.com>.
+1, if we find enough time to do so
Jacques
From: "Jacopo Cappellato" <ja...@hotwaxmedia.com>
>I think we should complete the migration from bsh scripts: to groovy: scripts and then we could remove the Beanshell specific code and jars from the trunk.
> What do you think?
>
> Jacopo
>
> On Apr 5, 2013, at 10:11 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
>
>> Oh! Thanks for the clarification.
>>
>> -Adrian
>>
>> On 4/5/2013 8:45 AM, Jacopo Cappellato wrote:
>>> Adrian,
>>>
>>> I think that Nicolas was proposing to replace " with ' to increase readability: this was not possible with Beanshell but it is now possible after we switch to groovy.
>>>
>>> Jacopo
>>>
>>>
>>>
>>> On Apr 5, 2013, at 9:26 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
>>>
>>>> We will see if anyone reports a problem. I ran unit tests after the replacement (the unit tests used the bsh: scriptlets a lot) and there were no errors reported.
>>>>
>>>> -Adrian
>>>>
>>>> On 4/5/2013 7:59 AM, Nicolas Malin wrote:
>>>>> Hi adrian,
>>>>>
>>>>> There is a risk to change " by ' when we change bsh by groovy engine on flexible string ?
>>>>> When I convert old customer specific code as you did, I replace also the string " .
>>>>>
>>>>> productMaintValue.getBigDecimal('intervalQuantity') is really more readable than productMaintValue.getBigDecimal("intervalQuantity")
>>>>>
>>>>> Just to be sure that I didn't to take a wrong way.
>>>>>
>>>>> Cheers,
>>>>> Nicolas
>>>>>
>>>>> Le 05/04/2013 00:01, adrianc@apache.org a écrit :
>>>>>> - <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>>>>> + <set field="nextIntervalQty" value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>>>>
>>
>
>
Re: svn commit: r1464779 - in /ofbiz/trunk: applications/accounting/script/org/ofbiz/accounting/fixedasset/ applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/ledger/ applications/accounting/scr...
Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
I think we should complete the migration from bsh scripts: to groovy: scripts and then we could remove the Beanshell specific code and jars from the trunk.
What do you think?
Jacopo
On Apr 5, 2013, at 10:11 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
> Oh! Thanks for the clarification.
>
> -Adrian
>
> On 4/5/2013 8:45 AM, Jacopo Cappellato wrote:
>> Adrian,
>>
>> I think that Nicolas was proposing to replace " with ' to increase readability: this was not possible with Beanshell but it is now possible after we switch to groovy.
>>
>> Jacopo
>>
>>
>>
>> On Apr 5, 2013, at 9:26 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
>>
>>> We will see if anyone reports a problem. I ran unit tests after the replacement (the unit tests used the bsh: scriptlets a lot) and there were no errors reported.
>>>
>>> -Adrian
>>>
>>> On 4/5/2013 7:59 AM, Nicolas Malin wrote:
>>>> Hi adrian,
>>>>
>>>> There is a risk to change " by ' when we change bsh by groovy engine on flexible string ?
>>>> When I convert old customer specific code as you did, I replace also the string " .
>>>>
>>>> productMaintValue.getBigDecimal('intervalQuantity') is really more readable than productMaintValue.getBigDecimal("intervalQuantity")
>>>>
>>>> Just to be sure that I didn't to take a wrong way.
>>>>
>>>> Cheers,
>>>> Nicolas
>>>>
>>>> Le 05/04/2013 00:01, adrianc@apache.org a écrit :
>>>>> - <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>>>> + <set field="nextIntervalQty" value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>>>
>
Re: svn commit: r1464779 - in /ofbiz/trunk: applications/accounting/script/org/ofbiz/accounting/fixedasset/
applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/ledger/
applications/accounting/scr...
Posted by Adrian Crum <ad...@sandglass-software.com>.
Oh! Thanks for the clarification.
-Adrian
On 4/5/2013 8:45 AM, Jacopo Cappellato wrote:
> Adrian,
>
> I think that Nicolas was proposing to replace " with ' to increase readability: this was not possible with Beanshell but it is now possible after we switch to groovy.
>
> Jacopo
>
>
>
> On Apr 5, 2013, at 9:26 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
>
>> We will see if anyone reports a problem. I ran unit tests after the replacement (the unit tests used the bsh: scriptlets a lot) and there were no errors reported.
>>
>> -Adrian
>>
>> On 4/5/2013 7:59 AM, Nicolas Malin wrote:
>>> Hi adrian,
>>>
>>> There is a risk to change " by ' when we change bsh by groovy engine on flexible string ?
>>> When I convert old customer specific code as you did, I replace also the string " .
>>>
>>> productMaintValue.getBigDecimal('intervalQuantity') is really more readable than productMaintValue.getBigDecimal("intervalQuantity")
>>>
>>> Just to be sure that I didn't to take a wrong way.
>>>
>>> Cheers,
>>> Nicolas
>>>
>>> Le 05/04/2013 00:01, adrianc@apache.org a écrit :
>>>> - <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>>> + <set field="nextIntervalQty" value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>>
Re: svn commit: r1464779 - in /ofbiz/trunk: applications/accounting/script/org/ofbiz/accounting/fixedasset/ applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/ledger/ applications/accounting/scr...
Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Adrian,
I think that Nicolas was proposing to replace " with ' to increase readability: this was not possible with Beanshell but it is now possible after we switch to groovy.
Jacopo
On Apr 5, 2013, at 9:26 AM, Adrian Crum <ad...@sandglass-software.com> wrote:
> We will see if anyone reports a problem. I ran unit tests after the replacement (the unit tests used the bsh: scriptlets a lot) and there were no errors reported.
>
> -Adrian
>
> On 4/5/2013 7:59 AM, Nicolas Malin wrote:
>> Hi adrian,
>>
>> There is a risk to change " by ' when we change bsh by groovy engine on flexible string ?
>> When I convert old customer specific code as you did, I replace also the string " .
>>
>> productMaintValue.getBigDecimal('intervalQuantity') is really more readable than productMaintValue.getBigDecimal("intervalQuantity")
>>
>> Just to be sure that I didn't to take a wrong way.
>>
>> Cheers,
>> Nicolas
>>
>> Le 05/04/2013 00:01, adrianc@apache.org a écrit :
>>> - <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>> + <set field="nextIntervalQty" value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
>>
>>
>
Re: svn commit: r1464779 - in /ofbiz/trunk: applications/accounting/script/org/ofbiz/accounting/fixedasset/
applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/ledger/
applications/accounting/scr...
Posted by Adrian Crum <ad...@sandglass-software.com>.
We will see if anyone reports a problem. I ran unit tests after the
replacement (the unit tests used the bsh: scriptlets a lot) and there
were no errors reported.
-Adrian
On 4/5/2013 7:59 AM, Nicolas Malin wrote:
> Hi adrian,
>
> There is a risk to change " by ' when we change bsh by groovy
> engine on flexible string ?
> When I convert old customer specific code as you did, I replace also
> the string " .
>
> productMaintValue.getBigDecimal('intervalQuantity') is really more
> readable than
> productMaintValue.getBigDecimal("intervalQuantity")
>
> Just to be sure that I didn't to take a wrong way.
>
> Cheers,
> Nicolas
>
> Le 05/04/2013 00:01, adrianc@apache.org a écrit :
>> - <set field="nextIntervalQty"
>> value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}"
>> type="BigDecimal"/>
>> + <set field="nextIntervalQty"
>> value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}"
>> type="BigDecimal"/>
>
>
Re: svn commit: r1464779 - in /ofbiz/trunk: applications/accounting/script/org/ofbiz/accounting/fixedasset/
applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/ledger/
applications/accounting/scr...
Posted by Nicolas Malin <ma...@librenberry.net>.
Hi adrian,
There is a risk to change " by ' when we change bsh by groovy
engine on flexible string ?
When I convert old customer specific code as you did, I replace also the
string " .
productMaintValue.getBigDecimal('intervalQuantity') is really more readable than productMaintValue.getBigDecimal("intervalQuantity")
Just to be sure that I didn't to take a wrong way.
Cheers,
Nicolas
Le 05/04/2013 00:01, adrianc@apache.org a écrit :
> - <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
> + <set field="nextIntervalQty" value="${groovy:maxIntervalQty.add(productMaintValue.getBigDecimal("intervalQuantity"));}" type="BigDecimal"/>
--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/