Commit d98b99d2 authored by Vincent Bechu's avatar Vincent Bechu Committed by Cédric Le Ninivin

erp5_officejs: replace reload by renderApplication

parent dea88e1a
...@@ -8,48 +8,53 @@ ...@@ -8,48 +8,53 @@
var erp5_url = gadget.props.element.querySelector("input[name='erp5_url']").value; var erp5_url = gadget.props.element.querySelector("input[name='erp5_url']").value;
return gadget.getSetting("portal_type") return gadget.getSetting("portal_type")
.push(function (portal_type) { .push(function (portal_type) {
var old_date = new Date(), return gadget.setSetting(
configuration = {}; 'jio_storage_description',
// We are looking for documents modified in the past 3 month {
old_date = new Date(old_date.getFullYear(), old_date.getMonth(), old_date.getDate() - 15); type: "replicate",
configuration = { use_remote_post: true,
type: "replicate", conflict_handling: 1,
// XXX This drop the signature lists... check_local_modification: true,
query: { check_local_creation: true,
query: 'portal_type:"' + portal_type check_local_deletion: false,
// XX Synchonizing the whole module is too much, here is a way to start quietly check_remote_modification: true,
// Supsended until modification_date is handled for synchronization check_remote_creation: true,
+ '" AND modification_date:>="' check_remote_deletion: true,
+ old_date.toISOString() + '" ', query: {
limit: [0, 1234567890] query: 'portal_type:"' + portal_type + '" '
}, },
use_remote_post: true, attachment_list: ["data"],
conflict_handling: 1, local_sub_storage: {
check_local_modification: true, type: "query",
check_local_creation: true,
check_local_deletion: false,
check_remote_modification: true,
check_remote_creation: true,
check_remote_deletion: true,
local_sub_storage: {
type: "query",
sub_storage: {
type: "uuid",
sub_storage: { sub_storage: {
type: "indexeddb", type: "uuid",
database: "officejs-erp5" sub_storage: {
type: "indexeddb",
database: "officejs-erp5"
}
}
},
remote_sub_storage: {
type: "mapping",
attachment_mapping_dict: {
"data": {
"get": {
"uri_template": (new URI("hateoas"))
.absoluteTo(erp5_url)
.toString() + "/{+id}?format="
}
}
},
sub_storage: {
type: "erp5",
url: (new URI("hateoas"))
.absoluteTo(erp5_url)
.toString(),
default_view_reference: "jio_view"
} }
} }
},
remote_sub_storage: {
type: "erp5",
url: (new URI("hateoas"))
.absoluteTo(erp5_url)
.toString(),
default_view_reference: "jio_view"
} }
}; );
return gadget.setSetting('jio_storage_description', configuration);
}) })
.push(function () { .push(function () {
return gadget.setSetting('jio_storage_name', "ERP5"); return gadget.setSetting('jio_storage_name', "ERP5");
...@@ -58,10 +63,7 @@ ...@@ -58,10 +63,7 @@
return gadget.setGlobalSetting('erp5_url', erp5_url); return gadget.setGlobalSetting('erp5_url', erp5_url);
}) })
.push(function () { .push(function () {
return gadget.reload(); return gadget.renderApplication({args:{page: 'sync', auto_repair: 'true'}});
})
.push(function () {
return gadget.redirect({page: 'sync', auto_repair: 'true'});
}); });
} }
...@@ -78,9 +80,9 @@ ...@@ -78,9 +80,9 @@
}) })
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("renderApplication","renderApplication")
.declareMethod("getGlobalSetting", function (key) { .declareMethod("getGlobalSetting", function (key) {
var gadget = this; var gadget = this;
return gadget.getDeclaredGadget("global_setting_gadget") return gadget.getDeclaredGadget("global_setting_gadget")
......
...@@ -138,11 +138,13 @@ ...@@ -138,11 +138,13 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS jIO ERP5 Configurator Page JS</string> </value> <value> <string>OfficeJS jIO ERP5 Configurator Page JS</string> </value>
</item> </item>
<item>
<key> <string>url_string</string> </key>
<value> <string>gadget_officejs_page_jio_erp5_configurator.js</string> </value>
</item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
<value> <value> <string>001</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
...@@ -269,7 +271,7 @@ ...@@ -269,7 +271,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.38591.30253.42973</string> </value> <value> <string>956.60.28713.5102</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +289,7 @@ ...@@ -287,7 +289,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1476438691.35</float> <float>1481903967.67</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