Commit 81326fc1 authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs] Add mapping storage in erp5 configurator to use fast synchro

parent 1e36b564
......@@ -55,12 +55,18 @@
}
},
local_sub_storage: {
type: "query",
type: "mapping",
property: {
"modification_date": ["formatDate", ["toISOString", "rfc822"]]
},
sub_storage: {
type: "uuid",
type: "query",
sub_storage: {
type: "indexeddb",
database: "officejs-erp5"
type: "uuid",
sub_storage: {
type: "indexeddb",
database: "officejs-erp5"
}
}
}
},
......
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.48087.30660.17442</string> </value>
<value> <string>961.48147.7132.45448</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1504015084.55</float>
<float>1504018485.52</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -133,6 +133,21 @@
}
}
}
},
"formatDate": {
"mapToSubProperty": function (property, sub_doc, doc, args) {
sub_doc[property] = (new Date(doc[property]))[args[0]]();
return property;
},
"mapToMainProperty": function (property, sub_doc, doc, args) {
if (args[1] === 'rfc822') {
doc[property] = (new Date(sub_doc[property]))
.toUTCString().replace('GMT', '+0000');
} else {
doc[property] = (new Date(sub_doc[property]))[args[1]]();
}
return property;
}
}
};
/*jslint unparam: false*/
......
......@@ -239,7 +239,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.25496.14411.56081</string> </value>
<value> <string>961.48123.48206.12014</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>1502900157.25</float>
<float>1504018014.82</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