[Zoo-discuss] ZOO-client and ZOO-API : concepts and usage
Fenoy Gerald
gerald.fenoy at geolabs.fr
Fri Jun 10 02:21:41 PDT 2016
Dear Rakesh,
nice to hear from you.
You will find my answers inline bellow.
> Le 10 juin 2016 à 10:28, rakesh prithiviraj <rakeshuk at outlook.com> a écrit :
>
> Hi,
>
> I really appreciate if someone could help me in understanding the concepts behind ZOO-client and ZOO-API and the relation between them. Thanks for your time.
>
> Objective: Create a web front end that allows user to select a WPS processor and execute it.
>
> I had a look at ZOO-client (zoo.js, wps-payload.js, utils.js) and ZOO-api (ZOO-api.js, ZOO-proj4js.js) description and my understanding is that ZOO-client can create WPS requests (GetCapabilities, DescribeProcess, ExecuteRequest, DismissRequest) and can send it directly to ZOO-Kernel. ZOO-client uses mustache templates for this. We do not need ZOO-API at all for this sequence. Is it correct? Also ZOO-client can also dynamically build the form based on DescribeProcess response.
>
This is correct, no need for ZOO-API in the sequence you have described. It is also right to say that the ZOO-Client can create form based on DescribeProcess, it is the case of the otb-example.html demo you are referring later (note that it is also the same for other new demos such as the saga one).
> Am i right to say that ZOO-api is server side equivalent of ZOO-client. This means ZOO-api can also generate WPS requests and can send it to ZOO-kernel. This means we can write simple web front that sends all the information (processor identifier, inputs, outputs etc.) that is required to create WPS requests to ZOO-API which then constructs the WPS requests and sends it to ZOO-Kernel.
You are right saying that the ZOO-API is used server-side and that it can construct WPS requests and handle the communication with the ZOO-Kernel.
>
> In my use case, I do not want the web front end to talk directly to ZOO-kernel but it should send information (as JSON or XML) to some backend which then logs this user activity in database, performs few checks with the user account and then creates and submits the WPS requests to ZOO-Kernel. This same backend receives the WPS response from ZOO-Kernel and knows how to handle it. The backend again updates the database (user account, history etc.) and then sends the information to web front end. So the backend is the client for ZOO-Kernel and not the web front end. I am hoping that ZOO-API is the one that I need to use as backend.
It is correct to say that you can use ZOO-API in you backend. Nevertheless, I don’t understand why you don’t want your web front end to communicate directly with the ZOO-Kernel. Indeed, in such a situation I feel the easiest way to go would be the following: create the backend client as a JavaScript service taking only one input (the JSON or XML content you were referring to), make your service invoking the required steps (user privileges checking for instance) prior to send WPS request, send it to the WPS server then handle it, at the end you can obviously invoke any other service / specific script to be run from the web server.
The JavaScript ZOO-API can send WPS request but also more basic HTTP requests if required.
>
> If my understanding of ZOO-api is not correct, then I need to develop a backend in Java/PHP that should act as middle layer between web front end and ZOO-Kernel.
>
> Also I had a look at this example http://zoo-project.org/examples/otb-example.html. It looks very promising. Is the source code of this exampe available as open source?
Well, I am not sure about this question. The ZOO-Client is fully open source, we simply have added an html page (its content can be found as the page itself) and two small JavaScript files so we did not think it would require anything to be published as everything is available online. We may be wrong here, if it may be of any help for anyone to have this submitted to the SVN tree please let us know and we can proceed by adding all the demo front end demos on the source repository.
I hope my answer was clear enough and it helps.
Best regards,
Gérald Fenoy
http://wiki.osgeo.org/wiki/User:Djay
More information about the Zoo-discuss
mailing list