Config file structure

A Mapbuilder configuration document follows the Object-Property-Value rule which is borrowed from RDF and GML3. As a rule of thumb, this means that elements in the config file alternate between UpperCamelCase and lowerCamelCase, UpperCamelCase is for objects and lowerCamelCase is for properties. An object can only contain another object through a property value and the property name should reflect the relationship or role that the contained Object plays.

A more complete description of the object-property-value rule can be found in section 2.1 of the document: Developing and Managing GML Application Schemas

The benefits of using this naming convention is that it clearly distinguishes between Objects and their properties. Objects in the configuration file map directly to Mapbuilder Javascript objects and it makes the configuration file much easier to parse.

Practically all object properties are optional.

In addition to simple properties, Models may have <models>, <widgets> and <tools> properties which list the objects of those types that act on that model. A Model object will therefore look like:

<Model_a>
  <property_1>pvalue</property_1>
  <property_2>pvalue</property_2>
  ...
  <models>
    ...(model objects)...
  </models>
  <widgets>
    ...(widget objects)...
  </widgets>
  <tools>
    ...(tool objects)...
  </tools>
</Model_a>

Widgets and Tools only contain simple property values, so these will look like:

<Widget_i>
  <property_1>pvalue</property_1>
  <property_2>pvalue</property_2>
  ...
</Widget_i>

and:

<Tool_x>
  <property_1>pvalue</property_1>
  <property_2>pvalue</property_2>
  ...
</Tool_x>

Keeping in mind that the config is itself a Model object, the basic structure of a Mapbuilder configuration file will look like this:

<MapbuilderConfig>
  <property_1>pvalue</property_1>
  <property_2>pvalue</property_2>
  ...
  <models>
    <Model_a>...</Model_a>
    <Model_b>...</Model_b>
    ...
  </models>
  <widgets>
    <Widget_i>...</Widget_i>
    <Widget_j>...</Widget_j>
    ...
  </widgets>
  <tools>
    <Tool_x>...</Tool_x>
    <Tool_y>...</Tool_y>
  </tools>
</MapbuilderConfig>

The actual objects that mapbuilder supports and the properties that can be assigned to them is detailed in the Component register.

previous    next