[docs/backend][s]: tidy up and factor out backend list to include file.

This commit is contained in:
Rufus Pollock
2012-10-22 16:30:15 +01:00
parent c9208f1a08
commit 68d2f66f66
5 changed files with 33 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
---
layout: container
title: Tutorial - Backends - Loading data from different sources using Backends
title: Loading data from different sources using Backends - Tutorial
recline-deps: true
root: ../
---
@@ -53,23 +53,18 @@ var dataset = recline.Model.Dataset({
{% endhighlight %}
<div class="alert alert-info">
<strong>Backend identifiers</strong>
<p><strong>Backend identifiers</strong>
How do you know the backend identifier for a given Backend? It's just the name
of the 'class' in recline.Backend module (but case-insensitive). E.g.
recline.Backend.ElasticSearch can be identified as 'ElasticSearch' or
'elasticsearch'.
'elasticsearch'.</p>
<p><strong>What Backends are available from Recline?</strong>
{% include backend-list.html %}
</p>
<p><strong>Backend you'd like to see not available?</strong> It's easy to write your own &ndash; see the <a href="backends.html">Backend reference docs</a> for details of the required API.
</p>
</div>
### Included Backends
* [gdocs: Google Docs (Spreadsheet)](src/backend.gdocs.html)
* [csv: CSV files](src/backend.csv.html)
* [elasticsearch: ElasticSearch](src/backend.elasticsearch.html) - this also covers the DataHub as it has an ElasticSearch compatible API
* [dataproxy: DataProxy (CSV and XLS on the Web)](src/backend.dataproxy.html)
* [couchdb: CouchDB](src/backend.couchdb.html)
Backend not on this list that you would like to see? It's very easy to write a
new backend -- see below for more details.
## Preparing your app
@@ -82,7 +77,7 @@ much more limited if you are just using a Backend. Specifically:
<script type="text/javascript" src="vendor/underscore/1.1.6/underscore.js"></script>
<script type="text/javascript" src="vendor/backbone/0.5.1/backbone.js"></script>
<!-- include the backend code you need e.g. here for gdocs -->
<script type="text/javascript" src="src/backend/gdocs.js"></script>
<script type="text/javascript" src="src/backend.gdocs.js"></script>
<!-- Or you can just include all of recline. -->
<script type="text/javascript" src="dist/recline.js"></script>
@@ -98,7 +93,7 @@ For Recline to be able to access a Google Spreadsheet it **must** have been
<div class="alert alert-info">
<strong>Want a real world example?</strong> This <a
href="http://okfnlabs.org/opendatacensus">Open Data Census micro-app</a> loads
href="http://dashboard.opengovernmentdata.org/census/">Open Data Census micro-app</a> loads
data from Google Docs and then displays it on a specialist interface combining
a bespoke chooser and a Kartograph (svg-only) map.
</div>
@@ -137,7 +132,7 @@ Recline supports ElasticSearch as a full read/write/query backend. It also means
For loading data from CSV files there are 3 cases:
1. CSV is online but on same domain -- we can then load using AJAX (as no problems with same origin policy)
1. CSV is online but on same domain or supporting CORS (S3 and Google Storage support CORS!) -- we can then load using AJAX (as no problems with same origin policy)
2. CSV is on local disk -- if your browser supports HTML5 File API we can load the CSV file off disk
3. CSV is online but not on same domain -- use DataProxy (see below)
@@ -211,9 +206,3 @@ You can customize the length of this timeout by setting the following constant:
recline.Backend.DataProxy.timeout = 10000;
{% endhighlight %}
## Writing your own backend
Writing your own backend is easy to do. Details of the required API are in the
[Backend documentation](backends.html).