Location: A review of cardiac cellular electrophysiology models @ f6a8f9030738 / dojo-presentation / js / dojo / dojox / data / s3 / README

Author:
David Nickerson <nickerso@users.sourceforge.net>
Date:
2009-07-16 02:00:03+12:00
Desc:
the starting point for the HH tutorial example
Permanent Source URI:
https://models.fieldml.org/workspace/a1/rawfile/f6a8f90307388eb4b040ee3566b84d88b59247f7/dojo-presentation/js/dojo/dojox/data/s3/README

Using Amazon S3 with Dojo has the following prerequisites:
    * You must be signed up to use Amazon S3. You can sign up for Amazon S3 at http://aws.amazon.com/s3.
    * Use the provided proxy (/dojox/rpc/s3/proxy.php) with PHP 5.
    * proxy.php requires the following modules:
          o Crypt_HMAC
          o HTTP_Request


To use S3 from Dojo, you need a proxy. You can use the provided proxy example file by renaming 
proxy.example-php to proxy.php and then you must enter your Amazon access key and secret access key
into the proxy.php file on line 3 and 4:

$accessKey = "access key";
$secretAccessKey = "secret access key";

You then use the Dojo RPC service with the "PROXIED-PATH" envelope:

dojo.require("dojox.rpc.Service");
dojo.require("dojox.rpc.ProxiedPath");
var s3Buckets = new dojox.rpc.Service({
	target:"http://s3.amazonaws.com/",
	proxyUrl:"../s3/proxy.php", // the path to the proxy
	transport:"REST",
	envelope:"PROXIED-PATH",
	contentType:"application/json",
	services:{
		myBucket:{
			target:"myBucket",
			parameters:[{type:"string"}]
		}
	}
});


To use the S3 as a Dojo data store you can use the S3JsonRestStore module. First setup an RPC service 
as shown above and then pass the RPC service to the S3JsonRestStore:

dojo.require("dojox.data.S3JsonRestStore");
s3Store = new dojox.data.S3JsonRestStore({service:s3Buckets.myBucket}); // and create a store for it

You can then use the s3Store as a normal Read/Write Dojo Data store.