Commit 84e37a56 authored by Marco Mariani's avatar Marco Mariani

minor style and grammar tweaks

parent 1c422fd3
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
### Getting Started ### Getting Started
To set up jIO include jio.js, dependencies and the connectors for the storages To setup you should jIO include jio.js, dependencies and the connectors for the storages
you want to use in your page header (note that more dependencies may be required you want to use in the HTML page header (note that more dependencies may be required
depending on type of storages being used): depending on type of storages being used):
<!-- jio + dependency --> <!-- jio + dependency -->
...@@ -31,7 +31,7 @@ Then create your jIO instance like this: ...@@ -31,7 +31,7 @@ Then create your jIO instance like this:
### Documents and Methods ### Documents and Methods
Documents are JSON strings that contain *meta-data* (properties, like a filename) Documents are JSON strings that contain *metadata* (properties, like a filename)
and *attachments* (optional content, for example *image.jpg*). and *attachments* (optional content, for example *image.jpg*).
jIO exposes the following methods to *create*, *read*, *update* and *delete* documents jIO exposes the following methods to *create*, *read*, *update* and *delete* documents
...@@ -41,7 +41,7 @@ each method, please refer to the documentation): ...@@ -41,7 +41,7 @@ each method, please refer to the documentation):
// create and store new document // create and store new document
jio_instance.post({"title": "some title"}). jio_instance.post({"title": "some title"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
// { // {
// "result": "success", // "result": "success",
// "id": "404aef5e-22cc-4a64-a292-37776c6464a3" // Generated id // "id": "404aef5e-22cc-4a64-a292-37776c6464a3" // Generated id
...@@ -52,7 +52,7 @@ each method, please refer to the documentation): ...@@ -52,7 +52,7 @@ each method, please refer to the documentation):
// create or update an existing document // create or update an existing document
jio_instance.put({"_id": "my_document", "title": "New Title"}). jio_instance.put({"_id": "my_document", "title": "New Title"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
// { // {
// "result": "success", // "result": "success",
// "id": "my_document", // "id": "my_document",
...@@ -64,7 +64,7 @@ each method, please refer to the documentation): ...@@ -64,7 +64,7 @@ each method, please refer to the documentation):
jio_instance.putAttachment({"_id": "my_document", "_attachment": "its_attachment", jio_instance.putAttachment({"_id": "my_document", "_attachment": "its_attachment",
"_data": "abc", "_mimetype": "text/plain"}). "_data": "abc", "_mimetype": "text/plain"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
// { // {
// "result": "success", // "result": "success",
// "id": "my_document", // "id": "my_document",
...@@ -106,7 +106,7 @@ each method, please refer to the documentation): ...@@ -106,7 +106,7 @@ each method, please refer to the documentation):
// delete a document and its attachment(s) // delete a document and its attachment(s)
jio_instance.remove({"_id": "my_document"}). jio_instance.remove({"_id": "my_document"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
// { // {
// "result": "success", // "result": "success",
// "id": "my_document" // "id": "my_document"
...@@ -116,7 +116,7 @@ each method, please refer to the documentation): ...@@ -116,7 +116,7 @@ each method, please refer to the documentation):
// delete an attachement // delete an attachement
jio_instance.removeAttachment({"_id": "my_document", "_attachment": "its_attachment"}). jio_instance.removeAttachment({"_id": "my_document", "_attachment": "its_attachment"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
// { // {
// "result": "success", // "result": "success",
// "id": "my_document", // "id": "my_document",
...@@ -126,7 +126,7 @@ each method, please refer to the documentation): ...@@ -126,7 +126,7 @@ each method, please refer to the documentation):
// get all documents // get all documents
jio_instance.allDocs().then(function (response) { jio_instance.allDocs().then(function (response) {
// console.log(response): // console.log(response);
// { // {
// "data": { // "data": {
// "total_rows": 1, // "total_rows": 1,
...@@ -301,7 +301,7 @@ create your own connector, please also refer to the [documentation](https://www. ...@@ -301,7 +301,7 @@ create your own connector, please also refer to the [documentation](https://www.
jIO uses complex-queries manager, which can be run on top of the allDocs() jIO uses complex-queries manager, which can be run on top of the allDocs()
method to query documents in the storage tree. A sample query would look like method to query documents in the storage tree. A sample query would look like
this (note, that allDocs and complex queries cannot be run on every storage and this (note that not all storages support allDocs and complex queries, and
that pre-querying of documents on distant storages should best be done that pre-querying of documents on distant storages should best be done
server-side): server-side):
...@@ -315,7 +315,7 @@ server-side): ...@@ -315,7 +315,7 @@ server-side):
// fields to return in response // fields to return in response
"select_list": [<string A>, <string B>] "select_list": [<string A>, <string B>]
}).then(function (response) { }).then(function (response) {
// console.log(response): // console.log(response);
// { // {
// "total_rows": 1, // "total_rows": 1,
// "rows": [{ // "rows": [{
...@@ -328,22 +328,22 @@ server-side): ...@@ -328,22 +328,22 @@ server-side):
// } // }
}); });
To find out more about complex queries, please refer to the documentation To find out more about complex queries, please refer to the documentation.
### Task Management ### Task Management
jIO is running a task queue manager in the background which processes incoming jIO is running a task queue manager in the background which processes incoming
tasks according to set of defined rules. To find out more and including how to tasks according to a set of defined rules. To find out more including how to
define your own execution rules, please refer to the documentation. define your own execution rules, please refer to the documentation.
### Conflict Management ### Conflict Management
As jIO allows to manage and share documents across multiple storage locactions As jIO allows to manage and share documents across multiple storage locactions,
it is likely for conflicts to occur (= multiple versions of a single document conflicts may happen (i.e. multiple versions of a single document
existing in the storage tree). jIO manages conflicts by ensuring that every existing in the storage tree). jIO manages conflicts by ensuring that every
version of a document is available on every storage and that conflicts are version of a document is available on every storage and that conflicts are
accessible (and solvable) using the *conflicts: true* option when using the accessible (and solvable) using the *conflicts: true* option when using the
respective jIO methods. For more info on conflicts and available options, please related jIO methods. For more info on conflicts and available options, please
refer to the documentation. refer to the documentation.
### Crash-Proof ### Crash-Proof
......
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: c600a8b2cb226583bf95768a6560ff9e config: b5eff715ffe3e787813e3b29d0dd7b1f
tags: fbb0d17656682115ca4d033fb2f83ba1 tags: fbb0d17656682115ca4d033fb2f83ba1
.. role:: js(code) .. role:: js(code)
:language: javascript :language: javascript
.. _list-of-available-storages: .. _list-of-available-storages:
List of Available Storages List of Available Storages
========================== ==========================
JIO saves his job queue in a workspace which is localStorage by default. jIO saves his job queue in a workspace which is localStorage by default.
Provided storage descriptions are also stored, and it can be dangerous to Provided storage descriptions are also stored, and it can be dangerous to
store passwords. store passwords.
The best way to create a storage description is to use the (often) provided The best way to create a storage description is to use the (often) provided
tool given by the storage library. The returned description is secured to avoid tool given by the storage library. The returned description is secured to avoid
clear readable password. (encrypted password for instance) cleartext, readable passwords (as opposed to encrypted passwords for instance).
When building storage trees, there is no limit on the number of storages you When building storage trees, there is no limit on the number of storages you
can use. The only thing you have to be aware of is compatability of simple and can use. The only thing you have to be aware of is compatibility of simple and
revision based storages. revision based storages.
...@@ -28,12 +26,11 @@ Connectors ...@@ -28,12 +26,11 @@ Connectors
LocalStorage LocalStorage
^^^^^^^^^^^^ ^^^^^^^^^^^^
Three methods are provided: Three methods are provided:
* :js:`createDescription(username, [application_name], [mode="localStorage"])` * :js:`createDescription(username, [application_name], [mode="localStorage"])`
* :js:`createLocalDescription(username, [application_name])` * :js:`createLocalDescription(username, [application_name])`
* :js:`createMemoryDescription(username, [application_name])` * :js:`createMemoryDescription(username, [application_name])`
All parameters are strings. All parameters are strings.
...@@ -51,8 +48,10 @@ Examples: ...@@ -51,8 +48,10 @@ Examples:
DavStorage DavStorage
^^^^^^^^^^ ^^^^^^^^^^
The tool dav_storage.createDescription generates a dav storage description for The method ``dav_storage.createDescription()`` generates a DAV storage description for
*no*, *basic* or *digest* authentication (*digest* is not implemented yet). *none*, *basic* or *digest* authentication.
NB: digest **is not implemented yet**.
.. code-block:: javascript .. code-block:: javascript
...@@ -60,16 +59,19 @@ The tool dav_storage.createDescription generates a dav storage description for ...@@ -60,16 +59,19 @@ The tool dav_storage.createDescription generates a dav storage description for
All parameters are strings. All parameters are strings.
.. XXX simplify here ============= ========================
parameter required?
Only ``url`` and ``auth_type`` are required. If ``auth_type`` is equal to "none", ============= ========================
then ``realm``, ``username`` and ``password`` are useless. ``username`` and ``password`` become ``url`` yes
required if ``auth_type`` is equal to "basic". And ``realm`` also becomes required if ``auth_type`` yes
``auth_type`` is equal to "digest". ``realm`` if auth_type == 'digest'
``username`` if auth_type != 'none'
``password`` if auth-type != 'none'
============= ========================
digest **is not implemented yet** If ``auth_type`` is "none", then ``realm``, ``username`` and ``password`` are never used.
**Be careful**: The generated description never contains readable password, but **Be careful**: The generated description never contains a readable password, but
for basic authentication, the password will just be base64 encoded. for basic authentication, the password will just be base64 encoded.
S3Storage S3Storage
...@@ -89,7 +91,7 @@ IndexStorage ...@@ -89,7 +91,7 @@ IndexStorage
^^^^^^^^^^^^ ^^^^^^^^^^^^
This handler indexes documents metadata into a database (which is a simple This handler indexes documents metadata into a database (which is a simple
document) to increase the speed of allDocs requests. However, it is not able to document) to increase the speed of ``allDocs()`` requests. However, it is not able to
manage the ``include_docs`` option. manage the ``include_docs`` option.
The sub storages have to manage ``query`` and ``include_docs`` options. The sub storages have to manage ``query`` and ``include_docs`` options.
...@@ -144,8 +146,8 @@ Revision Based Handlers ...@@ -144,8 +146,8 @@ Revision Based Handlers
A revision based handler is a storage which is able to do some document A revision based handler is a storage which is able to do some document
versioning using simple storages listed above. versioning using simple storages listed above.
On JIO command parameter, ``_id`` is still used to identify a document, but On jIO command parameter, ``_id`` is still used to identify a document, but
another id ``_rev`` must be defined to use a specific revision of this document. another id ``_rev`` must be defined to use a specific revision of that document.
On command responses, you will find another field ``rev`` which will represent the On command responses, you will find another field ``rev`` which will represent the
new revision produced by your action. All the document history is kept unless new revision produced by your action. All the document history is kept unless
......
JIO Complex Queries jIO Complex Queries
=================== ===================
What are Complex Queries? What are Complex Queries?
------------------------- -------------------------
In jIO, a complex query can tell a storage server to select, filter, sort, or In jIO, a complex query can ask a storage server to select, filter, sort, or
limit a document list before sending it back. If the server is not able to do limit a document list before sending it back. If the server is not able to do
so, the complex query tool can act on the retreived list by itself. Only the so, the complex query tool can act on the retreived list by itself. Only the
allDocs method can use complex queries. ``allDocs()`` method can use complex queries.
A query can either be a string (using a specific language useful for writing A query can either be a string (using a specific language useful for writing
queries), or it can be a tree of objects (useful to browse queries). To handle queries), or it can be a tree of objects (useful to browse queries). To handle
...@@ -16,12 +16,12 @@ complex queries, jIO uses a parsed grammar file which is compiled using `JSCC <h ...@@ -16,12 +16,12 @@ complex queries, jIO uses a parsed grammar file which is compiled using `JSCC <h
Why use Complex Queries? Why use Complex Queries?
------------------------ ------------------------
Complex queries can be used similar to database queries. So they are useful to: Complex queries can be used like database queries, for tasks such as:
* search a specific document * search a specific document
* sort a list of documents in a certain order * sort a list of documents in a certain order
* avoid retrieving a list of ten thousand documents * avoid retrieving a list of ten thousand documents
* limit the list to show only xy documents by page * limit the list to show only N documents per page
For some storages (like localStorage), complex queries can be a powerful tool For some storages (like localStorage), complex queries can be a powerful tool
to query accessible documents. When querying documents on a distant storage, to query accessible documents. When querying documents on a distant storage,
...@@ -34,7 +34,9 @@ itself. ...@@ -34,7 +34,9 @@ itself.
How to use Complex Queries with jIO? How to use Complex Queries with jIO?
------------------------------------ ------------------------------------
Complex queries can be triggered by including the option named query in the allDocs method call. An example would be: Complex queries can be triggered by including the option named query in the ``allDocs()`` method call.
Example:
.. code-block:: javascript .. code-block:: javascript
...@@ -74,11 +76,11 @@ Complex queries can be triggered by including the option named query in the allD ...@@ -74,11 +76,11 @@ Complex queries can be triggered by including the option named query in the allD
How to use Complex Queries outside jIO? How to use Complex Queries outside jIO?
--------------------------------------- ---------------------------------------
.. XXX 404 on complex_example.html .. XXX 404 page missing on complex_example.html
Complex Queries provides an API - which namespace is complex_queries. Please Complex Queries provides an API - which namespace is complex_queries.
also refer to the `Complex Queries sample page <http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1>`_ Refer to the `Complex Queries sample page <http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1>`_
on how to use these methods in- and outside jIO. The module provides: for how to use these methods, in and outside jIO. The module provides:
.. code-block:: javascript .. code-block:: javascript
...@@ -168,7 +170,7 @@ Default search types should be defined in the application's user interface ...@@ -168,7 +170,7 @@ Default search types should be defined in the application's user interface
components because criteria like filters will be changed frequently by the components because criteria like filters will be changed frequently by the
component (change ``limit: [0, 10]`` to ``limit: [10, 10]`` or ``sort_on: [['title', component (change ``limit: [0, 10]`` to ``limit: [10, 10]`` or ``sort_on: [['title',
'ascending']]`` to ``sort_on: [['creator', 'ascending']]``) and each component must 'ascending']]`` to ``sort_on: [['creator', 'ascending']]``) and each component must
have their own default properties to keep their own behavior. have its own default properties to keep their own behavior.
Convert Complex Queries into another type Convert Complex Queries into another type
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
...@@ -76,26 +76,26 @@ Create 10 methods: ``post``, ``put``, ``putAttachment``, ``get``, ``getAttachmen ...@@ -76,26 +76,26 @@ Create 10 methods: ``post``, ``put``, ``putAttachment``, ``get``, ``getAttachmen
(To help you design your methods, some tools are provided by jIO.util.) (To help you design your methods, some tools are provided by jIO.util.)
The first parameter command provides some methods to act on the JIO job: The first parameter command provides some methods to act on the jIO job:
* ``success``, to tell JIO that the job is successfully terminated * ``success``, to tell jIO that the job is successfully terminated
``command.success(status[Text], [{custom key to add to the response}]);`` ``command.success(status[Text], [{custom key to add to the response}]);``
* ``resolve``, is equal to success * ``resolve``, is equal to success
* ``error``, to tell JIO that the job cannot be done * ``error``, to tell jIO that the job cannot be done
``command.error(status[Text], [reason], [message], [{custom key to add to the response}])`` ``command.error(status[Text], [reason], [message], [{custom key to add to the response}])``
* ``retry``, to tell JIO that the job cannot be done now, but can be retried later. (same API than error) * ``retry``, to tell jIO that the job cannot be done now, but can be retried later. (same API than error)
* ``reject``, to tell JIO that the job cannot be done, let JIO to decide whether to retry or not. (same API than error) * ``reject``, to tell jIO that the job cannot be done, let jIO to decide whether to retry or not. (same API than error)
The second parameter ``metadata`` or ``param`` is the first parameter provided by the JIO user. The second parameter ``metadata`` or ``param`` is the first parameter provided by the jIO user.
The third parameter ``option`` is the option parameter provided by the JIO user. The third parameter ``option`` is the option parameter provided by the jIO user.
Methods should return the following objects: Methods should return the following objects:
......
...@@ -4,21 +4,26 @@ ...@@ -4,21 +4,26 @@
Downloads Downloads
========= =========
Core: Core
^^^^
* `[sha256.amd.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_ * `sha256.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_
* `[rsvp-custom.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.js>`_, AMD only version [`rsvp-custom.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.amd.js>`_] * `rsvp-custom.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.js>`_, AMD only version: `rsvp-custom.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.amd.js>`_
* jIO, `[jio.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.js>`_ * `jio.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.js>`_
* complex_queries, `[complex_queries.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/complex_queries.js>`_ * `complex_queries.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/complex_queries.js>`_
Storage dependencies: Storage dependencies
^^^^^^^^^^^^^^^^^^^^
* `jQuery <http://jquery.com/>`_, `[jquery.js] <http://code.jquery.com/jquery.js>`_ .. XXX this is a little confusing. Also, the link to sha1.js is broken (404)
* `sjcl <https://crypto.stanford.edu/sjcl/>`_, `[sjcl.zip] <https://crypto.stanford.edu/sjcl/sjcl.zip>`_
* `sha1 <http://pajhome.org.uk/crypt/md5/sha1.html>`_, `[sha1.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/jsSha1/sha1.js>`_, AMD compatible version [`sha1.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha1.amd.js>`_]
* `sha2, sha256 <http://anmar.eu.org/projects/jssha2/>`_, `[jssha2.zip] <http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip>`_, AMD compatible versions `[sha2.amd.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha2.amd.js>`_ `[sha256.amd.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_
Storage connectors: * `jquery.js <http://code.jquery.com/jquery.js>`_
* `sjcl <https://crypto.stanford.edu/sjcl/>`_, [`sjcl.zip <https://crypto.stanford.edu/sjcl/sjcl.zip>`_]
* `sha1 <http://pajhome.org.uk/crypt/md5/sha1.html>`_, [`sha1.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/jsSha1/sha1.js>`_], AMD compatible version: `sha1.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha1.amd.js>`_
* `sha2, sha256 <http://anmar.eu.org/projects/jssha2/>`_, `jssha2.zip <http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip>`_, AMD compatible versions: `sha2.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha2.amd.js>`_, `sha256.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_
Storage connectors
^^^^^^^^^^^^^^^^^^
* `localstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/localstorage.js>`_ * `localstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/localstorage.js>`_
* `davstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/davstorage.js>`_ * `davstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/davstorage.js>`_
...@@ -28,27 +33,29 @@ Storage connectors: ...@@ -28,27 +33,29 @@ Storage connectors:
* restsqlstorage.js (depends on jQuery) (WIP) * restsqlstorage.js (depends on jQuery) (WIP)
* mioga2storage.js (depends on jQuery) (WIP) * mioga2storage.js (depends on jQuery) (WIP)
Storage handlers: Storage handlers
^^^^^^^^^^^^^^^^
* `indexstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/indexstorage.js>`_ (WIP) * `indexstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/indexstorage.js>`_ (WIP)
* `gidstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/gidstorage.js>`_ (WIP) * `gidstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/gidstorage.js>`_ (WIP)
* `splitstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/splitstorage.js>`_ (WIP) * `splitstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/splitstorage.js>`_ (WIP)
* replicatestorage.js (WIP) * replicatestorage.js (WIP)
Revision based storage handlers: Revision based storage handlers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* `revisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/revisionstorage.js>`_ (depends on sha256) (WIP) * `revisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/revisionstorage.js>`_ (depends on sha256) (WIP)
* `replicaterevisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js>`_ (WIP) * `replicaterevisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js>`_ (WIP)
Minified version Minified version
---------------- ^^^^^^^^^^^^^^^^
.. XXX this sounds harsh. Can we provide it or at least be more explicit? .. XXX this sounds harsh. Can we provide it or at least be more explicit?
To get the minified version of the jIO library, you have to build it yourself. See documentation. To get the minified version of the jIO library, you have to build it yourself. See documentation.
Fork Fork
---- ^^^^
jIO source code jIO source code
......
.. _gid-storage: .. _gid-storage:
JIO GIDStorage jIO GIDStorage
============== ==============
A storage to enable interoperability between all kind of storages. A storage to enable interoperability between all kind of storages.
A global ID (GID) is a document id which represents a unique document. This ID A global ID (GID) is a document id which represents a unique document. This ID
will be used to find this unique document on all kind of backends. is then used to find this unique document on all types of backends.
This storage uses sub storage allDocs and complex queries to find unique documents, and converts their ids to gids. This storage uses sub storage allDocs and complex queries to find unique documents, and converts their ids to gids.
...@@ -43,7 +43,7 @@ Example: ...@@ -43,7 +43,7 @@ Example:
} }
This description tells the *GIDStorage* to use 2 metadata (``type``, ``title``) to define a This description tells the *GIDStorage* to use 2 metadata attributes (``type``, ``title``) to define a
document as unique in the default case. If the document is of type ``Text``, then document as unique in the default case. If the document is of type ``Text``, then
the handler will use 3 metadata (``type``, ``title``, ``language``). the handler will use 3 metadata (``type``, ``title``, ``language``).
If these constraints are not respected, then the storage returns an error telling us to If these constraints are not respected, then the storage returns an error telling us to
...@@ -72,6 +72,7 @@ constraints: ...@@ -72,6 +72,7 @@ constraints:
Available metadata types are: Available metadata types are:
* ``"json"`` - The json value of the metadata. * ``"json"`` - The json value of the metadata.
* ``"string"`` - The value as string if it is not a list. * ``"string"`` - The value as string if it is not a list.
* ``"list"`` - The value as list. * ``"list"`` - The value as list.
...@@ -86,9 +87,9 @@ Available metadata types are: ...@@ -86,9 +87,9 @@ Available metadata types are:
Document Requirements Document Requirements
--------------------- ---------------------
A metadata value must be a string. This string can be placed in an object which A metadata value must be a string. This string can be placed in an attribute within
key is 'content'. The object can contains custom keys with string values. A a ``"content"`` key. The object can contains custom keys with string values. A
metadata can contain several values. Example: metadata object can contain several values. Example:
.. code-block:: javascript .. code-block:: javascript
...@@ -109,7 +110,7 @@ metadata can contain several values. Example: ...@@ -109,7 +110,7 @@ metadata can contain several values. Example:
} }
Metadata which name begin with an underscore can contain anything. Metadata attributes which names begin with an underscore can contain anything.
.. code-block:: javascript .. code-block:: javascript
...@@ -121,7 +122,8 @@ Storage Requirements ...@@ -121,7 +122,8 @@ Storage Requirements
-------------------- --------------------
* This storage is not compatible with *RevisionStorage* and *ReplicateRevisionStorage*. * This storage is not compatible with *RevisionStorage* and *ReplicateRevisionStorage*.
* Sub storage have to support complex queries options and ``include_docs`` option. * Sub storages have to support options for ``complex queries`` and ``include_docs``.
Dependencies Dependencies
------------ ------------
...@@ -131,7 +133,7 @@ No dependency. ...@@ -131,7 +133,7 @@ No dependency.
Suggested storage tree Suggested storage tree
---------------------- ----------------------
Replication Between Storage:: Replication between storages::
Replicate Storage Replicate Storage
+-- GID Storage +-- GID Storage
...@@ -143,7 +145,7 @@ Replication Between Storage:: ...@@ -143,7 +145,7 @@ Replication Between Storage::
**CAUTION: All gid storage must have the same description!** **CAUTION: All gid storage must have the same description!**
Offline Application Usage:: Offline application usage::
Replicate Storage Replicate Storage
+-- Index Storage with DB in Local Storage +-- Index Storage with DB in Local Storage
......
.. JIO documentation master file, created by .. jIO documentation master file, created by
sphinx-quickstart on Fri Nov 15 11:55:08 2013. sphinx-quickstart on Fri Nov 15 11:55:08 2013.
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to JIO's documentation! Welcome to jIO's documentation!
=============================== ===============================
Contents: Contents:
...@@ -24,11 +24,5 @@ Contents: ...@@ -24,11 +24,5 @@ Contents:
authors authors
license license
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search` * :ref:`search`
...@@ -8,7 +8,7 @@ Introduction ...@@ -8,7 +8,7 @@ Introduction
What is jIO? What is jIO?
------------ ------------
JIO is a JavaScript library that allows to manage JSON documents on local or jIO is a JavaScript library that allows to manage JSON documents on local or
remote storages in asynchronous fashion. jIO is an abstracted API mapped after remote storages in asynchronous fashion. jIO is an abstracted API mapped after
CouchDB, that offers connectors to multiple storages, special handlers to CouchDB, that offers connectors to multiple storages, special handlers to
enhance functionality (replication, revisions, indexing) and a query module to enhance functionality (replication, revisions, indexing) and a query module to
...@@ -17,17 +17,15 @@ retrieve documents and specific information across storage trees. ...@@ -17,17 +17,15 @@ retrieve documents and specific information across storage trees.
How does it work? How does it work?
----------------- -----------------
.. XXX three parts? jIO is composed of two parts - jIO core and storage library(ies). The core
JIO is separated into three parts - jIO core and storage library(ies). The core
is using storage libraries (connectors) to interact with the associated remote is using storage libraries (connectors) to interact with the associated remote
storage servers. Some queries can be used on top of the jIO allDocs method to storage servers. Some queries can be used on top of the jIO ``allDocs()`` method to
query documents based on defined criteria. query documents based on defined criteria.
JIO uses a job management system, so every method called adds a job into a jIO uses a job management system, so every method call adds a job into a
queue. The queue is copied in the browser's local storage (by default), so it queue. The queue is copied in the browser's local storage (by default), so it
can be restored in case of a browser crash. Jobs are being invoked can be restored in case of browser crash. Jobs are invoked
asynchronously with ongoing jobs not being able to re-trigger to prevent asynchronously and ongoing jobs are not able to re-trigger to prevent
conflicts. conflicts.
Getting started Getting started
...@@ -36,7 +34,7 @@ Getting started ...@@ -36,7 +34,7 @@ Getting started
This walkthrough is designed to get you started using a basic jIO instance. This walkthrough is designed to get you started using a basic jIO instance.
#. Download jIO core, the storages you want to use as well as the #. Download jIO core, the storages you want to use as well as the
complex-queries scripts as well as the dependencies required for the storages complex-queries scripts and the dependencies required for the storages
you intend to use. :ref:`[Download & Fork] <download-fork>` you intend to use. :ref:`[Download & Fork] <download-fork>`
#. Add the scripts to your HTML page in the following order: #. Add the scripts to your HTML page in the following order:
...@@ -56,7 +54,7 @@ This walkthrough is designed to get you started using a basic jIO instance. ...@@ -56,7 +54,7 @@ This walkthrough is designed to get you started using a basic jIO instance.
<script ...> <script ...>
With require js, the main.js will be like this: With `RequireJS <http://requirejs.org/>`_, the main.js will look like:
.. code-block:: javascript .. code-block:: javascript
:linenos: :linenos:
...@@ -77,7 +75,7 @@ This walkthrough is designed to get you started using a basic jIO instance. ...@@ -77,7 +75,7 @@ This walkthrough is designed to get you started using a basic jIO instance.
}); });
#. jIO connects to a number of storages and allows to add handlers (or #. jIO connects to a number of storages and allows adding handlers (or
functions) to specifc storages. functions) to specifc storages.
You can use both handlers and available storages to build a storage You can use both handlers and available storages to build a storage
tree across which all documents will be maintained and managed by jIO. tree across which all documents will be maintained and managed by jIO.
...@@ -89,23 +87,21 @@ This walkthrough is designed to get you started using a basic jIO instance. ...@@ -89,23 +87,21 @@ This walkthrough is designed to get you started using a basic jIO instance.
// create your jio instance // create your jio instance
var my_jio = jIO.createJIO(storage_description); var my_jio = jIO.createJIO(storage_description);
.. XXX 6 methods or 10? #. The jIO API provides ten main methods to manage documents across the storage(s) specified in your jIO storage tree.
#. The jIO API provides six main methods to manage documents across the storage(s) specified in your jIO storage tree. ====================== ===================================================== ========================================
Method Example call Description
================== ===================================================== ======================================== ====================== ===================================================== ========================================
Method Sample Call Description ``post()`` :js:`my_jio.post(document, [options]);` Creates a new document
================== ===================================================== ======================================== ``put()`` :js:`my_jio.put(document, [options]);` Creates/Updates a document
`post` :js:`my_jio.post(document, [options]);` Creates a new document ``putAttachment()`` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document
`put` :js:`my_jio.put(document, [options]);` Creates/Updates a document ``get()`` :js:`my_jio.get(document, [options]);` Reads a document
`putAttachment` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document ``getAttachment()`` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment
`get` :js:`my_jio.get(document, [options]);` Reads a document ``remove()`` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments
`getAttachment` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment ``removeAttachment()`` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment
`remove` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments ``allDocs()`` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents
`removeAttachment` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment ``check()`` :js:`my_jio.check(document, [options]);` Check the document state
`allDocs` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents ``repair()`` :js:`my_jio.repair(document, [options]);` Repair the document
`check` :js:`my_jio.check(document, [options]);` Check the document state ====================== ===================================================== ========================================
`repair` :js:`my_jio.repair(document, [options]);` Repair the document
================== ===================================================== ========================================
How to manage documents? How to manage documents?
======================== ========================
JIO is mapped after the CouchDB API and extends them to provide unified, scalable jIO is mapped after the CouchDB APIs and extends them to provide unified, scalable
and high performance access via Javascript to a wide variety of different and high performance access via JavaScript to a wide variety of different
storage backends. storage backends.
If you are unfamiliar with `Apache CouchDB <http://couchdb.apache.org/>`_: If you are not familiar with `Apache CouchDB <http://couchdb.apache.org/>`_:
it is a scalable, fault-tolerant, and schema-free document-oriented database. it is a scalable, fault-tolerant, and schema-free document-oriented database.
It is used in large and small organizations for a variety of applications where It is used in large and small organizations for a variety of applications where
traditional SQL databases are not the best solution for the problem at hand. traditional SQL databases are not the best solution for the problem at hand.
...@@ -20,7 +20,7 @@ A document is an association of metadata and attachment(s). The metadata is the ...@@ -20,7 +20,7 @@ A document is an association of metadata and attachment(s). The metadata is the
set of properties of the document and the attachments are the binaries of the content set of properties of the document and the attachments are the binaries of the content
of the document. of the document.
In jIO, metadata is just a dictionnary with keys and values (JSON object), and In jIO, metadata is just a dictionary with keys and values (JSON object), and
attachments are just simple strings. attachments are just simple strings.
.. code-block:: javascript .. code-block:: javascript
...@@ -59,7 +59,7 @@ You can also retrieve document attachment metadata in this object. ...@@ -59,7 +59,7 @@ You can also retrieve document attachment metadata in this object.
Basic Methods Basic Methods
------------- -------------
Below you can find sample calls of the main jIO methods. All examples are using Below you can see examples of the main jIO methods. All examples are using
revisions (as in revision storage or replicate revision storage), so you can revisions (as in revision storage or replicate revision storage), so you can
see how method calls should be made with either of these storages. see how method calls should be made with either of these storages.
...@@ -103,40 +103,40 @@ see how method calls should be made with either of these storages. ...@@ -103,40 +103,40 @@ see how method calls should be made with either of these storages.
// delete a document and its attachment(s) // delete a document and its attachment(s)
jio_instance.remove({"_id": "my_document"}). jio_instance.remove({"_id": "my_document"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
}); });
// delete an attachment // delete an attachment
jio_instance.removeAttachment({"_id": "my_document", "_attachment": "its_attachment"}). jio_instance.removeAttachment({"_id": "my_document", "_attachment": "its_attachment"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
}); });
// get all documents // get all documents
jio_instance.allDocs().then(function (response) { jio_instance.allDocs().then(function (response) {
// console.log(response): // console.log(response);
}); });
Promises Promises
-------- --------
Each JIO methods returns a Promise object, which allows us to get responses into Each jIO method returns a Promise object, which allows us to get responses into
callback parameters and to chain callbacks with other returned values. callback parameters and to chain callbacks with other returned values.
JIO uses a custom version of `RSVP.js <https://github.com/tildeio/rsvp.js>`_, adding canceler and progression features. jIO uses a custom version of `RSVP.js <https://github.com/tildeio/rsvp.js>`_, adding canceler and progression features.
You can read more about promises: You can read more about promises:
* `github RSVP.js <https://github.com/tildeio/rsvp.js#rsvpjs-->`_ * `RSVP.js <https://github.com/tildeio/rsvp.js#rsvpjs-->`_ on GitHub
* `Promises/A+ <http://promisesaplus.com/>`_ * `Promises/A+ <http://promisesaplus.com/>`_
* `CommonJS Promises <http://wiki.commonjs.org/wiki/Promises>`_ * `CommonJS Promises <http://wiki.commonjs.org/wiki/Promises>`_
Method Options and Callback Responses Method Options and Callback Responses
------------------------------------- -------------------------------------
To retrieve JIO responses, you have to provide callbacks like this: To retrieve jIO responses, you have to provide callbacks like this:
.. code-block:: javascript .. code-block:: javascript
...@@ -144,17 +144,17 @@ To retrieve JIO responses, you have to provide callbacks like this: ...@@ -144,17 +144,17 @@ To retrieve JIO responses, you have to provide callbacks like this:
then([responseCallback], [errorCallback], [progressionCallback]); then([responseCallback], [errorCallback], [progressionCallback]);
* On command success, responseCallback will be called with the JIO response as first parameter. * On command success, ``responseCallback`` will be called with the jIO response as first parameter.
* On command error, errorCallback will be called with the JIO error as first parameter. * On command error, ``errorCallback`` will be called with the jIO error as first parameter.
* On command notification, progressionCallback will be called with the storage notification. * On command notification, ``progressionCallback`` will be called with the storage notification.
Here is a list of responses returned by JIO according to methods and options: Here is a list of responses returned by jIO according to methods and options:
================== =============================== ====================================== ================== =========================================== ===============================================
Option Available for Response (Callback first parameter) Option Available for Response (Callback first parameter)
================== =============================== ====================================== ================== =========================================== ===============================================
No options post, put, remove .. code-block:: javascript No options ``post()``, ``put()``, ``remove()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -164,7 +164,7 @@ No options post, put, remove .. code-block:: javascrip ...@@ -164,7 +164,7 @@ No options post, put, remove .. code-block:: javascrip
"status": 204, "status": 204,
"statusText": "No Content" "statusText": "No Content"
} }
No options putAttachment, removeAttachment .. code-block:: javascript No options ``putAttachment()``, ``removeAttachment()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -175,7 +175,7 @@ No options putAttachment, removeAttachment .. code-block:: javascrip ...@@ -175,7 +175,7 @@ No options putAttachment, removeAttachment .. code-block:: javascrip
"status": 204, "status": 204,
"statusText": "No Content" "statusText": "No Content"
} }
No options get .. code-block:: javascript No options ``get()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -187,7 +187,7 @@ No options get .. code-block:: javascrip ...@@ -187,7 +187,7 @@ No options get .. code-block:: javascrip
// Here, the document metadata // Here, the document metadata
} }
} }
No options getAttachment .. code-block:: javascript No options ``getAttachment()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -198,7 +198,7 @@ No options getAttachment .. code-block:: javascrip ...@@ -198,7 +198,7 @@ No options getAttachment .. code-block:: javascrip
"statusText": "Ok", "statusText": "Ok",
"data": Blob // Here, the attachment content "data": Blob // Here, the attachment content
} }
No option allDocs .. code-block:: javascript No option ``allDocs()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -215,7 +215,7 @@ No option allDocs .. code-block:: javascrip ...@@ -215,7 +215,7 @@ No option allDocs .. code-block:: javascrip
}] }]
} }
} }
include_docs: true allDocs .. code-block:: javascript include_docs: true ``allDocs()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -235,12 +235,12 @@ include_docs: true allDocs .. code-block:: javascrip ...@@ -235,12 +235,12 @@ include_docs: true allDocs .. code-block:: javascrip
}] }]
} }
} }
================== =============================== ====================================== ================== =========================================== ===============================================
In case of error, the errorCallback first parameter will look like: In case of error, the ``errorCallback`` first parameter will look like:
.. code-block:: javascript .. code-block:: javascript
......
...@@ -181,7 +181,7 @@ Good Example ...@@ -181,7 +181,7 @@ Good Example
.. code-block:: javascript .. code-block:: javascript
function func () { function func() {
return { return {
"name": "Batman" "name": "Batman"
}; };
...@@ -502,7 +502,7 @@ Additional Readings ...@@ -502,7 +502,7 @@ Additional Readings
Resources, additional reading materials and links: Resources, additional reading materials and links:
* `Javascript Patterns <http://shop.oreilly.com/product/9780596806767.do>`_, main ressource used. * `JavaScript Patterns <http://shop.oreilly.com/product/9780596806767.do>`_, main ressource used.
* `JSLint <http://www.jslint.com/>`_, code quality. * `JSLint <http://www.jslint.com/>`_, code quality.
* `YUIDoc <http://yuilibrary.com/projects/yuidoc>`_, generate documentation from code. * `YUIDoc <http://yuilibrary.com/projects/yuidoc>`_, generate documentation from code.
......
...@@ -7,7 +7,7 @@ Why Conflicts can Occur ...@@ -7,7 +7,7 @@ Why Conflicts can Occur
Using jIO you can store documents in multiple storage locations. With Using jIO you can store documents in multiple storage locations. With
increasing number of users working on a document and some storages not being increasing number of users working on a document and some storages not being
available or responding too slow, conflicts are more likely to occur. JIO available or responding too slow, conflicts are more likely to occur. jIO
defines a conflict as multiple versions of a document existing in a storage defines a conflict as multiple versions of a document existing in a storage
tree and a user trying to save on a version that does not match the latest tree and a user trying to save on a version that does not match the latest
version of the document. version of the document.
...@@ -37,11 +37,11 @@ Simple Conflict Example ...@@ -37,11 +37,11 @@ Simple Conflict Example
You are keeping a namecard file on your PC updating from your smartphone. Your You are keeping a namecard file on your PC updating from your smartphone. Your
smartphone ran out of battery and is offline when you update your namecard on smartphone ran out of battery and is offline when you update your namecard on
your PC with your new email adress. Someone else change this email from your PC your PC with your new email adress. Someone else changes this email from your PC
and once your smartphone is recharged, you go back online and the previous and once your smartphone is recharged, you go back online and the previous
update is executed. update is executed.
#. Setting up the storage tree #. Set up the storage tree
.. code-block:: javascript .. code-block:: javascript
...@@ -64,7 +64,7 @@ update is executed. ...@@ -64,7 +64,7 @@ update is executed.
}); });
#. Create your namecard on your smartphone #. Create the namecard on your smartphone
.. code-block:: javascript .. code-block:: javascript
...@@ -91,10 +91,10 @@ update is executed. ...@@ -91,10 +91,10 @@ update is executed.
// response.rev -> "2-068E73F5B44FEC987B51354DFC772891" // response.rev -> "2-068E73F5B44FEC987B51354DFC772891"
}); });
Your smartphone is offline, so you will now have one version (1-578...) on Your smartphone is offline, so now you will have one version (1-578...) on
your smartphone and another version on webDav (2-068...) on your PC. your smartphone and another version on webDav (2-068...) on your PC.
#. You modify your namecard while being offline #. You modify the namecard while being offline
.. code-block:: javascript .. code-block:: javascript
...@@ -114,7 +114,7 @@ update is executed. ...@@ -114,7 +114,7 @@ update is executed.
}); });
#. Later, your smartphone is online and you retrieve your namecard. #. Later, your smartphone is online and you retrieve the other version of the namecard.
.. code-block:: javascript .. code-block:: javascript
...@@ -157,7 +157,7 @@ update is executed. ...@@ -157,7 +157,7 @@ update is executed.
When deleting the conflicting version of your namecard, jIO removes this When deleting the conflicting version of your namecard, jIO removes this
version from all storages and sets the document tree leaf of this version to version from all storages and sets the document tree leaf of this version to
deleted. All storages now contain just a single version of your namecard deleted. All storages now contain just a single version of the namecard
(2-3753...). Note that, on the document tree, removing a revison will (2-3753...). Note that, on the document tree, removing a revison will
create a new revision with status set to *deleted*. create a new revision with status set to *deleted*.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Authors &mdash; JIO 2.0.0 documentation</title> <title>Authors &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<link rel="next" title="Copyright and license" href="license.html" /> <link rel="next" title="Copyright and license" href="license.html" />
<link rel="prev" title="JavaScript Naming Conventions" href="naming_conventions.html" /> <link rel="prev" title="JavaScript Naming Conventions" href="naming_conventions.html" />
</head> </head>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<li class="right" > <li class="right" >
<a href="naming_conventions.html" title="JavaScript Naming Conventions" <a href="naming_conventions.html" title="JavaScript Naming Conventions"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<li class="right" > <li class="right" >
<a href="naming_conventions.html" title="JavaScript Naming Conventions" <a href="naming_conventions.html" title="JavaScript Naming Conventions"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JIO Complex Queries &mdash; JIO 2.0.0 documentation</title> <title>jIO Complex Queries &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<link rel="next" title="Metadata" href="metadata.html" /> <link rel="next" title="Metadata" href="metadata.html" />
<link rel="prev" title="JIO GIDStorage" href="gid_storage.html" /> <link rel="prev" title="jIO GIDStorage" href="gid_storage.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
<a href="metadata.html" title="Metadata" <a href="metadata.html" title="Metadata"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li class="right" > <li class="right" >
<a href="gid_storage.html" title="JIO GIDStorage" <a href="gid_storage.html" title="jIO GIDStorage"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -52,25 +52,25 @@ ...@@ -52,25 +52,25 @@
<div class="body"> <div class="body">
<div class="section" id="jio-complex-queries"> <div class="section" id="jio-complex-queries">
<h1>JIO Complex Queries<a class="headerlink" href="#jio-complex-queries" title="Permalink to this headline"></a></h1> <h1>jIO Complex Queries<a class="headerlink" href="#jio-complex-queries" title="Permalink to this headline"></a></h1>
<div class="section" id="what-are-complex-queries"> <div class="section" id="what-are-complex-queries">
<h2>What are Complex Queries?<a class="headerlink" href="#what-are-complex-queries" title="Permalink to this headline"></a></h2> <h2>What are Complex Queries?<a class="headerlink" href="#what-are-complex-queries" title="Permalink to this headline"></a></h2>
<p>In jIO, a complex query can tell a storage server to select, filter, sort, or <p>In jIO, a complex query can ask a storage server to select, filter, sort, or
limit a document list before sending it back. If the server is not able to do limit a document list before sending it back. If the server is not able to do
so, the complex query tool can act on the retreived list by itself. Only the so, the complex query tool can act on the retreived list by itself. Only the
allDocs method can use complex queries.</p> <tt class="docutils literal"><span class="pre">allDocs()</span></tt> method can use complex queries.</p>
<p>A query can either be a string (using a specific language useful for writing <p>A query can either be a string (using a specific language useful for writing
queries), or it can be a tree of objects (useful to browse queries). To handle queries), or it can be a tree of objects (useful to browse queries). To handle
complex queries, jIO uses a parsed grammar file which is compiled using <a class="reference external" href="http://jscc.phorward-software.com/">JSCC</a>.</p> complex queries, jIO uses a parsed grammar file which is compiled using <a class="reference external" href="http://jscc.phorward-software.com/">JSCC</a>.</p>
</div> </div>
<div class="section" id="why-use-complex-queries"> <div class="section" id="why-use-complex-queries">
<h2>Why use Complex Queries?<a class="headerlink" href="#why-use-complex-queries" title="Permalink to this headline"></a></h2> <h2>Why use Complex Queries?<a class="headerlink" href="#why-use-complex-queries" title="Permalink to this headline"></a></h2>
<p>Complex queries can be used similar to database queries. So they are useful to:</p> <p>Complex queries can be used like database queries, for tasks such as:</p>
<ul class="simple"> <ul class="simple">
<li>search a specific document</li> <li>search a specific document</li>
<li>sort a list of documents in a certain order</li> <li>sort a list of documents in a certain order</li>
<li>avoid retrieving a list of ten thousand documents</li> <li>avoid retrieving a list of ten thousand documents</li>
<li>limit the list to show only xy documents by page</li> <li>limit the list to show only N documents per page</li>
</ul> </ul>
<p>For some storages (like localStorage), complex queries can be a powerful tool <p>For some storages (like localStorage), complex queries can be a powerful tool
to query accessible documents. When querying documents on a distant storage, to query accessible documents. When querying documents on a distant storage,
...@@ -82,7 +82,8 @@ itself.</p> ...@@ -82,7 +82,8 @@ itself.</p>
</div> </div>
<div class="section" id="how-to-use-complex-queries-with-jio"> <div class="section" id="how-to-use-complex-queries-with-jio">
<h2>How to use Complex Queries with jIO?<a class="headerlink" href="#how-to-use-complex-queries-with-jio" title="Permalink to this headline"></a></h2> <h2>How to use Complex Queries with jIO?<a class="headerlink" href="#how-to-use-complex-queries-with-jio" title="Permalink to this headline"></a></h2>
<p>Complex queries can be triggered by including the option named query in the allDocs method call. An example would be:</p> <p>Complex queries can be triggered by including the option named query in the <tt class="docutils literal"><span class="pre">allDocs()</span></tt> method call.</p>
<p>Example:</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="p">{};</span> <div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="p">{};</span>
<span class="c1">// search text query</span> <span class="c1">// search text query</span>
...@@ -119,9 +120,9 @@ itself.</p> ...@@ -119,9 +120,9 @@ itself.</p>
</div> </div>
<div class="section" id="how-to-use-complex-queries-outside-jio"> <div class="section" id="how-to-use-complex-queries-outside-jio">
<h2>How to use Complex Queries outside jIO?<a class="headerlink" href="#how-to-use-complex-queries-outside-jio" title="Permalink to this headline"></a></h2> <h2>How to use Complex Queries outside jIO?<a class="headerlink" href="#how-to-use-complex-queries-outside-jio" title="Permalink to this headline"></a></h2>
<p>Complex Queries provides an API - which namespace is complex_queries. Please <p>Complex Queries provides an API - which namespace is complex_queries.
also refer to the <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1">Complex Queries sample page</a> Refer to the <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1">Complex Queries sample page</a>
on how to use these methods in- and outside jIO. The module provides:</p> for how to use these methods, in and outside jIO. The module provides:</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span> <div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
<span class="nx">parseStringToObject</span><span class="o">:</span> <span class="p">[</span><span class="nb">Function</span><span class="o">:</span> <span class="nx">parseStringToObject</span><span class="p">],</span> <span class="nx">parseStringToObject</span><span class="o">:</span> <span class="p">[</span><span class="nb">Function</span><span class="o">:</span> <span class="nx">parseStringToObject</span><span class="p">],</span>
<span class="nx">stringEscapeRegexpCharacters</span><span class="o">:</span> <span class="p">[</span><span class="nb">Function</span><span class="o">:</span> <span class="nx">stringEscapeRegexpCharacters</span><span class="p">],</span> <span class="nx">stringEscapeRegexpCharacters</span><span class="o">:</span> <span class="p">[</span><span class="nb">Function</span><span class="o">:</span> <span class="nx">stringEscapeRegexpCharacters</span><span class="p">],</span>
...@@ -197,7 +198,7 @@ want to use a wildcard, just set the wildcard character to an empty string.</p> ...@@ -197,7 +198,7 @@ want to use a wildcard, just set the wildcard character to an empty string.</p>
components because criteria like filters will be changed frequently by the components because criteria like filters will be changed frequently by the
component (change <tt class="docutils literal"><span class="pre">limit:</span> <span class="pre">[0,</span> <span class="pre">10]</span></tt> to <tt class="docutils literal"><span class="pre">limit:</span> <span class="pre">[10,</span> <span class="pre">10]</span></tt> or <tt class="docutils literal"><span class="pre">sort_on:</span> <span class="pre">[['title',</span> component (change <tt class="docutils literal"><span class="pre">limit:</span> <span class="pre">[0,</span> <span class="pre">10]</span></tt> to <tt class="docutils literal"><span class="pre">limit:</span> <span class="pre">[10,</span> <span class="pre">10]</span></tt> or <tt class="docutils literal"><span class="pre">sort_on:</span> <span class="pre">[['title',</span>
<span class="pre">'ascending']]</span></tt> to <tt class="docutils literal"><span class="pre">sort_on:</span> <span class="pre">[['creator',</span> <span class="pre">'ascending']]</span></tt>) and each component must <span class="pre">'ascending']]</span></tt> to <tt class="docutils literal"><span class="pre">sort_on:</span> <span class="pre">[['creator',</span> <span class="pre">'ascending']]</span></tt>) and each component must
have their own default properties to keep their own behavior.</p> have its own default properties to keep their own behavior.</p>
</div> </div>
<div class="section" id="convert-complex-queries-into-another-type"> <div class="section" id="convert-complex-queries-into-another-type">
<h3>Convert Complex Queries into another type<a class="headerlink" href="#convert-complex-queries-into-another-type" title="Permalink to this headline"></a></h3> <h3>Convert Complex Queries into another type<a class="headerlink" href="#convert-complex-queries-into-another-type" title="Permalink to this headline"></a></h3>
...@@ -367,7 +368,7 @@ ignore: " "</pre> ...@@ -367,7 +368,7 @@ ignore: " "</pre>
</a></p> </a></p>
<h3><a href="index.html">Table Of Contents</a></h3> <h3><a href="index.html">Table Of Contents</a></h3>
<ul> <ul>
<li><a class="reference internal" href="#">JIO Complex Queries</a><ul> <li><a class="reference internal" href="#">jIO Complex Queries</a><ul>
<li><a class="reference internal" href="#what-are-complex-queries">What are Complex Queries?</a></li> <li><a class="reference internal" href="#what-are-complex-queries">What are Complex Queries?</a></li>
<li><a class="reference internal" href="#why-use-complex-queries">Why use Complex Queries?</a></li> <li><a class="reference internal" href="#why-use-complex-queries">Why use Complex Queries?</a></li>
<li><a class="reference internal" href="#how-to-use-complex-queries-with-jio">How to use Complex Queries with jIO?</a></li> <li><a class="reference internal" href="#how-to-use-complex-queries-with-jio">How to use Complex Queries with jIO?</a></li>
...@@ -385,7 +386,7 @@ ignore: " "</pre> ...@@ -385,7 +386,7 @@ ignore: " "</pre>
<h4>Previous topic</h4> <h4>Previous topic</h4>
<p class="topless"><a href="gid_storage.html" <p class="topless"><a href="gid_storage.html"
title="previous chapter">JIO GIDStorage</a></p> title="previous chapter">jIO GIDStorage</a></p>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="metadata.html" <p class="topless"><a href="metadata.html"
title="next chapter">Metadata</a></p> title="next chapter">Metadata</a></p>
...@@ -421,9 +422,9 @@ ignore: " "</pre> ...@@ -421,9 +422,9 @@ ignore: " "</pre>
<a href="metadata.html" title="Metadata" <a href="metadata.html" title="Metadata"
>next</a> |</li> >next</a> |</li>
<li class="right" > <li class="right" >
<a href="gid_storage.html" title="JIO GIDStorage" <a href="gid_storage.html" title="jIO GIDStorage"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>For developers &mdash; JIO 2.0.0 documentation</title> <title>For developers &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<link rel="next" title="JavaScript Naming Conventions" href="naming_conventions.html" /> <link rel="next" title="JavaScript Naming Conventions" href="naming_conventions.html" />
<link rel="prev" title="Metadata" href="metadata.html" /> <link rel="prev" title="Metadata" href="metadata.html" />
</head> </head>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<li class="right" > <li class="right" >
<a href="metadata.html" title="Metadata" <a href="metadata.html" title="Metadata"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -115,23 +115,23 @@ plus the storages and dependencies you need and you will be good to go.</p> ...@@ -115,23 +115,23 @@ plus the storages and dependencies you need and you will be good to go.</p>
</pre></div> </pre></div>
</div> </div>
<p>(To help you design your methods, some tools are provided by jIO.util.)</p> <p>(To help you design your methods, some tools are provided by jIO.util.)</p>
<p>The first parameter command provides some methods to act on the JIO job:</p> <p>The first parameter command provides some methods to act on the jIO job:</p>
<ul> <ul>
<li><p class="first"><tt class="docutils literal"><span class="pre">success</span></tt>, to tell JIO that the job is successfully terminated</p> <li><p class="first"><tt class="docutils literal"><span class="pre">success</span></tt>, to tell jIO that the job is successfully terminated</p>
<p><tt class="docutils literal"><span class="pre">command.success(status[Text],</span> <span class="pre">[{custom</span> <span class="pre">key</span> <span class="pre">to</span> <span class="pre">add</span> <span class="pre">to</span> <span class="pre">the</span> <span class="pre">response}]);</span></tt></p> <p><tt class="docutils literal"><span class="pre">command.success(status[Text],</span> <span class="pre">[{custom</span> <span class="pre">key</span> <span class="pre">to</span> <span class="pre">add</span> <span class="pre">to</span> <span class="pre">the</span> <span class="pre">response}]);</span></tt></p>
</li> </li>
<li><p class="first"><tt class="docutils literal"><span class="pre">resolve</span></tt>, is equal to success</p> <li><p class="first"><tt class="docutils literal"><span class="pre">resolve</span></tt>, is equal to success</p>
</li> </li>
<li><p class="first"><tt class="docutils literal"><span class="pre">error</span></tt>, to tell JIO that the job cannot be done</p> <li><p class="first"><tt class="docutils literal"><span class="pre">error</span></tt>, to tell jIO that the job cannot be done</p>
<p><tt class="docutils literal"><span class="pre">command.error(status[Text],</span> <span class="pre">[reason],</span> <span class="pre">[message],</span> <span class="pre">[{custom</span> <span class="pre">key</span> <span class="pre">to</span> <span class="pre">add</span> <span class="pre">to</span> <span class="pre">the</span> <span class="pre">response}])</span></tt></p> <p><tt class="docutils literal"><span class="pre">command.error(status[Text],</span> <span class="pre">[reason],</span> <span class="pre">[message],</span> <span class="pre">[{custom</span> <span class="pre">key</span> <span class="pre">to</span> <span class="pre">add</span> <span class="pre">to</span> <span class="pre">the</span> <span class="pre">response}])</span></tt></p>
</li> </li>
<li><p class="first"><tt class="docutils literal"><span class="pre">retry</span></tt>, to tell JIO that the job cannot be done now, but can be retried later. (same API than error)</p> <li><p class="first"><tt class="docutils literal"><span class="pre">retry</span></tt>, to tell jIO that the job cannot be done now, but can be retried later. (same API than error)</p>
</li> </li>
<li><p class="first"><tt class="docutils literal"><span class="pre">reject</span></tt>, to tell JIO that the job cannot be done, let JIO to decide whether to retry or not. (same API than error)</p> <li><p class="first"><tt class="docutils literal"><span class="pre">reject</span></tt>, to tell jIO that the job cannot be done, let jIO to decide whether to retry or not. (same API than error)</p>
</li> </li>
</ul> </ul>
<p>The second parameter <tt class="docutils literal"><span class="pre">metadata</span></tt> or <tt class="docutils literal"><span class="pre">param</span></tt> is the first parameter provided by the JIO user.</p> <p>The second parameter <tt class="docutils literal"><span class="pre">metadata</span></tt> or <tt class="docutils literal"><span class="pre">param</span></tt> is the first parameter provided by the jIO user.</p>
<p>The third parameter <tt class="docutils literal"><span class="pre">option</span></tt> is the option parameter provided by the JIO user.</p> <p>The third parameter <tt class="docutils literal"><span class="pre">option</span></tt> is the option parameter provided by the jIO user.</p>
<p>Methods should return the following objects:</p> <p>Methods should return the following objects:</p>
<ul> <ul>
<li><p class="first">post &#8211;&gt; success(&#8220;created&#8221;, {&#8220;id&#8221;: new_generated_id})</p> <li><p class="first">post &#8211;&gt; success(&#8220;created&#8221;, {&#8220;id&#8221;: new_generated_id})</p>
...@@ -378,7 +378,7 @@ can also add your own rules, as we&#8217;re going to see now.</p> ...@@ -378,7 +378,7 @@ can also add your own rules, as we&#8217;re going to see now.</p>
<li class="right" > <li class="right" >
<a href="metadata.html" title="Metadata" <a href="metadata.html" title="Metadata"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Downloads &mdash; JIO 2.0.0 documentation</title> <title>Downloads &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<link rel="next" title="How to manage documents?" href="manage_documents.html" /> <link rel="next" title="How to manage documents?" href="manage_documents.html" />
<link rel="prev" title="Introduction" href="introduction.html" /> <link rel="prev" title="Introduction" href="introduction.html" />
</head> </head>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<li class="right" > <li class="right" >
<a href="introduction.html" title="Introduction" <a href="introduction.html" title="Introduction"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -53,21 +53,26 @@ ...@@ -53,21 +53,26 @@
<div class="section" id="downloads"> <div class="section" id="downloads">
<span id="download-fork"></span><h1>Downloads<a class="headerlink" href="#downloads" title="Permalink to this headline"></a></h1> <span id="download-fork"></span><h1>Downloads<a class="headerlink" href="#downloads" title="Permalink to this headline"></a></h1>
<p>Core:</p> <div class="section" id="core">
<h2>Core<a class="headerlink" href="#core" title="Permalink to this headline"></a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js">[sha256.amd.js]</a></li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js">sha256.amd.js</a></li>
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.js">[rsvp-custom.js]</a>, AMD only version [<a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.amd.js">rsvp-custom.amd.js</a>]</li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.js">rsvp-custom.js</a>, AMD only version: <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.amd.js">rsvp-custom.amd.js</a></li>
<li>jIO, <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.js">[jio.js]</a></li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.js">jio.js</a></li>
<li>complex_queries, <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/complex_queries.js">[complex_queries.js]</a></li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/complex_queries.js">complex_queries.js</a></li>
</ul> </ul>
<p>Storage dependencies:</p> </div>
<div class="section" id="storage-dependencies">
<h2>Storage dependencies<a class="headerlink" href="#storage-dependencies" title="Permalink to this headline"></a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference external" href="http://jquery.com/">jQuery</a>, <a class="reference external" href="http://code.jquery.com/jquery.js">[jquery.js]</a></li> <li><a class="reference external" href="http://code.jquery.com/jquery.js">jquery.js</a></li>
<li><a class="reference external" href="https://crypto.stanford.edu/sjcl/">sjcl</a>, <a class="reference external" href="https://crypto.stanford.edu/sjcl/sjcl.zip">[sjcl.zip]</a></li> <li><a class="reference external" href="https://crypto.stanford.edu/sjcl/">sjcl</a>, [<a class="reference external" href="https://crypto.stanford.edu/sjcl/sjcl.zip">sjcl.zip</a>]</li>
<li><a class="reference external" href="http://pajhome.org.uk/crypt/md5/sha1.html">sha1</a>, <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/jsSha1/sha1.js">[sha1.js]</a>, AMD compatible version [<a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha1.amd.js">sha1.amd.js</a>]</li> <li><a class="reference external" href="http://pajhome.org.uk/crypt/md5/sha1.html">sha1</a>, [<a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/jsSha1/sha1.js">sha1.js</a>], AMD compatible version: <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha1.amd.js">sha1.amd.js</a></li>
<li><a class="reference external" href="http://anmar.eu.org/projects/jssha2/">sha2, sha256</a>, <a class="reference external" href="http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip">[jssha2.zip]</a>, AMD compatible versions <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha2.amd.js">[sha2.amd.js]</a> <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js">[sha256.amd.js]</a></li> <li><a class="reference external" href="http://anmar.eu.org/projects/jssha2/">sha2, sha256</a>, <a class="reference external" href="http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip">jssha2.zip</a>, AMD compatible versions: <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha2.amd.js">sha2.amd.js</a>, <a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js">sha256.amd.js</a></li>
</ul> </ul>
<p>Storage connectors:</p> </div>
<div class="section" id="storage-connectors">
<h2>Storage connectors<a class="headerlink" href="#storage-connectors" title="Permalink to this headline"></a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/localstorage.js">localstorage.js</a></li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/localstorage.js">localstorage.js</a></li>
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/davstorage.js">davstorage.js</a></li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/davstorage.js">davstorage.js</a></li>
...@@ -77,18 +82,23 @@ ...@@ -77,18 +82,23 @@
<li>restsqlstorage.js (depends on jQuery) (WIP)</li> <li>restsqlstorage.js (depends on jQuery) (WIP)</li>
<li>mioga2storage.js (depends on jQuery) (WIP)</li> <li>mioga2storage.js (depends on jQuery) (WIP)</li>
</ul> </ul>
<p>Storage handlers:</p> </div>
<div class="section" id="storage-handlers">
<h2>Storage handlers<a class="headerlink" href="#storage-handlers" title="Permalink to this headline"></a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/indexstorage.js">indexstorage.js</a> (WIP)</li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/indexstorage.js">indexstorage.js</a> (WIP)</li>
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/gidstorage.js">gidstorage.js</a> (WIP)</li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/gidstorage.js">gidstorage.js</a> (WIP)</li>
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/splitstorage.js">splitstorage.js</a> (WIP)</li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/splitstorage.js">splitstorage.js</a> (WIP)</li>
<li>replicatestorage.js (WIP)</li> <li>replicatestorage.js (WIP)</li>
</ul> </ul>
<p>Revision based storage handlers:</p> </div>
<div class="section" id="revision-based-storage-handlers">
<h2>Revision based storage handlers<a class="headerlink" href="#revision-based-storage-handlers" title="Permalink to this headline"></a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/revisionstorage.js">revisionstorage.js</a> (depends on sha256) (WIP)</li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/revisionstorage.js">revisionstorage.js</a> (depends on sha256) (WIP)</li>
<li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js">replicaterevisionstorage.js</a> (WIP)</li> <li><a class="reference external" href="http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js">replicaterevisionstorage.js</a> (WIP)</li>
</ul> </ul>
</div>
<div class="section" id="minified-version"> <div class="section" id="minified-version">
<h2>Minified version<a class="headerlink" href="#minified-version" title="Permalink to this headline"></a></h2> <h2>Minified version<a class="headerlink" href="#minified-version" title="Permalink to this headline"></a></h2>
<p>To get the minified version of the jIO library, you have to build it yourself. See documentation.</p> <p>To get the minified version of the jIO library, you have to build it yourself. See documentation.</p>
...@@ -131,6 +141,11 @@ ...@@ -131,6 +141,11 @@
<h3><a href="index.html">Table Of Contents</a></h3> <h3><a href="index.html">Table Of Contents</a></h3>
<ul> <ul>
<li><a class="reference internal" href="#">Downloads</a><ul> <li><a class="reference internal" href="#">Downloads</a><ul>
<li><a class="reference internal" href="#core">Core</a></li>
<li><a class="reference internal" href="#storage-dependencies">Storage dependencies</a></li>
<li><a class="reference internal" href="#storage-connectors">Storage connectors</a></li>
<li><a class="reference internal" href="#storage-handlers">Storage handlers</a></li>
<li><a class="reference internal" href="#revision-based-storage-handlers">Revision based storage handlers</a></li>
<li><a class="reference internal" href="#minified-version">Minified version</a></li> <li><a class="reference internal" href="#minified-version">Minified version</a></li>
<li><a class="reference internal" href="#fork">Fork</a></li> <li><a class="reference internal" href="#fork">Fork</a></li>
</ul> </ul>
...@@ -177,7 +192,7 @@ ...@@ -177,7 +192,7 @@
<li class="right" > <li class="right" >
<a href="introduction.html" title="Introduction" <a href="introduction.html" title="Introduction"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &mdash; JIO 2.0.0 documentation</title> <title>Index &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
</head> </head>
<body> <body>
<div class="related"> <div class="related">
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="#" title="General Index" <a href="#" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="#" title="General Index" <a href="#" title="General Index"
>index</a></li> >index</a></li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to JIO’s documentation! &mdash; JIO 2.0.0 documentation</title> <title>Welcome to jIO’s documentation! &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="#" /> <link rel="top" title="jIO 2.0.0 documentation" href="#" />
<link rel="next" title="Introduction" href="introduction.html" /> <link rel="next" title="Introduction" href="introduction.html" />
</head> </head>
<body> <body>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="introduction.html" title="Introduction" <a href="introduction.html" title="Introduction"
accesskey="N">next</a> |</li> accesskey="N">next</a> |</li>
<li><a href="#">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="#">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<div class="body"> <div class="body">
<div class="section" id="welcome-to-jio-s-documentation"> <div class="section" id="welcome-to-jio-s-documentation">
<h1>Welcome to JIO&#8217;s documentation!<a class="headerlink" href="#welcome-to-jio-s-documentation" title="Permalink to this headline"></a></h1> <h1>Welcome to jIO&#8217;s documentation!<a class="headerlink" href="#welcome-to-jio-s-documentation" title="Permalink to this headline"></a></h1>
<p>Contents:</p> <p>Contents:</p>
<div class="toctree-wrapper compound"> <div class="toctree-wrapper compound">
<ul> <ul>
...@@ -59,6 +59,11 @@ ...@@ -59,6 +59,11 @@
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="download.html">Downloads</a><ul> <li class="toctree-l1"><a class="reference internal" href="download.html">Downloads</a><ul>
<li class="toctree-l2"><a class="reference internal" href="download.html#core">Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="download.html#storage-dependencies">Storage dependencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="download.html#storage-connectors">Storage connectors</a></li>
<li class="toctree-l2"><a class="reference internal" href="download.html#storage-handlers">Storage handlers</a></li>
<li class="toctree-l2"><a class="reference internal" href="download.html#revision-based-storage-handlers">Revision based storage handlers</a></li>
<li class="toctree-l2"><a class="reference internal" href="download.html#minified-version">Minified version</a></li> <li class="toctree-l2"><a class="reference internal" href="download.html#minified-version">Minified version</a></li>
<li class="toctree-l2"><a class="reference internal" href="download.html#fork">Fork</a></li> <li class="toctree-l2"><a class="reference internal" href="download.html#fork">Fork</a></li>
</ul> </ul>
...@@ -83,7 +88,7 @@ ...@@ -83,7 +88,7 @@
<li class="toctree-l2"><a class="reference internal" href="available_storages.html#revision-based-handlers">Revision Based Handlers</a></li> <li class="toctree-l2"><a class="reference internal" href="available_storages.html#revision-based-handlers">Revision Based Handlers</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="gid_storage.html">JIO GIDStorage</a><ul> <li class="toctree-l1"><a class="reference internal" href="gid_storage.html">jIO GIDStorage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="gid_storage.html#where-it-can-be-used">Where it can be used</a></li> <li class="toctree-l2"><a class="reference internal" href="gid_storage.html#where-it-can-be-used">Where it can be used</a></li>
<li class="toctree-l2"><a class="reference internal" href="gid_storage.html#storage-description">Storage Description</a></li> <li class="toctree-l2"><a class="reference internal" href="gid_storage.html#storage-description">Storage Description</a></li>
<li class="toctree-l2"><a class="reference internal" href="gid_storage.html#document-requirements">Document Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="gid_storage.html#document-requirements">Document Requirements</a></li>
...@@ -92,7 +97,7 @@ ...@@ -92,7 +97,7 @@
<li class="toctree-l2"><a class="reference internal" href="gid_storage.html#suggested-storage-tree">Suggested storage tree</a></li> <li class="toctree-l2"><a class="reference internal" href="gid_storage.html#suggested-storage-tree">Suggested storage tree</a></li>
</ul> </ul>
</li> </li>
<li class="toctree-l1"><a class="reference internal" href="complex_queries.html">JIO Complex Queries</a><ul> <li class="toctree-l1"><a class="reference internal" href="complex_queries.html">jIO Complex Queries</a><ul>
<li class="toctree-l2"><a class="reference internal" href="complex_queries.html#what-are-complex-queries">What are Complex Queries?</a></li> <li class="toctree-l2"><a class="reference internal" href="complex_queries.html#what-are-complex-queries">What are Complex Queries?</a></li>
<li class="toctree-l2"><a class="reference internal" href="complex_queries.html#why-use-complex-queries">Why use Complex Queries?</a></li> <li class="toctree-l2"><a class="reference internal" href="complex_queries.html#why-use-complex-queries">Why use Complex Queries?</a></li>
<li class="toctree-l2"><a class="reference internal" href="complex_queries.html#how-to-use-complex-queries-with-jio">How to use Complex Queries with jIO?</a></li> <li class="toctree-l2"><a class="reference internal" href="complex_queries.html#how-to-use-complex-queries-with-jio">How to use Complex Queries with jIO?</a></li>
...@@ -103,7 +108,7 @@ ...@@ -103,7 +108,7 @@
<li class="toctree-l1"><a class="reference internal" href="metadata.html">Metadata</a><ul> <li class="toctree-l1"><a class="reference internal" href="metadata.html">Metadata</a><ul>
<li class="toctree-l2"><a class="reference internal" href="metadata.html#what-is-metadata">What is metadata?</a></li> <li class="toctree-l2"><a class="reference internal" href="metadata.html#what-is-metadata">What is metadata?</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html#why-use-metadata">Why use metadata?</a></li> <li class="toctree-l2"><a class="reference internal" href="metadata.html#why-use-metadata">Why use metadata?</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html#how-to-format-metadata-with-jio">How to format metadata with JIO</a></li> <li class="toctree-l2"><a class="reference internal" href="metadata.html#how-to-format-metadata-with-jio">How to format metadata with jIO</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html#list-of-metadata-to-use">List of metadata to use</a></li> <li class="toctree-l2"><a class="reference internal" href="metadata.html#list-of-metadata-to-use">List of metadata to use</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html#examples">Examples</a></li> <li class="toctree-l2"><a class="reference internal" href="metadata.html#examples">Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html#tools">Tools</a></li> <li class="toctree-l2"><a class="reference internal" href="metadata.html#tools">Tools</a></li>
...@@ -131,12 +136,7 @@ ...@@ -131,12 +136,7 @@
<li class="toctree-l1"><a class="reference internal" href="license.html">Copyright and license</a></li> <li class="toctree-l1"><a class="reference internal" href="license.html">Copyright and license</a></li>
</ul> </ul>
</div> </div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h1>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
<li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li> <li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
</ul> </ul>
</div> </div>
...@@ -150,14 +150,6 @@ ...@@ -150,14 +150,6 @@
<p class="logo"><a href="#"> <p class="logo"><a href="#">
<img class="logo" src="_static/jio-logo.png" alt="Logo"/> <img class="logo" src="_static/jio-logo.png" alt="Logo"/>
</a></p> </a></p>
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome to JIO&#8217;s documentation!</a><ul>
</ul>
</li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
<h4>Next topic</h4> <h4>Next topic</h4>
<p class="topless"><a href="introduction.html" <p class="topless"><a href="introduction.html"
title="next chapter">Introduction</a></p> title="next chapter">Introduction</a></p>
...@@ -192,7 +184,7 @@ ...@@ -192,7 +184,7 @@
<li class="right" > <li class="right" >
<a href="introduction.html" title="Introduction" <a href="introduction.html" title="Introduction"
>next</a> |</li> >next</a> |</li>
<li><a href="#">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="#">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Copyright and license &mdash; JIO 2.0.0 documentation</title> <title>Copyright and license &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<link rel="prev" title="Authors" href="authors.html" /> <link rel="prev" title="Authors" href="authors.html" />
</head> </head>
<body> <body>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<li class="right" > <li class="right" >
<a href="authors.html" title="Authors" <a href="authors.html" title="Authors"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -96,7 +96,7 @@ information on LGPL can be found <a class="reference external" href="http://en.w ...@@ -96,7 +96,7 @@ information on LGPL can be found <a class="reference external" href="http://en.w
<li class="right" > <li class="right" >
<a href="authors.html" title="Authors" <a href="authors.html" title="Authors"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript Naming Conventions &mdash; JIO 2.0.0 documentation</title> <title>JavaScript Naming Conventions &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<link rel="next" title="Authors" href="authors.html" /> <link rel="next" title="Authors" href="authors.html" />
<link rel="prev" title="For developers" href="developers.html" /> <link rel="prev" title="For developers" href="developers.html" />
</head> </head>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<li class="right" > <li class="right" >
<a href="developers.html" title="For developers" <a href="developers.html" title="For developers"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -191,7 +191,7 @@ split on multiple lines.</p> ...@@ -191,7 +191,7 @@ split on multiple lines.</p>
</pre></div> </pre></div>
</div> </div>
<p>Good Example</p> <p>Good Example</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="kd">function</span> <span class="nx">func</span> <span class="p">()</span> <span class="p">{</span> <div class="highlight-javascript"><div class="highlight"><pre><span class="kd">function</span> <span class="nx">func</span><span class="p">()</span> <span class="p">{</span>
<span class="k">return</span> <span class="p">{</span> <span class="k">return</span> <span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;Batman&quot;</span> <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;Batman&quot;</span>
<span class="p">};</span> <span class="p">};</span>
...@@ -451,7 +451,7 @@ itself. Comments should look like this:</p> ...@@ -451,7 +451,7 @@ itself. Comments should look like this:</p>
<h2>Additional Readings<a class="headerlink" href="#additional-readings" title="Permalink to this headline"></a></h2> <h2>Additional Readings<a class="headerlink" href="#additional-readings" title="Permalink to this headline"></a></h2>
<p>Resources, additional reading materials and links:</p> <p>Resources, additional reading materials and links:</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference external" href="http://shop.oreilly.com/product/9780596806767.do">Javascript Patterns</a>, main ressource used.</li> <li><a class="reference external" href="http://shop.oreilly.com/product/9780596806767.do">JavaScript Patterns</a>, main ressource used.</li>
<li><a class="reference external" href="http://www.jslint.com/">JSLint</a>, code quality.</li> <li><a class="reference external" href="http://www.jslint.com/">JSLint</a>, code quality.</li>
<li><a class="reference external" href="http://yuilibrary.com/projects/yuidoc">YUIDoc</a>, generate documentation from code.</li> <li><a class="reference external" href="http://yuilibrary.com/projects/yuidoc">YUIDoc</a>, generate documentation from code.</li>
</ul> </ul>
...@@ -541,7 +541,7 @@ itself. Comments should look like this:</p> ...@@ -541,7 +541,7 @@ itself. Comments should look like this:</p>
<li class="right" > <li class="right" >
<a href="developers.html" title="For developers" <a href="developers.html" title="For developers"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Revision Storages: Conflicts and Resolution &mdash; JIO 2.0.0 documentation</title> <title>Revision Storages: Conflicts and Resolution &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<link rel="next" title="List of Available Storages" href="available_storages.html" /> <link rel="next" title="List of Available Storages" href="available_storages.html" />
<link rel="prev" title="How to manage documents?" href="manage_documents.html" /> <link rel="prev" title="How to manage documents?" href="manage_documents.html" />
</head> </head>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<li class="right" > <li class="right" >
<a href="manage_documents.html" title="How to manage documents?" <a href="manage_documents.html" title="How to manage documents?"
accesskey="P">previous</a> |</li> accesskey="P">previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<h2>Why Conflicts can Occur<a class="headerlink" href="#why-conflicts-can-occur" title="Permalink to this headline"></a></h2> <h2>Why Conflicts can Occur<a class="headerlink" href="#why-conflicts-can-occur" title="Permalink to this headline"></a></h2>
<p>Using jIO you can store documents in multiple storage locations. With <p>Using jIO you can store documents in multiple storage locations. With
increasing number of users working on a document and some storages not being increasing number of users working on a document and some storages not being
available or responding too slow, conflicts are more likely to occur. JIO available or responding too slow, conflicts are more likely to occur. jIO
defines a conflict as multiple versions of a document existing in a storage defines a conflict as multiple versions of a document existing in a storage
tree and a user trying to save on a version that does not match the latest tree and a user trying to save on a version that does not match the latest
version of the document.</p> version of the document.</p>
...@@ -83,11 +83,11 @@ version on all storages.</p> ...@@ -83,11 +83,11 @@ version on all storages.</p>
<h2>Simple Conflict Example<a class="headerlink" href="#simple-conflict-example" title="Permalink to this headline"></a></h2> <h2>Simple Conflict Example<a class="headerlink" href="#simple-conflict-example" title="Permalink to this headline"></a></h2>
<p>You are keeping a namecard file on your PC updating from your smartphone. Your <p>You are keeping a namecard file on your PC updating from your smartphone. Your
smartphone ran out of battery and is offline when you update your namecard on smartphone ran out of battery and is offline when you update your namecard on
your PC with your new email adress. Someone else change this email from your PC your PC with your new email adress. Someone else changes this email from your PC
and once your smartphone is recharged, you go back online and the previous and once your smartphone is recharged, you go back online and the previous
update is executed.</p> update is executed.</p>
<ol class="arabic simple"> <ol class="arabic simple">
<li>Setting up the storage tree</li> <li>Set up the storage tree</li>
</ol> </ol>
<blockquote> <blockquote>
<div><div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">jio_instance</span> <span class="o">=</span> <span class="nx">jIO</span><span class="p">.</span><span class="nx">newJio</span><span class="p">({</span> <div><div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">jio_instance</span> <span class="o">=</span> <span class="nx">jIO</span><span class="p">.</span><span class="nx">newJio</span><span class="p">({</span>
...@@ -111,7 +111,7 @@ update is executed.</p> ...@@ -111,7 +111,7 @@ update is executed.</p>
</div> </div>
</div></blockquote> </div></blockquote>
<ol class="arabic"> <ol class="arabic">
<li><p class="first">Create your namecard on your smartphone</p> <li><p class="first">Create the namecard on your smartphone</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">jio_instance</span><span class="p">.</span><span class="nx">post</span><span class="p">({</span> <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">jio_instance</span><span class="p">.</span><span class="nx">post</span><span class="p">({</span>
<span class="s2">&quot;_id&quot;</span><span class="o">:</span> <span class="s2">&quot;myNameCard&quot;</span><span class="p">,</span> <span class="s2">&quot;_id&quot;</span><span class="o">:</span> <span class="s2">&quot;myNameCard&quot;</span><span class="p">,</span>
<span class="s2">&quot;email&quot;</span><span class="o">:</span> <span class="s2">&quot;me@web.com&quot;</span> <span class="s2">&quot;email&quot;</span><span class="o">:</span> <span class="s2">&quot;me@web.com&quot;</span>
...@@ -134,10 +134,10 @@ update is executed.</p> ...@@ -134,10 +134,10 @@ update is executed.</p>
<span class="p">});</span> <span class="p">});</span>
</pre></div> </pre></div>
</div> </div>
<p>Your smartphone is offline, so you will now have one version (1-578...) on <p>Your smartphone is offline, so now you will have one version (1-578...) on
your smartphone and another version on webDav (2-068...) on your PC.</p> your smartphone and another version on webDav (2-068...) on your PC.</p>
</li> </li>
<li><p class="first">You modify your namecard while being offline</p> <li><p class="first">You modify the namecard while being offline</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">jio_instance</span><span class="p">.</span><span class="nx">get</span><span class="p">({</span><span class="s2">&quot;_id&quot;</span><span class="o">:</span> <span class="s2">&quot;myNameCard&quot;</span><span class="p">}).</span><span class="nx">then</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">response</span><span class="p">)</span> <span class="p">{</span> <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">jio_instance</span><span class="p">.</span><span class="nx">get</span><span class="p">({</span><span class="s2">&quot;_id&quot;</span><span class="o">:</span> <span class="s2">&quot;myNameCard&quot;</span><span class="p">}).</span><span class="nx">then</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">response</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// response.id -&gt; &quot;myNameCard&quot;</span> <span class="c1">// response.id -&gt; &quot;myNameCard&quot;</span>
<span class="c1">// response.rev -&gt; &quot;1-5782E71F1E4BF698FA3793D9D5A96393&quot;</span> <span class="c1">// response.rev -&gt; &quot;1-5782E71F1E4BF698FA3793D9D5A96393&quot;</span>
...@@ -155,7 +155,7 @@ your smartphone and another version on webDav (2-068...) on your PC.</p> ...@@ -155,7 +155,7 @@ your smartphone and another version on webDav (2-068...) on your PC.</p>
</pre></div> </pre></div>
</div> </div>
</li> </li>
<li><p class="first">Later, your smartphone is online and you retrieve your namecard.</p> <li><p class="first">Later, your smartphone is online and you retrieve the other version of the namecard.</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">jio_instance</span><span class="p">.</span><span class="nx">get</span><span class="p">({</span><span class="s2">&quot;_id&quot;</span><span class="o">:</span> <span class="s2">&quot;myNameCard&quot;</span><span class="p">}).</span><span class="nx">then</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">response</span><span class="p">)</span> <span class="p">{</span> <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">jio_instance</span><span class="p">.</span><span class="nx">get</span><span class="p">({</span><span class="s2">&quot;_id&quot;</span><span class="o">:</span> <span class="s2">&quot;myNameCard&quot;</span><span class="p">}).</span><span class="nx">then</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">response</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// response.id -&gt; &quot;myNameCard&quot;</span> <span class="c1">// response.id -&gt; &quot;myNameCard&quot;</span>
<span class="c1">// response.rev -&gt; &quot;2-3753476B70A49EA4D8C9039E7B04254C&quot;</span> <span class="c1">// response.rev -&gt; &quot;2-3753476B70A49EA4D8C9039E7B04254C&quot;</span>
...@@ -192,7 +192,7 @@ specified in the GET call. Deleting either version will solve the conflict.</p> ...@@ -192,7 +192,7 @@ specified in the GET call. Deleting either version will solve the conflict.</p>
</div> </div>
<p>When deleting the conflicting version of your namecard, jIO removes this <p>When deleting the conflicting version of your namecard, jIO removes this
version from all storages and sets the document tree leaf of this version to version from all storages and sets the document tree leaf of this version to
deleted. All storages now contain just a single version of your namecard deleted. All storages now contain just a single version of the namecard
(2-3753...). Note that, on the document tree, removing a revison will (2-3753...). Note that, on the document tree, removing a revison will
create a new revision with status set to <em>deleted</em>.</p> create a new revision with status set to <em>deleted</em>.</p>
</li> </li>
...@@ -259,7 +259,7 @@ create a new revision with status set to <em>deleted</em>.</p> ...@@ -259,7 +259,7 @@ create a new revision with status set to <em>deleted</em>.</p>
<li class="right" > <li class="right" >
<a href="manage_documents.html" title="How to manage documents?" <a href="manage_documents.html" title="How to manage documents?"
>previous</a> |</li> >previous</a> |</li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; JIO 2.0.0 documentation</title> <title>Search &mdash; jIO 2.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script> <script type="text/javascript" src="_static/searchtools.js"></script>
<link rel="top" title="JIO 2.0.0 documentation" href="index.html" /> <link rel="top" title="jIO 2.0.0 documentation" href="index.html" />
<script type="text/javascript"> <script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); }); jQuery(function() { Search.loadIndex("searchindex.js"); });
</script> </script>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
accesskey="I">index</a></li> accesskey="I">index</a></li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<li class="right" style="margin-right: 10px"> <li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index" <a href="genindex.html" title="General Index"
>index</a></li> >index</a></li>
<li><a href="index.html">JIO 2.0.0 documentation</a> &raquo;</li> <li><a href="index.html">jIO 2.0.0 documentation</a> &raquo;</li>
</ul> </ul>
</div> </div>
<div class="footer"> <div class="footer">
......
This diff is collapsed.
.. role:: js(code) .. role:: js(code)
:language: javascript :language: javascript
.. _list-of-available-storages: .. _list-of-available-storages:
List of Available Storages List of Available Storages
...@@ -15,10 +13,10 @@ store passwords. ...@@ -15,10 +13,10 @@ store passwords.
The best way to create a storage description is to use the (often) provided The best way to create a storage description is to use the (often) provided
tool given by the storage library. The returned description is secured to avoid tool given by the storage library. The returned description is secured to avoid
clear readable password. (encrypted password for instance) cleartext, readable passwords (as opposed to encrypted passwords for instance).
When building storage trees, there is no limit on the number of storages you When building storage trees, there is no limit on the number of storages you
can use. The only thing you have to be aware of is compatability of simple and can use. The only thing you have to be aware of is compatibility of simple and
revision based storages. revision based storages.
...@@ -28,12 +26,11 @@ Connectors ...@@ -28,12 +26,11 @@ Connectors
LocalStorage LocalStorage
^^^^^^^^^^^^ ^^^^^^^^^^^^
Three methods are provided: Three methods are provided:
* :js:`createDescription(username, [application_name], [mode="localStorage"])` * :js:`createDescription(username, [application_name], [mode="localStorage"])`
* :js:`createLocalDescription(username, [application_name])` * :js:`createLocalDescription(username, [application_name])`
* :js:`createMemoryDescription(username, [application_name])` * :js:`createMemoryDescription(username, [application_name])`
All parameters are strings. All parameters are strings.
...@@ -51,8 +48,10 @@ Examples: ...@@ -51,8 +48,10 @@ Examples:
DavStorage DavStorage
^^^^^^^^^^ ^^^^^^^^^^
The tool dav_storage.createDescription generates a dav storage description for The method ``dav_storage.createDescription()`` generates a DAV storage description for
*no*, *basic* or *digest* authentication (*digest* is not implemented yet). *none*, *basic* or *digest* authentication.
NB: digest **is not implemented yet**.
.. code-block:: javascript .. code-block:: javascript
...@@ -60,16 +59,19 @@ The tool dav_storage.createDescription generates a dav storage description for ...@@ -60,16 +59,19 @@ The tool dav_storage.createDescription generates a dav storage description for
All parameters are strings. All parameters are strings.
.. XXX simplify here ============= ========================
parameter required?
Only ``url`` and ``auth_type`` are required. If ``auth_type`` is equal to "none", ============= ========================
then ``realm``, ``username`` and ``password`` are useless. ``username`` and ``password`` become ``url`` yes
required if ``auth_type`` is equal to "basic". And ``realm`` also becomes required if ``auth_type`` yes
``auth_type`` is equal to "digest". ``realm`` if auth_type == 'digest'
``username`` if auth_type != 'none'
``password`` if auth-type != 'none'
============= ========================
digest **is not implemented yet** If ``auth_type`` is "none", then ``realm``, ``username`` and ``password`` are never used.
**Be careful**: The generated description never contains readable password, but **Be careful**: The generated description never contains a readable password, but
for basic authentication, the password will just be base64 encoded. for basic authentication, the password will just be base64 encoded.
S3Storage S3Storage
...@@ -89,7 +91,7 @@ IndexStorage ...@@ -89,7 +91,7 @@ IndexStorage
^^^^^^^^^^^^ ^^^^^^^^^^^^
This handler indexes documents metadata into a database (which is a simple This handler indexes documents metadata into a database (which is a simple
document) to increase the speed of allDocs requests. However, it is not able to document) to increase the speed of ``allDocs()`` requests. However, it is not able to
manage the ``include_docs`` option. manage the ``include_docs`` option.
The sub storages have to manage ``query`` and ``include_docs`` options. The sub storages have to manage ``query`` and ``include_docs`` options.
...@@ -145,7 +147,7 @@ A revision based handler is a storage which is able to do some document ...@@ -145,7 +147,7 @@ A revision based handler is a storage which is able to do some document
versioning using simple storages listed above. versioning using simple storages listed above.
On jIO command parameter, ``_id`` is still used to identify a document, but On jIO command parameter, ``_id`` is still used to identify a document, but
another id ``_rev`` must be defined to use a specific revision of this document. another id ``_rev`` must be defined to use a specific revision of that document.
On command responses, you will find another field ``rev`` which will represent the On command responses, you will find another field ``rev`` which will represent the
new revision produced by your action. All the document history is kept unless new revision produced by your action. All the document history is kept unless
......
...@@ -4,10 +4,10 @@ jIO Complex Queries ...@@ -4,10 +4,10 @@ jIO Complex Queries
What are Complex Queries? What are Complex Queries?
------------------------- -------------------------
In jIO, a complex query can tell a storage server to select, filter, sort, or In jIO, a complex query can ask a storage server to select, filter, sort, or
limit a document list before sending it back. If the server is not able to do limit a document list before sending it back. If the server is not able to do
so, the complex query tool can act on the retreived list by itself. Only the so, the complex query tool can act on the retreived list by itself. Only the
allDocs method can use complex queries. ``allDocs()`` method can use complex queries.
A query can either be a string (using a specific language useful for writing A query can either be a string (using a specific language useful for writing
queries), or it can be a tree of objects (useful to browse queries). To handle queries), or it can be a tree of objects (useful to browse queries). To handle
...@@ -16,12 +16,12 @@ complex queries, jIO uses a parsed grammar file which is compiled using `JSCC <h ...@@ -16,12 +16,12 @@ complex queries, jIO uses a parsed grammar file which is compiled using `JSCC <h
Why use Complex Queries? Why use Complex Queries?
------------------------ ------------------------
Complex queries can be used similar to database queries. So they are useful to: Complex queries can be used like database queries, for tasks such as:
* search a specific document * search a specific document
* sort a list of documents in a certain order * sort a list of documents in a certain order
* avoid retrieving a list of ten thousand documents * avoid retrieving a list of ten thousand documents
* limit the list to show only xy documents by page * limit the list to show only N documents per page
For some storages (like localStorage), complex queries can be a powerful tool For some storages (like localStorage), complex queries can be a powerful tool
to query accessible documents. When querying documents on a distant storage, to query accessible documents. When querying documents on a distant storage,
...@@ -34,7 +34,9 @@ itself. ...@@ -34,7 +34,9 @@ itself.
How to use Complex Queries with jIO? How to use Complex Queries with jIO?
------------------------------------ ------------------------------------
Complex queries can be triggered by including the option named query in the allDocs method call. An example would be: Complex queries can be triggered by including the option named query in the ``allDocs()`` method call.
Example:
.. code-block:: javascript .. code-block:: javascript
...@@ -74,11 +76,11 @@ Complex queries can be triggered by including the option named query in the allD ...@@ -74,11 +76,11 @@ Complex queries can be triggered by including the option named query in the allD
How to use Complex Queries outside jIO? How to use Complex Queries outside jIO?
--------------------------------------- ---------------------------------------
.. XXX 404 on complex_example.html .. XXX 404 page missing on complex_example.html
Complex Queries provides an API - which namespace is complex_queries. Please Complex Queries provides an API - which namespace is complex_queries.
also refer to the `Complex Queries sample page <http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1>`_ Refer to the `Complex Queries sample page <http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1>`_
on how to use these methods in- and outside jIO. The module provides: for how to use these methods, in and outside jIO. The module provides:
.. code-block:: javascript .. code-block:: javascript
...@@ -168,7 +170,7 @@ Default search types should be defined in the application's user interface ...@@ -168,7 +170,7 @@ Default search types should be defined in the application's user interface
components because criteria like filters will be changed frequently by the components because criteria like filters will be changed frequently by the
component (change ``limit: [0, 10]`` to ``limit: [10, 10]`` or ``sort_on: [['title', component (change ``limit: [0, 10]`` to ``limit: [10, 10]`` or ``sort_on: [['title',
'ascending']]`` to ``sort_on: [['creator', 'ascending']]``) and each component must 'ascending']]`` to ``sort_on: [['creator', 'ascending']]``) and each component must
have their own default properties to keep their own behavior. have its own default properties to keep their own behavior.
Convert Complex Queries into another type Convert Complex Queries into another type
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
...@@ -4,21 +4,26 @@ ...@@ -4,21 +4,26 @@
Downloads Downloads
========= =========
Core: Core
^^^^
* `[sha256.amd.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_ * `sha256.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_
* `[rsvp-custom.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.js>`_, AMD only version [`rsvp-custom.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.amd.js>`_] * `rsvp-custom.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.js>`_, AMD only version: `rsvp-custom.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/rsvp/rsvp-custom.amd.js>`_
* jIO, `[jio.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.js>`_ * `jio.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.js>`_
* complex_queries, `[complex_queries.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/complex_queries.js>`_ * `complex_queries.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/complex_queries.js>`_
Storage dependencies: Storage dependencies
^^^^^^^^^^^^^^^^^^^^
* `jQuery <http://jquery.com/>`_, `[jquery.js] <http://code.jquery.com/jquery.js>`_ .. XXX this is a little confusing. Also, the link to sha1.js is broken (404)
* `sjcl <https://crypto.stanford.edu/sjcl/>`_, `[sjcl.zip] <https://crypto.stanford.edu/sjcl/sjcl.zip>`_
* `sha1 <http://pajhome.org.uk/crypt/md5/sha1.html>`_, `[sha1.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/jsSha1/sha1.js>`_, AMD compatible version [`sha1.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha1.amd.js>`_]
* `sha2, sha256 <http://anmar.eu.org/projects/jssha2/>`_, `[jssha2.zip] <http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip>`_, AMD compatible versions `[sha2.amd.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha2.amd.js>`_ `[sha256.amd.js] <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_
Storage connectors: * `jquery.js <http://code.jquery.com/jquery.js>`_
* `sjcl <https://crypto.stanford.edu/sjcl/>`_, [`sjcl.zip <https://crypto.stanford.edu/sjcl/sjcl.zip>`_]
* `sha1 <http://pajhome.org.uk/crypt/md5/sha1.html>`_, [`sha1.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/lib/jsSha1/sha1.js>`_], AMD compatible version: `sha1.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha1.amd.js>`_
* `sha2, sha256 <http://anmar.eu.org/projects/jssha2/>`_, `jssha2.zip <http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip>`_, AMD compatible versions: `sha2.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha2.amd.js>`_, `sha256.amd.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/sha256.amd.js>`_
Storage connectors
^^^^^^^^^^^^^^^^^^
* `localstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/localstorage.js>`_ * `localstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/localstorage.js>`_
* `davstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/davstorage.js>`_ * `davstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/davstorage.js>`_
...@@ -28,27 +33,29 @@ Storage connectors: ...@@ -28,27 +33,29 @@ Storage connectors:
* restsqlstorage.js (depends on jQuery) (WIP) * restsqlstorage.js (depends on jQuery) (WIP)
* mioga2storage.js (depends on jQuery) (WIP) * mioga2storage.js (depends on jQuery) (WIP)
Storage handlers: Storage handlers
^^^^^^^^^^^^^^^^
* `indexstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/indexstorage.js>`_ (WIP) * `indexstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/indexstorage.js>`_ (WIP)
* `gidstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/gidstorage.js>`_ (WIP) * `gidstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/gidstorage.js>`_ (WIP)
* `splitstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/splitstorage.js>`_ (WIP) * `splitstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/splitstorage.js>`_ (WIP)
* replicatestorage.js (WIP) * replicatestorage.js (WIP)
Revision based storage handlers: Revision based storage handlers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* `revisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/revisionstorage.js>`_ (depends on sha256) (WIP) * `revisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/revisionstorage.js>`_ (depends on sha256) (WIP)
* `replicaterevisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js>`_ (WIP) * `replicaterevisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js>`_ (WIP)
Minified version Minified version
---------------- ^^^^^^^^^^^^^^^^
.. XXX this sounds harsh. Can we provide it or at least be more explicit? .. XXX this sounds harsh. Can we provide it or at least be more explicit?
To get the minified version of the jIO library, you have to build it yourself. See documentation. To get the minified version of the jIO library, you have to build it yourself. See documentation.
Fork Fork
---- ^^^^
jIO source code jIO source code
......
...@@ -7,7 +7,7 @@ jIO GIDStorage ...@@ -7,7 +7,7 @@ jIO GIDStorage
A storage to enable interoperability between all kind of storages. A storage to enable interoperability between all kind of storages.
A global ID (GID) is a document id which represents a unique document. This ID A global ID (GID) is a document id which represents a unique document. This ID
will be used to find this unique document on all kind of backends. is then used to find this unique document on all types of backends.
This storage uses sub storage allDocs and complex queries to find unique documents, and converts their ids to gids. This storage uses sub storage allDocs and complex queries to find unique documents, and converts their ids to gids.
...@@ -43,7 +43,7 @@ Example: ...@@ -43,7 +43,7 @@ Example:
} }
This description tells the *GIDStorage* to use 2 metadata (``type``, ``title``) to define a This description tells the *GIDStorage* to use 2 metadata attributes (``type``, ``title``) to define a
document as unique in the default case. If the document is of type ``Text``, then document as unique in the default case. If the document is of type ``Text``, then
the handler will use 3 metadata (``type``, ``title``, ``language``). the handler will use 3 metadata (``type``, ``title``, ``language``).
If these constraints are not respected, then the storage returns an error telling us to If these constraints are not respected, then the storage returns an error telling us to
...@@ -72,6 +72,7 @@ constraints: ...@@ -72,6 +72,7 @@ constraints:
Available metadata types are: Available metadata types are:
* ``"json"`` - The json value of the metadata. * ``"json"`` - The json value of the metadata.
* ``"string"`` - The value as string if it is not a list. * ``"string"`` - The value as string if it is not a list.
* ``"list"`` - The value as list. * ``"list"`` - The value as list.
...@@ -86,9 +87,9 @@ Available metadata types are: ...@@ -86,9 +87,9 @@ Available metadata types are:
Document Requirements Document Requirements
--------------------- ---------------------
A metadata value must be a string. This string can be placed in an object which A metadata value must be a string. This string can be placed in an attribute within
key is 'content'. The object can contains custom keys with string values. A a ``"content"`` key. The object can contains custom keys with string values. A
metadata can contain several values. Example: metadata object can contain several values. Example:
.. code-block:: javascript .. code-block:: javascript
...@@ -109,7 +110,7 @@ metadata can contain several values. Example: ...@@ -109,7 +110,7 @@ metadata can contain several values. Example:
} }
Metadata which name begin with an underscore can contain anything. Metadata attributes which names begin with an underscore can contain anything.
.. code-block:: javascript .. code-block:: javascript
...@@ -121,7 +122,8 @@ Storage Requirements ...@@ -121,7 +122,8 @@ Storage Requirements
-------------------- --------------------
* This storage is not compatible with *RevisionStorage* and *ReplicateRevisionStorage*. * This storage is not compatible with *RevisionStorage* and *ReplicateRevisionStorage*.
* Sub storage have to support complex queries options and ``include_docs`` option. * Sub storages have to support options for ``complex queries`` and ``include_docs``.
Dependencies Dependencies
------------ ------------
...@@ -131,7 +133,7 @@ No dependency. ...@@ -131,7 +133,7 @@ No dependency.
Suggested storage tree Suggested storage tree
---------------------- ----------------------
Replication Between Storage:: Replication between storages::
Replicate Storage Replicate Storage
+-- GID Storage +-- GID Storage
...@@ -143,7 +145,7 @@ Replication Between Storage:: ...@@ -143,7 +145,7 @@ Replication Between Storage::
**CAUTION: All gid storage must have the same description!** **CAUTION: All gid storage must have the same description!**
Offline Application Usage:: Offline application usage::
Replicate Storage Replicate Storage
+-- Index Storage with DB in Local Storage +-- Index Storage with DB in Local Storage
......
...@@ -17,17 +17,15 @@ retrieve documents and specific information across storage trees. ...@@ -17,17 +17,15 @@ retrieve documents and specific information across storage trees.
How does it work? How does it work?
----------------- -----------------
.. XXX three parts? jIO is composed of two parts - jIO core and storage library(ies). The core
jIO is separated into three parts - jIO core and storage library(ies). The core
is using storage libraries (connectors) to interact with the associated remote is using storage libraries (connectors) to interact with the associated remote
storage servers. Some queries can be used on top of the jIO allDocs method to storage servers. Some queries can be used on top of the jIO ``allDocs()`` method to
query documents based on defined criteria. query documents based on defined criteria.
jIO uses a job management system, so every method called adds a job into a jIO uses a job management system, so every method call adds a job into a
queue. The queue is copied in the browser's local storage (by default), so it queue. The queue is copied in the browser's local storage (by default), so it
can be restored in case of a browser crash. Jobs are being invoked can be restored in case of browser crash. Jobs are invoked
asynchronously with ongoing jobs not being able to re-trigger to prevent asynchronously and ongoing jobs are not able to re-trigger to prevent
conflicts. conflicts.
Getting started Getting started
...@@ -36,7 +34,7 @@ Getting started ...@@ -36,7 +34,7 @@ Getting started
This walkthrough is designed to get you started using a basic jIO instance. This walkthrough is designed to get you started using a basic jIO instance.
#. Download jIO core, the storages you want to use as well as the #. Download jIO core, the storages you want to use as well as the
complex-queries scripts as well as the dependencies required for the storages complex-queries scripts and the dependencies required for the storages
you intend to use. :ref:`[Download & Fork] <download-fork>` you intend to use. :ref:`[Download & Fork] <download-fork>`
#. Add the scripts to your HTML page in the following order: #. Add the scripts to your HTML page in the following order:
...@@ -56,7 +54,7 @@ This walkthrough is designed to get you started using a basic jIO instance. ...@@ -56,7 +54,7 @@ This walkthrough is designed to get you started using a basic jIO instance.
<script ...> <script ...>
With require js, the main.js will be like this: With `RequireJS <http://requirejs.org/>`_, the main.js will look like:
.. code-block:: javascript .. code-block:: javascript
:linenos: :linenos:
...@@ -77,7 +75,7 @@ This walkthrough is designed to get you started using a basic jIO instance. ...@@ -77,7 +75,7 @@ This walkthrough is designed to get you started using a basic jIO instance.
}); });
#. jIO connects to a number of storages and allows to add handlers (or #. jIO connects to a number of storages and allows adding handlers (or
functions) to specifc storages. functions) to specifc storages.
You can use both handlers and available storages to build a storage You can use both handlers and available storages to build a storage
tree across which all documents will be maintained and managed by jIO. tree across which all documents will be maintained and managed by jIO.
...@@ -89,23 +87,21 @@ This walkthrough is designed to get you started using a basic jIO instance. ...@@ -89,23 +87,21 @@ This walkthrough is designed to get you started using a basic jIO instance.
// create your jio instance // create your jio instance
var my_jio = jIO.createJIO(storage_description); var my_jio = jIO.createJIO(storage_description);
.. XXX 6 methods or 10? #. The jIO API provides ten main methods to manage documents across the storage(s) specified in your jIO storage tree.
#. The jIO API provides six main methods to manage documents across the storage(s) specified in your jIO storage tree. ====================== ===================================================== ========================================
Method Example call Description
================== ===================================================== ======================================== ====================== ===================================================== ========================================
Method Sample Call Description ``post()`` :js:`my_jio.post(document, [options]);` Creates a new document
================== ===================================================== ======================================== ``put()`` :js:`my_jio.put(document, [options]);` Creates/Updates a document
`post` :js:`my_jio.post(document, [options]);` Creates a new document ``putAttachment()`` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document
`put` :js:`my_jio.put(document, [options]);` Creates/Updates a document ``get()`` :js:`my_jio.get(document, [options]);` Reads a document
`putAttachment` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document ``getAttachment()`` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment
`get` :js:`my_jio.get(document, [options]);` Reads a document ``remove()`` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments
`getAttachment` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment ``removeAttachment()`` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment
`remove` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments ``allDocs()`` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents
`removeAttachment` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment ``check()`` :js:`my_jio.check(document, [options]);` Check the document state
`allDocs` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents ``repair()`` :js:`my_jio.repair(document, [options]);` Repair the document
`check` :js:`my_jio.check(document, [options]);` Check the document state ====================== ===================================================== ========================================
`repair` :js:`my_jio.repair(document, [options]);` Repair the document
================== ===================================================== ========================================
How to manage documents? How to manage documents?
======================== ========================
jIO is mapped after the CouchDB API and extends them to provide unified, scalable jIO is mapped after the CouchDB APIs and extends them to provide unified, scalable
and high performance access via Javascript to a wide variety of different and high performance access via JavaScript to a wide variety of different
storage backends. storage backends.
If you are unfamiliar with `Apache CouchDB <http://couchdb.apache.org/>`_: If you are not familiar with `Apache CouchDB <http://couchdb.apache.org/>`_:
it is a scalable, fault-tolerant, and schema-free document-oriented database. it is a scalable, fault-tolerant, and schema-free document-oriented database.
It is used in large and small organizations for a variety of applications where It is used in large and small organizations for a variety of applications where
traditional SQL databases are not the best solution for the problem at hand. traditional SQL databases are not the best solution for the problem at hand.
...@@ -20,7 +20,7 @@ A document is an association of metadata and attachment(s). The metadata is the ...@@ -20,7 +20,7 @@ A document is an association of metadata and attachment(s). The metadata is the
set of properties of the document and the attachments are the binaries of the content set of properties of the document and the attachments are the binaries of the content
of the document. of the document.
In jIO, metadata is just a dictionnary with keys and values (JSON object), and In jIO, metadata is just a dictionary with keys and values (JSON object), and
attachments are just simple strings. attachments are just simple strings.
.. code-block:: javascript .. code-block:: javascript
...@@ -59,7 +59,7 @@ You can also retrieve document attachment metadata in this object. ...@@ -59,7 +59,7 @@ You can also retrieve document attachment metadata in this object.
Basic Methods Basic Methods
------------- -------------
Below you can find sample calls of the main jIO methods. All examples are using Below you can see examples of the main jIO methods. All examples are using
revisions (as in revision storage or replicate revision storage), so you can revisions (as in revision storage or replicate revision storage), so you can
see how method calls should be made with either of these storages. see how method calls should be made with either of these storages.
...@@ -103,34 +103,34 @@ see how method calls should be made with either of these storages. ...@@ -103,34 +103,34 @@ see how method calls should be made with either of these storages.
// delete a document and its attachment(s) // delete a document and its attachment(s)
jio_instance.remove({"_id": "my_document"}). jio_instance.remove({"_id": "my_document"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
}); });
// delete an attachment // delete an attachment
jio_instance.removeAttachment({"_id": "my_document", "_attachment": "its_attachment"}). jio_instance.removeAttachment({"_id": "my_document", "_attachment": "its_attachment"}).
then(function (response) { then(function (response) {
// console.log(response): // console.log(response);
}); });
// get all documents // get all documents
jio_instance.allDocs().then(function (response) { jio_instance.allDocs().then(function (response) {
// console.log(response): // console.log(response);
}); });
Promises Promises
-------- --------
Each jIO methods returns a Promise object, which allows us to get responses into Each jIO method returns a Promise object, which allows us to get responses into
callback parameters and to chain callbacks with other returned values. callback parameters and to chain callbacks with other returned values.
jIO uses a custom version of `RSVP.js <https://github.com/tildeio/rsvp.js>`_, adding canceler and progression features. jIO uses a custom version of `RSVP.js <https://github.com/tildeio/rsvp.js>`_, adding canceler and progression features.
You can read more about promises: You can read more about promises:
* `github RSVP.js <https://github.com/tildeio/rsvp.js#rsvpjs-->`_ * `RSVP.js <https://github.com/tildeio/rsvp.js#rsvpjs-->`_ on GitHub
* `Promises/A+ <http://promisesaplus.com/>`_ * `Promises/A+ <http://promisesaplus.com/>`_
* `CommonJS Promises <http://wiki.commonjs.org/wiki/Promises>`_ * `CommonJS Promises <http://wiki.commonjs.org/wiki/Promises>`_
Method Options and Callback Responses Method Options and Callback Responses
...@@ -144,17 +144,17 @@ To retrieve jIO responses, you have to provide callbacks like this: ...@@ -144,17 +144,17 @@ To retrieve jIO responses, you have to provide callbacks like this:
then([responseCallback], [errorCallback], [progressionCallback]); then([responseCallback], [errorCallback], [progressionCallback]);
* On command success, responseCallback will be called with the jIO response as first parameter. * On command success, ``responseCallback`` will be called with the jIO response as first parameter.
* On command error, errorCallback will be called with the jIO error as first parameter. * On command error, ``errorCallback`` will be called with the jIO error as first parameter.
* On command notification, progressionCallback will be called with the storage notification. * On command notification, ``progressionCallback`` will be called with the storage notification.
Here is a list of responses returned by jIO according to methods and options: Here is a list of responses returned by jIO according to methods and options:
================== =============================== ====================================== ================== =========================================== ===============================================
Option Available for Response (Callback first parameter) Option Available for Response (Callback first parameter)
================== =============================== ====================================== ================== =========================================== ===============================================
No options post, put, remove .. code-block:: javascript No options ``post()``, ``put()``, ``remove()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -164,7 +164,7 @@ No options post, put, remove .. code-block:: javascrip ...@@ -164,7 +164,7 @@ No options post, put, remove .. code-block:: javascrip
"status": 204, "status": 204,
"statusText": "No Content" "statusText": "No Content"
} }
No options putAttachment, removeAttachment .. code-block:: javascript No options ``putAttachment()``, ``removeAttachment()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -175,7 +175,7 @@ No options putAttachment, removeAttachment .. code-block:: javascrip ...@@ -175,7 +175,7 @@ No options putAttachment, removeAttachment .. code-block:: javascrip
"status": 204, "status": 204,
"statusText": "No Content" "statusText": "No Content"
} }
No options get .. code-block:: javascript No options ``get()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -187,7 +187,7 @@ No options get .. code-block:: javascrip ...@@ -187,7 +187,7 @@ No options get .. code-block:: javascrip
// Here, the document metadata // Here, the document metadata
} }
} }
No options getAttachment .. code-block:: javascript No options ``getAttachment()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -198,7 +198,7 @@ No options getAttachment .. code-block:: javascrip ...@@ -198,7 +198,7 @@ No options getAttachment .. code-block:: javascrip
"statusText": "Ok", "statusText": "Ok",
"data": Blob // Here, the attachment content "data": Blob // Here, the attachment content
} }
No option allDocs .. code-block:: javascript No option ``allDocs()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -215,7 +215,7 @@ No option allDocs .. code-block:: javascrip ...@@ -215,7 +215,7 @@ No option allDocs .. code-block:: javascrip
}] }]
} }
} }
include_docs: true allDocs .. code-block:: javascript include_docs: true ``allDocs()`` .. code-block:: javascript
{ {
"result": "success", "result": "success",
...@@ -235,12 +235,12 @@ include_docs: true allDocs .. code-block:: javascrip ...@@ -235,12 +235,12 @@ include_docs: true allDocs .. code-block:: javascrip
}] }]
} }
} }
================== =============================== ====================================== ================== =========================================== ===============================================
In case of error, the errorCallback first parameter will look like: In case of error, the ``errorCallback`` first parameter will look like:
.. code-block:: javascript .. code-block:: javascript
......
...@@ -14,9 +14,8 @@ The word "metadata" means "data about data". Metadata articulates a context for ...@@ -14,9 +14,8 @@ The word "metadata" means "data about data". Metadata articulates a context for
objects of interest -- "resources" such as MP3 files, library books, or objects of interest -- "resources" such as MP3 files, library books, or
satellite images -- in the form of "resource descriptions". As a tradition, satellite images -- in the form of "resource descriptions". As a tradition,
resource description dates back to the earliest archives and library catalogs. resource description dates back to the earliest archives and library catalogs.
The modern "metadata" field that gave rise to Dublin Core and other recent During the Web revolution of the mid-1990s, `Dublic Core <http://dublincore.org/metadata-basics/>`_
standards emerged with the Web revolution of the mid-1990s. has emerged as one of the prominent metadata standards.
http://dublincore.org/metadata-basics/
Why use metadata? Why use metadata?
----------------- -----------------
...@@ -61,10 +60,10 @@ List of metadata to use ...@@ -61,10 +60,10 @@ List of metadata to use
Identification Identification
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
* **"_id"**, a specific jIO metadata which helps the storage to find a document * **_id**, a specific jIO metadata which helps the storage to find a document
(can be a real path name, a dc:identifier, a uuid, ...). **String Only** (can be a real path name, a dc:identifier, a uuid, ...). **String Only**
* **"identifer"**, :js:`{"identifier": "http://domain/jio_home_page"}, {"identifier": "urn:ISBN:978-1-2345-6789-X"}, * **identifer**, :js:`{"identifier": "http://domain/jio_home_page"}, {"identifier": "urn:ISBN:978-1-2345-6789-X"},
{"identifier": [{"scheme": "DCTERMS.URI", "content": "http://domain/jio_home_page"}]}` {"identifier": [{"scheme": "DCTERMS.URI", "content": "http://domain/jio_home_page"}]}`
an unambiguous reference to the resource within a given context. Recommended an unambiguous reference to the resource within a given context. Recommended
...@@ -74,14 +73,14 @@ Identification ...@@ -74,14 +73,14 @@ Identification
Resource Locator (URL), the Digital Object Identifier (DOI) and the Resource Locator (URL), the Digital Object Identifier (DOI) and the
International Standard Book Number (ISBN). International Standard Book Number (ISBN).
* **"format"**, :js:`{"format": ["text/html", "52 kB"]}, {"format": ["image/jpeg", "100 x 100 pixels", "13.2 KiB"]}` * **format**, :js:`{"format": ["text/html", "52 kB"]}, {"format": ["image/jpeg", "100 x 100 pixels", "13.2 KiB"]}`
the physical or digital manifestation of the resource. Typically, Format may the physical or digital manifestation of the resource. Typically, Format may
include the media-type or dimensions of the resource. Examples of dimensions include the media-type or dimensions of the resource. Examples of dimensions
include size and duration. Format may be used to determine the software, include size and duration. Format may be used to determine the software,
hardware or other equipment needed to display or operate the resource. hardware or other equipment needed to display or operate the resource.
* **"date"**, :js:`{"date": "2011-12-13T14:15:16Z"}, {"date": {"scheme": "DCTERMS.W3CDTF", "content": "2011-12-13"}}` * **date**, :js:`{"date": "2011-12-13T14:15:16Z"}, {"date": {"scheme": "DCTERMS.W3CDTF", "content": "2011-12-13"}}`
a date associated with an event in the life cycle of the resource. Typically, a date associated with an event in the life cycle of the resource. Typically,
Date will be associated with the creation or availability of the resource. Date will be associated with the creation or availability of the resource.
...@@ -89,7 +88,7 @@ Identification ...@@ -89,7 +88,7 @@ Identification
of ISO 8601 `Date and Time Formats, W3C Note <http://www.w3.org/TR/NOTE-datetime>`_ of ISO 8601 `Date and Time Formats, W3C Note <http://www.w3.org/TR/NOTE-datetime>`_
and follows the YYYY-MM-DD format. and follows the YYYY-MM-DD format.
* **"type"**, :js:`{"type": "Text"}, {"type": "Image"}, {"type": "Dataset"}` * **type**, :js:`{"type": "Text"}, {"type": "Image"}, {"type": "Dataset"}`
the nature or genre of the content of the resource. Type includes terms describing the nature or genre of the content of the resource. Type includes terms describing
general categories, functions, genres, or aggregation levels for content. general categories, functions, genres, or aggregation levels for content.
...@@ -100,26 +99,26 @@ Identification ...@@ -100,26 +99,26 @@ Identification
Intellectual property Intellectual property
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
* **"creator"**, :js:`{"creator": "Tristan Cavelier"}, {"creator": ["Tristan Cavelier", "Sven Franck"]}` * **creator**, :js:`{"creator": "Tristan Cavelier"}, {"creator": ["Tristan Cavelier", "Sven Franck"]}`
an entity primarily responsible for creating the content of the resource. an entity primarily responsible for creating the content of the resource.
Examples of a Creator include a person, an organization, or a service. Examples of a Creator include a person, an organization, or a service.
Typically the name of the Creator should be used to indicate the entity. Typically the name of the Creator should be used to indicate the entity.
* **"publisher"**, :js:`{"publisher": "Nexedi"}` * **publisher**, :js:`{"publisher": "Nexedi"}`
the entity responsible for making the resource available. Examples of a the entity responsible for making the resource available. Examples of a
Publisher include a person, an organization, or a service. Typically, the name Publisher include a person, an organization, or a service. Typically, the name
of a Publisher should be used to indicate the entity. of a Publisher should be used to indicate the entity.
* **"contributor"**, :js:`{"contributor": ["Full Name", "Full Name", ...]}` * **contributor**, :js:`{"contributor": ["Full Name", "Full Name", ...]}`
an entity responsible for making contributions to the content of the an entity responsible for making contributions to the content of the
resource. Examples of a Contributor include a person, an organization or a resource. Examples of a Contributor include a person, an organization or a
service. Typically, the name of a Contributor should be used to indicate the service. Typically, the name of a Contributor should be used to indicate the
entity. entity.
* **"rights"**, :js:`{"rights": "Access limited to members"}, {"rights": "https://www.j-io.org/documentation/jio-documentation/#copyright-and-license"}` * **rights**, :js:`{"rights": "Access limited to members"}, {"rights": "https://www.j-io.org/documentation/jio-documentation/#copyright-and-license"}`
information about rights held in and over the resource. Typically a Rights information about rights held in and over the resource. Typically a Rights
element will contain a rights management statement for the resource, or element will contain a rights management statement for the resource, or
...@@ -132,24 +131,24 @@ Intellectual property ...@@ -132,24 +131,24 @@ Intellectual property
Content Content
^^^^^^^ ^^^^^^^
* **"title"**, :js:`{"title": "jIO Home Page"}` * **title**, :js:`{"title": "jIO Home Page"}`
the name given to the resource. Typically, a Title will be a name by which the resource is formally known. the name given to the resource. Typically, a Title will be a name by which the resource is formally known.
* **"subject"**, :js:`{"subject": "jIO"}, {"subject": ["jIO", "basics"]}` * **subject**, :js:`{"subject": "jIO"}, {"subject": ["jIO", "basics"]}`
the topic of the content of the resource. Typically, a Subject will be the topic of the content of the resource. Typically, a Subject will be
expressed as keywords or key phrases or classification codes that describe the expressed as keywords or key phrases or classification codes that describe the
topic of the resource. Recommended best practice is to select a value from a topic of the resource. Recommended best practice is to select a value from a
controlled vocabulary or formal classification scheme. controlled vocabulary or formal classification scheme.
* **"description"**, :js:`{"description": "Simple guide to show the basics of jIO"}, {"description": {"lang": "fr", "content": "Ma description"}}` * **description**, :js:`{"description": "Simple guide to show the basics of jIO"}, {"description": {"lang": "fr", "content": "Ma description"}}`
an account of the content of the resource. Description may include but is not an account of the content of the resource. Description may include but is not
limited to: an abstract, table of contents, reference to a graphical limited to: an abstract, table of contents, reference to a graphical
representation of content or a free-text account of the content. representation of content or a free-text account of the content.
* **"language"**, :js:`{"language": "en"}` * **language**, :js:`{"language": "en"}`
the language of the intellectual content of the resource. Recommended best the language of the intellectual content of the resource. Recommended best
practice for the values of the Language element is defined by `RFC 3066 <http://www.ietf.org/rfc/rfc3066.txt>`_ practice for the values of the Language element is defined by `RFC 3066 <http://www.ietf.org/rfc/rfc3066.txt>`_
...@@ -158,20 +157,20 @@ Content ...@@ -158,20 +157,20 @@ Content
or "eng" for English, "akk" for Akkadian, and "en-GB" for English used in the or "eng" for English, "akk" for Akkadian, and "en-GB" for English used in the
United Kingdom. United Kingdom.
* **"source"**, :js:`{"source": ["Image taken from a drawing by Mr. Artist", "<phone number>"]}`, * **source**, :js:`{"source": ["Image taken from a drawing by Mr. Artist", "<phone number>"]}`,
a Reference to a resource from which the present resource is derived. The a Reference to a resource from which the present resource is derived. The
present resource may be derived from the Source resource in whole or part. present resource may be derived from the Source resource in whole or part.
Recommended best practice is to reference the resource by means of a string or Recommended best practice is to reference the resource by means of a string or
number conforming to a formal identification system. number conforming to a formal identification system.
* **"relation"**, :js:`{"relation": "Resilience project"}` * **relation**, :js:`{"relation": "Resilience project"}`
a reference to a related resource. Recommended best practice is to reference a reference to a related resource. Recommended best practice is to reference
the resource by means of a string or number conforming to a formal the resource by means of a string or number conforming to a formal
identification system. identification system.
* **"coverage"**, :js:`{"coverage": "France"}` * **coverage**, :js:`{"coverage": "France"}`
the extent or scope of the content of the resource. Coverage will typically the extent or scope of the content of the resource. Coverage will typically
include spatial location (a place name or geographic co-ordinates), temporal include spatial location (a place name or geographic co-ordinates), temporal
...@@ -182,13 +181,13 @@ Content ...@@ -182,13 +181,13 @@ Content
places or time periods should be used in preference to numeric identifiers such places or time periods should be used in preference to numeric identifiers such
as sets of co-ordinates or date ranges. as sets of co-ordinates or date ranges.
* **"category"**, :js:`{"category": ["parent/26323", "resilience/javascript", "javascript/library/io"]}` * **category**, :js:`{"category": ["parent/26323", "resilience/javascript", "javascript/library/io"]}`
the category the resource is associated with. The categories may look like the category the resource is associated with. The categories may look like
navigational facets, they correspond to the properties of the resource which navigational facets, they correspond to the properties of the resource which
can be generated with metadata or some other informations (see `faceted search <https://en.wikipedia.org/wiki/Faceted_search>`_). can be generated with metadata or some other information (see `faceted search <https://en.wikipedia.org/wiki/Faceted_search>`_).
* **"product"**, :js:`{"product": "..."}` * **product**, :js:`{"product": "..."}`
for e-commerce use. for e-commerce use.
......
...@@ -181,7 +181,7 @@ Good Example ...@@ -181,7 +181,7 @@ Good Example
.. code-block:: javascript .. code-block:: javascript
function func () { function func() {
return { return {
"name": "Batman" "name": "Batman"
}; };
...@@ -502,7 +502,7 @@ Additional Readings ...@@ -502,7 +502,7 @@ Additional Readings
Resources, additional reading materials and links: Resources, additional reading materials and links:
* `Javascript Patterns <http://shop.oreilly.com/product/9780596806767.do>`_, main ressource used. * `JavaScript Patterns <http://shop.oreilly.com/product/9780596806767.do>`_, main ressource used.
* `JSLint <http://www.jslint.com/>`_, code quality. * `JSLint <http://www.jslint.com/>`_, code quality.
* `YUIDoc <http://yuilibrary.com/projects/yuidoc>`_, generate documentation from code. * `YUIDoc <http://yuilibrary.com/projects/yuidoc>`_, generate documentation from code.
......
...@@ -37,11 +37,11 @@ Simple Conflict Example ...@@ -37,11 +37,11 @@ Simple Conflict Example
You are keeping a namecard file on your PC updating from your smartphone. Your You are keeping a namecard file on your PC updating from your smartphone. Your
smartphone ran out of battery and is offline when you update your namecard on smartphone ran out of battery and is offline when you update your namecard on
your PC with your new email adress. Someone else change this email from your PC your PC with your new email adress. Someone else changes this email from your PC
and once your smartphone is recharged, you go back online and the previous and once your smartphone is recharged, you go back online and the previous
update is executed. update is executed.
#. Setting up the storage tree #. Set up the storage tree
.. code-block:: javascript .. code-block:: javascript
...@@ -64,7 +64,7 @@ update is executed. ...@@ -64,7 +64,7 @@ update is executed.
}); });
#. Create your namecard on your smartphone #. Create the namecard on your smartphone
.. code-block:: javascript .. code-block:: javascript
...@@ -91,10 +91,10 @@ update is executed. ...@@ -91,10 +91,10 @@ update is executed.
// response.rev -> "2-068E73F5B44FEC987B51354DFC772891" // response.rev -> "2-068E73F5B44FEC987B51354DFC772891"
}); });
Your smartphone is offline, so you will now have one version (1-578...) on Your smartphone is offline, so now you will have one version (1-578...) on
your smartphone and another version on webDav (2-068...) on your PC. your smartphone and another version on webDav (2-068...) on your PC.
#. You modify your namecard while being offline #. You modify the namecard while being offline
.. code-block:: javascript .. code-block:: javascript
...@@ -114,7 +114,7 @@ update is executed. ...@@ -114,7 +114,7 @@ update is executed.
}); });
#. Later, your smartphone is online and you retrieve your namecard. #. Later, your smartphone is online and you retrieve the other version of the namecard.
.. code-block:: javascript .. code-block:: javascript
...@@ -157,7 +157,7 @@ update is executed. ...@@ -157,7 +157,7 @@ update is executed.
When deleting the conflicting version of your namecard, jIO removes this When deleting the conflicting version of your namecard, jIO removes this
version from all storages and sets the document tree leaf of this version to version from all storages and sets the document tree leaf of this version to
deleted. All storages now contain just a single version of your namecard deleted. All storages now contain just a single version of the namecard
(2-3753...). Note that, on the document tree, removing a revison will (2-3753...). Note that, on the document tree, removing a revison will
create a new revision with status set to *deleted*. create a new revision with status set to *deleted*.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment