Commit 5d5683b1 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_officejs: Add Storage Choice possibility

parent a8c63431
......@@ -170,12 +170,6 @@
<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>
......@@ -219,7 +213,7 @@
</tuple>
<state>
<tuple>
<float>1439985572.02</float>
<float>1442854416.99</float>
<string>UTC</string>
</tuple>
</state>
......@@ -264,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.34162.16498.45226</string> </value>
<value> <string>945.58613.40423.28074</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -282,66 +276,7 @@
</tuple>
<state>
<tuple>
<float>1441799207.54</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>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</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>empty</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>1439984795.03</float>
<float>1442857868.63</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -285,7 +285,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.34034.51991.273</string> </value>
<value> <string>945.42727.27517.33075</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1441379761.67</float>
<float>1441901307.82</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -128,35 +128,43 @@ jquerymobile.css\n
jquerymobile.js\n
renderjs.js\n
rsvp.js\n
gadget_officejs_page_text_editor_list.js\n
gadget_officejs_page_text_editor_list.html\n
gadget_officejs_header.js\n
gadget_officejs_header.html\n
gadget_officejs_jio_web_page_view.js\n
gadget_officejs_jio.html\n
gadget_officejs_jio_web_page_view.html\n
gadget_officejs_text_editor_application_panel.js\n
gadget_officejs_text_editor_application_panel.html\n
gadget_officejs_page_add_text_document.html\n
gadget_officejs_page_jio_configurator.html\n
gadget_officejs_page_jio_dav_configurator.html\n
gadget_officejs_page_login.html\n
gadget_officejs_page_logout.html\n
gadget_officejs_page_share_webrtc_jio.html\n
gadget_officejs_page_sync.html\n
gadget_officejs_page_text_editor_list.html\n
gadget_officejs_router.html\n
gadget_officejs_router.js\n
gadget_officejs_jio.html\n
gadget_officejs_text_editor_application.html\n
gadget_officejs_text_editor_application_panel.html\n
gadget_officejs_translation.html\n
gadget_officejs_webrtc_jio.html\n
gadget_officejs_widget_listbox.html\n
gadget_officejs_header.js\n
gadget_officejs_jio.js\n
gadget_officejs_jio_web_page_view.js\n
gadget_officejs_page_add_text_document.js\n
gadget_officejs_page_jio_configurator.js\n
gadget_officejs_page_jio_dav_configurator.js\n
gadget_officejs_page_login.js\n
gadget_officejs_page_logout.js\n
gadget_officejs_page_share_webrtc_jio.js\n
gadget_officejs_page_share_webrtc_jio.html\n
gadget_officejs_webrtc_jio.js\n
gadget_officejs_webrtc_jio.html\n
gadget_officejs_page_text_editor_list.html\n
gadget_officejs_page_sync.js\n
gadget_officejs_page_text_editor_list.js\n
gadget_officejs_page_add_text_document.html\n
gadget_officejs_page_add_text_document.js\n
gadget_officejs_router.js\n
gadget_officejs_text_editor_application.js\n
gadget_officejs_text_editor_application_panel.js\n
gadget_officejs_translation.js\n
gadget_officejs_translation.html\n
gadget_officejs_translation_data.js\n
gadget_officejs_webrtc_jio.js\n
gadget_officejs_widget_listbox.js\n
gadget_officejs_widget_listbox.html\n
gadget_officejs_page_sync.js\n
gadget_officejs_page_sync.html\n
officejs_launcher.js\n
officejs_launcher.html\n
erp5_launcher.js\n
erp5_launcher.html\n
rjsunsafe/gadget_ckeditor.js\n
rjsunsafe/gadget_ckeditor.html\n
NETWORK:\n
......@@ -203,12 +211,6 @@ NETWORK:\n
<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>
......@@ -252,7 +254,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1441731873.74</float>
<float>1442854040.74</float>
<string>UTC</string>
</tuple>
</state>
......@@ -297,7 +299,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.43854.16066.11281</string> </value>
<value> <string>945.61166.25675.50432</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -315,64 +317,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1441969739.85</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>cedric.le.ninivin</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>1441730475.18</float>
<float>1443009061.03</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -441,12 +441,6 @@
<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>
......@@ -468,7 +462,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>cedric.le.ninivin</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -490,8 +484,8 @@
</tuple>
<state>
<tuple>
<float>1441100988.32</float>
<string>GMT</string>
<float>1442854033.56</float>
<string>UTC</string>
</tuple>
</state>
</object>
......@@ -535,7 +529,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.39862.6327.58811</string> </value>
<value> <string>945.58607.14824.6775</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -553,7 +547,7 @@
</tuple>
<state>
<tuple>
<float>1441729356.63</float>
<float>1442857960.12</float>
<string>UTC</string>
</tuple>
</state>
......@@ -565,61 +559,4 @@
</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>romain</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>1441100929.74</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -99,7 +99,9 @@
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>/*global window, rJS, jIO, FormData */\n
<value> <string encoding="cdata"><![CDATA[
/*global window, rJS, jIO, FormData */\n
/*jslint indent: 2, maxerr: 3 */\n
(function (window, rJS, jIO) {\n
"use strict";\n
......@@ -110,43 +112,28 @@
// Initialize the gadget local parameters\n
gadget.state_parameter_dict = {};\n
})\n
\n
.declareAcquiredMethod("redirect", "redirect")\n
.declareAcquiredMethod("getSetting", "getSetting")\n
\n
.declareMethod(\'createJio\', function (jio_options) {\n
this.state_parameter_dict.jio_storage = jIO.createJIO({\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: true,\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
var gadget = this;\n
if (jio_options === undefined) {\n
jio_options = {\n
type: "query",\n
sub_storage: {\n
type: "uuid",\n
sub_storage: {\n
type: "uuid",\n
sub_storage: {\n
type: "indexeddb",\n
database: "officejs"\n
}\n
type: "indexeddb",\n
database: "officejs"\n
}\n
},\n
remote_sub_storage: {\n
type: "erp5",\n
url: (new URI("hateoas"))\n
.absoluteTo(location.href)\n
.toString(),\n
default_view_reference: "jio_view"\n
}\n
};\n
}\n
this.state_parameter_dict.jio_storage = jIO.createJIO(jio_options);\n
return this.getSetting("jio_storage_name")\n
.push(function (jio_storage_name) {\n
gadget.state_parameter_dict.jio_storage_name = jio_storage_name;\n
});\n
})\n
.declareMethod(\'allDocs\', function () {\n
......@@ -186,11 +173,26 @@
return storage.removeAttachment.apply(storage, arguments);\n
})\n
.declareMethod(\'repair\', function () {\n
var storage = this.state_parameter_dict.jio_storage;\n
return storage.repair.apply(storage, arguments);\n
var gadget = this,\n
storage = gadget.state_parameter_dict.jio_storage;\n
return storage.repair.apply(storage, arguments)\n
.push(undefined, function (error) {\n
if(error.hasOwnProperty("currentTarget") &&\n
error.currentTarget.status === 401 &&\n
gadget.state_parameter_dict.jio_storage_name === "ERP5") {\n
return {\n
redirect: {\n
page: "login"\n
}\n
};\n
}\n
throw error;\n
});\n
});\n
\n
}(window, rJS, jIO));</string> </value>
}(window, rJS, jIO));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -325,7 +327,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.43851.47565.8721</string> </value>
<value> <string>945.58667.36801.48622</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -343,7 +345,7 @@
</tuple>
<state>
<tuple>
<float>1441969006.79</float>
<float>1442858006.69</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -217,12 +217,6 @@
<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>
......@@ -266,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1440171657.24</float>
<float>1442854134.29</float>
<string>UTC</string>
</tuple>
</state>
......@@ -311,7 +305,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.34162.16498.45226</string> </value>
<value> <string>945.58608.59350.33075</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -329,64 +323,7 @@
</tuple>
<state>
<tuple>
<float>1441723579.7</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>cedric.le.ninivin</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>1440171550.06</float>
<float>1442858061.15</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -110,9 +110,14 @@
\n
function saveContent(gadget, submit_event) {\n
var i,\n
doc = gadget.options.doc;\n
doc = gadget.options.doc,\n
today = new Date();\n
doc.parent_relative_url = "web_page_module";\n
doc.portal_type = "Web Page";\n
// Supsended until modification_date is handled for synchronization\n
//doc.modification_date = today.getDate()\n
// + \'/\' + (today.getMonth() - 2)\n
// + \'/\' + today.getFullYear();\n
for (i = 0; i < submit_event.target.length; i += 1) {\n
// XXX Should check input type instead\n
if (submit_event.target[i].name) {\n
......@@ -205,7 +210,7 @@
gadget.props.element.innerHTML = html;\n
return gadget.updateHeader({\n
title: options.doc.title + " | Web Page",\n
back_url: "#text_editor_list",\n
back_url: "#page=text_editor_list",\n
panel_action: false,\n
save_action: true\n
});\n
......@@ -320,12 +325,6 @@
<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>
......@@ -369,7 +368,7 @@
</tuple>
<state>
<tuple>
<float>1440171628.6</float>
<float>1442854047.94</float>
<string>UTC</string>
</tuple>
</state>
......@@ -414,7 +413,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.42760.43905.59050</string> </value>
<value> <string>945.61376.26272.49152</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -432,64 +431,7 @@
</tuple>
<state>
<tuple>
<float>1441963997.94</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>cedric.le.ninivin</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>