[659] | 1 | .. _services-zcfg: |
---|
| 2 | |
---|
| 3 | ZOO-Service configuration file |
---|
| 4 | ========================================= |
---|
| 5 | |
---|
| 6 | The ZOO-Service configuration file (.zcfg) describes a |
---|
| 7 | WPS service. It provides metadata information on a particular WPS |
---|
| 8 | Service and it is parsed by ZOO-Kernel when *DescribeProcess* and |
---|
| 9 | *Execute* request are sent. |
---|
| 10 | |
---|
| 11 | The ZOO-Service configuration file is divided into three distinct sections : |
---|
| 12 | |
---|
| 13 | * Main Metadata information |
---|
| 14 | * List of Inputs metadata information (optional since `rev. 469 <http://zoo-project.org/trac/changeset/469>`__) |
---|
| 15 | * List of Outputs metadata information |
---|
| 16 | |
---|
| 17 | .. warning:: The ZOO-Service configuration file is case sensitive. |
---|
| 18 | |
---|
| 19 | .. note:: There are many example ZCFG files in the ``cgi-env`` directory of the `ZOO-Project svn <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-services>`__. |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | Main section |
---|
| 23 | ------------------------- |
---|
| 24 | |
---|
| 25 | The fist part of the ZOO-Service configuration file is the ``main`` section, |
---|
| 26 | which contains general metadata information on the related WPS |
---|
| 27 | Service. |
---|
| 28 | |
---|
| 29 | Note that the "name of your service" between brackets on the first line has to be the exact same name |
---|
| 30 | as the function you defined in your services provider code. In most cases, this name is also the name |
---|
| 31 | of the ZCFG file without the "``.zcfg``" extension. |
---|
| 32 | |
---|
| 33 | An example of the ``main`` section is given bellow as reference. |
---|
| 34 | |
---|
| 35 | .. code-block:: none |
---|
| 36 | :linenos: |
---|
| 37 | |
---|
| 38 | [Name of WPS Service] |
---|
| 39 | Title = Title of the WPS Service |
---|
| 40 | Abstract = Description of the WPS Service |
---|
| 41 | processVersion = Version number of the WPS Service |
---|
| 42 | storeSupported = true/false |
---|
| 43 | statusSupported = true/false |
---|
| 44 | serviceType = Pprogramming language used to implement the service (C|Fortran|Python|Java|PHP|Ruby|Javascript) |
---|
| 45 | serviceProvider = Name of the Services provider (shared library|Python Module|Java Class|PHP Script|JavaScript Script) |
---|
| 46 | <MetaData> |
---|
| 47 | title = Metadata title of the WPS Service |
---|
| 48 | </MetaData> |
---|
| 49 | |
---|
| 50 | .. warning:: 'Name of WPS Service' must be the exact same name as the function defined in the WPS Service source code. |
---|
| 51 | |
---|
| 52 | .. note:: An ``extend`` parameter may be used for the `Process profile registry <process-profiles.html>`__. |
---|
| 53 | |
---|
| 54 | List of Inputs |
---|
| 55 | -------------- |
---|
| 56 | |
---|
| 57 | The second part of the ZOO-Service configuration file is the ``<DataInputs>`` |
---|
| 58 | section which lists the supported inputs. Each input is defined as : |
---|
| 59 | |
---|
| 60 | * Name (between brackets as for the name of the service before) |
---|
| 61 | * Various medata properties (``Title``, ``Abstract``, ``minOccurs``, ``maxOccurs`` and, in case of ComplexData, the optional ``maximumMegabytes``) |
---|
| 62 | * :ref:`Type Of Data Node <typeDataNodes>` |
---|
| 63 | |
---|
| 64 | A typical list of inputs (``<DataInputs>``) looks like the following: |
---|
| 65 | |
---|
| 66 | .. code-block:: none |
---|
| 67 | :linenos: |
---|
| 68 | |
---|
| 69 | <DataInputs> |
---|
| 70 | [Name of the first input] |
---|
| 71 | Title = Title of the first input |
---|
| 72 | Abstract = Abstract describing the first input |
---|
| 73 | minOccurs = Minimum occurence of the first input |
---|
| 74 | maxOccurs = Maximum occurence of the first input |
---|
| 75 | <Type Of Data Node /> |
---|
| 76 | [Name of the second input] |
---|
| 77 | Title = Title of the second input |
---|
| 78 | Abstract = Abstract describing the second input |
---|
| 79 | minOccurs = Minimum occurence of the second input |
---|
| 80 | maxOccurs = Maximum occurence of the second input |
---|
| 81 | <Type Of Data Node /> |
---|
| 82 | </DataInputs> |
---|
| 83 | |
---|
| 84 | .. note:: A ``<MetaData>`` node can also be added, as in the main metadata information. |
---|
| 85 | |
---|
| 86 | List of Outputs |
---|
| 87 | --------------- |
---|
| 88 | |
---|
| 89 | The third part of the ZOO Service configuration file is the ``<DataOutputs>`` |
---|
| 90 | section, which lists the supported outputs and is is very similar to a |
---|
| 91 | list of inputs. |
---|
| 92 | |
---|
| 93 | A typical list of outputs (``<DataOutputs>``) looks like the |
---|
| 94 | following: |
---|
| 95 | |
---|
| 96 | .. code-block:: none |
---|
| 97 | :linenos: |
---|
| 98 | |
---|
| 99 | <DataOutputs> |
---|
| 100 | [Name of the output] |
---|
| 101 | Title = Title of the output |
---|
| 102 | Abstract = Description of the output |
---|
| 103 | <Type Of Data Node /> |
---|
| 104 | </DataOutputs> |
---|
| 105 | |
---|
| 106 | .. _typeDataNodes: |
---|
| 107 | |
---|
| 108 | Type Of Data Nodes |
---|
| 109 | ------------------ |
---|
| 110 | |
---|
| 111 | The *Type Of Data Nodes* describes data types for inputs and |
---|
| 112 | outputs. There are three different types which are described in this |
---|
| 113 | section. |
---|
| 114 | * :ref:`LiteralData <LiteralData>` |
---|
| 115 | * :ref:`BoundingBoxData <BoundingBoxData>` |
---|
| 116 | * :ref:`ComplexData <ComplexData>` |
---|
| 117 | |
---|
| 118 | .. warning:: Every *BoundingBoxData* and *ComplexData* must have at least one ``<Default>`` node (even empty like ``<Default />``) |
---|
| 119 | |
---|
| 120 | .. _LiteralData: |
---|
| 121 | |
---|
| 122 | LiteralData node |
---|
| 123 | **************** |
---|
| 124 | |
---|
| 125 | A ``<LiteralData>`` node contains: |
---|
| 126 | |
---|
| 127 | - one (optional) ``AllowedValues`` key containing all value allowed for this input |
---|
| 128 | - one (optional) ``range`` properties containing the range (``[``, ``]``) |
---|
| 129 | - one (optional) ``rangeMin`` (``rangeMax``) properties containing the minimum (maximum) value of this range |
---|
| 130 | - one (optional) ``rangeSpacing`` properties containing the regular distance or spacing between value in this range |
---|
| 131 | - one (optional) ``rangeClosure`` properties containing the closure type (``c``, ``o``, ``oc``, ``co``) |
---|
| 132 | - one ``<Default>`` node, |
---|
| 133 | - zero or more ``<Supported>`` nodes depending on the existence or the number of supported Units Of Measure (UOM), and |
---|
| 134 | - a ``dataType`` property. The ``dataType`` property defines the type of literal data, such as a string, an interger and so on |
---|
| 135 | (consult `the complete list <http://www.w3.org/TR/xmlschema-2/#built-in-datatypes>`__ of supported data types). |
---|
| 136 | |
---|
| 137 | ``<Default>`` and ``<Supported>`` nodes can contain the ``uom`` property to define which UOM has to be used for |
---|
| 138 | this input value. |
---|
| 139 | |
---|
| 140 | For input ``<LiteralData>`` nodes, you can add the ``value`` property to the ``<Default>`` node to define a default |
---|
| 141 | value for this input. This means that, when your Service will be run, even if the input wasn't defined, this default |
---|
| 142 | value will be set as the current value for this input. |
---|
| 143 | |
---|
| 144 | A typical ``<LiteralData>`` node, defining a ``float`` data type using meters or degrees for its UOM, looks like the |
---|
| 145 | following: |
---|
| 146 | |
---|
| 147 | .. code-block:: guess |
---|
| 148 | :linenos: |
---|
| 149 | |
---|
| 150 | <LiteralData> |
---|
| 151 | dataType = float |
---|
| 152 | <Default> |
---|
| 153 | uom = meters |
---|
| 154 | </Default> |
---|
| 155 | <Supported> |
---|
| 156 | uom = feet |
---|
| 157 | </Supported> |
---|
| 158 | </LiteralData> |
---|
| 159 | |
---|
| 160 | |
---|
| 161 | A typical ``<LiteralData>`` node, defining a ``float`` data type which |
---|
| 162 | should take values contained in ``[0.0,100.0]``, looks like the following: |
---|
| 163 | |
---|
| 164 | .. code-block:: guess |
---|
| 165 | :linenos: |
---|
| 166 | |
---|
| 167 | <LiteralData> |
---|
| 168 | dataType = float |
---|
| 169 | rangeMin = 0.0 |
---|
| 170 | rangeMax = 100.0 |
---|
| 171 | rangeClosure = c |
---|
| 172 | <Default /> |
---|
| 173 | </LiteralData> |
---|
| 174 | |
---|
| 175 | Or more simply: |
---|
| 176 | |
---|
| 177 | .. code-block:: guess |
---|
| 178 | :linenos: |
---|
| 179 | |
---|
| 180 | <LiteralData> |
---|
| 181 | dataType = float |
---|
| 182 | range = [0.0,100.0] |
---|
| 183 | <Default /> |
---|
| 184 | </LiteralData> |
---|
| 185 | |
---|
| 186 | A typical ``<LiteralData>`` node, defining a ``string`` data type which |
---|
| 187 | support values ``hillshade``, ``slope``, ``aspect``, ``TRI``, ``TPI`` |
---|
| 188 | and ``roughness``, looks like the following: |
---|
| 189 | |
---|
| 190 | .. code-block:: guess |
---|
| 191 | :linenos: |
---|
| 192 | |
---|
| 193 | <LiteralData> |
---|
| 194 | dataType = string |
---|
| 195 | AllowedValues = hillshade,slope,aspect,TRI,TPI,roughness |
---|
| 196 | <Default /> |
---|
| 197 | </LiteralData> |
---|
| 198 | |
---|
| 199 | Properties ``AllowedValues`` and ``range*`` can be conbined with both ``<Default>`` and |
---|
| 200 | ``<Supported>`` nodes in the same was as ``<LiteralData>`` node. For |
---|
| 201 | instance, the following is supported: |
---|
| 202 | |
---|
| 203 | .. code-block:: guess |
---|
| 204 | :linenos: |
---|
| 205 | |
---|
| 206 | <LiteralData> |
---|
| 207 | dataType = int |
---|
| 208 | <Default> |
---|
| 209 | value = 11 |
---|
| 210 | AllowedValues = -10,-8,-7,-5,-1 |
---|
| 211 | rangeMin = 0 |
---|
| 212 | rangeMin = 100 |
---|
| 213 | rangeClosure = co |
---|
| 214 | </Default> |
---|
| 215 | <Supported> |
---|
| 216 | rangeMin = 200 |
---|
| 217 | rangeMin = 600 |
---|
| 218 | rangeClosure = co |
---|
| 219 | </Supported> |
---|
| 220 | <Supported> |
---|
| 221 | rangeMin = 750 |
---|
| 222 | rangeMin = 990 |
---|
| 223 | rangeClosure = co |
---|
| 224 | rangeSpacing = 10 |
---|
| 225 | </Supported> |
---|
| 226 | </LiteralData> |
---|
| 227 | |
---|
| 228 | .. _BoundingBoxData: |
---|
| 229 | |
---|
| 230 | BoundingBoxData node |
---|
| 231 | ******************** |
---|
| 232 | |
---|
| 233 | A ``<BoundingBoxData>`` node contains: |
---|
| 234 | |
---|
| 235 | - one ``<Default>`` node with a CRS property defining the default Coordinate Reference Systems (CRS), and |
---|
| 236 | - one or more ``<Supported>`` nodes depending on the number of CRS your service supports (note that you can |
---|
| 237 | alternatively use a single ``<Supported>`` node with a comma-separated list of supported CRS). |
---|
| 238 | |
---|
| 239 | A 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>`__ |
---|
| 240 | and `EPSG:3785 <http://www.epsg-registry.org/indicio/query?request=GetRepositoryItem&id=urn:ogc:def:crs:EPSG::3785>`__), |
---|
| 241 | looks like the following: |
---|
| 242 | |
---|
| 243 | .. code-block:: guess |
---|
| 244 | :linenos: |
---|
| 245 | |
---|
| 246 | <BoundingBoxData> |
---|
| 247 | <Default> |
---|
| 248 | CRS = urn:ogc:def:crs:EPSG:6.6:4326 |
---|
| 249 | </Default> |
---|
| 250 | <Supported> |
---|
| 251 | CRS = urn:ogc:def:crs:EPSG:6.6:4326 |
---|
| 252 | </Supported> |
---|
| 253 | <Supported> |
---|
| 254 | CRS = urn:ogc:def:crs:EPSG:6.6:3785 |
---|
| 255 | </Supported> |
---|
| 256 | </BoundingBoxData> |
---|
| 257 | |
---|
| 258 | .. _ComplexData: |
---|
| 259 | |
---|
| 260 | ComplexData node |
---|
| 261 | **************** |
---|
| 262 | |
---|
| 263 | A ComplexData node contains: |
---|
| 264 | |
---|
| 265 | - a ``<Default>`` node and |
---|
| 266 | - one or more ``<Supported>`` nodes depending on the number of supported formats. A format is made up of this |
---|
| 267 | set of properties : ``mimeType``, ``encoding`` and optionaly ``schema``. |
---|
| 268 | |
---|
| 269 | For output ComplexData nodes, you can add the ``extension`` property to define what extension to use to name |
---|
| 270 | the file when storing the result is required. Obviously, you'll have to add the ``extension`` property to each |
---|
| 271 | supported format (for the ``<Default>`` and ``<Supported>`` nodes). |
---|
| 272 | |
---|
| 273 | You can also add the ``asReference`` property to the ``<Default>`` node to define if the output should be |
---|
| 274 | stored on server side per default. |
---|
| 275 | |
---|
| 276 | .. Note:: the client can always modify this behavior by setting ``asReference`` attribute to ``true`` or ``false`` |
---|
| 277 | for this output in the request ``ResponseDocument`` parameter. |
---|
| 278 | |
---|
| 279 | You can see below a sample ComplexData node for default ``application/json`` and ``text/xml`` (encoded in UTF-8 |
---|
| 280 | or base64) mimeTypes support: |
---|
| 281 | |
---|
| 282 | .. code-block:: guess |
---|
| 283 | :linenos: |
---|
| 284 | |
---|
| 285 | <ComplexData> |
---|
| 286 | <Default> |
---|
| 287 | mimeType = application/json |
---|
| 288 | encoding = UTF-8 |
---|
| 289 | </Default> |
---|
| 290 | <Supported> |
---|
| 291 | mimeType = text/xml |
---|
| 292 | encoding = base64 |
---|
| 293 | schema = http://fooa/gml/3.1.0/polygon.xsd |
---|
| 294 | </Supported> |
---|
| 295 | <Supported> |
---|
| 296 | mimeType = text/xml |
---|
| 297 | encoding = UTF-8 |
---|
| 298 | schema = http://fooa/gml/3.1.0/polygon.xsd |
---|
| 299 | </Supported> |
---|
| 300 | </ComplexData> |
---|