# Cloud Storage support for Dropbox and OneDrive The experimental feature module("lively.experimental.CloudStorageWebRequests") adds cloud storage support to Lively Kernel. With that feature enabled, the system can handle a new form of URLs: e.g. "dropbox:///Lively/PartsBin/" and "onedrive:///Lively/PartsBin/". These urls can then be used in all other places of Lively that use WebResources to retrieve and update content, e.g. the SCB and the PartsBin. To demonstrated that feature, we added two additional PartsBin urls, that expect some PartsBin contents under "Lively/PartsBin" in your favorite cloud storage. ## Implementation The cloud storage API is implemented in 3 modules: - module('lively.net.Dropbox') - module('lively.net.OneDrive') - module('lively.net.CloudStorage') And it needs callback code that is stored in lively/net/callbacks/. We registered a Dropbox and OneDrive application that accepts those callbacks for https://lively-kernel.org/babelsberg/core/lively/net/callbacks/onedrive.html and https://lively-kernel.org/babelsberg/core/lively/net/callbacks/dropbox.html We can add additional URLS for dropbox, as we did for https://lively-web.org/core/lively/net/callbacks/dropbox.html, but in principal we an installation under localhost should be able to use the callback code on lively-kernel, but for that we must encode that URL absolute (which we currently did not not, yet). As the URLs already suggested. The whole thing works only with HTTPS which our apache proxy can happyly provide for us. ## Future Work We plan to be able to use our new connection to our local drives to (manually or automatically) sync files (js / parts / worlds) between our the public Wiki and the CloudStorage. Tim, wants to work on his babelsberg constraints code that way. Jens, for example, wants to move all its former private weberkstatt content into the dropbox.
Formatter
Wed May 06 2015 04:51:20 GMT-0700 (PDT)
enabled
# Syncing CloudStorage content with hashes When we can get similar hashes from all our WebResources, we could implement a very fast synchronization approach. OneDrive gets use the following for "/Lively/PartsBin/Basic/Cloud.html": "crc32Hash": "152AF118", "sha1Hash": "6367D32C318BBDAB27494D2CA8EF638443168125" Dropbox on the other hand is less verbose, when browsing a directory, it just gives you the minum information: { "rev": "c45d401397f44", "thumb_exists": false, "path": "/Lively/PartsBin/Basic/Cloud.html", "is_dir": false, "client_mtime": "Mon, 24 Jun 2013 08:24:48 +0000", "icon": "page_white_code", "read_only": false, "modifier": null, "bytes": 7088, "modified": "Mon, 24 Jun 2013 08:38:04 +0000", "size": "6.9 KB", "root": "dropbox", "mime_type": "text/html", "revision": 804308 }, But as documented in https://www.dropbox.com/developers/datastore/docs/js a conentHash is also available, if we ask nicely. See also https://www.dropbox.com/developers/core/bestpractices .
{
  "@odata.context""https://api.onedrive.com/v1.0/$metadata#drives('me')/items/$entity",
  "createdBy"{
    "device"{
      "id""18bffd053d686d"
    },
    "user"{
      "displayName""Jens Lincke",
      "id""d333aee656452f8b"
    },
    "oneDriveSync"{
      "@odata.type""#oneDrive.identity",
      "id""2f872ede-9a60-4eb6-a8c7-cdf2a4c4de67"
    }
  },
  "createdDateTime""2015-04-16T10:06:58.82Z",
  "cTag""adDpEMzMzQUVFNjU2NDUyRjhCITEzODE5Mi42MzU2NjQzODk0NjUyMDAwMDA",
  "eTag""aRDMzM0FFRTY1NjQ1MkY4QiExMzgxOTIuMA",
  "id""D333AEE656452F8B!138192",
  "lastModifiedBy"{
    "device"{
      "id""18bffd053d686d"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
{
  "read_only"false,
  "hash""16fd2a69bca30e3a319a263ed500223f",
  "revision"584139,
  "bytes"0,
  "thumb_exists"false,
  "rev""8e9cb01397f44",
  "modified""Mon, 18 Feb 2013 14:39:38 +0000",
  "size""0 bytes",
  "path""/Lively/PartsBin/Basic",
  "is_dir"true,
  "modifier": null,
  "root""dropbox",
  "contents"[
    {
      "rev""8f35701397f44",
      "thumb_exists"false,
      "path""/Lively/PartsBin/Basic/.svn",
      "is_dir"true,
      "icon""folder",
      "read_only"false,
      "modifier": null,
      "bytes"0,
      "modified""Mon, 18 Feb 2013 14:42:20 +0000",
      "size""0 bytes",
      "root""dropbox",
      "revision"586583
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Pretty Print
## Ondrive Example: