Commit 448c8af0 authored by Roque's avatar Roque

erp5_officejs: fix in appcachestorage sync

parent 310f3338
......@@ -221,17 +221,28 @@ gadget_officejs_setting.html\n
officejs_logo_text_editor.png\n
\n
#discussion tool\n
jio_appcachestorage.js\n
gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
#gadget_erp5_pt_form_view_editable.html\n
#gadget_erp5_pt_form_view_editable.js\n
gadget_officejs_discussion_tool_router.html\n
\n
#needed for appcachestorage sync\n
/\n
app/\n
gadget_officejs_discussion_tool.configuration\n
gadget_officejs_discussion_tool.json\n
gadget_officejs_bootloader.js\n
gadget_officejs_bootloader_presentation.html\n
gadget_officejs_bootloader_presentation.js\n
gadget_officejs_bootloader_presentation.css\n
gadget_officejs_bootloader_serviceworker.js\n
officejs_logo.png\n
jio_appcachestorage.js\n
\n
#configuration resources\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewAsJio&view=jio_view\n
\n
\n
#gadget_erp5_page_ojs_controller.html\n
#gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_post_list.html\n
gadget_erp5_page_ojs_post_list.js\n
gadget_erp5_page_ojs_add_post.html\n
......@@ -722,7 +733,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.23087.41251.34321</string> </value>
<value> <string>974.28677.41110.58265</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -740,7 +751,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1552654934.35</float>
<float>1552930907.35</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -262,7 +262,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.22751.14721.17885</string> </value>
<value> <string>974.28632.10387.52002</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -280,7 +280,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1552575389.52</float>
<float>1552929997.96</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -77,8 +77,8 @@
var gadget = this,
origin_url = window.location.protocol + "//" + window.location.hostname + window.location.pathname,
prefix = "./",
// TODO these values should come from gadget.props.cache_file/version -add script in html body
version = "app/",
hateoas_script = "hateoas/ERP5Document_getHateoas",
// TODO manifest should come from gadget.props.cache_file -add script in html body
manifest = "gadget_officejs_discussion_tool.configuration",
// TODO review this storage because is not necessary to save the attachments into data storage
// it should be enough with only the appcache (and a aux local storage) in order to get the attachments
......@@ -106,7 +106,6 @@
remote_sub_storage: {
type: "appcache",
manifest: manifest,
version: version,
origin_url: origin_url
}
}, appcache_storage,
......@@ -140,10 +139,9 @@
.push(function (attachment_dict) {
return new RSVP.Queue()
.push(function () {
var promise_list = [], i = 0,
blob_urls = [prefix + "/", prefix + version, prefix + version + manifest];
var promise_list = [], i = 0;
for (var id in attachment_dict) {
if (blob_urls.indexOf(id) >= 0) {
if (id.indexOf(hateoas_script) === -1) {
promise_list.push(appcache_storage.getAttachment(origin_url, id));
} else {
promise_list.push(appcache_storage.getAttachment(origin_url, id, {"format": "json"}));
......@@ -173,7 +171,7 @@
});
}, function (error) {
console.log("Error while appcache-local storage synchronization");
console.log(error);
throw error;
});
});
});
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.24123.33456.1297</string> </value>
<value> <string>974.28676.40020.52309</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1552673890.26</float>
<float>1552931000.35</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,5 +14,14 @@
</head>
<body>
<form novalidate>
<button type="submit" class="ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<!--
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="erp5_form"
data-gadget-sandbox="public">
</div>
-->
</form>
</body>
</html>
\ No newline at end of file
......@@ -229,7 +229,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>973.44981.11075.37051</string> </value>
<value> <string>974.24313.14346.54886</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -247,7 +247,7 @@
</tuple>
<state>
<tuple>
<float>1551184378.85</float>
<float>1552670110.32</float>
<string>UTC</string>
</tuple>
</state>
......
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