Skip to content
jeanphilippe-p edited this page Aug 12, 2016 · 57 revisions

Table of Contents

  1. Manifest list
  2. Manifest description
  3. Manifest example

Manifest list

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.

Manifest description

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 Model Person can have a foreign property Mother. 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>

Id property

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 example

<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>

Clone this wiki locally