<IMPORT> : Field import

Java class : leon.info.LyFieldInfoImport

ROLE

This tag allows to value a field from the value of another field with the same type taken in a class pointed by a relation contained in the same class that the field defining the import. This field can be local or not. If local, it can be editable and this field is automatically updated and this update is notified when data of the import change. On the contrary, if the field is not local, it can be editable in creation or modification forms, but in this case the import is only used to initialise the corresponding input field and is not used anymore afterwards. Relations taken into account in the import can be filtered by giving the desired filter in the import.

ATTRIBUTES

<!ATTLIST IMPORT
	  relation IDREF #REQUIRED
	  class IDREF #IMPLIED
	  idref IDREF #REQUIRED>
Attribute Mand. Description Default
relation yes Relation that refers to the classes containing the field to import.  
class no Class pointed by the relation and containing the field to import. If the relation refers to a single class or if all the referred classes are accepted, this attribute does not need to be set.  
idref yes Id of the field to import from the class(es) referred by the relation.  

ELEMENTS

<!ELEMENT IMPORT 
	  (FILTER |
	   FILTER_REF)?>
Element Mand. Mult. Description
FILTER yes no Filter used to limit objects taken into account in the import.
FILTER_REF yes no Reference of the filter used to limit objects taken into account in the import.

SAMPLE

<IMPORT relation="item" idref="itemUnitPrice"/>

If the relation is multiple and the imported field has type NUMBER, the function
associated to that number field is used to compute the value of the field that
specifies the import. Imagine that we have a class Invoice that contains a relation
items pointing to a list of Invoice Items and that this last class has a numeric field
amount with the SUM function associated to it, in that case it is possible to define
a field total on Invoice by simply defining an import of the amount field on Invoice
Items and using the items relation of Invoice.

<IMPORT relation="items" class="InvoiceItem" idref="amount"/>