.. _client-what:
What is ZOO-Client ?
=========================
ZOO-Client is a client-side JavaScript API which provides simple methods
for interacting with `WPS `__ server from web
applications. It is helpful for sending requests to any WPS compliant
server (such as :ref:`kernel_index`) and to parse the output responses
using simple JavaScript.
JavaScript
-------------------------------
ZOO-Client relies on modern JavaScript libraries and can be seamlessly
integrated in new or existing web platforms or applications. ZOO-Client works by expanding the tags available in WPS specific
templates using values provided by a JavaScript hash or object. It
allows to build valid WPS requests and to send them to a WPS server. It
also provides functions to easily parse and reuse the output XML
responses. Read the :ref:`next section ` to get started.
Templates
-------------------------------
ZOO-Client uses logic-less `Mustache `__
templates for creating well-formed WPS requests. Templates are called
*logic-less* because they do not contain any *if* statements, *else*
clauses, or *for* loops, but only **tags**. Some tags are dynamically replaced by a
value or a series of values.
GetCapabilities
..........................................................
*GetCapabilities* requests are created using the following template:
::
1.0.0
DescribeProcess
..........................................................
*DescribeProcess* requests are created using the following template:
::
{{#identifiers}}
{{.}}
{{/identifiers}}
Execute
..........................................................
*Execute* requests are created using a more complex template, as shown bellow:
::
{{Identifier}}
{{#DataInputs}}
{{#is_literal}}
{{identifier}}
{{value}}
{{/is_literal}}
{{#is_bbox}}
{{identifier}}
{{lowerCorner}}
{{upperCorner}}
{{/is_bbox}}
{{#is_complex}}
{{#is_reference}}
{{#is_get}}
{{identifier}}
{{/is_get}}
{{#is_post}}
{{identifier}}
{{#headers}}
{{/headers}}
{{{value}}}
{{/is_post}}
{{/is_reference}}
{{^is_reference}}
{{identifier}}
{{#is_XML}}
{{{value}}}{{/is_XML}}{{^is_XML}}{{/is_XML}}
{{/is_reference}}
{{/is_complex}}
{{/DataInputs}}
{{#RawDataOutput}}
{{#DataOutputs}}
{{identifier}}
{{/DataOutputs}}
{{/RawDataOutput}}
{{^RawDataOutput}}
{{#DataOutputs}}
{{#is_literal}}
{{identifier}}
{{/is_literal}}
{{^is_literal}}
{{identifier}}
{{/is_literal}}
{{/DataOutputs}}
{{/RawDataOutput}}