Changes between Version 2 and Version 3 of ZooWebSite/ZooServices/Examples


Ignore:
Timestamp:
Apr 17, 2010, 5:52:52 PM (10 years ago)
Author:
djay
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ZooWebSite/ZooServices/Examples

    v2 v3  
    44
    55= Python =
     6
     7You'll find here informations needed to deploy your own Python Services Provider.
     8
     9== Python ZCFG requirements ==
     10
     11For each Services providen by your ZOO Python Services Provider, the ZCFG File have to be named as the Python module function name.
     12
     13The ZCFG file should contain the following :
     14
     15  serviceType::
     16    Python
     17  serviceProvider::
     18    the name of the Python module to use as a ZOO Service Provider. For instance, if your script, located in the same directory as your ZOO Kernel, was named {{{my_module.py}}} then you should use {{{my_module}}} (the Python module name) as {{{serviceProvider}}} value in ZCFG file.
     19
     20== Python Data Structure used ==
     21
     22The Python module's function to be used as a service have to :
     23
     24 * take three arguments : the main configuration, inputs and outputs maps are passed to the Python module as [http://docs.python.org/tutorial/datastructures.html#dictionaries dictionaries].
     25 * return an integer : corresopnding to the service status code.
     26
     27==== Sample Data Structure ====
     28
     29In the following you 'll find a sample argument passed to the Python module's function for the two first [browser:trunk/zoo-kernel/main.cfg main configuration file]' sections.
     30
     31{{{
     32#!python
     33main={
     34   "main": {"encoding": "utf-8",
     35            "version": "1.0.0",
     36            "serverAddress": "http://www.zoo-project.org/zoo/",
     37            "lang": "fr-FR,en-CA"},
     38   "identification": {"title": "The Zoo WPS Development Server",
     39                      "abstract": "Development version of ZooWPS.",
     40                      "fees": "None",
     41                      "accessConstraints": "none",
     42                      "keywords": "WPS,GIS,buffer"}
     43}
     44}}}
     45
     46== Sample ZOO Python Services Provider ==
     47
     48The following code represent a simple ZOO Python Services Provider which provides only one Service, the {{{HelloPy}}} one.
    649
    750{{{
     
    1356}}}
    1457
    15 [browser:trunk/zoo-services/hello-py/cgi-env/HelloPy.zcfg Link to HelloPy.zcfg]
    16 
     58|| [browser:trunk/zoo-services/hello-py/cgi-env/HelloPy.zcfg The ZCFG File] || [http://svn.zoo-project.org/zoo/?Service=WPS&Request=DescribeProcess&Version=1.0.0&Identifier=HelloPy DescribeProcess]||[http://svn.zoo-project.org/zoo/?Service=WPS&Request=Execute&Version=1.0.0&Identifier=HelloPy&DataInputs=a=ZOO%20Project&RawDataOutput=Result RawDataOutput]||
    1759= PHP =
    1860

Search

Context Navigation

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