source: Dev/branches/rest-dojo-ui/client/dojox/data/s3/README @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 1.4 KB
Line 
1Using Amazon S3 with Dojo has the following prerequisites:
2    * You must be signed up to use Amazon S3. You can sign up for Amazon S3 at http://aws.amazon.com/s3.
3    * Use the provided proxy (/dojox/rpc/s3/proxy.php) with PHP 5.
4    * proxy.php requires the following modules:
5          o Crypt_HMAC
6          o HTTP_Request
7
8
9To use S3 from Dojo, you need a proxy. You can use the provided proxy example file by renaming
10proxy.example-php to proxy.php and then you must enter your Amazon access key and secret access key
11into the proxy.php file on line 3 and 4:
12
13$accessKey = "access key";
14$secretAccessKey = "secret access key";
15
16You then use the Dojo RPC service with the "PROXIED-PATH" envelope:
17
18dojo.require("dojox.rpc.Service");
19dojo.require("dojox.rpc.ProxiedPath");
20var s3Buckets = new dojox.rpc.Service({
21        target:"http://s3.amazonaws.com/",
22        proxyUrl:"../s3/proxy.php", // the path to the proxy
23        transport:"REST",
24        envelope:"PROXIED-PATH",
25        contentType:"application/json",
26        services:{
27                myBucket:{
28                        target:"myBucket",
29                        parameters:[{type:"string"}]
30                }
31        }
32});
33
34
35To use the S3 as a Dojo data store you can use the S3JsonRestStore module. First setup an RPC service
36as shown above and then pass the RPC service to the S3JsonRestStore:
37
38dojo.require("dojox.data.S3JsonRestStore");
39s3Store = new dojox.data.S3JsonRestStore({service:s3Buckets.myBucket}); // and create a store for it
40
41You can then use the s3Store as a normal Read/Write Dojo Data store.
Note: See TracBrowser for help on using the repository browser.