source: trunk/docs/services/zcfg-reference.txt @ 421

Last change on this file since 421 was 349, checked in by neteler, 13 years ago

fix double LF

  • Property svn:keywords set to HeadURL Date Author Id Rev
  • Property svn:mime-type set to text/plain
File size: 8.1 KB
Line 
1.. _services-zcfg:
2   
3ZCFG : the ZOO Service Configuration File
4========================================= 
5
6:Authors: Nicolas Bozon, Gérald Fenoy, Jeff McKenna
7:Last Updated: $Date: 2011-12-07 13:44:57 +0000 (Wed, 07 Dec 2011) $
8
9.. contents:: Table of Contents
10    :depth: 3
11    :backlinks: top
12
13The ZOO Service configuration file (.zcfg) describes the service and will be parsed by
14the ZOO Kernel. We will describe here what such a file contains.
15You can also take a look at the existing examples of ZCFG files in the ``cgi-env`` directory
16of each services available in the `ZOO-Project SVN source tree <http://zoo-project.org/trac/browser/trunk/zoo-services>`__.
17
18A ZOO Configuration file is divided into three distinct sections :
19
201. Main Metadata information
212. List of Inputs metadata information
223. List of Outputs metadata information
23
24.. Note:: The ZOO Service Configuration File is case sensitive.
25
26Main Metadata Information
27-------------------------
28
29The fist part in a ZOO Configuration file contains the metadata information relative to the service.
30Note that the "name of your service" between brackets on the first line has to be the exact same name
31as the function you defined in your services provider code. In most cases, this name is also the name
32of the ZCFG file without the "``.zcfg``" extension.
33
34You can see below a description of the main metadata information:
35
36.. code-block:: none
37   :linenos:
38
39   [Name of your service]
40   Title = Title of your service
41   Abstract = Description of your service
42   processVersion = Version number of your service
43   storeSupported = true/false
44   statusSupported = true/false
45   serviceType = the programming language used to implement the service (C/Fortran/Python/Java/PHP/Javascript)
46   serviceProvider = name of your services provider (shared library/Python Module/Java Class/PHP Script/JavaScript script)
47   <MetaData>
48     title = Metadata title of your service
49   </MetaData>
50
51List of Inputs
52--------------
53
54The list of inputs contains metadata information of each supported input, and they are grouped using a ``<DataInputs>`` node.
55
56Each input is defined as :
57
58-  a name (between brackets as for the name of the service before)
59- various medata properties (``Title``, ``Abstract``, ``minOccurs`` and ``maxOccurs``)
60- a Type Of Data node (:ref:`description <typeDataNodes>`)
61
62A typical list of inputs (``<DataInputs>``) look like the following:
63
64.. code-block:: none
65   :linenos:
66   
67   <DataInputs>
68     [Name of the first input]
69       Title = Title of the first input
70       Abstract = Abstract describing the first input
71       minOccurs = Minimum occurence of the first input
72       maxOccurs = Maximum occurence of the first input
73       <Type Of Data Node />
74     [Name of the second input]
75       Title = Title of the second input
76       Abstract = Abstract describing the second input
77       minOccurs = Minimum occurence of the second input
78       maxOccurs = Maximum occurence of the second input
79       <Type Of Data Node />
80   </DataInputs>
81   
82.. Note:: you can add ``<MetaData>`` node as in the main metadata information.
83
84List of Outputs
85---------------
86
87The list of outputs is very similar to a list of inputs except it is specified as a ``<DataOutputs>`` node.
88
89A typical ``<DataOutputs>`` node looks like the following:
90
91.. code-block:: none
92   :linenos:
93   
94   <DataOutputs>
95     [Name of the output]
96       Title = Title of the output
97       Abstract = Description of the output
98       <Type Of Data Node />
99   </DataOutputs>
100
101.. _typeDataNodes:
102
103Type Of Data Nodes
104------------------
105
106In the beginning of this ZCFG introduction, we spoke about "Type Of Data Nodes" to describe the data type of inputs and outputs.
107
108You can define your data as:
109
110- :ref:`LiteralData <LiteralData>`
111- :ref:`BoundingBoxData <BoundingBoxData>`
112- :ref:`ComplexData <ComplexData>`
113
114Except for ``LiteralData``, each *Type Of Data* node must have at least one ``<Default>`` and one ``<Supported>`` node. Even
115if one of those are empty, it **has to be present** with an opening and closing tag on two different lines. So, something
116like the following:
117
118.. code-block:: guess
119   :linenos:
120
121   <Default>
122   </Default>
123
124Otherwise, ZOO-Kernel won't be able to parse your ZCFG and will fail to process requests.
125
126.. _LiteralData:
127
128LiteralData node
129****************
130
131A ``<LiteralData>`` node contains:
132
133- one ``<Default>`` node,
134- zero or more ``<Supported>`` nodes depending on the existence or the number of supported Units Of Measure (UOM), and
135- a ``dataType`` property. The ``dataType`` property defines the type of literal data, such as a string, an interger and so on
136  (consult `the complete list <http://www.w3.org/TR/xmlschema-2/#built-in-datatypes>`__ of supported data types).
137
138``<Default>`` and ``<Supported>`` nodes can contain the ``uom`` property to define which UOM has to be used for
139this input value.
140
141For input ``<LiteralData>`` nodes, you can add the ``value`` property to the ``<Default>`` node to define a default
142value for this input. This means that, when your Service will be run, even if the input wasn't defined, this default
143value will be set as the current value for this input.
144
145A typical ``<LiteralData>`` node, defining a ``float`` data type using meters or degrees for its UOM, looks like the
146following:
147
148.. code-block:: guess
149   :linenos:
150   
151   <LiteralData>
152     dataType = float
153     <Default>
154       uom = meters
155     </Default>
156     <Supported>
157       uom = feet
158     </Supported>
159   </LiteralData>
160
161.. _BoundingBoxData:
162
163BoundingBoxData node
164********************
165
166A ``<BoundingBoxData>`` node contains:
167
168- one ``<Default>`` node with a CRS property defining the default Coordinate Reference Systems (CRS), and
169- one or more ``<Supported>`` nodes depending on the number of CRS your service supports (note that you can
170  alternatively use a single ``<Supported>`` node with a comma-separated list of supported CRS).
171
172A typical ``<BoundingBoxData>`` node, for two supported CRS (`EPSG:4326 <http://www.epsg-registry.org/indicio/query?request=GetRepositoryItem&id=urn:ogc:def:crs:EPSG::4326>`__
173and `EPSG:3785 <http://www.epsg-registry.org/indicio/query?request=GetRepositoryItem&id=urn:ogc:def:crs:EPSG::3785>`__),
174looks like the following:
175
176.. code-block:: guess
177   :linenos:
178   
179   <BoundingBoxData>
180     <Default>
181       CRS = urn:ogc:def:crs:EPSG:6.6:4326
182     </Default>
183     <Supported>
184       CRS = urn:ogc:def:crs:EPSG:6.6:4326
185     </Supported>
186     <Supported>
187       CRS = urn:ogc:def:crs:EPSG:6.6:3785
188     </Supported>
189   </BoundingBoxData>
190
191.. _ComplexData:
192
193ComplexData node
194****************
195
196A ComplexData node contains:
197
198- a ``<Default>`` node and
199- one or more ``<Supported>`` nodes depending on the number of supported formats. A format is made up of this
200  set of properties : ``mimeType``, ``encoding`` and optionaly ``schema``.
201
202For output ComplexData nodes, you can add the ``extension`` property to define what extension to use to name
203the file when storing the result is required. Obviously, you'll have to add the ``extension`` property to each
204supported format (for the ``<Default>`` and ``<Supported>`` nodes).
205
206You can also add the ``asReference`` property to the ``<Default>`` node to define if the output should be
207stored on server side per default.
208
209.. Note:: the client can always modify this behavior by setting ``asReference`` attribute to ``true`` or ``false``
210          for this output in the request ``ResponseDocument`` parameter.
211
212You can see below a sample ComplexData node for default ``application/json`` and ``text/xml`` (encoded in UTF-8
213or base64) mimeTypes support:
214
215.. code-block:: guess
216   :linenos:
217   
218   <ComplexData>
219     <Default>
220       mimeType = application/json
221       encoding = UTF-8
222     </Default>
223     <Supported>
224       mimeType = text/xml
225       encoding = base64
226       schema = http://fooa/gml/3.1.0/polygon.xsd
227     </Supported>
228     <Supported>
229       mimeType = text/xml
230       encoding = UTF-8
231       schema = http://fooa/gml/3.1.0/polygon.xsd
232     </Supported>
233   </ComplexData>
Note: See TracBrowser for help on using the repository browser.

Search

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png