| 622 | |
| 623 | ===== storeExecuteResponse parameter and GetStatus Service ===== |
| 624 | |
| 625 | If you go in your local {{{/home/user/zoows/sources/zoo-services/utils/status}}}, you'll find the code for a ServiceProvider which will provide the {{{GetStatus}}} service and the {{{longProcess}}} one. The last is a simple example to learn how to use the {{{status}}} variable from {{{lenv}}} section of the main configuration {{{maps}}} and the {{{updateStatus}}} function you have to call to take your status value into account. The main service providen is the {{{GetStatus}}} one, it is able to give you information about the current status value from a service running in background mode. |
| 626 | |
| 627 | You have to know that the ZOO Kernel will detect the presence of the {{{GetStatus}}} service and if it is available it will then return the link the corresponding {{{Execute}}} request. |
| 628 | |
| 629 | So now you will deploy the {{{GetStatus}}} and {{{longProcess}}} service on your local environment. As for each services, you shall be able to deploy the services simply by copying the {{{cgi-env}}} directory into your Apache {{{cgi-bin}}} directory. You can use the following command : |
| 630 | |
| 631 | {{{ |
| 632 | #!sh |
| 633 | sudo cp ~user/zoows/sources/zoo-services/utils/status/cgi-env/*{zcfg,zo} /usr/lib/cgi-bin |
| 634 | }}} |
| 635 | |
| 636 | For simple Services it is the right way to deploy Service Providers. But in this specific case you'll have also to add some special parameter in the {{{main}}} section of you main configuration file and to copy an xsl file used to replace on the fly in the {{{ResponseDocument}}} the {{{percentCompleted}}} attribute of the {{{ProcessStarted}}} node returned by the {{{GetStatus}}} service. |
| 637 | |
| 638 | So first edit you {{{main.cfg}}} file to add the following lines in your main section : |
| 639 | |
| 640 | {{{ |
| 641 | #!c |
| 642 | rewriteUrl=call |
| 643 | dataPath=/var/www/data |
| 644 | }}} |
| 645 | |
| 646 | Here you define the path where the service is able to find the xsl file, specified in the {{{dataPath}}} parameter. You also tell the ZOO Kernel that you want to use the rewriteUrl we defined in the [wiki:ZooWorkshop/FOSS4GJapan/UsingZooFromOSGeoLiveVM previous section]. |
| 647 | |
| 648 | To finish your deploiement, you'll have now to copy the xsl file in the defined {{{dataPath}}} directory. You can use the following command : |
| 649 | |
| 650 | |
| 651 | {{{ |
| 652 | #!sh |
| 653 | cp ~/zoows/sources/zoo-services/utils/status/cgi-env/*xsl /var/www/data |
| 654 | }}} |
| 655 | |
| 656 | Now, if you run the following request to run the service longProcess : |
| 657 | |
| 658 | [http://localhost/zoo/?request=Execute&service=WPS&version=1.0.0&Identifier=longProcess&DataInputs=&storeExecuteResponse=true] |
| 659 | |
| 660 | You shall get the a XML document looking like the following : |
| 661 | |
| 662 | '''Image Here''' |