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 |
---|
44 | provided `Mustache <http://mustache.github.io/>`_ templates using |
---|
45 | `Node.js <http://nodejs.org/>`__. The ZOO-Client templates are located |
---|
46 | in the ``/zoo-project/zoo-client/lib/tpl`` directory downloaded from |
---|
47 | svn. |
---|
48 | |
---|
49 | * Install Node.js (see related `documentation <https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager>`__.) |
---|
50 | * Install Hogan, the JavaScript templating engine, using the following command: |
---|
51 | |
---|
52 | :: |
---|
53 | |
---|
54 | sudo npm install hogan |
---|
55 | |
---|
56 | |
---|
57 | * Use Hulk (Hogan's command line utility) for compiling the tempaltes |
---|
58 | using the following command: |
---|
59 | |
---|
60 | :: |
---|
61 | |
---|
62 | hulk zoo-client/lib/tpl/*mustache > \ zoo-client/lib/js/wps-client/payloads.js |
---|
63 | |
---|
64 | .. warning:: Using different versions of Hogan to compile and to use in a web application may lead to compatibility issue. |
---|
65 | |
---|
66 | Everything is now ready to work with :ref:`ZOO-Client <client-what>`. Read the :ref:`next section <client-example>` for an example JavaScript application. |
---|
67 | |
---|
68 | Building ZOO-Client documentation |
---|
69 | --------------------------------- |
---|
70 | |
---|
71 | You may also build the ZOO-Client API documentation using `jsDoc |
---|
72 | <http://usejsdoc.org/jsDoc>`__, with the following command: |
---|
73 | |
---|
74 | :: |
---|
75 | |
---|
76 | npm install jsdoc |
---|
77 | ~/node_modules/.bin/jsdoc zoo-client/lib/js/wps-client/* -p |
---|
78 | |
---|
79 | This will build HTML documentation in a new directory named ``/out`` in |
---|
80 | your working directory. |
---|
81 | |
---|