Commit 6900195c authored by Roque's avatar Roque

erp5_officejs: update exporter app to use new precache storage to generate the app zip files

parent e594e132
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<script src="zipfilestorage-with-jszip.js"></script> <script src="zipfilestorage-with-jszip.js"></script>
<script src="jio_filesystemstorage.js"></script> <script src="jio_filesystemstorage.js"></script>
<script src="jio_appcachestorage.js"></script> <script src="jio_appcachestorage.js"></script>
<script src="jio_precachestorage.js"></script>
</head> </head>
......
...@@ -149,171 +149,183 @@ ...@@ -149,171 +149,183 @@
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>publish</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>publish</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>comment</string> </key>
<item> <value> <string></string> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1491395389.96</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1491395389.96</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
<item> </value>
<key> <string>validation_state</string> </key> </item>
<value> <string>published</string> </value> <item>
</item> <key> <string>validation_state</string> </key>
</dictionary> <value> <string>published</string> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>edit</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>edit</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <item>
<none/> <key> <string>comment</string> </key>
</value> <value>
</item> <none/>
<item> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>serial</string> </key> </item>
<value> <string>970.27017.22588.52565</string> </value> <item>
</item> <key> <string>serial</string> </key>
<item> <value> <string>979.3226.30420.13465</string> </value>
<key> <string>state</string> </key> </item>
<value> <string>current</string> </value> <item>
</item> <key> <string>state</string> </key>
<item> <value> <string>current</string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1537537669.28</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1586167074.77</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
</dictionary> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU="> <record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>detect_converted_file</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>detect_converted_file</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>comment</string> </key>
<item> <value> <string></string> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>external_processing_state</string> </key> </item>
<value> <string>converted</string> </value> <item>
</item> <key> <string>external_processing_state</string> </key>
<item> <value> <string>converted</string> </value>
<key> <string>serial</string> </key> </item>
<value> <string>0.0.0.0</string> </value> <item>
</item> <key> <string>serial</string> </key>
<item> <value> <string>0.0.0.0</string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1491395255.14</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1491395255.14</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
</dictionary> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
...@@ -6,18 +6,23 @@ ...@@ -6,18 +6,23 @@
var origin_url = (window.location.origin + window.location.pathname) var origin_url = (window.location.origin + window.location.pathname)
.replace("officejs_export/", ""), .replace("officejs_export/", ""),
precache_manifest = "WebSection_getPrecacheManifest",
//TODO get rid of this old HARDCODED app dict and get everything from config
application_dict = { application_dict = {
"Text Editor": { "Text Editor": {
"url": "officejs_text_editor/", "url": "officejs_text_editor/",
"cache": "gadget_officejs_text_editor.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Smart Assistant": { "Smart Assistant": {
"url": "officejs_smart_assistant/", "url": "officejs_smart_assistant/",
"cache": "gadget_smart_assistant.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Media Player": { "Media Player": {
"url": "officejs_media_player/", "url": "officejs_media_player/",
"cache": "gadget_officejs_media_player.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Notebook": { "Notebook": {
"url": "officejs_notebook/", "url": "officejs_notebook/",
...@@ -25,11 +30,13 @@ ...@@ -25,11 +30,13 @@
}, },
"Illustration Editor": { "Illustration Editor": {
"url": "officejs_svg_editor/", "url": "officejs_svg_editor/",
"cache": "gadget_officejs_illustration.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"PDF Viewer": { "PDF Viewer": {
"url": "officejs_pdf_viewer/", "url": "officejs_pdf_viewer/",
"cache": "gadget_officejs_pdf_viewer.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Cribjs": { "Cribjs": {
"url": "officejs_cribjs/", "url": "officejs_cribjs/",
...@@ -37,31 +44,38 @@ ...@@ -37,31 +44,38 @@
}, },
"Bookmark Manager": { "Bookmark Manager": {
"url": "officejs_bookmark_manager/", "url": "officejs_bookmark_manager/",
"cache" : "gadget_officejs_bookmark_manager.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Onlyoffice Text": { "Onlyoffice Text": {
"url": "ooffice_text/", "url": "ooffice_text/",
"cache": "gadget_ooffice_text.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Onlyoffice Spreadsheet": { "Onlyoffice Spreadsheet": {
"url": "ooffice_spreadsheet/", "url": "ooffice_spreadsheet/",
"cache": "gadget_ooffice_spreadsheet.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Onlyoffice Presentation": { "Onlyoffice Presentation": {
"url": "ooffice_presentation/", "url": "ooffice_presentation/",
"cache": "gadget_ooffice_presentation.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Web Table Editor": { "Web Table Editor": {
"url": "officejs_web_table_editor/", "url": "officejs_web_table_editor/",
"cache": "gadget_officejs_web_table.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Image Editor": { "Image Editor": {
"url": "officejs_image_editor/", "url": "officejs_image_editor/",
"cache": "gadget_officejs_image_editor.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Awesome Free Software Publisher List": { "Awesome Free Software Publisher List": {
"url": "afs/", "url": "afs/",
"cache": "gadget_erp5_afs.appcache", "storage_type": "precache",
"cache": precache_manifest,
"no_installer": true "no_installer": true
}, },
"Jabber Client": { "Jabber Client": {
...@@ -99,7 +113,8 @@ ...@@ -99,7 +113,8 @@
}, },
"Drive App": { "Drive App": {
"url": "officejs_drive_app/", "url": "officejs_drive_app/",
"cache": "gadget_officejs_drive_app.appcache" "storage_type": "precache",
"cache": precache_manifest
}, },
"Travel Expense": { "Travel Expense": {
"url": "officejs_hr/", "url": "officejs_hr/",
...@@ -108,7 +123,8 @@ ...@@ -108,7 +123,8 @@
}, },
"Javascript editor (CodeMirror)": { "Javascript editor (CodeMirror)": {
"url": "officejs_codemirror/", "url": "officejs_codemirror/",
"cache": "gadget_officejs_codemirror.appcache" "storage_type": "precache",
"cache": precache_manifest
} }
}; };
...@@ -125,7 +141,8 @@ ...@@ -125,7 +141,8 @@
app = application_dict[form_result.web_site]; app = application_dict[form_result.web_site];
zip_name = form_result.filename; zip_name = form_result.filename;
return gadget.fillZip(app.cache, origin_url + app.url, app.no_installer) return gadget.fillZip(app.storage_type, app.cache, origin_url + app.url,
app.no_installer)
.push(function (zip_file) { .push(function (zip_file) {
var element = gadget.element, var element = gadget.element,
a = document.createElement("a"), a = document.createElement("a"),
...@@ -146,7 +163,8 @@ ...@@ -146,7 +163,8 @@
.ready(function (g) { .ready(function (g) {
g.props = {}; g.props = {};
}) })
.declareMethod("fillZip", function (cache_file, site_url, no_installer) { .declareMethod("fillZip", function (storage_type, cache_file, site_url,
no_installer) {
var file_storage = jIO.createJIO({ var file_storage = jIO.createJIO({
type: "replicate", type: "replicate",
conflict_handling: 2, conflict_handling: 2,
...@@ -160,7 +178,8 @@ ...@@ -160,7 +178,8 @@
type: "filesystem", type: "filesystem",
document: site_url, document: site_url,
sub_storage: { sub_storage: {
type: "appcache", //keep appcache as default for backward compatibility
type: storage_type || "appcache",
take_installer: no_installer === undefined, take_installer: no_installer === undefined,
manifest: cache_file, manifest: cache_file,
origin_url: site_url, origin_url: site_url,
......
...@@ -172,171 +172,183 @@ ...@@ -172,171 +172,183 @@
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>publish</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>publish</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>comment</string> </key>
<item> <value> <string></string> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1491395384.2</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1491395384.2</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
<item> </value>
<key> <string>validation_state</string> </key> </item>
<value> <string>published</string> </value> <item>
</item> <key> <string>validation_state</string> </key>
</dictionary> <value> <string>published</string> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>edit</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>edit</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <item>
<none/> <key> <string>comment</string> </key>
</value> <value>
</item> <none/>
<item> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>serial</string> </key> </item>
<value> <string>970.27017.22588.52565</string> </value> <item>
</item> <key> <string>serial</string> </key>
<item> <value> <string>983.24635.55687.32341</string> </value>
<key> <string>state</string> </key> </item>
<value> <string>current</string> </value> <item>
</item> <key> <string>state</string> </key>
<item> <value> <string>current</string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1537537740.22</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1587979974.43</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
</dictionary> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU="> <record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>detect_converted_file</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>detect_converted_file</string> </value>
<key> <string>actor</string> </key> </item>
<value> <string>zope</string> </value> <item>
</item> <key> <string>actor</string> </key>
<item> <value> <string>zope</string> </value>
<key> <string>comment</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>comment</string> </key>
<item> <value> <string></string> </value>
<key> <string>error_message</string> </key> </item>
<value> <string></string> </value> <item>
</item> <key> <string>error_message</string> </key>
<item> <value> <string></string> </value>
<key> <string>external_processing_state</string> </key> </item>
<value> <string>converted</string> </value> <item>
</item> <key> <string>external_processing_state</string> </key>
<item> <value> <string>converted</string> </value>
<key> <string>serial</string> </key> </item>
<value> <string>0.0.0.0</string> </value> <item>
</item> <key> <string>serial</string> </key>
<item> <value> <string>0.0.0.0</string> </value>
<key> <string>time</string> </key> </item>
<value> <item>
<object> <key> <string>time</string> </key>
<klass> <value>
<global name="DateTime" module="DateTime.DateTime"/> <object>
</klass> <klass>
<tuple> <global name="DateTime" module="DateTime.DateTime"/>
<none/> </klass>
</tuple> <tuple>
<state> <none/>
<tuple> </tuple>
<float>1491394589.6</float> <state>
<string>UTC</string> <tuple>
</tuple> <float>1491394589.6</float>
</state> <string>UTC</string>
</object> </tuple>
</value> </state>
</item> </object>
</dictionary> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </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