Commit f9435ae1 authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: using MappingStorge thx @vincentB

parent c7647853
...@@ -20,11 +20,8 @@ ...@@ -20,11 +20,8 @@
return { return {
type: "query", type: "query",
sub_storage: { sub_storage: {
type: "uuid", type: "indexeddb",
sub_storage: { database: 'officejs_' + name + '_cache_erp5'
type: "indexeddb",
database: 'officejs_' + name + '_cache_erp5'
}
} }
}; };
} }
...@@ -146,7 +143,7 @@ ...@@ -146,7 +143,7 @@
return jIO.createJIO({ return jIO.createJIO({
type: "replicate", type: "replicate",
query: { query: {
query: '(portal_type: ("Web Style", "Web Page", "Web Script")) AND ' + query: 'reference: "%" AND (portal_type: ("Web Style", "Web Page", "Web Script")) AND ' +
erp5_query + modification_date, erp5_query + modification_date,
limit: [0, 1234567890] limit: [0, 1234567890]
}, },
...@@ -158,26 +155,22 @@ ...@@ -158,26 +155,22 @@
check_remote_modification: true, check_remote_modification: true,
check_remote_creation: true, check_remote_creation: true,
check_remote_deletion: true, check_remote_deletion: true,
local_sub_storage: { //use_bulk_get: true,
type: "attachasproperty", use_bulk: false,
map: { local_sub_storage: get_jio_cache_storage(name),
text_content: {
body_name: "text_content",
content_type_name: "content_type"
},
data: {
body_name: "data",
content_type_name: "content_type"
}
},
sub_storage: get_jio_cache_storage(name)
},
remote_sub_storage: { remote_sub_storage: {
type: "erp5", type: "mapping",
url: (new URI("hateoasnoauth")) sub_storage: {
.absoluteTo(location.href) type: "erp5",
.toString(), url: (new URI("hateoasnoauth"))
default_view_reference: "jio_view" .absoluteTo(location.href)
.toString(),
default_view_reference: "jio_view"
},
mapping_dict: {"id": {
"equal": "url_string",
"default_property": "reference"
}}
} }
}); });
} }
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>955.8487.48731.31863</string> </value> <value> <string>955.20973.48171.43827</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1478563709.48</float> <float>1480578496.19</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, jIO, URI, location, console, document, RSVP, loopEventListener, navigator, XMLHttpRequest, ProgressEvent */ /*global window, rJS, jIO, URI, location, console, document, RSVP, loopEventListener, navigator, XMLHttpRequest, ProgressEvent*/
/*jslint nomen: true, indent: 2, maxerr: 15*/ /*jslint nomen: true, indent: 2*/
(function (window, rJS) { (function (window, rJS) {
"use strict"; "use strict";
...@@ -13,11 +13,8 @@ ...@@ -13,11 +13,8 @@
return { return {
type: "query", type: "query",
sub_storage: { sub_storage: {
type: "uuid", type: "indexeddb",
sub_storage: { database: 'officejs_' + name + '_cache_erp5'
type: "indexeddb",
database: 'officejs_' + name + '_cache_erp5'
}
} }
}; };
} }
...@@ -139,7 +136,7 @@ ...@@ -139,7 +136,7 @@
return jIO.createJIO({ return jIO.createJIO({
type: "replicate", type: "replicate",
query: { query: {
query: '(portal_type: ("Web Style", "Web Page", "Web Script")) AND ' + query: 'reference: "%" AND (portal_type: ("Web Style", "Web Page", "Web Script")) AND ' +
erp5_query + modification_date, erp5_query + modification_date,
limit: [0, 1234567890] limit: [0, 1234567890]
}, },
...@@ -151,26 +148,22 @@ ...@@ -151,26 +148,22 @@
check_remote_modification: true, check_remote_modification: true,
check_remote_creation: true, check_remote_creation: true,
check_remote_deletion: true, check_remote_deletion: true,
local_sub_storage: { //use_bulk_get: true,
type: "attachasproperty", use_bulk: false,
map: { local_sub_storage: get_jio_cache_storage(name),
text_content: {
body_name: "text_content",
content_type_name: "content_type"
},
data: {
body_name: "data",
content_type_name: "content_type"
}
},
sub_storage: get_jio_cache_storage(name)
},
remote_sub_storage: { remote_sub_storage: {
type: "erp5", type: "mapping",
url: (new URI("hateoasnoauth")) sub_storage: {
.absoluteTo(location.href) type: "erp5",
.toString(), url: (new URI("hateoasnoauth"))
default_view_reference: "jio_view" .absoluteTo(location.href)
.toString(),
default_view_reference: "jio_view"
},
mapping_dict: {"id": {
"equal": "url_string",
"default_property": "reference"
}}
} }
}); });
} }
...@@ -416,4 +409,4 @@ ...@@ -416,4 +409,4 @@
}); });
}); });
}(window, rJS)); }(window, rJS));
\ No newline at end of file
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>955.22065.61366.57770</string> </value> <value> <string>955.40145.23133.18397</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1479378360.51</float> <float>1480578663.21</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>955.630.63038.16349</string> </value> <value> <string>955.40147.13377.15940</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1478729480.3</float> <float>1480529399.17</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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