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="J</