Project

General

Profile

1
<h2>Config file structure</h2>
2

    
3
<p>
4
A Mapbuilder configuration document follows the Object-Property-Value 
5
rule which is borrowed from RDF and GML3.
6
As a rule of thumb, this means that elements in the config file
7
alternate between UpperCamelCase and lowerCamelCase, 
8
UpperCamelCase is for objects and lowerCamelCase is for properties. 
9
An object can only contain another object through a property value and the 
10
property name should reflect the relationship or role that the 
11
contained Object plays.
12
</p>
13

    
14
<p>
15
A more complete description of the object-property-value rule
16
can be found in section 2.1 of the document: 
17
<a href="http://www.geoconnections.org/developersCorner/devCorner_devNetwork/components/GML_bpv1.3_E.pdf">
18
Developing and Managing GML Application Schemas</a>
19
</p>
20

    
21
<p>
22
The benefits of using this naming convention is that it clearly distinguishes
23
between Objects and their properties. 
24
Objects in the configuration file map directly to Mapbuilder Javascript objects
25
and it makes the configuration file much easier to parse.
26
</p>
27

    
28
<p>
29
Practically all object properties are optional.
30
</p>
31

    
32
<p>
33
In addition to simple properties, Models may have &lt;models&gt;, &lt;widgets&gt;
34
and &lt;tools&gt; properties which list the objects of those types that act
35
on that model.
36
A Model object will therefore look like:
37
</p>
38
<pre>
39
&lt;Model_a&gt;
40
  &lt;property_1&gt;pvalue&lt;/property_1&gt;
41
  &lt;property_2&gt;pvalue&lt;/property_2&gt;
42
  ...
43
  &lt;models&gt;
44
    ...(model objects)...
45
  &lt;/models&gt;
46
  &lt;widgets&gt;
47
    ...(widget objects)...
48
  &lt;/widgets&gt;
49
  &lt;tools&gt;
50
    ...(tool objects)...
51
  &lt;/tools&gt;
52
&lt;/Model_a&gt;
53
</pre>
54

    
55
<p>
56
Widgets and Tools only contain simple property values, so these will look like:
57
</p>
58
<pre>
59
&lt;Widget_i&gt;
60
  &lt;property_1&gt;pvalue&lt;/property_1&gt;
61
  &lt;property_2&gt;pvalue&lt;/property_2&gt;
62
  ...
63
&lt;/Widget_i&gt;
64
</pre>
65
<p>
66
and:
67
</p>
68
<pre>
69
&lt;Tool_x&gt;
70
  &lt;property_1&gt;pvalue&lt;/property_1&gt;
71
  &lt;property_2&gt;pvalue&lt;/property_2&gt;
72
  ...
73
&lt;/Tool_x&gt;
74
</pre>
75

    
76
<p>
77
Keeping in mind that the config is itself a Model object, 
78
the basic structure of a Mapbuilder configuration file will look like this:
79
</p>
80
<pre>
81
&lt;MapbuilderConfig&gt;
82
  &lt;property_1&gt;pvalue&lt;/property_1&gt;
83
  &lt;property_2&gt;pvalue&lt;/property_2&gt;
84
  ...
85
  &lt;models&gt;
86
    &lt;Model_a&gt;...&lt;/Model_a&gt;
87
    &lt;Model_b&gt;...&lt;/Model_b&gt;
88
    ...
89
  &lt;/models&gt;
90
  &lt;widgets&gt;
91
    &lt;Widget_i&gt;...&lt;/Widget_i&gt;
92
    &lt;Widget_j&gt;...&lt;/Widget_j&gt;
93
    ...
94
  &lt;/widgets&gt;
95
  &lt;tools&gt;
96
    &lt;Tool_x&gt;...&lt;/Tool_x&gt;
97
    &lt;Tool_y&gt;...&lt;/Tool_y&gt;
98
  &lt;/tools&gt;
99
&lt;/MapbuilderConfig&gt;
100
</pre>
101

    
102
<p>
103
The actual objects that mapbuilder supports and the properties that can be 
104
assigned to them is detailed in the <a href="docs/register">Component register.</a>
105
</p>
106

    
107
<p align="right">
108
<a href="?page=config/mvc">previous</a>&nbsp;&nbsp;&nbsp; 
109
<a href="?page=config/patterns">next</a>
110
</p>
(5-5/7)