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