You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2006/08/05 15:57:23 UTC

svn commit: r429000 - /incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml

Author: jleroux
Date: Sat Aug  5 06:57:23 2006
New Revision: 429000

URL: http://svn.apache.org/viewvc?rev=429000&view=rev
Log:
Deprecated operations replaced by set operations in PromoServices.xml (Apache OFBIZ-90)

Modified:
    incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml

Modified: incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml?rev=429000&r1=428999&r2=429000&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml (original)
+++ incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml Sat Aug  5 06:57:23 2006
@@ -29,14 +29,13 @@
         <sequenced-id-to-env sequence-name="ProductPromo" env-name="newEntity.productPromoId"/>
         <field-to-result field-name="productPromoId" map-name="newEntity"/>
 
-        <if-empty field-name="newEntity.userEntered">
-            <string-to-field string="Y" field-name="newEntity.userEntered"/>
-        </if-empty>
+        <set value="Y" set-if-empty="true" field="newEntity.userEntered"/>
+
         <now-timestamp-to-env env-name="nowTimestamp"/>
-        <env-to-env env-name="nowTimestamp" to-env-name="newEntity.createdDate"/>
-        <env-to-env env-name="nowTimestamp" to-env-name="newEntity.lastModifiedDate"/>
-        <env-to-env env-name="userLogin.userLoginId" to-env-name="newEntity.lastModifiedByUserLogin"/>
-        <env-to-env env-name="userLogin.userLoginId" to-env-name="newEntity.createdByUserLogin"/>
+        <set from-field="nowTimestamp" field="newEntity.createdDate"/>
+        <set from-field="nowTimestamp" field="newEntity.lastModifiedDate"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
 
         <create-value value-name="newEntity"/>
     </simple-method>
@@ -45,16 +44,15 @@
         <check-permission permission="CATALOG_PRICE_MAINT"><fail-property resource="ProductUiLabels" property="ProductPriceMaintPermissionError"/></check-permission>
         <check-errors/>
 
-        <field-to-field field-name="productPromoId" map-name="parameters" to-map-name="lookupPKMap"/>
+        <set from-field="parameters.productPromoId" field="lookupPKMap.productPromoId"/>
         <find-by-primary-key entity-name="ProductPromo" map-name="lookupPKMap" value-name="lookedUpValue"/>
         <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
 
-        <if-empty field-name="newEntity.userEntered">
-            <string-to-field string="Y" field-name="newEntity.userEntered"/>
-        </if-empty>
+        <set value="Y" set-if-empty="true" field="newEntity.userEntered"/>
+
         <now-timestamp-to-env env-name="nowTimestamp"/>
-        <env-to-env env-name="nowTimestamp" to-env-name="newEntity.lastModifiedDate"/>
-        <env-to-env env-name="userLogin.userLoginId" to-env-name="newEntity.lastModifiedByUserLogin"/>
+        <set from-field="nowTimestamp" field="newEntity.lastModifiedDate"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
 
         <store-value value-name="lookedUpValue"/>
     </simple-method>
@@ -65,7 +63,7 @@
 
         <!-- TODO: if a force remove flag is passed, remove related info first, maybe just rules, store assocs, etc -->
 
-        <field-to-field field-name="productPromoId" map-name="parameters" to-map-name="lookupPKMap"/>
+        <set from-field="parameters.productPromoId" field="lookupPKMap.productPromoId"/>
         <find-by-primary-key entity-name="ProductPromo" map-name="lookupPKMap" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
@@ -152,10 +150,10 @@
         <field-to-result field-name="productPromoCodeId" map-name="newEntity"/>
 
         <now-timestamp-to-env env-name="nowTimestamp"/>
-        <env-to-env env-name="nowTimestamp" to-env-name="newEntity.createdDate"/>
-        <env-to-env env-name="nowTimestamp" to-env-name="newEntity.lastModifiedDate"/>
-        <env-to-env env-name="userLogin.userLoginId" to-env-name="newEntity.lastModifiedByUserLogin"/>
-        <env-to-env env-name="userLogin.userLoginId" to-env-name="newEntity.createdByUserLogin"/>
+        <set from-field="nowTimestamp" field="newEntity.createdDate"/>
+        <set from-field="nowTimestamp" field="newEntity.lastModifiedDate"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
 
         <create-value value-name="newEntity"/>
     </simple-method>
@@ -170,8 +168,8 @@
         <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
 
         <now-timestamp-to-env env-name="nowTimestamp"/>
