Commit 0e405480 authored by iv's avatar iv Committed by iv

OfficeJS: Add Lucas's first steps for use of DropBox storage (as comments).

parent 87e8ef5e
......@@ -144,6 +144,11 @@
</form>\n
</div>\n
<div class="ui-block-c">\n
<!--form class="select-dropbox-form" style="margin-right: .3125em; margin-left: .3125em;">\n
<button class="ui-btn ui-btn-b" type="submit" data-i18n="Dropbox Storage">Dropbox Storage</button>\n
</form>\n
</div>\n
<div class="ui-block-d" -->\n
<form class="select-local-form" style="margin-right: .3125em; margin-left: .3125em;">\n
<button class="ui-btn ui-btn-b" type="submit" data-i18n="Local is Enough">Local is Enough</button>\n
</form>\n
......@@ -297,7 +302,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -311,7 +316,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.12629.17894.55808</string> </value>
<value> <string>949.20639.37177.22408</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -329,7 +334,7 @@
</tuple>
<state>
<tuple>
<float>1448032104.14</float>
<float>1456135138.17</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -178,6 +178,11 @@
function setDAVConfiguration(gadget) {\n
return gadget.redirect({page: \'jio_dav_configurator\'});\n
}\n
\n
/* // Dropbox\n
function setDropboxConfiguration(gadget) {\n
return gadget.redirect({page: \'jio_dropbox_configurator\'});\n
} */\n
\n
var gadget_klass = rJS(window);\n
\n
......@@ -239,7 +244,15 @@
function () {\n
return setDAVConfiguration(gadget);\n
}\n
)\n
) /*, // Dropbox\n
loopEventListener(\n
gadget.props.element.querySelector(\'form.select-dropbox-form\'),\n
\'submit\',\n
true,\n
function () {\n
return setDropboxConfiguration(gadget);\n
}\n
) */\n
]);\n
});\n
});\n
......@@ -368,7 +381,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -382,7 +395,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.12629.17894.55808</string> </value>
<value> <string>949.20690.55610.35242</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -400,7 +413,7 @@
</tuple>
<state>
<tuple>
<float>1447936126.33</float>
<float>1456134900.49</float>
<string>UTC</string>
</tuple>
</state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_jio_dropbox_configurator.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_page_jio_dropbox_configurator_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
\n
<title>OfficeJS jIO Dropbox Configurator Page</title>\n
\n
<script src="rsvp.js"></script>\n
<script src="renderjs.js"></script>\n
\n
<script src="gadget_officejs_page_jio_dropbox_configurator.js"></script>\n
\n
</head>\n
\n
<body>\n
<article class="ui-content ui-body-c">\n
<section class="ui-content-header-plain">\n
<h3 class="ui-content-title ui-body-c">\n
<span class="ui-icon ui-icon-custom ui-icon-database">&nbsp;</span>\n
Please go to\n
<a href="https://www.dropbox.com/1/oauth2/authorize?client_id=htgu71r22avg8zt&response_type=code" target="_blank"> this link </a>\n
to connect to your Dropbox account.\n
</h3>\n
</h2>\n
you will receive an access token to put in the field below.\n
</section>\n
<section class="ui-body-c ui-content-section">\n
<form class="dropbox-configuration-form">\n
\n
<div class="ui-form">\n
<div class="ui-field-contain">\n
<label data-i18n="dropbox_token:">Access token:</label>\n
<input type="text" name="dropbox_token" value=""/>\n
</div>\n
</div>\n
\n
<div class="select-storage ui-controlgroup ui-controlgroup-horizontal">\n
<div class="ui-grid-b ui-responsive">\n
<div class="ui-block-a"></div>\n
<div class="ui-block-b"></div>\n
<div class="ui-block-c">\n
<button type="submit" data-i18n="Connect" class="ui-btn-btn-right">Connect</button>\n
</div>\n
</div>\n
</div>\n
</form>\n
</section>\n
</article>\n
<article class="ui-content ui-body-c">\n
<section class="ui-content-header-plain">\n
<h3 class="ui-content-title ui-body-c">\n
<span class="ui-icon ui-icon-custom ui-icon-file-text-o">&nbsp;</span>\n
Your Text Documents\n
</h3>\n
</section>\n
<section class="ui-body-c ui-content-section">\n
<div class="ui-controlgroup ui-controlgroup-horizontal">\n
<div class="ui-grid-a ui-responsive">\n
<div class="ui-block-a">\n
<a class="ui-btn" href="#page=sync">Synchronize</a>\n
</div>\n
<div class="ui-block-b">\n
<a class="ui-btn" href="#page=document_list">Go to document List</a>\n
</div>\n
</div>\n
</div>\n
</section>\n
</article>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>OfficeJS jIO Dropbox Configurator Page</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>lucas_parsy</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1450434278.71</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>947.57126.51132.11229</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1456133357.95</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1450433676.01</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_page_jio_dropbox_configurator.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_page_jio_dropbox_configurator_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>/*global window, rJS, RSVP, URI, location,\n
loopEventListener, btoa */\n
/*jslint nomen: true, indent: 2, maxerr: 3*/\n
(function (window, rJS, RSVP) {\n
"use strict";\n
\n
function setjIODropboxConfiguration(gadget) {\n
var configuration = {\n
type: "replicate",\n
// XXX This drop the signature lists...\n
query: {\n
query: \'portal_type:"Web Page" \',\n
// XX Synchonizing the whole module is too much, here is a way to start quietly\n
//+ \'AND local_roles: ("Owner") \'\n
//+ \'AND validation_state: ("draft", "released_alive", "shared_alive", "published_alive") \',\n
limit: [0, 1234567890]\n
},\n
use_remote_post: false,\n
conflict_handling: 2,\n
check_local_modification: true,\n
check_local_creation: true,\n
check_local_deletion: true,\n
check_remote_modification: true,\n
check_remote_creation: true,\n
check_remote_deletion: true,\n
local_sub_storage: {\n
type: "query",\n
sub_storage: {\n
type: "uuid",\n
sub_storage: {\n
type: "indexeddb",\n
database: "officejs-dav"\n
}\n
}\n
},\n
remote_sub_storage: {\n
type: "query",\n
sub_storage: {\n
type: "drivetojiomapping",\n
sub_storage: {\n
type: "dropbox",\n
access_token : gadget.props.element.querySelector("input[name=\'dropbox_token\']").value,\n
root: "dropbox"\n
}\n
}\n
}\n
};\n
return gadget.setSetting(\'jio_storage_description\', configuration)\n
.push(function () {\n
return gadget.setSetting(\'jio_storage_name\', "Dropbox");\n
})\n
.push(function () {\n
return gadget.reload();\n
});\n
}\n
\n
var gadget_klass = rJS(window);\n
\n
gadget_klass\n
.ready(function (g) {\n
g.props = {};\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
g.props.deferred = RSVP.defer();\n
return g.getSetting(\'jio_storage_name\');\n
})\n
.push(function (jio_storage_name) {\n
if (jio_storage_name === "Dropbox") {\n
return g.getSetting(\'jio_storage_description\');\n
}\n
});\n
})\n
.declareAcquiredMethod("updateHeader", "updateHeader")\n
.declareAcquiredMethod("redirect", "redirect")\n
.declareAcquiredMethod("reload", "reload")\n
.declareAcquiredMethod("getSetting", "getSetting")\n
.declareAcquiredMethod("setSetting", "setSetting")\n
.declareMethod("render", function () {\n
var gadget = this;\n
return gadget.updateHeader({\n
title: "Connect To Dropbox Storage",\n
back_url: "#page=jio_configurator",\n
panel_action: false\n
}).push(function () {\n
return gadget.props.deferred.resolve();\n
});\n
})\n
\n
/////////////////////////////////////////\n
// Form submit\n
/////////////////////////////////////////\n
.declareService(function () {\n
var gadget = this;\n
\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.props.deferred.promise;\n
})\n
.push(function () {\n
return loopEventListener(\n
gadget.props.element.querySelector(\'form\'),\n
\'submit\',\n
true,\n
function () {\n
return setjIODropboxConfiguration(gadget);\n
}\n
);\n
});\n
});\n
\n
\n
}(window, rJS, RSVP));</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>OfficeJS jIO Dropbox Configurator Page JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>lucas_parsy</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1450434274.63</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>949.20661.60975.48759</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1456133199.28</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1450433833.8</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment