Login  Register

Re: Simple questions on Simple Methods(Mini Language) - Series 1

Posted by cjhowe on Oct 08, 2006; 2:02am
URL: http://ofbiz.116.s1.nabble.com/Simple-questions-on-Simple-Methods-Mini-Language-Series-1-tp142134p142135.html

this by no means is a complete explanation...just a
quick usable one.  For a complete explanation you
might want to check out Undersun Consulting's Advanced
Framework Training ;)

--- "Alex D. Fleming" <[hidden email]> wrote:

> Hi,
>  
>  I am looking to have answer for some simple
> questions : (I will be thankful if anybody of you
> could help me ).
>  
>  The questions are related to the Mini Language/
> Simple Methods :
>  
>  1) What's the Difference in :
>  <entity-one entity-name="Product"
> value-name="product" auto-field-map="true"/>
>  &
>  <make-value value-name="lookupPKMap"
> entity-name="Product"/>
>  

<entity-one> is a search by primary key productId will
need to be somewhere in the context (i'm not sure if
it needs to be the field parameters.productId or
simply productId)
instead of using auto-field-map="true" you may find it
easier as you're getting used to the minilang to be
specific and do the following
<entity-one ...>
 <field-map field-name="" value="" (or env-name=""/>
</entity-one>
just remember that you must specify the complete
primary key

<make-value> returns an empty generic entity of the
entity you specify.  This makes it much easier (less
error prone) to do a create, store, remove than does
creating the map by hand.

>  2)  What's the Difference in :
>  <if-compare> & <if-compare-field>
>  

<if-compare> will compare the field to the value
specified in the value=""

<if-compare-field> will compare the field to another
field.

>  3) What's the difference in the following two
> sentence :
>  <field-to-field field-name="productId"
> to-field-name="productIdToCheck"/>
>  &
>  <set field="productId" value="productIdToCheck"/>
>  

<field-to-field I believe has been deprecated in usage
in favor of <set> however notice your
value="productIdToCheck" is the string literal
"productIdToCheck" and not the field productIdToCheck

to make them equivalent statements, it should be <set
field="productId" from-field="productIdToCheck"/>

>  It may be some stupid questions but I will feel
> happy if somebody clears my doughts.
>  
Hope that helped

>  
> ---------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls
> to the US (and 30+ countries) for 2¢/min or less.