-        <env-to-env env-name="nowTimestamp" to-env-name="newEntity.lastModifiedDate"/>
-        <env-to-env env-name="userLogin.userLoginId" to-env-name="newEntity.lastModifiedByUserLogin"/>
+        <set from-field="nowTimestamp" field="newEntity.lastModifiedDate"/>
+        <set from-field="userLogin.userLoginId" field="newEntity.lastModifiedByUserLogin"/>
 
         <store-value value-name="lookedUpValue"/>
     </simple-method>
@@ -348,10 +346,9 @@
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
 
-        <if-empty field-name="fromDate" map-name="newEntity">
-            <now-timestamp-to-env env-name="nowTimestamp"/>
-            <env-to-field env-name="nowTimestamp" field-name="fromDate" map-name="newEntity"/>
-        </if-empty>
+        <now-timestamp-to-env env-name="nowTimestamp"/>
+        <set from-field="nowTimestamp.fromDate" set-if-empty="true" field="newEntity.fromDate"/>
+
 
         <create-value value-name="newEntity"/>
     </simple-method>



Re: svn commit: r429000 - /incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml

Posted by "David E. Jones" <jo...@undersunconsulting.com>.
In the new advanced framework videos I did a complete coverage of the  
minilang operations. The plan for the official docs is to move them  
from the current HTML file to the XSD file for "real-time" reference,  
everything except the overview and how-to stuff of course (ie all of  
the reference stuff). I've done some work on this here and there, ie  
moving stuff over and adding detail to the XSD for new stuff.

So, the place to look is the XSD file, and the new videos and their  
transcription of course....

-David


On Aug 5, 2006, at 9:58 AM, Jacques Le Roux wrote:

> David,
>
> Thanks, this was not obvious. Is therre somewhere an update for  
> minilang documentation (set, etc.) ? I revert for the moment and
> will make a new patch soon.
>
> Jacques
>
>
>>
>> On Aug 5, 2006, at 7:57 AM, jleroux@apache.org wrote:
>>
>>> Modified: incubator/ofbiz/trunk/applications/product/script/org/
>>> ofbiz/product/promo/PromoServices.xml
>>> URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/
>>> applications/product/script/org/ofbiz/product/promo/
>>> PromoServices.xml?rev=429000&r1=428999&r2=429000&view=diff
>>> ==================================================================== 
>>> ==
>>> ========
>>> --- incubator/ofbiz/trunk/applications/product/script/org/ofbiz/
>>> product/promo/PromoServices.xml (original)
>>> +++ incubator/ofbiz/trunk/applications/product/script/org/ofbiz/
>>> product/promo/PromoServices.xml Sat Aug  5 06:57:23 2006
>>> @@ -29,14 +29,13 @@
>>>          <sequenced-id-to-env sequence-name="ProductPromo" env-
>>> name="newEntity.productPromoId"/>
>>>          <field-to-result field-name="productPromoId" map-
>>> name="newEntity"/>
>>>
>>> -        <if-empty field-name="newEntity.userEntered">
>>> -            <string-to-field string="Y" field-
>>> name="newEntity.userEntered"/>
>>> -        </if-empty>
>>> +        <set value="Y" set-if-empty="true"
>>> field="newEntity.userEntered"/>
>>> +
>>
>> There was at least one more of these in this commit, but I'll just
>> use this one as an example.
>>
>> There is a problem with this because the set operation is not
>> equivalent to the if-empty + string-to-field. In other words, you
>> still need the if-empty around the set operation.
>>
>> The reason is that if newEntity.userEntered is NOT empty then with
>> the if-empty tag it will do nothing, but without the if-empty tag it
>> will still do the set operation!
>>
>> In other words, the set-if-empty attribute does not mean "set only if
>> empty" it means "set if empty or not empty".
>>
>> -David
>


Re: svn commit: r429000 - /incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml

Posted by Jacques Le Roux <ja...@les7arts.com>.
David,

Thanks, this was not obvious. Is therre somewhere an update for minilang documentation (set, etc.) ? I revert for the moment and
will make a new patch soon.

Jacques


>
> On Aug 5, 2006, at 7:57 AM, jleroux@apache.org wrote:
>
> > Modified: incubator/ofbiz/trunk/applications/product/script/org/
> > ofbiz/product/promo/PromoServices.xml
> > URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/
> > applications/product/script/org/ofbiz/product/promo/
> > PromoServices.xml?rev=429000&r1=428999&r2=429000&view=diff
> > ======================================================================
> > ========
> > --- incubator/ofbiz/trunk/applications/product/script/org/ofbiz/
> > product/promo/PromoServices.xml (original)
> > +++ incubator/ofbiz/trunk/applications/product/script/org/ofbiz/
> > product/promo/PromoServices.xml Sat Aug  5 06:57:23 2006
> > @@ -29,14 +29,13 @@
> >          <sequenced-id-to-env sequence-name="ProductPromo" env-
> > name="newEntity.productPromoId"/>
> >          <field-to-result field-name="productPromoId" map-
> > name="newEntity"/>
> >
> > -        <if-empty field-name="newEntity.userEntered">
> > -            <string-to-field string="Y" field-
> > name="newEntity.userEntered"/>
> > -        </if-empty>
> > +        <set value="Y" set-if-empty="true"
> > field="newEntity.userEntered"/>
> > +
>
> There was at least one more of these in this commit, but I'll just
> use this one as an example.
>
> There is a problem with this because the set operation is not
> equivalent to the if-empty + string-to-field. In other words, you
> still need the if-empty around the set operation.
>
> The reason is that if newEntity.userEntered is NOT empty then with
> the if-empty tag it will do nothing, but without the if-empty tag it
> will still do the set operation!
>
> In other words, the set-if-empty attribute does not mean "set only if
> empty" it means "set if empty or not empty".
>
> -David


Re: svn commit: r429000 - /incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml

Posted by "David E. Jones" <jo...@undersunconsulting.com>.
On Aug 5, 2006, at 7:57 AM, jleroux@apache.org wrote:

> Modified: incubator/ofbiz/trunk/applications/product/script/org/ 
> ofbiz/product/promo/PromoServices.xml
> URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/ 
> applications/product/script/org/ofbiz/product/promo/ 
> PromoServices.xml?rev=429000&r1=428999&r2=429000&view=diff
> ====================================================================== 
> ========
> --- incubator/ofbiz/trunk/applications/product/script/org/ofbiz/ 
> product/promo/PromoServices.xml (original)
> +++ incubator/ofbiz/trunk/applications/product/script/org/ofbiz/ 
> product/promo/PromoServices.xml Sat Aug  5 06:57:23 2006
> @@ -29,14 +29,13 @@
>          <sequenced-id-to-env sequence-name="ProductPromo" env- 
> name="newEntity.productPromoId"/>
>          <field-to-result field-name="productPromoId" map- 
> name="newEntity"/>
>
> -        <if-empty field-name="newEntity.userEntered">
> -            <string-to-field string="Y" field- 
> name="newEntity.userEntered"/>
> -        </if-empty>
> +        <set value="Y" set-if-empty="true"  
> field="newEntity.userEntered"/>
> +

There was at least one more of these in this commit, but I'll just  
use this one as an example.

There is a problem with this because the set operation is not  
equivalent to the if-empty + string-to-field. In other words, you  
still need the if-empty around the set operation.

The reason is that if newEntity.userEntered is NOT empty then with  
the if-empty tag it will do nothing, but without the if-empty tag it  
will still do the set operation!

In other words, the set-if-empty attribute does not mean "set only if  
empty" it means "set if empty or not empty".

-David


Re: svn commit: r429000 - /incubator/ofbiz/trunk/applications/product/script/org/ofbiz/product/promo/PromoServices.xml

Posted by "David E. Jones" <jo...@undersunconsulting.com>.
On Aug 5, 2006, at 7:57 AM, jleroux@apache.org wrote:

> Modified: incubator/ofbiz/trunk/applications/product/script/org/ 
> ofbiz/product/promo/PromoServices.xml
> URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/ 
> applications/product/script/org/ofbiz/product/promo/ 
> PromoServices.xml?rev=429000&r1=428999&r2=429000&view=diff
> ====================================================================== 
> ========
> --- incubator/ofbiz/trunk/applications/product/script/org/ofbiz/ 
> product/promo/PromoServices.xml (original)
> +++ incubator/ofbiz/trunk/applications/product/script/org/ofbiz/ 
> product/promo/PromoServices.xml Sat Aug  5 06:57:23 2006
> @@ -29,14 +29,13 @@
>          <sequenced-id-to-env sequence-name="ProductPromo" env- 
> name="newEntity.productPromoId"/>
>          <field-to-result field-name="productPromoId" map- 
> name="newEntity"/>
>
> -        <if-empty field-name="newEntity.userEntered">
> -            <string-to-field string="Y" field- 
> name="newEntity.userEntered"/>
> -        </if-empty>
> +        <set value="Y" set-if-empty="true"  
> field="newEntity.userEntered"/>
> +

There was at least one more of these in this commit, but I'll just  
use this one as an example.

There is a problem with this because the set operation is not  
equivalent to the if-empty + string-to-field. In other words, you  
still need the if-empty around the set operation.

The reason is that if newEntity.userEntered is NOT empty then with  
the if-empty tag it will do nothing, but without the if-empty tag it  
will still do the set operation!

In other words, the set-if-empty attribute does not mean "set only if  
empty" it means "set if empty or not empty".

-David