Commit 674c2378 authored by Hardik Juneja's avatar Hardik Juneja

erp5_officejs: Add support for ERP5 as handshake option for webrtc page share

parent 09c9ae60
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
gadget.props.webrtc_share_name = webrtc_share_name; gadget.props.webrtc_share_name = webrtc_share_name;
return gadget.getSetting('webrtc_share_description') return gadget.getSetting('webrtc_share_description')
}) })
.push(function(webrtc_share_description){ .push(function(webrtc_share_description) {
if(window.location.hash) { if(window.location.hash) {
var index = window.location.hash.indexOf('room='), var index = window.location.hash.indexOf('room='),
type; type;
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
} }
); );
}) })
.push(function(g){ .push(function(g) {
var config; var config;
if (gadget.props.webrtc_share_name === "DAV") { if (gadget.props.webrtc_share_name === "DAV" || gadget.props.webrtc_share_name === "ERP5" ) {
type = "jio"; type = "jio";
config = webrtc_share_description.remote_sub_storage; config = webrtc_share_description.remote_sub_storage;
} else { } else {
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.15487.18741.41096</string> </value> <value> <string>954.35924.33648.64204</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1475137884.03</float> <float>1476277769.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>947.12629.17894.55808</string> </value> <value> <string>953.32434.36327.35225</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1448032104.14</float> <float>1475239510.96</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -77,6 +77,23 @@ ...@@ -77,6 +77,23 @@
return gadget.reload(); return gadget.reload();
}); });
} }
function setWebrtcShareConfiguration(gadget) {
var configuration = {
remote_sub_storage: {
type: "erp5",
url: (new URI("hateoas"))
.absoluteTo(location.href)
.toString(),
default_view_reference: "view"
}
};
return gadget.setSetting('webrtc_share_description', configuration)
.push(function () {
return gadget.setSetting('webrtc_share_name', "ERP5");
})
}
function setDAVConfiguration(gadget) { function setDAVConfiguration(gadget) {
return gadget.redirect({page: 'jio_dav_configurator'}); return gadget.redirect({page: 'jio_dav_configurator'});
...@@ -104,9 +121,15 @@ ...@@ -104,9 +121,15 @@
return gadget.updateHeader({ return gadget.updateHeader({
title: "Storage Configuration" title: "Storage Configuration"
}).push(function () { }).push(function () {
return gadget.getSetting("webrtc_share_name")
}).push(function (setting) {
if (!setting) {
return setWebrtcShareConfiguration(gadget);
}
}).push(function (setting) {
return RSVP.all([ return RSVP.all([
gadget.getSetting('jio_storage_name'), gadget.getSetting('jio_storage_name'),
gadget.getSetting('application_title') gadget.getSetting('application_title'),
]); ]);
}).push(function (setting_list) { }).push(function (setting_list) {
switch (setting_list[0]) { switch (setting_list[0]) {
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>cedric.le.ninivin</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>947.12629.17894.55808</string> </value> <value> <string>954.35989.13930.10461</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1447936126.33</float> <float>1476281593.66</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.5849.14852.49954</string> </value> <value> <string>954.14434.12379.58060</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1474559647.83</float> <float>1475074692.17</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,31 +5,19 @@ ...@@ -5,31 +5,19 @@
"use strict"; "use strict";
function setERP5Configuration(gadget) { function setERP5Configuration(gadget) {
return gadget.getSetting("portal_type") var configuration = {
.push(function (portal_type) { remote_sub_storage: {
var configuration = { type: "erp5",
local_sub_storage: { url: (new URI("hateoas"))
type: "query", .absoluteTo(location.href)
sub_storage: { .toString(),
type: "uuid", default_view_reference: "view"
sub_storage: { }
type: "indexeddb", };
database: "officejs-erp5"
} return gadget.setSetting('webrtc_share_description', configuration)
}
},
remote_sub_storage: {
type: "erp5",
url: (new URI("hateoas"))
.absoluteTo(location.href)
.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('webrtc_share_name', "ERP5");
}) })
.push(function () { .push(function () {
return gadget.reload(); return gadget.reload();
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.15508.28746.25412</string> </value> <value> <string>954.35964.26780.28620</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1475139184.89</float> <float>1476280104.88</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