Commit 1dc6125d authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs] Limite signature storage to one bootloader

fix attachment parallel synchronization issue
parent a7bb5b65
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,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_limitalldocsstorage.js"></script>
<script src="jio_appcachestorage.js"></script> <script src="jio_appcachestorage.js"></script>
<script src="gadget_officejs_bootloader.js"></script> <script src="gadget_officejs_bootloader.js"></script>
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>vincent</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.50636.39446.44697</string> </value> <value> <string>963.23296.14479.51302</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1504537605.24</float> <float>1510305002.75</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -19,10 +19,14 @@ var repair = false; ...@@ -19,10 +19,14 @@ var repair = false;
check_local_deletion: false, check_local_deletion: false,
check_local_modification: false, check_local_modification: false,
signature_sub_storage: { signature_sub_storage: {
type: "query", type: "limitalldocs",
document: window.location.href,
sub_storage: { sub_storage: {
type: "indexeddb", type: "query",
database: "officejs-hash" sub_storage: {
type: "indexeddb",
database: "officejs-hash"
}
} }
}, },
local_sub_storage: { local_sub_storage: {
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.20662.59245.4181</string> </value> <value> <string>963.23305.42668.58504</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1510149659.24</float> <float>1510305608.12</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
this._prefix + "gadget_officejs_bootloader_serviceworker.js", this._prefix + "gadget_officejs_bootloader_serviceworker.js",
this._prefix + "gadget_erp5_nojqm.css", this._prefix + "gadget_erp5_nojqm.css",
this._prefix + "officejs_logo.png", this._prefix + "officejs_logo.png",
this._prefix + "jio_appcachestorage.js" this._prefix + "jio_appcachestorage.js",
this._prefix + "jio_limitalldocsstorage.js"
]; ];
} else { } else {
this._relative_url_list = [this._prefix + "/"]; this._relative_url_list = [this._prefix + "/"];
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.9196.27669.54835</string> </value> <value> <string>963.23286.30579.38041</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509459715.1</float> <float>1510304670.05</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*jslint indent:2, maxlen: 80, nomen: true */
/*global jIO */
(function (jIO) {
"use strict";
function LimitAllDocsStorage(spec) {
this._document = spec.document;
this._sub_storage = jIO.createJIO(spec.sub_storage);
}
LimitAllDocsStorage.prototype.get = function () {
return this._sub_storage.get.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.allAttachments = function () {
return this._sub_storage.allAttachments.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.post = function () {
return this._sub_storage.post.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.put = function () {
return this._sub_storage.put.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.remove = function () {
return this._sub_storage.remove.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.getAttachment = function () {
return this._sub_storage.getAttachment.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.putAttachment = function () {
return this._sub_storage.putAttachment.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.removeAttachment = function () {
return this._sub_storage.removeAttachment.apply(this._sub_storage,
arguments);
};
LimitAllDocsStorage.prototype.repair = function () {
return this._sub_storage.repair.apply(this._sub_storage, arguments);
};
LimitAllDocsStorage.prototype.hasCapacity = function (name) {
return this._sub_storage.hasCapacity(name);
};
LimitAllDocsStorage.prototype.buildQuery = function (options) {
var storage = this;
return this._sub_storage.allDocs(options)
.push(function (result) {
var i;
for (i = 0; i < result.data.total_rows; i += 1) {
if (result.data.rows[i].id === storage._document) {
return [result.data.rows[i]];
}
}
return [];
});
};
jIO.addStorage('limitalldocs', LimitAllDocsStorage);
}(jIO));
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