On Aug 5, 2006, at 7:57 AM, [hidden email] 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 |
Administrator
|
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, [hidden email] 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 |
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, [hidden email] 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 > |
Free forum by Nabble | Edit this page |