[659] | 1 | .. _client-howto: |
---|
| 2 | |
---|
| 3 | Using ZOO-Client |
---|
| 4 | ================== |
---|
| 5 | |
---|
| 6 | This section will help you to get started using :ref:`ZOO-Client <client-what>`. |
---|
| 7 | |
---|
| 8 | Prerequisites |
---|
| 9 | ---------------------- |
---|
| 10 | |
---|
| 11 | ZOO-Client is based on the following Javascript libraries |
---|
| 12 | |
---|
| 13 | - jQuery (`http://www.jquery.com <http://www.jquery.com>`_) |
---|
| 14 | - x2js (`https://code.google.com/p/x2js <https://code.google.com/p/x2js/>`_) |
---|
| 15 | - Require.js (`http://requirejs.org <http://requirejs.org/>`_ ) |
---|
| 16 | - Hogan.js (`http://twitter.github.io/hogan.js <http://twitter.github.io/hogan.js>`_ ) |
---|
| 17 | - query-string (`https://github.com/sindresorhus/query-string <https://github.com/sindresorhus/query-string/>`_ ) |
---|
| 18 | |
---|
| 19 | .. warning:: |
---|
| 20 | |
---|
| 21 | `Node.js <http://nodejs.org/>`__ is also required on your system |
---|
| 22 | for compiling ZOO-Client templates. |
---|
| 23 | |
---|
| 24 | Download |
---|
| 25 | ----------------------- |
---|
| 26 | |
---|
| 27 | If you did not :ref:`download <install-download>` the ZOO-Project |
---|
| 28 | source code already, please proceed to a svn checkout with the |
---|
| 29 | following command: |
---|
| 30 | |
---|
| 31 | :: |
---|
| 32 | |
---|
| 33 | svn checkout http://svn.zoo-project.org/svn/trunk/zoo-project/zoo-client |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | .. warning:: |
---|
| 37 | You do not necessarily need to :ref:`install <install-installation>` the ZOO-Project server for using ZOO-Client. The corresponding svn `directory <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-client>`__ is needed only. |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | Compiling ZOO-Client templates |
---|
| 41 | --------------------------- |
---|
| 42 | |
---|
| 43 | In order to work with ZOO-Client, you will first need to compile the provided `Mustache <http://mustache.github.io/>`_ |
---|
| 44 | templates using `Node.js <http://nodejs.org/>`__. The ZOO-Client templates are located in the ``/zoo-project/zoo-client/lib/tpl`` directory downloaded from svn. |
---|
| 45 | |
---|
| 46 | * Install Node.js (see related `documentation <https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager>`__.) |
---|
| 47 | * Install Hogan, the JavaScript templating engine, using the following command: |
---|
| 48 | |
---|
| 49 | :: |
---|
| 50 | |
---|
| 51 | sudo npm install hogan |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | * Use Hulk (Hogan's command line utility) for compiling the tempaltes |
---|
| 55 | using the following command: |
---|
| 56 | |
---|
| 57 | :: |
---|
| 58 | |
---|
| 59 | hulk zoo-client/lib/tpl/*mustache > \ zoo-client/lib/js/wps-client/payloads.js |
---|
| 60 | |
---|
| 61 | .. warning:: Using different versions of Hogan to compile and to use in a web application may lead to compatibility issue. |
---|
| 62 | |
---|
| 63 | Everything is now ready to work with :ref:`ZOO-Client <client-what>`. Read the :ref:`next section <client-example>` for an example JavaScript application. |
---|
| 64 | |
---|
| 65 | Building ZOO-Client documentation |
---|
| 66 | -------------------------- |
---|
| 67 | |
---|
| 68 | You may also build the ZOO-Client API documentation using `jsDoc |
---|
| 69 | <http://usejsdoc.org/jsDoc>`__, with the following command: |
---|
| 70 | |
---|
| 71 | :: |
---|
| 72 | |
---|
| 73 | npm install jsdoc |
---|
| 74 | ~/node_modules/.bin/jsdoc zoo-client/lib/js/wps-client/* -p |
---|
| 75 | |
---|
| 76 | This will build HTML documentation in a new directory named ``/out`` in |
---|
| 77 | your working directory. |
---|
| 78 | |
---|