Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
d96d4e4d
Commit
d96d4e4d
authored
Aug 17, 2016
by
Hardik Juneja
Committed by
hardikj
Sep 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webrtc_gadget: Webrtc gadget which use JIO or Websocket for handshake
parent
4c743377
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
6008 additions
and
0 deletions
+6008
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_html.html
...ateItem/web_page_module/gadget_webrtc_handshake_html.html
+23
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_html.xml
...lateItem/web_page_module/gadget_webrtc_handshake_html.xml
+259
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_js.js
...emplateItem/web_page_module/gadget_webrtc_handshake_js.js
+190
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_js.xml
...mplateItem/web_page_module/gadget_webrtc_handshake_js.xml
+255
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_html.html
.../PathTemplateItem/web_page_module/gadget_webrtc_html.html
+17
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_html.xml
...t/PathTemplateItem/web_page_module/gadget_webrtc_html.xml
+194
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_html.html
...teItem/web_page_module/gadget_webrtc_jio_bridge_html.html
+26
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_html.xml
...ateItem/web_page_module/gadget_webrtc_jio_bridge_html.xml
+259
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_js.js
...mplateItem/web_page_module/gadget_webrtc_jio_bridge_js.js
+278
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_js.xml
...plateItem/web_page_module/gadget_webrtc_jio_bridge_js.xml
+255
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_js.xml
...get/PathTemplateItem/web_page_module/gadget_webrtc_js.xml
+486
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_html.html
...ule/gadget_webrtc_serverless_demo_master_helper_html.html
+32
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_html.xml
...dule/gadget_webrtc_serverless_demo_master_helper_html.xml
+259
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_js.js
..._module/gadget_webrtc_serverless_demo_master_helper_js.js
+241
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_js.xml
...module/gadget_webrtc_serverless_demo_master_helper_js.xml
+267
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_html.html
...age_module/gadget_webrtc_serverless_demo_master_html.html
+97
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_html.xml
...page_module/gadget_webrtc_serverless_demo_master_html.xml
+200
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_js.js
...eb_page_module/gadget_webrtc_serverless_demo_master_js.js
+115
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_js.xml
...b_page_module/gadget_webrtc_serverless_demo_master_js.xml
+196
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_html.html
...dule/gadget_webrtc_serverless_demo_slave_helper_html.html
+28
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_html.xml
...odule/gadget_webrtc_serverless_demo_slave_helper_html.xml
+259
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_js.js
...e_module/gadget_webrtc_serverless_demo_slave_helper_js.js
+133
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_js.xml
..._module/gadget_webrtc_serverless_demo_slave_helper_js.xml
+267
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_html.html
...page_module/gadget_webrtc_serverless_demo_slave_html.html
+100
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_html.xml
..._page_module/gadget_webrtc_serverless_demo_slave_html.xml
+322
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_js.xml
...eb_page_module/gadget_webrtc_serverless_demo_slave_js.xml
+458
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_html.html
...b_page_module/gadget_webrtc_websocket_handshake_html.html
+20
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_html.xml
...eb_page_module/gadget_webrtc_websocket_handshake_html.xml
+338
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_js.js
...m/web_page_module/gadget_webrtc_websocket_handshake_js.js
+81
-0
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_js.xml
.../web_page_module/gadget_webrtc_websocket_handshake_js.xml
+318
-0
bt5/erp5_webrtc_gadget/bt/dependency_list
bt5/erp5_webrtc_gadget/bt/dependency_list
+1
-0
bt5/erp5_webrtc_gadget/bt/template_format_version
bt5/erp5_webrtc_gadget/bt/template_format_version
+1
-0
bt5/erp5_webrtc_gadget/bt/template_keep_last_workflow_history_only_path_list
...get/bt/template_keep_last_workflow_history_only_path_list
+16
-0
bt5/erp5_webrtc_gadget/bt/template_path_list
bt5/erp5_webrtc_gadget/bt/template_path_list
+16
-0
bt5/erp5_webrtc_gadget/bt/title
bt5/erp5_webrtc_gadget/bt/title
+1
-0
No files found.
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_html.html
0 → 100644
View file @
d96d4e4d
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
<title>
WebRTC Handshake Gadget
</title>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"jiodev.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_webrtc_handshake.js"
></script>
</head>
<body>
<div
data-gadget-url=
"gadget_jio.html"
data-gadget-scope=
"jio_gadget"
data-gadget-sandbox=
"public"
></div>
</body>
</html>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_handshake.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
JIO handshaking gadget for Webrtc Gadget
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_handshake_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Gadget to handle handshaking using JIO
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966649.39
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39247.53862.46899
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472631386.92
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_js.js
0 → 100644
View file @
d96d4e4d
/*jslint indent:2, maxlen:100, nomen:true*/
/*global rJS, window, WebSocket, RSVP*/
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
function
createJio
(
gadget
,
config
)
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
)
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
createJio
(
config
);
})
.
push
(
null
,
function
(
e
)
{
// TODO: Throw error in a correct way
throw
new
Error
(
"
Wrong Config
"
,
config
);
})
}
window
.
promiseDoWhile
=
function
(
loopFunction
,
input
)
{
// calls loopFunction(input) until it returns a non positive value
// this queue is to protect the inner loop queue from the
// `promiseDoWhile` caller, avoiding it to enqueue the inner
// loop queue.
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// here is the inner loop queue
var
loop_queue
=
new
RSVP
.
Queue
();
function
iterate
(
previous_iteration_result
)
{
if
(
!
previous_iteration_result
)
{
return
input
;
}
loop_queue
.
push
(
iterate
);
return
loopFunction
(
input
);
}
return
loop_queue
.
push
(
function
()
{
return
loopFunction
(
input
);
})
.
push
(
iterate
);
});
};
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
})
.
declareMethod
(
'
create_room
'
,
function
(
roomid
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
put
(
roomid
,
{});
})
.
push
(
null
,
function
(
e
){
console
.
log
(
e
);
})
})
.
declareMethod
(
'
register
'
,
function
(
roomid
,
peerid
,
config
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
createJio
(
gadget
,
config
);
})
.
push
(
function
()
{
return
gadget
.
create_room
(
roomid
);
})
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
putAttachment
(
roomid
,
peerid
,
''
);
});
// TODO: create new function, show registered peers?
})
.
declareMethod
(
'
handle_offer_answer
'
,
function
(
roomid
,
options
)
{
var
gadget
=
this
,
jio_gadget
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
putAttachment
(
roomid
,
options
.
name
,
options
.
data
);
})
})
.
declareMethod
(
'
get_answer
'
,
function
(
roomid
,
attachment
)
{
var
gadget
=
this
,
jio_gadget
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
getAttachment
(
roomid
,
attachment
);
});
})
.
declareMethod
(
'
get_offers
'
,
function
(
roomid
)
{
var
gadget
=
this
,
jio_gadget
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
allAttachments
(
roomid
);
});
})
.
declareMethod
(
'
wait_until_available
'
,
function
(
roomid
,
query
,
callbackPromise
)
{
// Pool the document until available
var
gadget
=
this
,
response
,
offers
=
[];
var
action
=
function
(
response
)
{
return
gadget
.
get_offers
(
roomid
)
.
push
(
function
(
response
)
{
var
offers
=
[];
for
(
var
doc_name
in
response
)
{
if
(
doc_name
.
split
(
'
_
'
).
length
===
1
&&
doc_name
===
query
)
{
return
gadget
.
get_answer
(
roomid
,
query
);
}
else
if
(
doc_name
.
split
(
'
_
'
).
length
===
2
&&
doc_name
.
split
(
'
_
'
)[
0
]
+
'
_
'
===
query
)
{
offers
.
push
(
gadget
.
get_answer
(
roomid
,
doc_name
));
}
}
return
RSVP
.
all
(
offers
);
})
.
push
(
function
(
responses
)
{
if
(
responses
.
constructor
!==
Array
)
{
responses
=
[
responses
];
}
if
(
!
responses
.
length
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
delay
(
5000
);
})
.
push
(
function
()
{
return
true
;
});
}
var
blobs
=
responses
;
var
texts
=
[];
for
(
var
blob
in
blobs
)
{
texts
.
push
(
jIO
.
util
.
readBlobAsText
(
blobs
[
blob
]));
}
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
(
texts
);
})
.
push
(
function
(
o
){
var
a
=
[];
for
(
var
offer
in
o
)
{
a
.
push
(
o
[
offer
].
target
.
result
);
}
if
(
typeof
callbackPromise
===
"
function
"
)
{
return
callbackPromise
(
a
);
}
else
{
offers
=
a
;
return
false
;
}
});
});
};
return
promiseDoWhile
(
action
,
callbackPromise
);
})
.
declareMethod
(
'
close
'
,
function
(
roomid
,
peerid
,
to
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
removeAttachment
(
roomid
,
peerid
+
"
_
"
+
to
);
});
});
})(
window
,
rJS
,
RSVP
);
\ No newline at end of file
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_handshake_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_handshake.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
JIO handshaking gadget for Webrtc Gadget
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_handshake_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Gadget to handle handshaking using JIO
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966645.61
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.14301.62370.56661
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1475066759.35
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_html.html
0 → 100644
View file @
d96d4e4d
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
<title>
WebRTC Gadget
</title>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_webrtc.js"
></script>
</head>
<body>
</body>
</html>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc Gadget
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
webrtc gadget
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966610.71
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_html.html
0 → 100644
View file @
d96d4e4d
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
<title>
WebRTC DataChannel Gadget
</title>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_webrtc_jio_bridge.js"
></script>
</head>
<body>
<div
data-gadget-url=
"gadget_webrtc_handshake.html"
data-gadget-scope=
"handshake_gadget"
data-gadget-sandbox=
"public"
></div>
<div
data-gadget-url=
"gadget_webrtc_websocket_handshake.html"
data-gadget-scope=
"websocket_handshake_gadget"
data-gadget-sandbox=
"public"
></div>
<div
class=
"gadget_webrtc"
></div>
</body>
</html>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_jio_bridge.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Bridge for Webrtc and JIO Gadgets
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_jio_bridge_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Connector for webrtc and jio gadgets
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966513.56
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.57024.40223.50090
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1473697957.39
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_js.js
0 → 100644
View file @
d96d4e4d
/*jslint indent:2, maxlen:100, nomen:true*/
/*global rJS, RSVP, window*/
(
function
(
rJS
,
window
,
RSVP
)
{
"
use strict
"
;
var
connection_options
=
[
{
// No need for stun server on the same lan / ipv6
iceServers
:
[
{
'
url
'
:
'
stun:23.21.150.121
'
},
{
url
:
'
stun:stun.1.google.com:19302
'
}
]
},
{
'
optional
'
:
[{
DtlsSrtpKeyAgreement
:
true
}]
}
],
data_channel_options
=
{
reliable
:
true
},
offer_contraints
=
{
mandatory
:
{
OfferToReceiveAudio
:
false
,
OfferToReceiveVideo
:
false
}
};
function
declareSubGadget
(
gadget
,
url
)
{
var
container_element
=
gadget
.
props
.
element
.
querySelector
(
"
.
"
+
url
.
split
(
"
.
"
)[
0
]),
element
=
document
.
createElement
(
"
div
"
);
container_element
.
innerHTML
=
""
;
container_element
.
appendChild
(
element
);
return
gadget
.
declareGadget
(
url
,
{
element
:
element
,
scope
:
url
,
sandbox
:
"
public
"
});
}
function
dropSubGadget
(
gadget
,
scope
)
{
return
gadget
.
getDeclaredGadget
(
scope
)
.
push
(
function
(
result
)
{
return
result
.
getElement
();
})
.
push
(
function
(
element
)
{
if
(
element
.
parentElement
)
{
element
.
parentElement
.
removeChild
(
element
);
}
return
gadget
.
dropGadget
(
scope
);
});
}
function
createOffer
(
gadget
,
title
)
{
var
webrtc
=
gadget
.
props
.
webrtc_connections
[
"
webrtc
"
+
gadget
.
props
.
counter
];
return
webrtc
.
createConnection
.
apply
(
webrtc
,
connection_options
)
.
push
(
function
()
{
return
webrtc
.
createDataChannel
(
title
,
data_channel_options
);
})
.
push
(
function
()
{
return
webrtc
.
createOffer
(
offer_contraints
);
})
.
push
(
function
(
local_description
)
{
return
webrtc
.
setLocalDescription
(
local_description
);
})
.
push
(
function
()
{
return
gadget
.
props
.
description_defer
.
promise
;
});
}
function
registerAnswer
(
gadget
,
description
)
{
return
gadget
.
props
.
webrtc_connections
[
"
webrtc
"
+
gadget
.
props
.
counter
]
.
setRemoteDescription
(
description
)
.
push
(
function
()
{
return
gadget
.
props
.
channel_defer
.
promise
;
});
}
function
createAnswer
(
gadget
,
description
)
{
var
webrtc
=
gadget
.
props
.
webrtc_connections
[
"
webrtc
"
+
gadget
.
props
.
counter
];
return
webrtc
.
createConnection
.
apply
(
webrtc
,
connection_options
)
.
push
(
function
()
{
return
webrtc
.
setRemoteDescription
(
description
);
})
.
push
(
function
()
{
return
webrtc
.
createAnswer
(
offer_contraints
);
})
.
push
(
function
(
local_description
)
{
return
webrtc
.
setLocalDescription
(
local_description
);
})
.
push
(
function
()
{
return
gadget
.
props
.
description_defer
.
promise
;
});
}
function
waitForConnection
(
gadget
)
{
return
gadget
.
props
.
channel_defer
.
promise
;
}
function
handleConnection
(
gadget
,
handler_gadget
,
options
,
offer
)
{
// create a new webrtc gadget instance
var
new_element
=
document
.
createElement
(
"
div
"
);
gadget
.
props
.
element
.
querySelector
(
"
.gadget_webrtc
"
).
appendChild
(
new_element
);
var
scope
=
"
webrtc
"
+
gadget
.
props
.
counter
;
return
gadget
.
declareGadget
(
"
gadget_webrtc.html
"
,
{
scope
:
scope
,
element
:
new_element
})
.
push
(
function
(
webrtc_gadget
)
{
gadget
.
props
.
webrtc_connections
[
scope
]
=
webrtc_gadget
;
if
(
options
.
initiator
===
true
)
{
return
createOffer
(
gadget
,
options
.
peerid
)
.
push
(
function
(
description
)
{
var
params
=
{
'
name
'
:
options
.
to
+
'
_
'
+
options
.
peerid
,
'
data
'
:
new
Blob
([
JSON
.
stringify
({
from
:
options
.
peerid
,
action
:
"
offer
"
,
data
:
description
})],
{
type
:
"
application/json
"
})};
return
handler_gadget
.
handle_offer_answer
(
options
.
roomid
,
params
);
})
.
push
(
function
(){
return
handler_gadget
.
wait_until_available
(
options
.
roomid
,
options
.
peerid
+
'
_
'
,
function
(
response
){
return
registerAnswer
(
gadget
,
JSON
.
parse
(
response
).
data
)
.
push
(
function
()
{
return
handler_gadget
.
close
(
options
.
roomid
,
options
.
peerid
,
options
.
to
,
options
.
listner
);
})
.
push
(
function
()
{
return
false
;
});
});
});
}
else
{
if
(
!
offer
.
data
)
{
throw
new
Error
(
"
No offer provided in connect function
"
);
}
return
createAnswer
(
gadget
,
offer
.
data
)
.
push
(
function
(
answer
)
{
var
params
=
{
name
:
options
.
to
+
'
_
'
+
options
.
peerid
,
data
:
new
Blob
([
JSON
.
stringify
({
to
:
options
.
to
,
action
:
"
answer
"
,
data
:
answer
})],
{
type
:
"
application/json
"
})
};
return
handler_gadget
.
handle_offer_answer
(
options
.
roomid
,
params
);
})
.
push
(
function
()
{
return
handler_gadget
.
close
(
options
.
roomid
,
options
.
peerid
,
options
.
to
,
options
.
listner
);
})
.
push
(
function
(){
return
RSVP
.
any
([
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
delay
(
20000
);
})
.
push
(
function
()
{
console
.
info
(
'
-- webrtc client disappears...
'
);
return
dropSubGadget
(
gadget
,
"
webrtc
"
+
gadget
.
props
.
counter
);
}),
waitForConnection
(
gadget
)
]);
});
}
});
}
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
g
.
props
.
description_defer
=
RSVP
.
defer
();
g
.
props
.
channel_defer
=
RSVP
.
defer
();
g
.
props
.
counter
=
0
;
g
.
props
.
webrtc_connections
=
{};
return
g
.
getElement
()
.
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
});
})
.
declareAcquiredMethod
(
"
notifyDataChannelMessage
"
,
"
notifyDataChannelMessage
"
)
.
allowPublicAcquisition
(
'
notifyDataChannelClosed
'
,
function
(
argument_list
,
scope
)
{
var
gadget
=
this
;
return
dropSubGadget
(
this
,
scope
)
.
push
(
function
()
{
return
updateInfo
(
gadget
);
});
})
.
allowPublicAcquisition
(
"
notifyDescriptionCalculated
"
,
function
(
args
)
{
this
.
props
.
description_defer
.
resolve
(
args
[
0
]);
this
.
props
.
description_defer
=
RSVP
.
defer
();
})
.
allowPublicAcquisition
(
"
notifyDataChannelOpened
"
,
function
()
{
this
.
props
.
channel_defer
.
resolve
();
})
.
declareMethod
(
'
send
'
,
function
(
args
,
to
)
{
//TODO: Add sent-to by name, functionality here
var
webrtc
=
this
.
props
.
webrtc_connections
[
to
];
return
webrtc
.
send
.
apply
(
webrtc
,
arguments
);
})
.
declareMethod
(
'
connect
'
,
function
(
options
){
var
gadget
=
this
,
jsonOffer
,
handler
,
roomid
=
options
.
roomid
,
peerid
=
options
.
peerid
;
if
(
options
.
type
===
"
websocket
"
)
{
handler
=
"
websocket_handshake_gadget
"
;
}
else
if
(
options
.
type
===
"
jio
"
)
{
handler
=
"
handshake_gadget
"
;
}
gadget
.
props
.
handler_gadget
=
handler
;
return
this
.
getDeclaredGadget
(
handler
)
.
push
(
function
(
handler_gadget
){
return
handler_gadget
.
register
(
options
.
roomid
,
options
.
peerid
,
options
.
config
);
})
.
push
(
function
(){
function
connectCallback
(
offer
,
handler_gadget
)
{
return
RSVP
.
Queue
()
.
push
(
function
(){
if
(
options
.
preConnection
)
{
return
options
.
preConnection
(
options
,
offer
);
}
else
{
return
;
}
})
.
push
(
function
()
{
return
handleConnection
(
gadget
,
handler_gadget
,
options
,
offer
);
})
.
push
(
function
()
{
if
(
options
.
postConnection
)
{
return
options
.
postConnection
(
options
,
offer
);
}
else
{
return
;
}
});
}
if
(
gadget
.
props
.
handler_gadget
)
{
return
gadget
.
getDeclaredGadget
(
gadget
.
props
.
handler_gadget
)
.
push
(
function
(
handler_gadget
)
{
if
(
options
.
listner
)
{
return
handler_gadget
.
wait_until_available
(
roomid
,
peerid
+
'
_
'
,
function
(
offers
){
var
connections
=
[];
// TODO: have a array for channel_defer for concurency?
gadget
.
props
.
channel_defer
=
RSVP
.
defer
();
for
(
var
offer
in
offers
)
{
jsonOffer
=
JSON
.
parse
(
offers
[
offer
]);
if
(
jsonOffer
.
action
===
"
offer
"
)
{
gadget
.
props
.
counter
+=
1
;
connections
.
push
(
connectCallback
(
jsonOffer
,
handler_gadget
));
}
}
return
RSVP
.
all
(
connections
);
});
}
else
{
return
handleConnection
(
gadget
,
handler_gadget
,
options
);
}
});
}
else
{
throw
new
Error
(
"
Peer is not registered
"
);
}
});
});
}(
rJS
,
window
,
RSVP
));
\ No newline at end of file
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_jio_bridge_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_jio_bridge.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Bridge for Webrtc and JIO Gadgets
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_jio_bridge_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Connector for webrtc and jio gadgets (js)
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966500.93
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.14300.3742.31044
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1475066648.69
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Manifest"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc Gadget
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Manifest
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content
</string>
</key>
<value>
<string>
/*jslint indent: 2, maxlen: 80, nomen: true */,\n
/*global rJS, RSVP, window*/\n
(function (rJS, RSVP, window) {\n
"use strict";\n
\n
var RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection ||\n
window.webkitRTCPeerConnection || window.msRTCPeerConnection,\n
RTCSessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription ||\n
window.webkitRTCSessionDescription || window.msRTCSessionDescription;\n
\n
function enqueueDefer(gadget, callback) {\n
var deferred = gadget.props.current_deferred;\n
\n
// Unblock queue\n
if (deferred !== undefined) {\n
deferred.resolve("Another event added");\n
}\n
\n
// Add next callback\n
try {\n
gadget.props.service_queue.push(callback);\n
} catch (error) {\n
throw new Error("Connection gadget already crashed... " +\n
gadget.props.service_queue.rejectedReason.toString());\n
}\n
\n
// Block the queue\n
deferred = RSVP.defer();\n
gadget.props.current_deferred = deferred;\n
gadget.props.service_queue.push(function () {\n
return deferred.promise;\n
});\n
\n
}\n
\n
function deferOnIceCandidate(candidate) {\n
var gadget = this;\n
\n
enqueueDefer(gadget, function () {\n
// Firing this callback with a null candidate indicates that\n
// trickle ICE gathering has finished, and all the candidates\n
// are now present in pc.localDescription. Waiting until now\n
// to create the answer saves us from having to send offer +\n
// answer + iceCandidates separately.\n
if (candidate.candidate === null) {\n
return gadget.notifyDescriptionCalculated(JSON.stringify(gadget.props.connection.localDescription));\n
}\n
});\n
}\n
\n
function deferDataChannelOnOpen() {\n
var gadget = this;\n
enqueueDefer(gadget, function () {\n
return gadget.notifyDataChannelOpened();\n
});\n
}\n
\n
function deferDataChannelOnClose() {\n
var gadget = this;\n
enqueueDefer(gadget, function () {\n
return gadget.notifyDataChannelClosed();\n
});\n
}\n
\n
function deferDataChannelOnMessage(evt) {\n
var gadget = this;\n
enqueueDefer(gadget, function () {\n
return gadget.notifyDataChannelMessage(evt.data);\n
// var data = JSON.parse(evt.data);\n
// console.log(data.message);\n
});\n
}\n
\n
function deferServerDisconnection(gadget) {\n
enqueueDefer(gadget, function () {\n
// Try to auto connection\n
if (gadget.props.connection !== undefined) {\n
gadget.props.connection.disconnect();\n
delete gadget.props.connection;\n
}\n
});\n
}\n
\n
// function deferOfferSuccessCallback(description) {\n
// var gadget = this;\n
// enqueueDefer(gadget, function () {\n
// gadget.props.connection.setLocalDescription(description);\n
// });\n
// }\n
\n
function deferErrorHandler(error) {\n
enqueueDefer(this, function () {\n
throw error;\n
});\n
}\n
\n
function deferServerConnection(gadget) {\n
deferServerDisconnection(gadget);\n
\n
}\n
\n
function listenToChannelEvents(gadget) {\n
gadget.props.channel.onopen = deferDataChannelOnOpen.bind(gadget);\n
gadget.props.channel.onclose = deferDataChannelOnClose.bind(gadget);\n
gadget.props.channel.onmessage = deferDataChannelOnMessage.bind(gadget);\n
gadget.props.channel.onerror = deferErrorHandler.bind(gadget);\n
}\n
\n
rJS(window)\n
.ready(function (g) {\n
g.props = {};\n
})\n
\n
.declareAcquiredMethod(\'notifyDescriptionCalculated\',\n
\'notifyDescriptionCalculated\')\n
.declareAcquiredMethod(\'notifyDataChannelOpened\',\n
\'notifyDataChannelOpened\')\n
.declareAcquiredMethod(\'notifyDataChannelMessage\',\n
\'notifyDataChannelMessage\')\n
.declareAcquiredMethod(\'notifyDataChannelClosed\',\n
\'notifyDataChannelClosed\')\n
\n
.declareService(function () {\n
/////////////////////////\n
// Handle WebRTC connection\n
/////////////////////////\n
var context = this;\n
\n
context.props.service_queue = new RSVP.Queue();\n
deferServerConnection(context);\n
\n
return new RSVP.Queue()\n
.push(function () {\n
return context.props.service_queue;\n
})\n
.push(function () {\n
// XXX Handle cancellation\n
throw new Error("Service should not have been stopped!");\n
})\n
.push(undefined, function (error) {\n
// Always disconnect in case of error\n
if (context.props.connection !== undefined) {\n
context.props.connection.close();\n
}\n
throw error;\n
});\n
})\n
\n
\n
.declareMethod(\'createConnection\', function (configuration, constraints) {\n
this.props.connection = new RTCPeerConnection(configuration, constraints);\n
this.props.connection.onicecandidate = deferOnIceCandidate.bind(this);\n
var context = this;\n
this.props.connection.ondatachannel = function (evt) {\n
context.props.channel = evt.channel;\n
listenToChannelEvents(context);\n
};\n
})\n
\n
.declareMethod(\'createDataChannel\', function (title, options) {\n
// XXX Improve to support multiple data channel\n
this.props.channel = this.props.connection.createDataChannel(title, options);\n
listenToChannelEvents(this);\n
// console.log("Channel type: " + this.props.channel.binarytype);\n
})\n
\n
.declareMethod(\'createOffer\', function (constraints) {\n
var gadget = this;\n
return new RSVP.Promise(function (resolve, reject) {\n
gadget.props.connection.createOffer(\n
resolve,\n
reject,\n
constraints\n
);\n
});\n
})\n
\n
.declareMethod(\'setRemoteDescription\', function (description) {\n
var gadget = this;\n
return new RSVP.Promise(function (resolve, reject) {\n
gadget.props.connection.setRemoteDescription(\n
new RTCSessionDescription(JSON.parse(description)),\n
resolve,\n
reject\n
);\n
});\n
})\n
\n
.declareMethod(\'setLocalDescription\', function (description) {\n
var gadget = this;\n
return new RSVP.Promise(function (resolve, reject) {\n
gadget.props.connection.setLocalDescription(\n
new RTCSessionDescription(description),\n
resolve,\n
reject\n
);\n
});\n
})\n
\n
.declareMethod(\'createAnswer\', function (constraints) {\n
var gadget = this;\n
return new RSVP.Promise(function (resolve, reject) {\n
gadget.props.connection.createAnswer(\n
resolve,\n
reject,\n
constraints\n
);\n
});\n
})\n
\n
.declareMethod(\'send\', function (message) {\n
this.props.channel.send(message);\n
})\n
\n
.declareMethod(\'close\', function () {\n
// XXX Of course, this will fail if connection is not open yet...\n
this.props.channel.close();\n
this.props.connection.close();\n
delete this.props.channel;\n
delete this.props.connection;\n
});\n
\n
}(rJS, RSVP, window));\n
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
webrtc gadget
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966491.22
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.51044.11136.7543
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1475065036.81
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_html.html
0 → 100644
View file @
d96d4e4d
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Share jIO
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_webrtc_serverless_demo_master_helper.js"
></script>
</head>
<body>
<div
class=
"ui-grid-b ui-responsive"
>
<div
class=
"ui-block-a"
></div>
<div
class=
"ui-block-b"
>
<p
data-i18n=
"This is a renderJS gadget which shares a jIO storage via WebRTC."
>
This is a renderJS gadget which shares a jIO storage via WebRTC.
</p>
<h2
data-i18n=
"Peer list"
>
Peer list
</h2>
<p><span
data-i18n=
"Connected peers:"
>
Connected peers:
</span>
<span
class=
"peer_count"
>
0
</span></p>
<pre
class=
"info"
></pre>
</div>
<div
class=
"ui-block-c"
></div>
</div>
<div
class=
"gadget_handshake"
>
<div
data-gadget-url=
"gadget_webrtc_handshake.html"
data-gadget-scope=
"gadget_handshake.html"
>
</div>
</div>
<div
class=
"gadget_webrtc_jio_bridge"
></div>
</body>
</html>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master_helper.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master_helper_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
share jio with slaves
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472731728.11
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39310.7473.35379
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472635088.36
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_js.js
0 → 100644
View file @
d96d4e4d
/*global window, rJS, document, RSVP, console, DOMException */
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
document
,
RSVP
,
console
,
DOMException
)
{
"
use strict
"
;
window
.
promiseDoWhile
=
function
(
loopFunction
,
input
)
{
// calls loopFunction(input) until it returns a non positive value
// this queue is to protect the inner loop queue from the
// `promiseDoWhile` caller, avoiding it to enqueue the inner
// loop queue.
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// here is the inner loop queue
var
loop_queue
=
new
RSVP
.
Queue
();
function
iterate
(
previous_iteration_result
)
{
if
(
!
previous_iteration_result
)
{
return
input
;
}
loop_queue
.
push
(
iterate
);
return
loopFunction
(
input
);
}
return
loop_queue
.
push
(
function
()
{
return
loopFunction
(
input
);
})
.
push
(
iterate
);
});
};
function
dropSubGadget
(
gadget
,
scope
)
{
return
gadget
.
getDeclaredGadget
(
scope
)
.
push
(
function
(
result
)
{
return
result
.
getElement
();
})
.
push
(
function
(
element
)
{
if
(
element
.
parentElement
)
{
element
.
parentElement
.
removeChild
(
element
);
}
delete
gadget
.
state_parameter_dict
.
scope_ip
[
scope
];
return
gadget
.
dropGadget
(
scope
);
});
}
function
getWebRTCScopeList
(
gadget
)
{
var
result_list
=
[],
element_list
=
gadget
.
state_parameter_dict
.
element
.
querySelector
(
"
.gadget_webrtc_jio_bridge
"
)
.
childNodes
,
i
;
for
(
i
=
0
;
i
<
element_list
.
length
;
i
+=
1
)
{
result_list
.
push
(
element_list
[
i
].
getAttribute
(
"
data-gadget-scope
"
));
}
return
result_list
;
}
function
updateInfo
(
gadget
)
{
var
scope_list
=
getWebRTCScopeList
(
gadget
),
i
,
result
=
""
;
for
(
i
=
0
;
i
<
scope_list
.
length
;
i
+=
1
)
{
result
+=
gadget
.
state_parameter_dict
.
scope_ip
[
scope_list
[
i
]]
+
"
\n
"
;
}
gadget
.
state_parameter_dict
.
element
.
querySelector
(
"
.info
"
).
textContent
=
result
;
gadget
.
state_parameter_dict
.
element
.
querySelector
(
"
.peer_count
"
).
textContent
=
i
;
}
function
sendWebRTC
(
gadget
,
rtc_gadget
,
scope
,
message
)
{
return
rtc_gadget
.
send
(
message
)
.
push
(
undefined
,
function
(
error
)
{
if
((
error
instanceof
DOMException
)
&&
(
error
.
name
===
'
InvalidStateError
'
))
{
return
dropSubGadget
(
gadget
,
scope
)
.
push
(
function
()
{
return
updateInfo
(
gadget
);
},
function
(
error
)
{
console
.
log
(
"
-- Can not drop remote subgadget
"
+
scope
);
console
.
log
(
error
);
return
;
});
}
throw
error
;
});
}
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
// Initialize the gadget local parameters
gadget
.
state_parameter_dict
=
{
websocket_initialized
:
false
,
counter
:
0
,
connecting
:
false
,
scope_ip
:
{}
};
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
gadget
.
state_parameter_dict
.
element
=
element
;
})
.
push
(
function
()
{
return
updateInfo
(
gadget
);
});
})
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
jio_post
"
,
"
jio_post
"
)
.
declareAcquiredMethod
(
"
jio_put
"
,
"
jio_put
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_repair
"
,
"
jio_repair
"
)
.
allowPublicAcquisition
(
'
notifyDataChannelClosed
'
,
function
(
argument_list
,
scope
)
{
/*jslint unparam:true*/
var
gadget
=
this
;
return
dropSubGadget
(
this
,
scope
)
.
push
(
function
()
{
return
updateInfo
(
gadget
);
});
})
.
allowPublicAcquisition
(
"
notifyDataChannelMessage
"
,
function
(
argument_list
,
scope
)
{
var
json
=
JSON
.
parse
(
argument_list
[
0
]),
rtc_gadget
,
context
=
this
;
return
context
.
getDeclaredGadget
(
scope
)
.
push
(
function
(
g
)
{
rtc_gadget
=
g
;
// Call jio API
return
context
[
"
jio_
"
+
json
.
method_name
].
apply
(
context
,
json
.
argument_list
);
})
.
push
(
function
(
result
)
{
return
sendWebRTC
(
context
,
rtc_gadget
,
scope
,
JSON
.
stringify
({
id
:
json
.
id
,
result
:
result
,
type
:
"
jio_response
"
}));
},
function
(
error
)
{
return
sendWebRTC
(
context
,
rtc_gadget
,
scope
,
JSON
.
stringify
({
id
:
json
.
id
,
result
:
error
,
type
:
"
error
"
}));
});
})
.
declareMethod
(
'
connect
'
,
function
(
handshake_gadget
,
room_id
,
offer
)
{
var
gadget
=
this
,
scope
,
rtc_gadget
;
return
new
RSVP
.
Queue
()
.
push
(
function
(
response
)
{
gadget
.
state_parameter_dict
.
connecting
=
true
;
gadget
.
state_parameter_dict
.
counter
+=
1
;
var
new_element
=
document
.
createElement
(
"
div
"
);
gadget
.
state_parameter_dict
.
element
.
querySelector
(
"
.gadget_webrtc_jio_bridge
"
).
appendChild
(
new_element
);
scope
=
"
webrtc
"
+
gadget
.
state_parameter_dict
.
counter
;
return
gadget
.
declareGadget
(
"
gadget_webrtc_jio_bridge.html
"
,
{
scope
:
scope
,
element
:
new_element
})
.
push
(
function
(
gg
){
rtc_gadget
=
gg
;
// https://github.com/diafygi/webrtc-ips
var
ip_regex
=
/
([
0-9
]{1,3}(\.[
0-9
]{1,3}){3}
|
[
a-f0-9
]{1,4}(
:
[
a-f0-9
]{1,4}){7})
/
,
ip_list
=
[],
ip_dict
=
{},
ip_addr
,
line_list
=
JSON
.
parse
(
offer
.
data
).
sdp
.
split
(
'
\n
'
),
i
;
for
(
i
=
0
;
i
<
line_list
.
length
;
i
+=
1
)
{
if
(
line_list
[
i
].
indexOf
(
'
a=candidate:
'
)
===
0
)
{
ip_addr
=
ip_regex
.
exec
(
line_list
[
i
])[
1
];
if
(
!
ip_addr
.
match
(
/^
[
a-f0-9
]{1,4}(
:
[
a-f0-9
]{1,4}){7}
$/
))
{
// Hide ipv6
if
(
!
ip_dict
[
ip_addr
])
{
ip_list
.
push
(
ip_addr
);
ip_dict
[
ip_addr
]
=
true
;
}
}
}
}
gadget
.
state_parameter_dict
.
scope_ip
[
scope
]
=
ip_list
;
return
rtc_gadget
.
connect
({
roomid
:
room_id
,
peerid
:
'
master
'
,
to
:
offer
.
from
,
offer
:
JSON
.
stringify
(
offer
.
data
)
});
})
.
push
(
function
()
{
return
RSVP
.
any
([
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
delay
(
20000
);
})
.
push
(
function
()
{
console
.
info
(
'
-- webrtc client disappears...
'
);
return
dropSubGadget
(
gadget
,
scope
);
}),
rtc_gadget
.
waitForConnection
()
]);
})
.
push
(
function
()
{
gadget
.
state_parameter_dict
.
connecting
=
false
;
return
updateInfo
(
gadget
);
});
})
})
.
declareMethod
(
'
initiate
'
,
function
(
roomid
)
{
var
gadget
=
this
,
handshake_gadget
,
rtc_gadget
,
blob
;
return
this
.
getDeclaredGadget
(
'
gadget_handshake.html
'
)
.
push
(
function
(
gad
)
{
handshake_gadget
=
gad
;
roomid
=
"
/
"
+
roomid
+
"
/
"
;
return
handshake_gadget
.
create_room
(
roomid
);
})
.
push
(
function
()
{
return
gadget
.
declareGadget
(
"
gadget_webrtc_jio_bridge.html
"
)
})
.
push
(
function
(
rg
)
{
// register peer
rtc_gadget
=
rg
;
return
rtc_gadget
.
register
(
roomid
,
'
master
'
);
})
.
push
(
function
(
r
)
{
var
peerid
=
'
master
'
;
return
handshake_gadget
.
wait_until_available
(
roomid
,
peerid
+
'
_
'
,
function
(
offers
)
{
var
connections
=
[];
for
(
var
offer
in
offers
)
{
connections
.
push
(
gadget
.
connect
(
handshake_gadget
,
roomid
,
JSON
.
parse
(
offers
[
offer
].
target
.
result
)));
}
return
RSVP
.
all
(
connections
);
});
});
});
}(
window
,
rJS
,
document
,
RSVP
,
console
,
DOMException
));
\ No newline at end of file
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_helper_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
contributors
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master_helper.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master_helper_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
OfficeJS Share jIO Page JS
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472731710.8
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39310.18911.56729
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472635108.35
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_html.html
0 → 100644
View file @
d96d4e4d
<!DOCTYPE html>
<html
manifest=
"master.appcache"
>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Serverless WebRTC - Master
</title>
<style
type=
"text/css"
>
body
{
background-color
:
#f9f9f9
;
color
:
#2C3E50
;
font-family
:
Arial
;
}
.ui-content
,
.ui-responsive
{
background-color
:
white
;
border
:
1px
solid
#2C3E50
;
border-radius
:
.375em
;
padding
:
1em
;
width
:
50%
;
margin
:
0
auto
1em
;
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
.ui-responsive
div
p
:first-child
{
display
:
none
;
}
@media
(
max-width
:
48em
)
{
.ui-content
,
.ui-responsive
{
width
:
100%
;
}
}
h2
,
h3
{
padding
:
0
;
margin
:
0
;
font-size
:
1.17em
;
text-align
:
center
;
}
label
{
width
:
60%
;
display
:
inline-block
;
padding
:
.5em
0
;
}
label
span
{
display
:
inline-block
;
width
:
40%
;
padding-right
:
.5em
;
}
</style>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<!-- custom -->
<script
src=
"gadget_webrtc_serverless_demo_master.js"
type=
"text/javascript"
></script>
</head>
<body>
<!-- MASTER -->
<!-- NOTE: must have BroadCaster running on same device to work -->
<div
class=
"ui-content"
>
<h3>
Master
</h3>
<ul>
<li>
The master gadget contains a jIO storage indexedDB.
</li>
<li>
Slaves connect to master over WebSockets URL set by the Broadcaster
</li>
<li>
Once webRTC is active the slave can access the storage over webRTC
</li>
</div>
<div
class=
"ui-content"
>
<form
class=
"ops-form-initializer"
>
<h3>
Create a Room
</h3>
<br>
<label><span>
Name your room
</span><input
type=
"text"
class=
"ops-socket-connector"
/></label>
<input
type=
"submit"
value=
"Do It"
/>
</form>
</div>
<!-- socket broadcaster -->
<div
data-gadget-url=
"gadget_webrtc_serverless_demo_master_helper.html"
data-gadget-scope=
"share_storage_via_webrtc"
data-gadget-sandbox=
"public"
></div>
<!-- storage -->
<div
data-gadget-url=
"gadget_jio.html"
data-gadget-scope=
"jio_gadget"
data-gadget-sandbox=
"public"
></div>
</body>
</html>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Master for demo WebRTC application
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39288.14205.2013
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472633817.03
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_js.js
0 → 100644
View file @
d96d4e4d
/*global window, rJS, document, RSVP, console, DOMException */
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
document
,
RSVP
,
console
,
DOMException
)
{
"
use strict
"
;
/////////////////////////////////////////////////////////////////
// Some functions
/////////////////////////////////////////////////////////////////
function
createJio
(
gadget
)
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
)
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
createJio
({
type
:
"
query
"
,
sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
"
type
"
:
"
indexeddb
"
,
"
database
"
:
"
serverless
"
}
}
});
});
}
/////////////////////////////////////////////////////////////////
// Gadget behaviour
/////////////////////////////////////////////////////////////////
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
.
ready
(
function
(
gadget
)
{
gadget
.
state_parameter_dict
=
{};
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
gadget
.
state_parameter_dict
.
element
=
element
;
});
})
// Configure jIO to indexeddb
.
ready
(
function
(
gadget
)
{
return
createJio
(
gadget
);
})
/////////////////////////////////////////////////////////////////
// acquired methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// published methods
/////////////////////////////////////////////////////////////////
.
allowPublicAcquisition
(
"
jio_post
"
,
function
(
my_param_list
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
my_gadget
)
{
return
my_gadget
.
post
.
apply
(
my_gadget
,
my_param_list
);
});
})
.
allowPublicAcquisition
(
"
jio_get
"
,
function
(
my_param_list
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
my_gadget
)
{
return
my_gadget
.
get
.
apply
(
my_gadget
,
my_param_list
);
});
})
.
allowPublicAcquisition
(
"
jio_allDocs
"
,
function
(
my_param_list
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
jio_gadget
"
);
})
.
push
(
function
(
my_gadget
)
{
return
my_gadget
.
allDocs
.
apply
(
my_gadget
,
my_param_list
);
});
})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared services
/////////////////////////////////////////////////////////////////
.
declareService
(
function
()
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getElement
()
})
.
push
(
function
(
element
)
{
function
initializeWebrtcConnecton
(
my_event
)
{
var
value
=
element
.
querySelector
(
"
.ops-socket-connector
"
).
value
;
return
gadget
.
getDeclaredGadget
(
'
share_storage_via_webrtc
'
)
.
push
(
function
(
g
){
g
.
initiate
(
value
);
})
}
// Listen to form submit
return
loopEventListener
(
element
,
'
submit
'
,
false
,
initializeWebrtcConnecton
);
})
});
}(
window
,
rJS
,
document
,
RSVP
,
console
,
DOMException
));
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_master_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_master_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Master for demo WebRTC application
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39307.56761.32460
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472634987.37
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_html.html
0 → 100644
View file @
d96d4e4d
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
<title>
Jio Gadget
</title>
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_webrtc_serverless_demo_slave_helper.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
data-gadget-url=
"gadget_jio.html"
data-gadget-scope=
"jio_gadget"
data-gadget-sandbox=
"public"
></div>
<div
data-gadget-url=
"gadget_webrtc_handshake.html"
data-gadget-scope=
"handshake_gadget"
data-gadget-sandbox=
"public"
></div>
<div
class=
"gadget_webrtc_jio_bridge"
></div>
</body>
</html>
\ No newline at end of file
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave_helper.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave_helper_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
helper for webrtc demo application slave
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966544.8
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39280.31348.37853
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472633497.48
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_js.js
0 → 100644
View file @
d96d4e4d
/*global window, rJS, document, RSVP */
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
document
,
RSVP
)
{
"
use strict
"
;
var
timeout
=
600000
;
function
S4
()
{
return
(
'
0000
'
+
Math
.
floor
(
Math
.
random
()
*
0x10000
/* 65536 */
).
toString
(
16
)).
slice
(
-
4
);
}
function
UUID
()
{
return
S4
()
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
S4
()
+
S4
();
}
function
wrapJioAccess
(
gadget
,
method_name
,
argument_list
)
{
return
gadget
.
getDeclaredGadget
(
'
gadget_webrtc_jio_bridge.html
'
)
.
push
(
function
(
rtc_gadget
)
{
gadget
.
state_parameter_dict
.
message_count
+=
1
;
gadget
.
state_parameter_dict
.
message_dict
[
gadget
.
state_parameter_dict
.
message_count
]
=
RSVP
.
defer
();
return
RSVP
.
all
([
rtc_gadget
.
send
(
JSON
.
stringify
({
id
:
gadget
.
state_parameter_dict
.
message_count
,
type
:
"
jio_query
"
,
method_name
:
method_name
,
argument_list
:
Array
.
prototype
.
slice
.
call
(
argument_list
)
})),
RSVP
.
any
([
RSVP
.
timeout
(
timeout
),
gadget
.
state_parameter_dict
.
message_dict
[
gadget
.
state_parameter_dict
.
message_count
].
promise
])
]);
})
.
push
(
function
(
result_list
)
{
return
result_list
[
1
];
});
}
function
declareSubGadget
(
gadget
,
url
)
{
var
container_element
=
gadget
.
state_parameter_dict
.
element
.
querySelector
(
"
.
"
+
url
.
split
(
"
.
"
)[
0
]),
element
=
document
.
createElement
(
"
div
"
);
container_element
.
innerHTML
=
""
;
container_element
.
appendChild
(
element
);
return
gadget
.
declareGadget
(
url
,
{
element
:
element
,
scope
:
url
,
sandbox
:
"
public
"
});
}
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
// Initialize the gadget local parameters
gadget
.
state_parameter_dict
=
{};
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
gadget
.
state_parameter_dict
.
element
=
element
;
});
})
.
allowPublicAcquisition
(
"
notifyDataChannelMessage
"
,
function
(
argument_list
)
{
var
json
=
JSON
.
parse
(
argument_list
[
0
]),
context
=
this
;
if
(
json
.
type
===
"
jio_response
"
)
{
context
.
state_parameter_dict
.
message_dict
[
json
.
id
].
resolve
(
json
.
result
);
}
else
if
(
json
.
type
===
"
error
"
)
{
context
.
state_parameter_dict
.
message_dict
[
json
.
id
].
reject
(
json
.
result
);
}
// Drop all other kind of messages
})
.
allowPublicAcquisition
(
"
notifyWebSocketMessage
"
,
function
(
argument_list
)
{
var
json
=
JSON
.
parse
(
argument_list
[
0
]),
gadget
=
this
;
if
(
json
.
action
===
"
answer
"
)
{
if
(
json
.
to
===
gadget
.
state_parameter_dict
.
uuid
)
{
gadget
.
state_parameter_dict
.
answer_defer
.
resolve
(
json
.
data
);
}
}
})
.
declareMethod
(
'
createJio
'
,
function
(
options
)
{
var
context
=
this
,
roomid
=
"
/
"
+
options
.
room
+
"
/
"
,
rtc_gadget
,
handshake_gadget
;
return
declareSubGadget
(
context
,
'
gadget_webrtc_jio_bridge.html
'
)
.
push
(
function
(
gadget
)
{
context
.
state_parameter_dict
.
uuid
=
UUID
();
context
.
state_parameter_dict
.
message_count
=
0
;
context
.
state_parameter_dict
.
message_dict
=
{};
rtc_gadget
=
gadget
;
// register peer
return
rtc_gadget
.
register
(
roomid
,
context
.
state_parameter_dict
.
uuid
);
})
.
push
(
function
(
peers
){
var
options
=
{
roomid
:
roomid
,
peerid
:
context
.
state_parameter_dict
.
uuid
,
initiator
:
true
,
to
:
'
master
'
}
return
rtc_gadget
.
connect
(
options
);
})
})
.
declareMethod
(
'
allDocs
'
,
function
()
{
return
wrapJioAccess
(
this
,
'
allDocs
'
,
arguments
);
})
.
declareMethod
(
'
get
'
,
function
()
{
return
wrapJioAccess
(
this
,
'
get
'
,
arguments
);
})
.
declareMethod
(
'
put
'
,
function
()
{
return
wrapJioAccess
(
this
,
'
put
'
,
arguments
);
})
.
declareMethod
(
'
post
'
,
function
()
{
return
wrapJioAccess
(
this
,
'
post
'
,
arguments
);
})
.
declareMethod
(
'
remove
'
,
function
()
{
return
wrapJioAccess
(
this
,
'
remove
'
,
arguments
);
})
}(
window
,
rJS
,
document
,
RSVP
));
\ No newline at end of file
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_helper_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
contributors
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave_helper.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave_helper_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
helper for webrtc demo application slave (js)
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1471966535.92
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39312.52960.8294
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472635259.04
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_html.html
0 → 100644
View file @
d96d4e4d
<!DOCTYPE html>
<html
manifest=
"slave.appcache"
>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Serverless WebRTC - Slave
</title>
<style
type=
"text/css"
>
body
{
background-color
:
#f9f9f9
;
color
:
#2C3E50
;
font-family
:
Arial
;
}
.ui-content
,
.ui-responsive
{
background-color
:
white
;
border
:
1px
solid
#2C3E50
;
border-radius
:
.375em
;
padding
:
1em
;
width
:
50%
;
margin
:
0
auto
1em
;
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
@media
(
max-width
:
48em
)
{
.ui-content
,
.ui-responsive
{
width
:
100%
;
}
}
h2
,
h3
{
padding
:
0
;
margin
:
0
;
font-size
:
1.17em
;
text-align
:
center
;
}
label
{
width
:
60%
;
display
:
inline-block
;
padding
:
.5em
0
;
}
label
span
{
display
:
inline-block
;
width
:
40%
;
padding-right
:
.5em
;
}
</style>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<!-- custom -->
<script
src=
"gadget_webrtc_serverless_demo_slave.js"
type=
"text/javascript"
></script>
</head>
<body>
<!-- SLAVE -->
<!-- connect to master via WebSockets, then access master storage via WebRTC -->
<!-- shared storage access -->
<div
data-gadget-url=
"gadget_webrtc_serverless_demo_slave_helper.html"
data-gadget-scope=
"access_storage_via_webrtc"
data-gadget-sandbox=
"public"
></div>
<div
class=
"ui-content"
>
<h3
style=
"display:inline-block;"
>
Status:
</h3>
<span
class=
"ops-status"
></span>
</div>
<div
class=
"ui-content"
>
<form
class=
"ops-form-initializer"
>
<h3>
Welcome Minions of WWW!
</h3>
<label><span>
Name your Master
</span><input
type=
"text"
class=
"ops-socket-connector"
/></label>
<input
type=
"submit"
value=
"Take me to church"
/>
</form>
</div>
<div
class=
"ui-content"
>
<form
class=
"ops-form-create"
>
<h3>
Create Records
</h3>
<label><span>
First Name
</span><input
type=
"text"
name=
"field_first_name"
/></label>
<label><span>
Last Name
</span><input
type=
"text"
name=
"field_last_name"
/></label>
<input
type=
"submit"
value=
"Create Record"
/>
</form>
</div>
<div
class=
"ui-content"
>
<form
class=
"ops-form-query"
>
<h3>
Query Records
</h3>
<label><span>
Search
</span><input
type=
"search"
name=
"field_search_string"
/></label>
<input
type=
"submit"
value=
"Search For Names"
/>
</form>
<ul
class=
"ops-result-list"
>
</ul>
</div>
</body>
</html>
\ No newline at end of file
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Slave for demo WebRTC application
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472830277.08
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.40762.36916.46574
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472722249.04
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
detect_converted_file
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
converted
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472722195.95
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_serverless_demo_slave_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Manifest"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Webrtc with JIO demo App
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_serverless_demo_slave_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Manifest
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*global window, rJS, document, RSVP */\n
/*jslint indent: 2, maxerr: 3 */\n
(function (window, rJS, document, RSVP) {\n
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
// Some functions\n
/////////////////////////////////////////////////////////////////\n
function displayError(gadget, error) {\n
// Do not break the application in case of errors.\n
// Display it to the user for now, and allow user to go back to the frontpage\n
var error_text = "",\n
status = gadget.state_parameter_dict.status_message;\n
\n
if (error instanceof RSVP.CancellationError) {\n
return;\n
}\n
\n
if (error instanceof XMLHttpRequest) {\n
error_text = error.toString() + " " +\n
error.status + " " +\n
error.statusText;\n
} else if (error instanceof Error) {\n
error_text = error.toString();\n
} else {\n
error_text = JSON.stringify(error);\n
}\n
\n
console.error(error);\n
console.error(error.stack);\n
status.textContent = "Error: " + error_text; \n
}\n
\n
function escapeString(my_string) {\n
//return my_string.replace(/\\"/g, "\\\\\\"");\n
return my_string;\n
}\n
\n
function findList(my_target) {\n
var list = my_target.nextSibling;\n
\n
while(list && list.nodeType != 1) {\n
list = list.nextSibling;\n
}\n
return list;\n
}\n
\n
function clearList(my_list) {\n
while (my_list.firstChild) {\n
my_list.removeChild(my_list.firstChild);\n
}\n
}\n
\n
function queryRecordOverWebrtc(my_gadget, my_event) {\n
var target = my_event.target,\n
search_string = target.elements.field_search_string.value,\n
status = my_gadget.state_parameter_dict.status_message,\n
list = findList(target),\n
lookup;\n
\n
if (search_string) {\n
lookup = escapeString(search_string);\n
clearList(list);\n
return new RSVP.Queue()\n
.push(function () {\n
status.textContent = "Querying storage...";\n
return my_gadget.shared_jio_allDocs({\n
"query": \'first:"%\' + lookup + \'%" OR last:"%\' + lookup + \'%"\',\n
//"include_docs": true NOT SUPPORTED ON INDEXEDDB \n
});\n
})\n
.push(function (my_result) {\n
var promise_list = [], \n
i, \n
i_len;\n
\n
// fetch records one by one\n
for (i = 0, i_len = my_result.data.total_rows; i < i_len; i += 1) {\n
promise_list.push(\n
my_gadget.shared_jio_get(my_result.data.rows[i].id)\n
);\n
}\n
return RSVP.all(promise_list);\n
})\n
.push(function (my_result_list) {\n
var fragment = document.createDocumentFragment(),\n
result,\n
doc,\n
i,\n
i_len;\n
\n
status.textContent = "";\n
\n
for (i = 0, i_len = my_result_list.length; i < i_len; i += 1) {\n
doc = my_result_list[i];\n
result = document.createElement("li");\n
result.textContent = doc.first + " " + doc.last;\n
fragment.appendChild(result);\n
}\n
list.appendChild(fragment);\n
});\n
}\n
status.textContent = "Please enter search string.";\n
}\n
\n
function createRecordOverWebrtc(my_gadget, my_event) {\n
var target = my_event.target,\n
first = target.elements.field_first_name.value,\n
last = target.elements.field_last_name.value,\n
status = my_gadget.state_parameter_dict.status_message;\n
\n
if (first && last) {\n
return new RSVP.Queue()\n
.push(function () {\n
status.textContent = "Posting to storage...";\n
return my_gadget.shared_jio_post({"first": first, "last": last});\n
})\n
.push(function (my_storage_reply) {\n
status.textContent = "ok, record created: " + my_storage_reply;\n
});\n
}\n
status.textContent = "Please enter first and last name.";\n
return;\n
}\n
\n
function initializeWebrtcConnecton(my_gadget, my_event) {\n
var target = my_event.target,\n
value = target.querySelector(".ops-socket-connector").value,\n
status = my_gadget.state_parameter_dict.status_message;\n
\n
if (value) {\n
status.textContent = "Try to connect over to room" + value + " ...";\n
return new RSVP.Queue()\n
.push(function () {\n
return my_gadget.shared_jio_create({"room": value});\n
})\n
.push(function () {\n
status.textContent = "WebRTC active.";\n
});\n
}\n
status.textContent = "Please enter WebSocket Url.";\n
return false;\n
}\n
\n
/////////////////////////////////////////////////////////////////\n
// Gadget behaviour\n
/////////////////////////////////////////////////////////////////\n
\n
rJS(window)\n
/////////////////////////////////////////////////////////////////\n
// ready\n
/////////////////////////////////////////////////////////////////\n
.ready(function (gadget) {\n
gadget.state_parameter_dict = {};\n
return gadget.getElement()\n
.push(function (element) {\n
gadget.state_parameter_dict.element = element;\n
gadget.state_parameter_dict.status_message = \n
element.querySelector(".ops-status");\n
});\n
})\n
\n
/////////////////////////////////////////////////////////////////\n
// acquired methods\n
/////////////////////////////////////////////////////////////////\n
\n
/////////////////////////////////////////////////////////////////\n
// published methods\n
/////////////////////////////////////////////////////////////////\n
.allowPublicAcquisition(\'reportServiceError\', function (param_list, gadget_scope) {\n
if (gadget_scope === undefined) {\n
// don\'t fail in case of dropped subgadget (like previous page)\n
// only accept errors from header, panel and displayed page\n
return;\n
}\n
return displayError(this, param_list[0]);\n
})\n
\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
.declareMethod(\'shared_jio_create\', function (my_param_list) {\n
var gadget = this;\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.getDeclaredGadget("access_storage_via_webrtc");\n
})\n
.push(function (my_gadget) {\n
return my_gadget.createJio(my_param_list); \n
});\n
})\n
.declareMethod("shared_jio_post", function (my_param_dict) {\n
var gadget = this;\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.getDeclaredGadget("access_storage_via_webrtc");\n
})\n
.push(function (my_gadget) {\n
return my_gadget.post(my_param_dict);\n
});\n
})\n
.declareMethod("shared_jio_get", function (my_param_dict) {\n
var gadget = this;\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.getDeclaredGadget("access_storage_via_webrtc");\n
})\n
.push(function (my_gadget) {\n
return my_gadget.get(my_param_dict);\n
});\n
})\n
.declareMethod("shared_jio_allDocs", function (my_param_dict) {\n
var gadget = this;\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.getDeclaredGadget("access_storage_via_webrtc");\n
})\n
.push(function (my_gadget) {\n
return my_gadget.allDocs(my_param_dict);\n
});\n
})\n
\n
/////////////////////////////////////////////////////////////////\n
// declared services\n
/////////////////////////////////////////////////////////////////\n
.declareService(function () {\n
var gadget = this;\n
\n
function handleFormSubmit(my_event) {\n
\n
switch (my_event.target.className) {\n
case "ops-form-initializer":\n
return initializeWebrtcConnecton(gadget, my_event);\n
case "ops-form-create":\n
return createRecordOverWebrtc(gadget, my_event);\n
case "ops-form-query":\n
return queryRecordOverWebrtc(gadget, my_event);\n
}\n
}\n
\n
// Listen to form submit\n
return loopEventListener(\n
gadget.state_parameter_dict.element,\n
\'submit\',\n
false,\n
handleFormSubmit\n
);\n
});\n
\n
}(window, rJS, document, RSVP));\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Slave for demo WebRTC application
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.39271.9120.48793
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472632772.63
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_html.html
0 → 100644
View file @
d96d4e4d
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Share jIO
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_webrtc_websocket_handshake.js"
></script>
</head>
<body>
<div
class=
"gadget_websocket"
>
<div
data-gadget-url=
"gadget_websocket.html"
data-gadget-scope=
"gadget_websocket"
>
</div>
</div>
</body>
</html>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_html.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
contributors
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_websocket_handshake.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Websocket handshaking gadget for Webrtc Gadget
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_websocket_handshake_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_substitution_mapping_method_id
</string>
</key>
<value>
<string>
WebPage_getRenderJSSubstitutionMappingDict
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Gadget to handle handshaking using websocket
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472825428.9
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
953.42501.63327.60416
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1474538090.89
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
detect_converted_file
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
converted
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472810439.97
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_js.js
0 → 100644
View file @
d96d4e4d
/*jslint indent:2, maxlen:80, nomen:true */
/*global rJS, window, WebSocket, RSVP*/
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
g
.
props
.
notify_websocket_message
=
function
()
{};
})
.
allowPublicAcquisition
(
"
notifyWebSocketMessage
"
,
function
(
argument_list
)
{
if
(
JSON
.
parse
(
argument_list
[
0
]).
from
!==
this
.
props
.
peerid
)
{
return
this
.
props
.
notify_websocket_message
(
argument_list
);
}
})
.
allowPublicAcquisition
(
"
notifyWebSocketClosed
"
,
function
(
argument_list
)
{
return
;
})
.
declareMethod
(
'
create_room
'
,
function
(
roomid
)
{
this
.
props
.
roomid
=
roomid
;
return
RSVP
.
promise
;
})
.
declareMethod
(
'
register
'
,
function
(
roomid
,
peerid
,
config
)
{
var
gadget
=
this
;
gadget
.
props
.
peerid
=
peerid
;
return
gadget
.
getDeclaredGadget
(
'
gadget_websocket
'
)
.
push
(
function
(
socket_gadget
)
{
gadget
.
props
.
ws_url
=
config
.
url
;
return
socket_gadget
.
createSocket
(
config
.
url
);
});
})
.
declareMethod
(
'
handle_offer_answer
'
,
function
(
roomid
,
offer
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
jIO
.
util
.
readBlobAsText
(
offer
.
data
);
})
.
push
(
function
(
result
)
{
offer
=
result
.
target
.
result
;
return
gadget
.
getDeclaredGadget
(
"
gadget_websocket
"
);
})
.
push
(
function
(
g
)
{
return
g
.
send
(
offer
);
});
})
.
declareMethod
(
'
get_answer
'
,
function
(
roomid
,
attachment
)
{
var
gadget
=
this
;
return
;
})
.
declareMethod
(
'
get_offers
'
,
function
(
roomid
)
{
var
gadget
=
this
;
return
;
})
.
declareMethod
(
'
wait_until_available
'
,
function
(
roomid
,
query
,
prom
)
{
// execute given function on each websocket message
var
gadget
=
this
,
response
,
offers
;
gadget
.
props
.
notify_websocket_message
=
prom
;
})
.
declareMethod
(
'
close
'
,
function
(
roomid
,
peerid
,
to
,
listner
)
{
if
(
!
listner
)
{
var
gadget
=
this
;
return
gadget
.
getDeclaredGadget
(
"
gadget_websocket
"
)
.
push
(
function
(
socket_gadget
)
{
return
socket_gadget
.
close
();
});
}
});
})(
window
,
rJS
,
RSVP
);
\ No newline at end of file
bt5/erp5_webrtc_gadget/PathTemplateItem/web_page_module/gadget_webrtc_websocket_handshake_js.xml
0 → 100644
View file @
d96d4e4d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_webrtc_websocket_handshake.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Websocket handshaking gadget for Webrtc Gadget
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_webrtc_websocket_handshake_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<string>
en
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Gadget to handle handshaking using websocket
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472825439.19
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.15519.18357.4829
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1475139801.28
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
detect_converted_file
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
converted
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1472808633.09
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_webrtc_gadget/bt/dependency_list
0 → 100644
View file @
d96d4e4d
erp5_web_renderjs_ui
\ No newline at end of file
bt5/erp5_webrtc_gadget/bt/template_format_version
0 → 100644
View file @
d96d4e4d
1
\ No newline at end of file
bt5/erp5_webrtc_gadget/bt/template_keep_last_workflow_history_only_path_list
0 → 100644
View file @
d96d4e4d
web_page_module/gadget_webrtc_handshake_html
web_page_module/gadget_webrtc_handshake_js
web_page_module/gadget_webrtc_html
web_page_module/gadget_webrtc_jio_bridge_html
web_page_module/gadget_webrtc_jio_bridge_js
web_page_module/gadget_webrtc_js
web_page_module/gadget_webrtc_serverless_demo_master_helper_html
web_page_module/gadget_webrtc_serverless_demo_master_helper_js
web_page_module/gadget_webrtc_serverless_demo_master_html
web_page_module/gadget_webrtc_serverless_demo_master_js
web_page_module/gadget_webrtc_serverless_demo_slave_helper_html
web_page_module/gadget_webrtc_serverless_demo_slave_helper_js
web_page_module/gadget_webrtc_serverless_demo_slave_html
web_page_module/gadget_webrtc_serverless_demo_slave_js
web_page_module/gadget_webrtc_websocket_handshake_js
web_page_module/gadget_webrtc_websocket_handshake_html
\ No newline at end of file
bt5/erp5_webrtc_gadget/bt/template_path_list
0 → 100644
View file @
d96d4e4d
web_page_module/gadget_webrtc_handshake_html
web_page_module/gadget_webrtc_handshake_js
web_page_module/gadget_webrtc_html
web_page_module/gadget_webrtc_jio_bridge_html
web_page_module/gadget_webrtc_jio_bridge_js
web_page_module/gadget_webrtc_js
web_page_module/gadget_webrtc_serverless_demo_master_helper_html
web_page_module/gadget_webrtc_serverless_demo_master_helper_js
web_page_module/gadget_webrtc_serverless_demo_master_html
web_page_module/gadget_webrtc_serverless_demo_master_js
web_page_module/gadget_webrtc_serverless_demo_slave_helper_html
web_page_module/gadget_webrtc_serverless_demo_slave_helper_js
web_page_module/gadget_webrtc_serverless_demo_slave_html
web_page_module/gadget_webrtc_serverless_demo_slave_js
web_page_module/gadget_webrtc_websocket_handshake_html
web_page_module/gadget_webrtc_websocket_handshake_js
\ No newline at end of file
bt5/erp5_webrtc_gadget/bt/title
0 → 100644
View file @
d96d4e4d
erp5_webrtc_gadget
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment