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

minor style and grammar tweaks

parent 1c422fd3
......@@ -5,8 +5,8 @@
### Getting Started
To set up 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
To setup you should jIO include jio.js, dependencies and the connectors for the storages
you want to use in the HTML page header (note that more dependencies may be required
depending on type of storages being used):
<!-- jio + dependency -->
......@@ -31,7 +31,7 @@ Then create your jIO instance like this:
### 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*).
jIO exposes the following methods to *create*, *read*, *update* and *delete* documents
......@@ -41,7 +41,7 @@ each method, please refer to the documentation):
// create and store new document
jio_instance.post({"title": "some title"}).
then(function (response) {
// console.log(response):
// console.log(response);
// {
// "result": "success",
// "id": "404aef5e-22cc-4a64-a292-37776c6464a3" // Generated id
......@@ -52,7 +52,7 @@ each method, please refer to the documentation):
// create or update an existing document
jio_instance.put({"_id": "my_document", "title": "New Title"}).
then(function (response) {
// console.log(response):
// console.log(response);
// {
// "result": "success",
// "id": "my_document",
......@@ -64,7 +64,7 @@ each method, please refer to the documentation):
jio_instance.putAttachment({"_id": "my_document", "_attachment": "its_attachment",
"_data": "abc", "_mimetype": "text/plain"}).
then(function (response) {
// console.log(response):
// console.log(response);
// {
// "result": "success",
// "id": "my_document",
......@@ -106,7 +106,7 @@ each method, please refer to the documentation):
// delete a document and its attachment(s)
jio_instance.remove({"_id": "my_document"}).
then(function (response) {
// console.log(response):
// console.log(response);
// {
// "result": "success",
// "id": "my_document"
......@@ -116,7 +116,7 @@ each method, please refer to the documentation):
// delete an attachement
jio_instance.removeAttachment({"_id": "my_document", "_attachment": "its_attachment"}).
then(function (response) {
// console.log(response):
// console.log(response);
// {
// "result": "success",
// "id": "my_document",
......@@ -126,7 +126,7 @@ each method, please refer to the documentation):
// get all documents
jio_instance.allDocs().then(function (response) {
// console.log(response):
// console.log(response);
// {
// "data": {
// "total_rows": 1,
......@@ -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()
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
server-side):
......@@ -315,7 +315,7 @@ server-side):
// fields to return in response
"select_list": [<string A>, <string B>]
}).then(function (response) {
// console.log(response):
// console.log(response);
// {
// "total_rows": 1,
// "rows": [{
......@@ -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
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.
### Conflict Management
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
As jIO allows to manage and share documents across multiple storage locactions,
conflicts may happen (i.e. multiple versions of a single document
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
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.
### Crash-Proof
......
# 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.
config: c600a8b2cb226583bf95768a6560ff9e
config: b5eff715ffe3e787813e3b29d0dd7b1f
tags: fbb0d17656682115ca4d033fb2f83ba1
.. role:: js(code)
:language: javascript
.. _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
store passwords.
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
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
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.
......@@ -28,12 +26,11 @@ Connectors
LocalStorage
^^^^^^^^^^^^
Three methods are provided:
* :js:`createDescription(username, [application_name], [mode="localStorage"])`
* :js:`createLocalDescription(username, [application_name])`
* :js:`createMemoryDescription(username, [application_name])`
* :js:`createDescription(username, [application_name], [mode="localStorage"])`
* :js:`createLocalDescription(username, [application_name])`
* :js:`createMemoryDescription(username, [application_name])`
All parameters are strings.
......@@ -51,8 +48,10 @@ Examples:
DavStorage
^^^^^^^^^^
The tool dav_storage.createDescription generates a dav storage description for
*no*, *basic* or *digest* authentication (*digest* is not implemented yet).
The method ``dav_storage.createDescription()`` generates a DAV storage description for
*none*, *basic* or *digest* authentication.
NB: digest **is not implemented yet**.
.. code-block:: javascript
......@@ -60,16 +59,19 @@ The tool dav_storage.createDescription generates a dav storage description for
All parameters are strings.
.. XXX simplify here
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
required if ``auth_type`` is equal to "basic". And ``realm`` also becomes required if
``auth_type`` is equal to "digest".
============= ========================
parameter required?
============= ========================
``url`` yes
``auth_type`` yes
``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.
S3Storage
......@@ -89,7 +91,7 @@ IndexStorage
^^^^^^^^^^^^
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.
The sub storages have to manage ``query`` and ``include_docs`` options.
......@@ -144,8 +146,8 @@ Revision Based Handlers
A revision based handler is a storage which is able to do some document
versioning using simple storages listed above.
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.
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 that document.
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
......
JIO Complex Queries
jIO 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
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
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
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
* sort a list of documents in a certain order
* 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
to query accessible documents. When querying documents on a distant storage,
......@@ -34,7 +34,9 @@ itself.
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
......@@ -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?
---------------------------------------
.. 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
also 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:
Complex Queries provides an API - which namespace is complex_queries.
Refer to the `Complex Queries sample page <http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1>`_
for how to use these methods, in and outside jIO. The module provides:
.. code-block:: javascript
......@@ -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
component (change ``limit: [0, 10]`` to ``limit: [10, 10]`` or ``sort_on: [['title',
'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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -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.)
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}]);``
* ``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}])``
* ``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:
......
......@@ -4,21 +4,26 @@
Downloads
=========
Core:
Core
^^^^
* `[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>`_]
* jIO, `[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>`_
* `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>`_
* `jio.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.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>`_
* `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>`_
.. XXX this is a little confusing. Also, the link to sha1.js is broken (404)
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>`_
* `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:
* restsqlstorage.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)
* `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)
* 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)
* `replicaterevisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js>`_ (WIP)
Minified version
----------------
^^^^^^^^^^^^^^^^
.. 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.
Fork
----
^^^^
jIO source code
......
.. _gid-storage:
JIO GIDStorage
jIO GIDStorage
==============
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
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.
......@@ -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
the handler will use 3 metadata (``type``, ``title``, ``language``).
If these constraints are not respected, then the storage returns an error telling us to
......@@ -72,6 +72,7 @@ constraints:
Available metadata types are:
* ``"json"`` - The json value of the metadata.
* ``"string"`` - The value as string if it is not a list.
* ``"list"`` - The value as list.
......@@ -86,9 +87,9 @@ Available metadata types are:
Document Requirements
---------------------
A metadata value must be a string. This string can be placed in an object which
key is 'content'. The object can contains custom keys with string values. A
metadata can contain several values. Example:
A metadata value must be a string. This string can be placed in an attribute within
a ``"content"`` key. The object can contains custom keys with string values. A
metadata object can contain several values. Example:
.. code-block:: javascript
......@@ -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
......@@ -121,7 +122,8 @@ Storage Requirements
--------------------
* 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
------------
......@@ -131,7 +133,7 @@ No dependency.
Suggested storage tree
----------------------
Replication Between Storage::
Replication between storages::
Replicate Storage
+-- GID Storage
......@@ -143,7 +145,7 @@ Replication Between Storage::
**CAUTION: All gid storage must have the same description!**
Offline Application Usage::
Offline application usage::
Replicate 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.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to JIO's documentation!
Welcome to jIO's documentation!
===============================
Contents:
......@@ -24,11 +24,5 @@ Contents:
authors
license
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
......@@ -8,7 +8,7 @@ Introduction
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
CouchDB, that offers connectors to multiple storages, special handlers to
enhance functionality (replication, revisions, indexing) and a query module to
......@@ -17,17 +17,15 @@ retrieve documents and specific information across storage trees.
How does it work?
-----------------
.. XXX three parts?
JIO is separated into three parts - jIO core and storage library(ies). The core
jIO is composed of two parts - jIO core and storage library(ies). The core
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.
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
can be restored in case of a browser crash. Jobs are being invoked
asynchronously with ongoing jobs not being able to re-trigger to prevent
can be restored in case of browser crash. Jobs are invoked
asynchronously and ongoing jobs are not able to re-trigger to prevent
conflicts.
Getting started
......@@ -36,7 +34,7 @@ Getting started
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
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>`
#. 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.
<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
:linenos:
......@@ -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.
You can use both handlers and available storages to build a storage
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.
// create your jio instance
var my_jio = jIO.createJIO(storage_description);
.. XXX 6 methods or 10?
#. The jIO API provides six main methods to manage documents across the storage(s) specified in your jIO storage tree.
================== ===================================================== ========================================
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
`putAttachment` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document
`get` :js:`my_jio.get(document, [options]);` Reads a document
`getAttachment` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment
`remove` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments
`removeAttachment` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment
`allDocs` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents
`check` :js:`my_jio.check(document, [options]);` Check the document state
`repair` :js:`my_jio.repair(document, [options]);` Repair the document
================== ===================================================== ========================================
#. The jIO API provides ten main methods to manage documents across the storage(s) specified in your jIO storage tree.
====================== ===================================================== ========================================
Method Example call Description
====================== ===================================================== ========================================
``post()`` :js:`my_jio.post(document, [options]);` Creates a new document
``put()`` :js:`my_jio.put(document, [options]);` Creates/Updates a document
``putAttachment()`` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document
``get()`` :js:`my_jio.get(document, [options]);` Reads a document
``getAttachment()`` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment
``remove()`` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments
``removeAttachment()`` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment
``allDocs()`` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents
``check()`` :js:`my_jio.check(document, [options]);` Check the document state
``repair()`` :js:`my_jio.repair(document, [options]);` Repair the document
====================== ===================================================== ========================================
......@@ -181,7 +181,7 @@ Good Example
.. code-block:: javascript
function func () {
function func() {
return {
"name": "Batman"
};
......@@ -502,7 +502,7 @@ Additional Readings
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.
* `YUIDoc <http://yuilibrary.com/projects/yuidoc>`_, generate documentation from code.
......
......@@ -7,7 +7,7 @@ Why Conflicts can Occur
Using jIO you can store documents in multiple storage locations. With
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
tree and a user trying to save on a version that does not match the latest
version of the document.
......@@ -37,11 +37,11 @@ Simple Conflict Example
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
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
update is executed.
#. Setting up the storage tree
#. Set up the storage tree
.. code-block:: javascript
......@@ -64,7 +64,7 @@ update is executed.
});
#. Create your namecard on your smartphone
#. Create the namecard on your smartphone
.. code-block:: javascript
......@@ -91,10 +91,10 @@ update is executed.
// 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.
#. You modify your namecard while being offline
#. You modify the namecard while being offline
.. code-block:: javascript
......@@ -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
......@@ -157,7 +157,7 @@ update is executed.
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
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
create a new revision with status set to *deleted*.
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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="prev" title="JavaScript Naming Conventions" href="naming_conventions.html" />
</head>
......@@ -42,7 +42,7 @@
<li class="right" >
<a href="naming_conventions.html" title="JavaScript Naming Conventions"
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>
</div>
......@@ -109,7 +109,7 @@
<li class="right" >
<a href="naming_conventions.html" title="JavaScript Naming Conventions"
>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>
</div>
<div class="footer">
......
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,9 +25,9 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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="prev" title="JIO GIDStorage" href="gid_storage.html" />
<link rel="prev" title="jIO GIDStorage" href="gid_storage.html" />
</head>
<body>
<div class="related">
......@@ -40,9 +40,9 @@
<a href="metadata.html" title="Metadata"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="gid_storage.html" title="JIO GIDStorage"
<a href="gid_storage.html" title="jIO GIDStorage"
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>
</div>
......@@ -52,25 +52,25 @@
<div class="body">
<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">
<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
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
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>
</div>
<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>
<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">
<li>search a specific document</li>
<li>sort a list of documents in a certain order</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>
<p>For some storages (like localStorage), complex queries can be a powerful tool
to query accessible documents. When querying documents on a distant storage,
......@@ -82,7 +82,8 @@ itself.</p>
</div>
<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>
<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>
<span class="c1">// search text query</span>
......@@ -119,9 +120,9 @@ itself.</p>
</div>
<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>
<p>Complex Queries provides an API - which namespace is complex_queries. Please
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>
on how to use these methods in- and outside jIO. The module provides:</p>
<p>Complex Queries provides an API - which namespace is complex_queries.
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>
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>
<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>
......@@ -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
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
have their own default properties to keep their own behavior.</p>
have its own default properties to keep their own behavior.</p>
</div>
<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>
......@@ -367,7 +368,7 @@ ignore: " "</pre>
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<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="#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>
......@@ -385,7 +386,7 @@ ignore: " "</pre>
<h4>Previous topic</h4>
<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>
<p class="topless"><a href="metadata.html"
title="next chapter">Metadata</a></p>
......@@ -421,9 +422,9 @@ ignore: " "</pre>
<a href="metadata.html" title="Metadata"
>next</a> |</li>
<li class="right" >
<a href="gid_storage.html" title="JIO GIDStorage"
<a href="gid_storage.html" title="jIO GIDStorage"
>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>
</div>
<div class="footer">
......
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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="prev" title="Metadata" href="metadata.html" />
</head>
......@@ -42,7 +42,7 @@
<li class="right" >
<a href="metadata.html" title="Metadata"
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>
</div>
......@@ -115,23 +115,23 @@ plus the storages and dependencies you need and you will be good to go.</p>
</pre></div>
</div>
<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>
<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>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">resolve</span></tt>, is equal to success</p>
</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>
</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><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>
</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 third parameter <tt class="docutils literal"><span class="pre">option</span></tt> is the option 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>Methods should return the following objects:</p>
<ul>
<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>
<li class="right" >
<a href="metadata.html" title="Metadata"
>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>
</div>
<div class="footer">
......
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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="prev" title="Introduction" href="introduction.html" />
</head>
......@@ -42,7 +42,7 @@
<li class="right" >
<a href="introduction.html" title="Introduction"
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>
</div>
......@@ -53,21 +53,26 @@
<div class="section" id="downloads">
<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">
<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>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>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:/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:/jio.js">jio.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>
<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">
<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="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://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://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="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>
</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">
<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>
......@@ -77,18 +82,23 @@
<li>restsqlstorage.js (depends on jQuery) (WIP)</li>
<li>mioga2storage.js (depends on jQuery) (WIP)</li>
</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">
<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/splitstorage.js">splitstorage.js</a> (WIP)</li>
<li>replicatestorage.js (WIP)</li>
</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">
<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>
</ul>
</div>
<div class="section" id="minified-version">
<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>
......@@ -131,6 +141,11 @@
<h3><a href="index.html">Table Of Contents</a></h3>
<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="#fork">Fork</a></li>
</ul>
......@@ -177,7 +192,7 @@
<li class="right" >
<a href="introduction.html" title="Introduction"
>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>
</div>
<div class="footer">
......
......@@ -10,7 +10,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -27,7 +27,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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>
<body>
<div class="related">
......@@ -36,7 +36,7 @@
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
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>
</div>
......@@ -87,7 +87,7 @@
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
>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>
</div>
<div class="footer">
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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" />
</head>
<body>
......@@ -38,7 +38,7 @@
<li class="right" >
<a href="introduction.html" title="Introduction"
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>
</div>
......@@ -48,7 +48,7 @@
<div class="body">
<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>
<div class="toctree-wrapper compound">
<ul>
......@@ -59,6 +59,11 @@
</ul>
</li>
<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#fork">Fork</a></li>
</ul>
......@@ -83,7 +88,7 @@
<li class="toctree-l2"><a class="reference internal" href="available_storages.html#revision-based-handlers">Revision Based Handlers</a></li>
</ul>
</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#storage-description">Storage Description</a></li>
<li class="toctree-l2"><a class="reference internal" href="gid_storage.html#document-requirements">Document Requirements</a></li>
......@@ -92,7 +97,7 @@
<li class="toctree-l2"><a class="reference internal" href="gid_storage.html#suggested-storage-tree">Suggested storage tree</a></li>
</ul>
</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#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>
......@@ -103,7 +108,7 @@
<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#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#examples">Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html#tools">Tools</a></li>
......@@ -131,12 +136,7 @@
<li class="toctree-l1"><a class="reference internal" href="license.html">Copyright and license</a></li>
</ul>
</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">
<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>
</ul>
</div>
......@@ -150,14 +150,6 @@
<p class="logo"><a href="#">
<img class="logo" src="_static/jio-logo.png" alt="Logo"/>
</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>
<p class="topless"><a href="introduction.html"
title="next chapter">Introduction</a></p>
......@@ -192,7 +184,7 @@
<li class="right" >
<a href="introduction.html" title="Introduction"
>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>
</div>
<div class="footer">
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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" />
</head>
<body>
......@@ -38,7 +38,7 @@
<li class="right" >
<a href="authors.html" title="Authors"
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>
</div>
......@@ -96,7 +96,7 @@ information on LGPL can be found <a class="reference external" href="http://en.w
<li class="right" >
<a href="authors.html" title="Authors"
>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>
</div>
<div class="footer">
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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="prev" title="For developers" href="developers.html" />
</head>
......@@ -42,7 +42,7 @@
<li class="right" >
<a href="developers.html" title="For developers"
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>
</div>
......@@ -191,7 +191,7 @@ split on multiple lines.</p>
</pre></div>
</div>
<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="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;Batman&quot;</span>
<span class="p">};</span>
......@@ -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>
<p>Resources, additional reading materials and links:</p>
<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://yuilibrary.com/projects/yuidoc">YUIDoc</a>, generate documentation from code.</li>
</ul>
......@@ -541,7 +541,7 @@ itself. Comments should look like this:</p>
<li class="right" >
<a href="developers.html" title="For developers"
>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>
</div>
<div class="footer">
......
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.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="prev" title="How to manage documents?" href="manage_documents.html" />
</head>
......@@ -42,7 +42,7 @@
<li class="right" >
<a href="manage_documents.html" title="How to manage documents?"
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>
</div>
......@@ -57,7 +57,7 @@
<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
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
tree and a user trying to save on a version that does not match the latest
version of the document.</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>
<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
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
update is executed.</p>
<ol class="arabic simple">
<li>Setting up the storage tree</li>
<li>Set up the storage tree</li>
</ol>
<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>
......@@ -111,7 +111,7 @@ update is executed.</p>
</div>
</div></blockquote>
<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>
<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>
......@@ -134,10 +134,10 @@ update is executed.</p>
<span class="p">});</span>
</pre></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>
</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>
<span class="c1">// response.id -&gt; &quot;myNameCard&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>
</pre></div>
</div>
</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>
<span class="c1">// response.id -&gt; &quot;myNameCard&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>
</div>
<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
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
create a new revision with status set to <em>deleted</em>.</p>
</li>
......@@ -259,7 +259,7 @@ create a new revision with status set to <em>deleted</em>.</p>
<li class="right" >
<a href="manage_documents.html" title="How to manage documents?"
>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>
</div>
<div class="footer">
......
......@@ -8,7 +8,7 @@
<head>
<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/pygments.css" type="text/css" />
......@@ -26,7 +26,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.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">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
......@@ -40,7 +40,7 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
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>
</div>
......@@ -91,7 +91,7 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>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>
</div>
<div class="footer">
......
This diff is collapsed.
.. role:: js(code)
:language: javascript
.. _list-of-available-storages:
List of Available Storages
......@@ -15,10 +13,10 @@ store passwords.
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
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
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.
......@@ -28,12 +26,11 @@ Connectors
LocalStorage
^^^^^^^^^^^^
Three methods are provided:
* :js:`createDescription(username, [application_name], [mode="localStorage"])`
* :js:`createLocalDescription(username, [application_name])`
* :js:`createMemoryDescription(username, [application_name])`
* :js:`createDescription(username, [application_name], [mode="localStorage"])`
* :js:`createLocalDescription(username, [application_name])`
* :js:`createMemoryDescription(username, [application_name])`
All parameters are strings.
......@@ -51,8 +48,10 @@ Examples:
DavStorage
^^^^^^^^^^
The tool dav_storage.createDescription generates a dav storage description for
*no*, *basic* or *digest* authentication (*digest* is not implemented yet).
The method ``dav_storage.createDescription()`` generates a DAV storage description for
*none*, *basic* or *digest* authentication.
NB: digest **is not implemented yet**.
.. code-block:: javascript
......@@ -60,16 +59,19 @@ The tool dav_storage.createDescription generates a dav storage description for
All parameters are strings.
.. XXX simplify here
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
required if ``auth_type`` is equal to "basic". And ``realm`` also becomes required if
``auth_type`` is equal to "digest".
============= ========================
parameter required?
============= ========================
``url`` yes
``auth_type`` yes
``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.
S3Storage
......@@ -89,7 +91,7 @@ IndexStorage
^^^^^^^^^^^^
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.
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
versioning using simple storages listed above.
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
new revision produced by your action. All the document history is kept unless
......
......@@ -4,10 +4,10 @@ jIO 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
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
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
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
* sort a list of documents in a certain order
* 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
to query accessible documents. When querying documents on a distant storage,
......@@ -34,7 +34,9 @@ itself.
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
......@@ -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?
---------------------------------------
.. 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
also 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:
Complex Queries provides an API - which namespace is complex_queries.
Refer to the `Complex Queries sample page <http://git.erp5.org/gitweb/jio.git/blob/HEAD:/examples/complex_example.html?js=1>`_
for how to use these methods, in and outside jIO. The module provides:
.. code-block:: javascript
......@@ -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
component (change ``limit: [0, 10]`` to ``limit: [10, 10]`` or ``sort_on: [['title',
'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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -4,21 +4,26 @@
Downloads
=========
Core:
Core
^^^^
* `[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>`_]
* jIO, `[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>`_
* `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>`_
* `jio.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/jio.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>`_
* `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>`_
.. XXX this is a little confusing. Also, the link to sha1.js is broken (404)
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>`_
* `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:
* restsqlstorage.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)
* `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)
* 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)
* `replicaterevisionstorage.js <http://git.erp5.org/gitweb/jio.git/blob_plain/refs/heads/master:/src/jio.storage/replicatestorage.js>`_ (WIP)
Minified version
----------------
^^^^^^^^^^^^^^^^
.. 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.
Fork
----
^^^^
jIO source code
......
......@@ -7,7 +7,7 @@ jIO GIDStorage
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
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.
......@@ -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
the handler will use 3 metadata (``type``, ``title``, ``language``).
If these constraints are not respected, then the storage returns an error telling us to
......@@ -72,6 +72,7 @@ constraints:
Available metadata types are:
* ``"json"`` - The json value of the metadata.
* ``"string"`` - The value as string if it is not a list.
* ``"list"`` - The value as list.
......@@ -86,9 +87,9 @@ Available metadata types are:
Document Requirements
---------------------
A metadata value must be a string. This string can be placed in an object which
key is 'content'. The object can contains custom keys with string values. A
metadata can contain several values. Example:
A metadata value must be a string. This string can be placed in an attribute within
a ``"content"`` key. The object can contains custom keys with string values. A
metadata object can contain several values. Example:
.. code-block:: javascript
......@@ -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
......@@ -121,7 +122,8 @@ Storage Requirements
--------------------
* 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
------------
......@@ -131,7 +133,7 @@ No dependency.
Suggested storage tree
----------------------
Replication Between Storage::
Replication between storages::
Replicate Storage
+-- GID Storage
......@@ -143,7 +145,7 @@ Replication Between Storage::
**CAUTION: All gid storage must have the same description!**
Offline Application Usage::
Offline application usage::
Replicate Storage
+-- Index Storage with DB in Local Storage
......
......@@ -17,17 +17,15 @@ retrieve documents and specific information across storage trees.
How does it work?
-----------------
.. XXX three parts?
jIO is separated into three parts - jIO core and storage library(ies). The core
jIO is composed of two parts - jIO core and storage library(ies). The core
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.
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
can be restored in case of a browser crash. Jobs are being invoked
asynchronously with ongoing jobs not being able to re-trigger to prevent
can be restored in case of browser crash. Jobs are invoked
asynchronously and ongoing jobs are not able to re-trigger to prevent
conflicts.
Getting started
......@@ -36,7 +34,7 @@ Getting started
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
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>`
#. 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.
<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
:linenos:
......@@ -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.
You can use both handlers and available storages to build a storage
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.
// create your jio instance
var my_jio = jIO.createJIO(storage_description);
.. XXX 6 methods or 10?
#. The jIO API provides six main methods to manage documents across the storage(s) specified in your jIO storage tree.
================== ===================================================== ========================================
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
`putAttachment` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document
`get` :js:`my_jio.get(document, [options]);` Reads a document
`getAttachment` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment
`remove` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments
`removeAttachment` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment
`allDocs` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents
`check` :js:`my_jio.check(document, [options]);` Check the document state
`repair` :js:`my_jio.repair(document, [options]);` Repair the document
================== ===================================================== ========================================
#. The jIO API provides ten main methods to manage documents across the storage(s) specified in your jIO storage tree.
====================== ===================================================== ========================================
Method Example call Description
====================== ===================================================== ========================================
``post()`` :js:`my_jio.post(document, [options]);` Creates a new document
``put()`` :js:`my_jio.put(document, [options]);` Creates/Updates a document
``putAttachment()`` :js:`my_jio.putAttachement(attachment, [options]);` Updates/Adds an attachment to a document
``get()`` :js:`my_jio.get(document, [options]);` Reads a document
``getAttachment()`` :js:`my_jio.getAttachment(attachment, [options]);` Reads a document attachment
``remove()`` :js:`my_jio.remove(document, [options]);` Deletes a document and its attachments
``removeAttachment()`` :js:`my_jio.removeAttachment(attachment, [options]);` Deletes a document attachment
``allDocs()`` :js:`my_jio.allDocs([options]);` Retrieves a list of existing documents
``check()`` :js:`my_jio.check(document, [options]);` Check the document state
``repair()`` :js:`my_jio.repair(document, [options]);` Repair the document
====================== ===================================================== ========================================
This diff is collapsed.
......@@ -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
satellite images -- in the form of "resource descriptions". As a tradition,
resource description dates back to the earliest archives and library catalogs.
The modern "metadata" field that gave rise to Dublin Core and other recent
standards emerged with the Web revolution of the mid-1990s.
http://dublincore.org/metadata-basics/
During the Web revolution of the mid-1990s, `Dublic Core <http://dublincore.org/metadata-basics/>`_
has emerged as one of the prominent metadata standards.
Why use metadata?
-----------------
......@@ -61,10 +60,10 @@ List of metadata to use
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**
* **"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"}]}`
an unambiguous reference to the resource within a given context. Recommended
......@@ -74,14 +73,14 @@ Identification
Resource Locator (URL), the Digital Object Identifier (DOI) and the
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
include the media-type or dimensions of the resource. Examples of dimensions
include size and duration. Format may be used to determine the software,
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,
Date will be associated with the creation or availability of the resource.
......@@ -89,7 +88,7 @@ Identification
of ISO 8601 `Date and Time Formats, W3C Note <http://www.w3.org/TR/NOTE-datetime>`_
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
general categories, functions, genres, or aggregation levels for content.
......@@ -100,26 +99,26 @@ Identification
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.
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.
* **"publisher"**, :js:`{"publisher": "Nexedi"}`
* **publisher**, :js:`{"publisher": "Nexedi"}`
the entity responsible for making the resource available. Examples of a
Publisher include a person, an organization, or a service. Typically, the name
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
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
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
element will contain a rights management statement for the resource, or
......@@ -132,24 +131,24 @@ Intellectual property
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.
* **"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
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
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
limited to: an abstract, table of contents, reference to a graphical
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
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
or "eng" for English, "akk" for Akkadian, and "en-GB" for English used in the
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
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
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
the resource by means of a string or number conforming to a formal
identification system.
* **"coverage"**, :js:`{"coverage": "France"}`
* **coverage**, :js:`{"coverage": "France"}`
the extent or scope of the content of the resource. Coverage will typically
include spatial location (a place name or geographic co-ordinates), temporal
......@@ -182,13 +181,13 @@ Content
places or time periods should be used in preference to numeric identifiers such
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
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.
......
......@@ -181,7 +181,7 @@ Good Example
.. code-block:: javascript
function func () {
function func() {
return {
"name": "Batman"
};
......@@ -502,7 +502,7 @@ Additional Readings
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.
* `YUIDoc <http://yuilibrary.com/projects/yuidoc>`_, generate documentation from code.
......
......@@ -37,11 +37,11 @@ Simple Conflict Example
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
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
update is executed.
#. Setting up the storage tree
#. Set up the storage tree
.. code-block:: javascript
......@@ -64,7 +64,7 @@ update is executed.
});
#. Create your namecard on your smartphone
#. Create the namecard on your smartphone
.. code-block:: javascript
......@@ -91,10 +91,10 @@ update is executed.
// 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.
#. You modify your namecard while being offline
#. You modify the namecard while being offline
.. code-block:: javascript
......@@ -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
......@@ -157,7 +157,7 @@ update is executed.
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
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
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