Enumeration documentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Enumeration documentation

Cameron Smith-6
Could someone point me to good documentation for using the Entity Engine enumeration facility?  I have loooked through existing entitymodel.xml files, and can see well enough how to declare a field as Enumeration type.

What I cannot see it, how to specifiy in XML, and consult in Java, the particular subset of entries in the enumeration table, which correspond to a particular field in a particular Entity.  For instance in Person we have residenceStatusEnumId, and that is linked to Enumeration via:
   <relation type="one" fk-name="PERSON_RESS_ENUM" title="ResidenceStatus" rel-entity-name="Enumeration">
            <key-map field-name="residenceStatusEnumId" rel-field-name="enumId"/>
        </relation>

However looking at the values installed in Enumeration via ant run-install-seed, we have a set of 4 entries which appear to be the values for this enumeration, with enumTypeId = "PTY_RESID_STTS".

What I cannot figure out is, how does OFBiz get from PERSON_RESS_ENUM to PTY_RESID_STATUS??

cameron


Send instant messages to your online friends http://uk.messenger.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: Enumeration documentation

David E Jones-2

On Dec 10, 2006, at 7:12 AM, Cameron Smith wrote:

> Could someone point me to good documentation for using the Entity  
> Engine enumeration facility?  I have loooked through existing  
> entitymodel.xml files, and can see well enough how to declare a  
> field as Enumeration type.
>
> What I cannot see it, how to specifiy in XML, and consult in Java,  
> the particular subset of entries in the enumeration table, which  
> correspond to a particular field in a particular Entity.  For  
> instance in Person we have residenceStatusEnumId, and that is  
> linked to Enumeration via:
>    <relation type="one" fk-name="PERSON_RESS_ENUM"  
> title="ResidenceStatus" rel-entity-name="Enumeration">
>             <key-map field-name="residenceStatusEnumId" rel-field-
> name="enumId"/>
>         </relation>
>
> However looking at the values installed in Enumeration via ant run-
> install-seed, we have a set of 4 entries which appear to be the  
> values for this enumeration, with enumTypeId = "PTY_RESID_STTS".
>
> What I cannot figure out is, how does OFBiz get from  
> PERSON_RESS_ENUM to PTY_RESID_STATUS??

It doesn't. In your form definitions and such you have to limit the  
options shown by the enumTypeId manually.

-David