You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by sqlien <sm...@yahoo.fr> on 2007/10/03 09:44:33 UTC

tag in services.xml

hi,

Can anyone tell me what mean these two lines in services.xml files

<auto-attributes mode="IN" include="pk" optional="false"/>
<auto-attributes mode="IN" include="nonpk" optional="true"/>

why we use them ? 

thanks
-- 
View this message in context: http://www.nabble.com/%3Cauto-attributes%3E-tag-in-services.xml-tf4560287.html#a13014245
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: tag in services.xml

Posted by Jonathon -- Improov <jo...@improov.com>.
Sometimes, when you need only the reference to an existing record, you will want service callers 
to pass in PK (primary key) fields. PK fields are combined to form the "key" to look up a 
particular record. Non-PK fields form the "data" for the record.

Other times, when you need to update an existing record or to create a new record, you will 
obviously need more than PK fields. You'll need non-PK fields.

Jonathon

sqlien wrote:
> Thank you for your replies. 
> other question : why we distinguishe these two attributes include="nonpk"
> and  include="pk"; in the implementation of a service i never found this
> distinction when manipulating IN parameters.
> 
> jonwimp wrote:
>> Not sure if <attribute> overrides an <auto-attributes>. There's
>> <override>.
>>
>> In <auto-attributes>, there's also <exclude>, so you can selectively
>> exclude some attributes in 
>> the entity specified in <auto-attributes entity-name="SomeEntity">.
>>
>> Usually, you'll use <override> to override the "optional" attribute of an
>> attribute. For eg,
>>
>>    <auto-attributes entity-name="SomeEntity" include="pk"
>> optional="false"/>
>>    <override name="somePkInSomeEntity" optional="true"/>
>>
>> I skipped several attributes in the above eg.
>>
>> Jonathon
>>
>> Amine AZZI wrote:
>>> it's a shortcut, instead of declaring each attribute apart, you can use
>>> this
>>> tag to generate all attributes with default values taken from the entity
>>> model definition of the used entity.
>>> Of course, you can override this declaration by declaring an existing
>>> attribute.
>>>
>>> Regards.
>>> Amine.
>>>
>>> 2007/10/3, sqlien <sm...@yahoo.fr>:
>>>> hi,
>>>>
>>>> Can anyone tell me what mean these two lines in services.xml files
>>>>
>>>> <auto-attributes mode="IN" include="pk" optional="false"/>
>>>> <auto-attributes mode="IN" include="nonpk" optional="true"/>
>>>>
>>>> why we use them ?
>>>>
>>>> thanks
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/%3Cauto-attributes%3E-tag-in-services.xml-tf4560287.html#a13014245
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition. 
>>> Version: 7.5.488 / Virus Database: 269.13.39/1045 - Release Date:
>>> 10/2/2007 6:43 PM
>>
>>
> 


Re: tag in services.xml

Posted by sqlien <sm...@yahoo.fr>.
Thank you for your replies. 
other question : why we distinguishe these two attributes include="nonpk"
and  include="pk"; in the implementation of a service i never found this
distinction when manipulating IN parameters.

jonwimp wrote:
> 
> Not sure if <attribute> overrides an <auto-attributes>. There's
> <override>.
> 
> In <auto-attributes>, there's also <exclude>, so you can selectively
> exclude some attributes in 
> the entity specified in <auto-attributes entity-name="SomeEntity">.
> 
> Usually, you'll use <override> to override the "optional" attribute of an
> attribute. For eg,
> 
>    <auto-attributes entity-name="SomeEntity" include="pk"
> optional="false"/>
>    <override name="somePkInSomeEntity" optional="true"/>
> 
> I skipped several attributes in the above eg.
> 
> Jonathon
> 
> Amine AZZI wrote:
>> it's a shortcut, instead of declaring each attribute apart, you can use
>> this
>> tag to generate all attributes with default values taken from the entity
>> model definition of the used entity.
>> Of course, you can override this declaration by declaring an existing
>> attribute.
>> 
>> Regards.
>> Amine.
>> 
>> 2007/10/3, sqlien <sm...@yahoo.fr>:
>>>
>>> hi,
>>>
>>> Can anyone tell me what mean these two lines in services.xml files
>>>
>>> <auto-attributes mode="IN" include="pk" optional="false"/>
>>> <auto-attributes mode="IN" include="nonpk" optional="true"/>
>>>
>>> why we use them ?
>>>
>>> thanks
>>> --
>>> View this message in context:
>>> http://www.nabble.com/%3Cauto-attributes%3E-tag-in-services.xml-tf4560287.html#a13014245
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> ------------------------------------------------------------------------
>> 
>> No virus found in this incoming message.
>> Checked by AVG Free Edition. 
>> Version: 7.5.488 / Virus Database: 269.13.39/1045 - Release Date:
>> 10/2/2007 6:43 PM
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cauto-attributes%3E-tag-in-services.xml-tf4560287.html#a13016593
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: tag in services.xml

