| 6 | |
| 7 | You'll find here informations needed to deploy your own Python Services Provider. |
| 8 | |
| 9 | == Python ZCFG requirements == |
| 10 | |
| 11 | For each Services providen by your ZOO Python Services Provider, the ZCFG File have to be named as the Python module function name. |
| 12 | |
| 13 | The 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 | |
| 22 | The 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 | |
| 29 | In 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 |
| 33 | main={ |
| 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 | |
| 48 | The following code represent a simple ZOO Python Services Provider which provides only one Service, the {{{HelloPy}}} one. |