<RELATION> : Relation field

Java class : leon.info.LyRelationFieldInfo

ROLE

This element describes a field that refers to one or several objects of the application. The object references stored inside the value of this field may be ordered or not. Information about that kind of field could be completed by the list of target classes of the application, a default value, a field that specify the target class and a field that creates a context.

ATTRIBUTES

<!ATTLIST RELATION
	  id ID #REQUIRED
	  template IDREF #IMPLIED
	  extends IDREF #IMPLIED
	  abstract ( true | false) "false"
	  javaName NMTOKEN #IMPLIED
	  multiple ( true | false) "false"
	  ordered ( true | false) "false"
	  calculated ( true | false) "false"
	  noContext ( true | false) "false"
	  noToolbar ( true | false) "false"
	  showAs ( DEFAULT | TABLE | LINK | FORM) "DEFAULT"
	  direction ( NONE | FORWARD | BACKWARD | BOTH) "BOTH"
	  type ( ASSOCIATION | COMPOSITION | PARENT | DEPENDENCY) "ASSOCIATION"
	  userData CDATA #IMPLIED
	  reverse IDREF #IMPLIED
	  behavior NMTOKEN #IMPLIED>
Attribute Mand. Description Default
id yes This is the identifier of this field.  
template no Reference to the relation field used as pattern.  
extends no Reference of the field from which this field inherits. A relation may only extends another relation from a parent class. In the case of an extension it is possible to restrict the list of authorized classes with the CLASSES element.  
abstract no Indicates whether the relation is abstract or not. An abstract relation may not be valued. It must be extended in order to be used. false
javaName no Name of the Java attribute that corresponds to the current field when automatic code generation is used. The default value is the name of the current field.  
multiple no This attributes indicates if the field may accept one or several reference to objects of the application. false
ordered no This attribute indicates if the list of reference to objects of the application is stored with a defined order. This attribute is useless for relation fields that are not multiple. false
calculated no Indicates whether the relation is calculated or not. Attribute reserved for an applicative use. false
noContext no This attribute indicates if the context of views that contains this field is taken into account to compute the domain, the list of objects that may be used as values for this relation. Usually, all the logical objects of the relation domain must be related with at least one of the logical objects of the context. When this attribute is set to 'true' this behavior is removed. false
noToolbar no This attribute indicates that this relation has no associated toolbar in creation/modification forms. false
showAs no Allows to choose the type of presentation:
-DEFAULT : default presentation,
-TABLE : table presentation.
DEFAULT
direction no This attribute defines the direction followed when this field is used inside the computing of a cross-reference. Inside the application, cross-references are computed and used many times to manage contexts between views of the graphical user interface. This attribute tells how references to objects defined on this field should be taken into account:
- NONE: all existing references to objects stored inside this field are ignored during computation of cross-references.
- FORWARD: during the computation of a cross-reference, this field may be only used in the direct way to collect objects. The object that has this field defined in its class can give the reference to objects stored inside the associated value. On the other hand, objects stored inside the value of this field are not allowed to give the reference to the object that holds this value.
- BACKWARD: during the computation of a cross-reference, this field may be only used in the reverse way to collect objects. The rule applied is the opposite
BOTH
type no Gives the type of the relation. 3 types of relations are supported :
- ASSOCIATION: association relation without any dependency between the object and related objects,
-COMPOSITION: composition relation between the object and related objects. The deletion of the object involves the deletion of related objects.
ASSOCIATION
userData no User data. Attribute reserved for an applicative use.  
reverse no RELATION.reverse  
behavior no Name of the Java class representing the behavior of this field. Reserved for a future use.  

ELEMENTS

<!ELEMENT RELATION 
	  ((((%A_F_BIND; | F_BINDS)?, IMPORT?) | %A_DAEMON;)?,
	   %COMMON_FIELD_BEGIN;,
	   CLASSES*,
	   MIN?,
	   MAX?,
	   NROWS?,
	   NCOLS?,
	   DEFAULT?,
	   CONTEXT_FIELD?,
	   CLASS_FIELD?,
	   %FIELD_END;)>
Element Mand. Mult. Description
A_F_BIND
yes no Physical binding of the field (see %A_F_BIND; : Field binding (FB)' chapter).
F_BINDS yes no Binding with multiple physical fields (see F_BINDS : Managing multiple keys on a relation (FB)' chapter). Allows to manage multiple foreign keys when using a location corresponding to a relational data base.
IMPORT no no Allows to import the value of a field belonging to a class referred by a relation found in the same class as this field (see IMPORT tag).
A_DAEMON
yes no Information about the daemon to manage this relation.
COMMON_FIELD_BEGIN
yes no Common begin part for a field description.
CLASSES no yes This is the list of target classes. It defines the classes the referred objects should belong. 'For example, if we set the default value for the field (), inside the application, this variable should be defined during the session (session.addValue("$PROJECT", object)).
MIN no no Gives for a multiple relation the minimum number of values that are expected on input for this field.
MAX no no Gives for a multiple relation the maximum number of values that are accepted on input for this field.
NROWS no no Specifies for a multiple relation the number of lines of the graphical input field.
NCOLS no no Specifies the number of columns of the graphical input field.
DEFAULT no no This is the default value. The value should be a string that is the identifier of an existing object of the application. The value could also be an application variable provided it is defined during the user session.
CONTEXT_FIELD no no This attribute adds a context over the current field that limit the list of objects available for the selection.
CLASS_FIELD no no This attribute defines the field that specifies the target classes.
FIELD_END
yes no End of a field description.

SAMPLE 1

<RELATION id="alr_net">
	<ROUTES>
		<ROUTE target='netClass'>
			<STEP idrefs='alr_obj' target='muxClass'/>
		</ROUTE>
		<ROUTE target='netClass'>
			<STEP idrefs='alr_obj' target='cardClass'/>
			<STEP idrefs='card_eqt' target='muxClass'/>
		</ROUTE>
		<ROUTE>
			<STEP idrefs='alr_obj' target='portClass'/>
			<STEP idrefs='port_card' target='cardClass'/>
			<STEP idrefs='card_eqt' target='muxClass'/>
		</ROUTE>
	</ROUTES>
	<NAME value="ALR_NETWORK"/>
	<F_MARKS sort='true' filter='true' find='true' table='true' 			local='true'/>
	<CLASSES idrefs="netClass"/>
</RELATION>

SAMPLE 2

<RELATION id="br_eme" direction='FORWARD'>
	<F_BIND value="EMETTEUR"/>
	<NAME value="BR_EMETTEUR"/>
	<TAB value="TAB_EMISSION"/>
	<F_MARKS create='true' set='true' sort='true' filter='true' find='true' table='true'>
		<MARK name='EMISSION'/>
	</F_MARKS>
	<CLASSES idrefs="custClass usrClass"/>
	<DEFAULT value="$USER"/>
</RELATION>