<INCLUDE> : Include

Java class : leon.info.LyInclude

ROLE

The tag enables use of external objects defined in an other model. The objects declared in this tag may be either classes or actions (simple actions, compound actions or tab actions). These objects can of course be used normally in the model as if they were defined in it, like any other objects (class of a relation, sub-action of an action, parameter of an action...).
The loading of the sub-model is triggered by: for classes, when accessing their internal structure (fields, actions, routes), for actions and for classes, when used as parameters of LySession.invokeAction. The aim is to enable dividing an application into several sub-applications with dependencies between them, the included model being loaded only when it is effectively used. This encourages collaboration work by enabling the division of the work between several developers while minimizing the interactions between them.

ATTRIBUTES

<!ATTLIST INCLUDE
	  applicationId NMTOKEN #IMPLIED
	  xmlFile CDATA #REQUIRED
	  version CDATA #IMPLIED
	  load ( true | false) "false">
Attribute Mand. Description Default
applicationId no Id. of the application used for loading resources  
xmlFile yes Relative path of the sub-model.  
version no Version of the included model.  
load no Indicates if loading of the include is done on parsing or when needed. false

ELEMENTS

<!ELEMENT INCLUDE 
	  (INFO)*>
Element Mand. Mult. Description
INFO yes no List of objects declared as imported from the included sub-model. These objects are referenced by their id and have a type: class, action simple, compound action or tab action). An error occurs when loading the included model, if an object with the specified id is not found or if the found object has not the right type.
To allow their use in toolbars and menus without loading the included model, these external objects may have a name, an alias, a group and a prefix.

SAMPLE

<PROJECT id="compta">
...

<INCLUDE xmlFile="leon/contrib/compta/info/admin.xml"
		applicationId="admin">
	<INFO id="user">
		<NAME value="User"/>
		<GROUP value="Admin"/>
	</INFO>
	<INFO id="result"/>
	<INFO id="balance" type='ACTION'>
		<NAME value='Account'/>
		<GROUP value='Admin'/>
		<PREFIX value='result'/>
	</INFO>
</INCLUDE>

...
</PROJECT>

Note : The sub-project "admin" can do the reverse include of the "compta" project.