-
Notifications
You must be signed in to change notification settings - Fork 0
Manifest
- Manifest list
- Manifest description
- Manifest example
The list of all your manifests must be referenced in the fundamental file manifestList.xml.
The path to this file must be defined in the file config.json (see [Installation] (https://github.com/jeanphilippe-p/ObjectManagerLib/wiki/Installation) page for more informations).
File manifestList.xml look like :
<list>
<manifest type="person">relative/path/to/person/manifest.xml</manifest>
<manifest type="house">relative/path/to/house/manifest.xml</manifest>
<manifest type="town">relative/path/to/town/manifest.xml</manifest>
</list>
Each manifest node must have an attribut type (name of your model) and the path where we can found this manifest.
the path must be relative to the folder that contain manifestList.xml file.
A Manifest is simply a list of properties
<manifest>
<properties>
...
</properties>
</manifest>
There are two kind of properties : property and foreign property.
- Property
A property is defined by the node<property>,has a name and a type - Foreign property
Foreign properties are defined by the node<foreignProperty>and refer another Object that has an existence elsewhere. For example a ModelPersoncan have a foreign propertyMother. A person 'John' has a mother 'Jane' and 'Jane' can exist without 'John'.
<manifest>
<properties>
<property type="string">firstName</property>
<property type="string">lastName</property>
<foreignProperty type="person">father</foreignProperty>
<foreignProperty type="person">mother</foreignProperty>
</properties>
</manifest>
An id property is a part of a model id. Commonly models have only one id property but you can define several id properties.
to define a property has id property you just have to add an attribut id with value "1" (foreign properties can not be id)
<manifest>
<properties>
<property type="string" id="1">id</property>
<property type="string">firstName</property>
<property type="string">lastName</property>
<property type="integer">age</property>
<foreignProperty type="place">birthPlace</foreignProperty>
<property type="string">
<name>sex</name>
<enum>
<value>male</value>
<value>female</value>
</enum>
</property>
<foreignProperty type="person">father</foreignProperty>
<foreignProperty type="person">mother</foreignProperty>
<foreignProperty type="array">
<name>children</name>
<values type="person" name="child"/>
</foreignProperty>
<foreignProperty type="array">
<name>homes</name>
<values type="home" name="home"/>
</foreignProperty>
</properties>
</manifest>