Posted by Jonathon -- Improov <jo...@improov.com>.
Not sure if <attribute> overrides an <auto-attributes>. There's <override>.

In <auto-attributes>, there's also <exclude>, so you can selectively exclude some attributes in 
the entity specified in <auto-attributes entity-name="SomeEntity">.

Usually, you'll use <override> to override the "optional" attribute of an attribute. For eg,

   <auto-attributes entity-name="SomeEntity" include="pk" optional="false"/>
   <override name="somePkInSomeEntity" optional="true"/>

I skipped several attributes in the above eg.

Jonathon

Amine AZZI wrote:
> it's a shortcut, instead of declaring each attribute apart, you can use this
> tag to generate all attributes with default values taken from the entity
> model definition of the used entity.
> Of course, you can override this declaration by declaring an existing
> attribute.
> 
> Regards.
> Amine.
> 
> 2007/10/3, sqlien <sm...@yahoo.fr>:
>>
>> hi,
>>
>> Can anyone tell me what mean these two lines in services.xml files
>>
>> <auto-attributes mode="IN" include="pk" optional="false"/>
>> <auto-attributes mode="IN" include="nonpk" optional="true"/>
>>
>> why we use them ?
>>
>> thanks
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cauto-attributes%3E-tag-in-services.xml-tf4560287.html#a13014245
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> ------------------------------------------------------------------------
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.488 / Virus Database: 269.13.39/1045 - Release Date: 10/2/2007 6:43 PM


Re: tag in services.xml

Posted by Amine AZZI <ba...@gmail.com>.
it's a shortcut, instead of declaring each attribute apart, you can use this
tag to generate all attributes with default values taken from the entity
model definition of the used entity.
Of course, you can override this declaration by declaring an existing
attribute.

Regards.
Amine.

2007/10/3, sqlien <sm...@yahoo.fr>:
>
>
> hi,
>
> Can anyone tell me what mean these two lines in services.xml files
>
> <auto-attributes mode="IN" include="pk" optional="false"/>
> <auto-attributes mode="IN" include="nonpk" optional="true"/>
>
> why we use them ?
>
> thanks
> --
> View this message in context:
> http://www.nabble.com/%3Cauto-attributes%3E-tag-in-services.xml-tf4560287.html#a13014245
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>

Re: tag in services.xml

Posted by Jonathon -- Improov <jo...@improov.com>.
I think the default is inclue="all". Which means, pk and nonpk fields are included.

Jonathon

sqlien wrote:
> if I make <auto-attributes mode="IN"  optional="false"/> without 
> include="pk" / include="nonpk", pk and non pk fields are implicitly passed
> IN or not ? 
> 
> 
> sqlien wrote:
>> hi,
>>
>> Can anyone tell me what mean these two lines in services.xml files
>>
>> <auto-attributes mode="IN" include="pk" optional="false"/>
>> <auto-attributes mode="IN" include="nonpk" optional="true"/>
>>
>> why we use them ? 
>>
>> thanks
>>
> 


Re: tag in services.xml

Posted by sqlien <sm...@yahoo.fr>.
if I make <auto-attributes mode="IN"  optional="false"/> without 
include="pk" / include="nonpk", pk and non pk fields are implicitly passed
IN or not ? 


sqlien wrote:
> 
> hi,
> 
> Can anyone tell me what mean these two lines in services.xml files
> 
> <auto-attributes mode="IN" include="pk" optional="false"/>
> <auto-attributes mode="IN" include="nonpk" optional="true"/>
> 
> why we use them ? 
> 
> thanks
> 

-- 
View this message in context: http://www.nabble.com/%3Cauto-attributes%3E-tag-in-services.xml-tf4560287.html#a13034578
Sent from the OFBiz - User mailing list archive at Nabble.com.