Commit 807b1fe0 authored by Roque's avatar Roque

Officejs: migrate from cache manifest to service worker

Drop appcache use in all OfficeJS application

See merge request !1091
parents 44a13278 cf477758
Pipeline #9439 passed with stage
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<script src="${latest_version}/rsvp.js"></script> <script src="${latest_version}/rsvp.js"></script>
<script src="${latest_version}/renderjs.js"></script> <script src="${latest_version}/renderjs.js"></script>
<script src="${latest_version}/jiodev.js"></script> <script src="${latest_version}/jiodev.js"></script>
<script src="jio_appcachestorage.js"></script> <script src="jio_precachestorage.js"></script>
<script src="gadget_officejs_bootloader.js"></script> <script src="gadget_officejs_bootloader.js"></script>
</head> </head>
......
...@@ -159,11 +159,13 @@ ...@@ -159,11 +159,13 @@
</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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -207,16 +209,20 @@ ...@@ -207,16 +209,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -239,7 +245,7 @@ ...@@ -239,7 +245,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>967.13437.59295.35805</string> </value> <value> <string>983.5704.62351.904</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +263,7 @@ ...@@ -257,7 +263,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1525098912.16</float> <float>1587737022.07</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -266,16 +272,20 @@ ...@@ -266,16 +272,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -323,7 +333,9 @@ ...@@ -323,7 +333,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
...@@ -36,7 +36,7 @@ var repair = false; ...@@ -36,7 +36,7 @@ var repair = false;
} }
}, },
remote_sub_storage: { remote_sub_storage: {
type: "appcache", type: "precache",
manifest: gadget.props.cache_file, manifest: gadget.props.cache_file,
version: gadget.props.version_url, version: gadget.props.version_url,
take_installer: true take_installer: true
......
...@@ -154,11 +154,13 @@ ...@@ -154,11 +154,13 @@
</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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -202,16 +204,20 @@ ...@@ -202,16 +204,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -234,7 +240,7 @@ ...@@ -234,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>967.24634.17714.15001</string> </value> <value> <string>983.27330.42899.26726</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +258,7 @@ ...@@ -252,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543506463.01</float> <float>1587734784.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -261,16 +267,20 @@ ...@@ -261,16 +267,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -318,7 +328,9 @@ ...@@ -318,7 +328,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
/*jslint indent:2, maxlen: 80, nomen: true */
/*global jIO, RSVP, window, Rusha, Blob, URL, console */
(function (window, jIO, RSVP, Rusha, Blob, URL, console) {
"use strict";
var rusha = new Rusha();
function PreCacheStorage(spec) {
this._precache_manifest_script = spec.manifest;
this._take_installer = spec.take_installer || false;
this._origin_url = spec.origin_url !== undefined ?
spec.origin_url : window.location.href;
this._version = spec.version || "";
this._prefix = spec.prefix || "./";
this._documents = {};
// Harcoded here, find a better way.
if (this._take_installer) {
this._relative_url_list = [
this._prefix,
this._prefix + "gadget_officejs_bootloader.js",
this._prefix + "gadget_officejs_bootloader.html",
this._prefix + "gadget_officejs_bootloader_presentation.html",
this._prefix + "gadget_officejs_bootloader_presentation.js",
this._prefix + "gadget_officejs_bootloader_presentation.css",
this._prefix + "gadget_officejs_bootloader_serviceworker.js",
this._prefix + "gadget_erp5_nojqm.css",
this._prefix + "officejs_logo.png",
this._prefix + "jio_precachestorage.js"
];
} else {
this._relative_url_list = [this._prefix + "/"];
}
if (this._take_installer) {
this._version = 'app/';
}
this._version = this._prefix + this._version;
}
PreCacheStorage.prototype.get = function (id) {
if (this._documents.hasOwnProperty(id)) {
return this._documents[id];
}
throw new jIO.util.jIOError('can not find document : ' + id, 404);
};
PreCacheStorage.prototype.hasCapacity = function () {
return true;
};
PreCacheStorage.prototype.getAttachment = function (origin_url,
relative_url) {
return new RSVP.Queue()
.push(function () {
return jIO.util.ajax({
type: "GET",
url: new URL(relative_url, origin_url),
dataType: "blob"
});
})
.push(function (result) {
return result.target.response;
});
};
PreCacheStorage.prototype.allAttachments = function (id) {
if (id === this._origin_url) {
var result = {}, i, len = this._relative_url_list.length;
for (i = 0; i < len; i += 1) {
result[this._relative_url_list[i]] = {};
}
return result;
}
return [];
};
PreCacheStorage.prototype.buildQuery = function () {
var result = [], id;
for (id in this._documents) {
if (this._documents.hasOwnProperty(id)) {
result.push({
'id': id,
'value': this._documents[id],
'doc': this._documents[id]
});
}
}
return result;
};
PreCacheStorage.prototype.repair = function () {
var storage = this, url;
return new RSVP.Queue()
.push(function () {
return jIO.util.ajax({
type: "GET",
url: new URL(storage._precache_manifest_script,
new URL(storage._version, storage._origin_url))
});
})
.push(function (response) {
var base_manifest_text = response.target.responseText,
relative_url_list,
i,
hash = rusha.digestFromString(base_manifest_text +
response.target
.getResponseHeader("ETag"));
relative_url_list = Object.keys(JSON.parse(base_manifest_text));
storage._relative_url_list.push(storage._version);
storage._relative_url_list.push(storage._version +
storage._precache_manifest_script);
storage._documents[storage._origin_url] = {'hash': hash};
for (i = 0; i < relative_url_list.length; i += 1) {
url = relative_url_list[i];
if (url.includes('?')) {
throw new Error("It is not allow to cache urls with parameters." +
" url: " + url);
}
storage._relative_url_list.push(
storage._version + url
);
}
}, function (error) {
if (error.target.status === 404 && !error.message) {
error.message = "Couldn't get the precache manifest '" +
storage._precache_manifest_script + "'";
}
throw error;
});
};
jIO.addStorage('precache', PreCacheStorage);
}(window, jIO, RSVP, Rusha, Blob, URL, console));
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="Web Manifest" module="erp5.portal_type"/> <global name="Web Script" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -64,9 +64,7 @@ ...@@ -64,9 +64,7 @@
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple/>
<string>contributor/person_module/1</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -75,13 +73,9 @@ ...@@ -75,13 +73,9 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_drive_app.appcache</string> </value> <value> <string>jio_precachestorage.js</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -91,7 +85,7 @@ ...@@ -91,7 +85,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_drive_app_appcache</string> </value> <value> <string>gadget_officejs_jio_precachestorage_js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -99,7 +93,7 @@ ...@@ -99,7 +93,7 @@
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Manifest</string> </value> <value> <string>Web Script</string> </value>
</item> </item>
<item> <item>
<key> <string>short_title</string> </key> <key> <string>short_title</string> </key>
...@@ -107,128 +101,9 @@ ...@@ -107,128 +101,9 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n
# generated on Fri, 5 Sep 2017 16:00:33 +0900\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
font-awesome/font-awesome.css\n
font-awesome/font-awesome-webfont.eot\n
font-awesome/font-awesome-webfont.woff\n
font-awesome/font-awesome-webfont.woff2\n
font-awesome/font-awesome-webfont.ttf\n
font-awesome/font-awesome-webfont.svg\n
gadget_erp5_nojqm.css\n
jio_ojs_storage.js\n
gadget_erp5_global.js\n
URI.js\n
dygraph.js\n
handlebars.js\n
domsugar.js\n
jiodev.js\n
renderjs.js\n
rsvp.js\n
gadget_global.js\n
erp5_launcher_nojqm.js\n
gadget_officejs_router.js\n
gadget_erp5_router.html\n
gadget_erp5_router.js\n
gadget_officejs_liberator.html\n
gadget_officejs_liberator.js\n
gadget_jio.html\n
gadget_jio.js\n
gadget_translate.html\n
gadget_translate.js\n
gadget_translation.html\n
gadget_translation.js\n
gadget_translation_data.js\n
gadget_erp5_editor_panel.html\n
gadget_erp5_editor_panel.js\n
gadget_erp5_drive_app_panel.html\n
gadget_erp5_drive_app_panel.js\n
gadget_erp5_header.html\n
gadget_erp5_header.js\n
gadget_drive_app_jio.html\n
gadget_drive_app_jio.js\n
gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_drive_app_add_document.html\n
gadget_erp5_page_drive_app_add_document.js\n
gadget_erp5_page_drive_app_configurator.html\n
gadget_erp5_page_drive_app_configurator.js\n
gadget_erp5_page_ojs_sync.html\n
gadget_erp5_page_ojs_sync.js\n
gadget_erp5_page_drive_app_document_list.html\n
gadget_erp5_page_drive_app_document_list.js\n
gadget_drive_app_configurator_access.html\n
gadget_drive_app_configurator_access.js\n
gadget_html5_input.html\n
gadget_html5_input.js\n
gadget_erp5_field_multicheckbox.html\n
gadget_erp5_field_multicheckbox.js\n
gadget_erp5_searchfield.html\n
gadget_erp5_searchfield.js\n
gadget_erp5_pt_form_list.html\n
gadget_erp5_pt_form_list.js\n
gadget_erp5_form.html\n
gadget_erp5_form.js\n
gadget_erp5_label_field.html\n
gadget_erp5_label_field.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_datetime.html\n
gadget_erp5_field_datetime.js\n
gadget_html5_element.html\n
gadget_html5_element.js\n
gadget_erp5_notification.html\n
gadget_erp5_notification.js\n
gadget_erp5_field_string.html\n
gadget_erp5_field_string.js\n
gadget_erp5_field_editor.html\n
gadget_erp5_field_editor.js\n
gadget_erp5_field_gadget.html\n
gadget_erp5_field_gadget.js\n
gadget_erp5_search_editor.html\n
gadget_erp5_search_editor.js\n
gadget_erp5_sort_editor.html\n
gadget_erp5_sort_editor.js\n
gadget_erp5_field_password.html\n
gadget_erp5_field_password.js\n
gadget_erp5_page_ojs_configurator.html\n
gadget_erp5_page_ojs_configurator.js\n
gadget_ojs_configurator_access.html\n
gadget_ojs_configurator_access.js\n
gadget_erp5_field_list.html\n
gadget_erp5_field_list.js\n
gadget_html5_select.html\n
gadget_html5_select.js\n
gadget_html5_textarea.html\n
gadget_html5_textarea.js\n
gadget_erp5_field_integer.html\n
gadget_erp5_field_integer.js\n
gadget_erp5_field_textarea.html\n
gadget_erp5_field_textarea.js\n
gadget_erp5_field_radio.html\n
gadget_erp5_field_radio.js\n
gadget_officejs_bootloader_serviceworker.js\n
gadget_erp5_page_drive_app_car.html\n
gadget_erp5_page_drive_app_car.js\n
drive_app_landing_page.html\n
gadget_officejs_drive_app_router.html\n
gadget_officejs_jio_drive_record_view.html\n
gadget_officejs_jio_drive_record_view.js\n
\n
#setting\n
gadget_officejs_setting.js\n
gadget_officejs_setting.html\n
NETWORK:\n
*</string> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Drive App Gadget OfficeJS AppCache</string> </value> <value> <string>jio_precachestorage.js</string> </value>
</item> </item>
<item> <item>
<key> <string>url_string</string> </key> <key> <string>url_string</string> </key>
...@@ -322,7 +197,7 @@ NETWORK:\n ...@@ -322,7 +197,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1503461993.92</float> <float>1586165638.67</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -371,7 +246,7 @@ NETWORK:\n ...@@ -371,7 +246,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>977.38881.34981.23125</string> </value> <value> <string>983.46175.933.7662</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -389,7 +264,7 @@ NETWORK:\n ...@@ -389,7 +264,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1582043052.59</float> <float>1588765387.52</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -450,7 +325,7 @@ NETWORK:\n ...@@ -450,7 +325,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1503459831.13</float> <float>1586165299.65</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -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,11 +149,13 @@ ...@@ -149,11 +149,13 @@
</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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -197,16 +199,20 @@ ...@@ -197,16 +199,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -229,7 +235,7 @@ ...@@ -229,7 +235,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.27017.22588.52565</string> </value> <value> <string>979.3226.30420.13465</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -247,7 +253,7 @@ ...@@ -247,7 +253,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1537537669.28</float> <float>1586167074.77</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -256,16 +262,20 @@ ...@@ -256,16 +262,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -313,7 +323,9 @@ ...@@ -313,7 +323,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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,11 +172,13 @@ ...@@ -172,11 +172,13 @@
</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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -220,16 +222,20 @@ ...@@ -220,16 +222,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -252,7 +258,7 @@ ...@@ -252,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.27017.22588.52565</string> </value> <value> <string>983.24635.55687.32341</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +276,7 @@ ...@@ -270,7 +276,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1537537740.22</float> <float>1587979974.43</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -279,16 +285,20 @@ ...@@ -279,16 +285,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -336,7 +346,9 @@ ...@@ -336,7 +346,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
</item> </item>
<item> <item>
<key> <string>configuration_cache_file</string> </key> <key> <string>configuration_cache_file</string> </key>
<value> <string>gadget_officejs_bookmark_manager.appcache</string> </value> <value> <string>WebSection_getPrecacheManifest</string> </value>
</item> </item>
<item> <item>
<key> <string>configuration_content_security_policy</string> </key> <key> <string>configuration_content_security_policy</string> </key>
...@@ -449,7 +449,7 @@ ...@@ -449,7 +449,7 @@
</item> </item>
<item> <item>
<key> <string>configuration_manifest_url</string> </key> <key> <string>configuration_manifest_url</string> </key>
<value> <string>gadget_officejs_bookmark_manager.appcache</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>configuration_panel_gadget_url</string> </key> <key> <string>configuration_panel_gadget_url</string> </key>
...@@ -638,11 +638,13 @@ ...@@ -638,11 +638,13 @@
</record> </record>
<record id="9" aka="AAAAAAAAAAk="> <record id="9" aka="AAAAAAAAAAk=">
<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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -686,16 +688,20 @@ ...@@ -686,16 +688,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="10" aka="AAAAAAAAAAo="> <record id="10" aka="AAAAAAAAAAo=">
<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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -718,7 +724,7 @@ ...@@ -718,7 +724,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.16291.54139.21060</string> </value> <value> <string>979.3226.30420.13465</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -736,7 +742,7 @@ ...@@ -736,7 +742,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1502106563.18</float> <float>1587726298.29</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -745,7 +751,9 @@ ...@@ -745,7 +751,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
...@@ -289,6 +289,16 @@ ...@@ -289,6 +289,16 @@
<value> <string>string</string> </value> <value> <string>string</string> </value>
</item> </item>
</dictionary> </dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_precache_manifest_script_list</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -341,12 +351,19 @@ ...@@ -341,12 +351,19 @@
</item> </item>
<item> <item>
<key> <string>configuration_manifest_url</string> </key> <key> <string>configuration_manifest_url</string> </key>
<value> <string>gadget_officejs_bookmark_manager.appcache</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>configuration_panel_gadget_url</string> </key> <key> <string>configuration_panel_gadget_url</string> </key>
<value> <string>gadget_erp5_ojs_bookmark_panel.html</string> </value> <value> <string>gadget_erp5_ojs_bookmark_panel.html</string> </value>
</item> </item>
<item>
<key> <string>configuration_precache_manifest_script_list</string> </key>
<value> <string>WebSection_getOfficeJsPrecacheManifestList\n
WebSection_getBookmarkManagerPrecacheManifestList</string> </value>
</item>
<item> <item>
<key> <string>configuration_router_gadget_url</string> </key> <key> <string>configuration_router_gadget_url</string> </key>
<value> <string>gadget_officejs_bookmark_manager_router.html</string> </value> <value> <string>gadget_officejs_bookmark_manager_router.html</string> </value>
...@@ -514,11 +531,13 @@ ...@@ -514,11 +531,13 @@
</record> </record>
<record id="6" aka="AAAAAAAAAAY="> <record id="6" aka="AAAAAAAAAAY=">
<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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -562,16 +581,20 @@ ...@@ -562,16 +581,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="7" aka="AAAAAAAAAAc="> <record id="7" aka="AAAAAAAAAAc=">
<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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -594,7 +617,7 @@ ...@@ -594,7 +617,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.56847.37331.36710</string> </value> <value> <string>983.27429.10249.37171</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -612,7 +635,7 @@ ...@@ -612,7 +635,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1504539819.0</float> <float>1587974231.45</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -621,7 +644,9 @@ ...@@ -621,7 +644,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
</item> </item>
<item> <item>
<key> <string>configuration_cache_file</string> </key> <key> <string>configuration_cache_file</string> </key>
<value> <string>gadget_officejs_codemirror.appcache</string> </value> <value> <string>WebSection_getPrecacheManifest</string> </value>
</item> </item>
<item> <item>
<key> <string>configuration_content_security_policy</string> </key> <key> <string>configuration_content_security_policy</string> </key>
...@@ -473,7 +473,7 @@ ...@@ -473,7 +473,7 @@
</item> </item>
<item> <item>
<key> <string>configuration_manifest_url</string> </key> <key> <string>configuration_manifest_url</string> </key>
<value> <string>gadget_officejs.appcache</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>configuration_panel_gadget_url</string> </key> <key> <string>configuration_panel_gadget_url</string> </key>
...@@ -666,11 +666,13 @@ ...@@ -666,11 +666,13 @@
</record> </record>
<record id="9" aka="AAAAAAAAAAk="> <record id="9" aka="AAAAAAAAAAk=">
<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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -714,16 +716,20 @@ ...@@ -714,16 +716,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="10" aka="AAAAAAAAAAo="> <record id="10" aka="AAAAAAAAAAo=">
<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>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -746,7 +752,7 @@ ...@@ -746,7 +752,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.50798.33418.15411</string> </value> <value> <string>979.3226.30420.13465</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -764,7 +770,7 @@ ...@@ -764,7 +770,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1566301713.02</float> <float>1587472024.47</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -773,7 +779,9 @@ ...@@ -773,7 +779,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
url_list = [
#code mirror specific
"gadget_officejs_codemirror.configuration",
"officejs_javascript_editor_icon.png",
"gadget_officejs_json_manifest_javascript_editor.json",
"gadget_officejs_codemirror_router.html",
"gadget_officejs_jio_web_script_view.html",
"gadget_officejs_jio_web_script_view.js",
]
return url_list
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_createAppConfigurationManifest</string> </value> <value> <string>WebSection_getBase64ConfigurationUrlList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
This diff is collapsed.
This diff is collapsed.
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