- merging branches/developers/ritzalam/bigbluebutton-client to trunk
git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@1191 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
parent
98dc0bc272
commit
cdc1662e81
@ -11,8 +11,8 @@
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" sourcepath="${PROJECT_FRAMEWORKS}/source" useDefaultLinkType="true"/>
|
||||
</modifiedEntries>
|
||||
<excludedEntries>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
|
||||
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
|
||||
</excludedEntries>
|
||||
@ -38,7 +38,10 @@
|
||||
<module application="src/BigBlueButton.mxml" destPath="ListenersModule.swf" optimize="true" sourcePath="src/ListenersModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="ChatModule.swf" optimize="true" sourcePath="src/ChatModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="PresentationModule.swf" optimize="true" sourcePath="src/PresentationModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="WhiteboardModule.swf" optimize="true" sourcePath="src/WhiteboardModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="LoginModule.swf" optimize="true" sourcePath="src/LoginModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="JoinModule.swf" optimize="true" sourcePath="src/JoinModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="PhoneModule.swf" optimize="true" sourcePath="src/PhoneModule.mxml"/>
|
||||
<module application="src/BigBlueButton.mxml" destPath="Red5PhoneModule.swf" optimize="true" sourcePath="src/Red5PhoneModule.mxml"/>
|
||||
</modules>
|
||||
<buildCSSFiles/>
|
||||
</actionScriptProperties>
|
||||
|
@ -1,46 +0,0 @@
|
||||
# The location of your Flex SDK (no spaces allowed in path!).
|
||||
flex.sdk.dir = /Developer/SDKs/flex
|
||||
|
||||
# Specifies the location of the configuration file that defines compiler options.
|
||||
flex.config.xml = ${flex.sdk.dir}/frameworks/flex-config.xml
|
||||
|
||||
# SWF output filename.
|
||||
output.swf.name = publisher
|
||||
|
||||
# Default HTML page title.
|
||||
swf.release.title = Red5 Publisher
|
||||
|
||||
# Debug HTML page title.
|
||||
swf.debug.title = ${swf.release.title} (debug version)
|
||||
|
||||
# Specifies the output path and filename for the resulting files.
|
||||
build.dir = bin/
|
||||
|
||||
# Main MXML file.
|
||||
main.application = main.mxml
|
||||
|
||||
# Source path folder.
|
||||
src.dir = ../classes/
|
||||
|
||||
# Lib path folder.
|
||||
lib.dir = ../lib/
|
||||
|
||||
# Cairngorm SWC library location.
|
||||
lib.cairngorm.swc = ${lib.dir}/Cairngorm.swc
|
||||
|
||||
# The location of your asdoc executable (no spaces allowed in path!).
|
||||
asdoc.exe = ${flex.sdk.dir}/bin/asdoc
|
||||
|
||||
# The folder where the asdoc HTML-files will be created.
|
||||
asdoc.output.dir = doc/
|
||||
|
||||
# The folder where the asdoc templates are located.
|
||||
asdoc.templates.dir = ${flex.sdk.dir}/asdoc/templates
|
||||
|
||||
# Left frameset width.
|
||||
asdoc.framewidth = 300
|
||||
|
||||
# Class-folders you want to search for classes to be included in the docs,
|
||||
# seperated by spaces (for example ../com/ ../net/ ).
|
||||
# To include every .as and .mxml file within your project, just state ../
|
||||
asdoc.domainextensions = ${src.dir}/org/red5/samples/publisher
|
@ -1,301 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- ======================================================================
|
||||
Red5 Publisher application
|
||||
A Flex 2 application to test the streaming capabilities of Red5.
|
||||
|
||||
Thijs Triemstra (info@collab.nl)
|
||||
====================================================================== -->
|
||||
<project
|
||||
name="Red5 Publisher"
|
||||
default="build"
|
||||
basedir=".">
|
||||
|
||||
<property file="./build.properties" />
|
||||
|
||||
<!-- dirs -->
|
||||
<property
|
||||
name="release.build.dir"
|
||||
location="${build.dir}/release/"/>
|
||||
<property
|
||||
name="debug.build.dir"
|
||||
location="${build.dir}/debug/"/>
|
||||
<property
|
||||
name="lib.swc"
|
||||
location="${lib.cairngorm.swc}"/>
|
||||
<!-- files -->
|
||||
<property
|
||||
name="mxmlc.jar"
|
||||
location="${flex.sdk.dir}/lib/mxmlc.jar"/>
|
||||
<property
|
||||
name="main.application.release.out"
|
||||
location="${release.build.dir}/${output.swf.name}.swf"/>
|
||||
<property
|
||||
name="main.application.debug.out"
|
||||
location="${debug.build.dir}/${output.swf.name}-debug.swf"/>
|
||||
<!-- wrapper -->
|
||||
<property
|
||||
name="wrapper.dir"
|
||||
location="${flex.sdk.dir}/resources/html-templates/express-installation-with-history"/>
|
||||
<property
|
||||
name="output.debug.html"
|
||||
location="${debug.build.dir}/${output.swf.name}-debug.html"/>
|
||||
<property
|
||||
name="output.release.html"
|
||||
location="${release.build.dir}/${output.swf.name}.html"/>
|
||||
<property
|
||||
name="swf.width"
|
||||
value="100%"/>
|
||||
<property
|
||||
name="swf.height"
|
||||
value="100%"/>
|
||||
<property
|
||||
name="swf.version.major"
|
||||
value="9"/>
|
||||
<property
|
||||
name="swf.version.minor"
|
||||
value="0"/>
|
||||
<property
|
||||
name="swf.version.revision"
|
||||
value="0"/>
|
||||
<property
|
||||
name="swf.application"
|
||||
value="${output.swf.name}"/>
|
||||
<property
|
||||
name="swf.swf"
|
||||
value="${output.swf.name}"/>
|
||||
<property
|
||||
name="swf.bgcolor"
|
||||
value="#FFFFFF"/>
|
||||
|
||||
<description>
|
||||
Red5 Publisher
|
||||
</description>
|
||||
|
||||
<!-- =================================
|
||||
target: build
|
||||
================================= -->
|
||||
<target
|
||||
name="build"
|
||||
depends="clean,
|
||||
init,
|
||||
compile.release,
|
||||
compile.debug,
|
||||
make.release.wrapper,
|
||||
make.debug.wrapper,
|
||||
docs"
|
||||
description="--> ${swf.release.title} application">
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: make.release.wrapper
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target
|
||||
name="make.release.wrapper">
|
||||
<make.wrapper
|
||||
width="${swf.width}"
|
||||
height="${swf.height}"
|
||||
title="${swf.release.title}"
|
||||
version.major="${swf.version.major}"
|
||||
version.minor="${swf.version.minor}"
|
||||
version.revision="${swf.version.revision}"
|
||||
application="${swf.application}}"
|
||||
swf="${swf.swf}"
|
||||
bgcolor="${swf.bgcolor}"
|
||||
wrapper.dir="${wrapper.dir}"
|
||||
output.dir="${release.build.dir}"
|
||||
output.html="${output.release.html}" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: make.debug.wrapper
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target
|
||||
name="make.debug.wrapper">
|
||||
<make.wrapper
|
||||
width="${swf.width}"
|
||||
height="${swf.height}"
|
||||
title="${swf.debug.title}"
|
||||
version.major="${swf.version.major}"
|
||||
version.minor="${swf.version.minor}"
|
||||
version.revision="${swf.version.revision}"
|
||||
application="${swf.application}}"
|
||||
swf="${swf.swf}-debug"
|
||||
bgcolor="${swf.bgcolor}"
|
||||
wrapper.dir="${wrapper.dir}"
|
||||
output.dir="${debug.build.dir}"
|
||||
output.html="${output.debug.html}" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: compile.release
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target
|
||||
name="compile.release">
|
||||
<mxmlc.compile
|
||||
in="${main.application}"
|
||||
out="${main.application.release.out}"
|
||||
additional='-benchmark -optimize=true -title "${swf.release.title}" -description "${swf.release.title}"' />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: compile.debug
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target
|
||||
name="compile.debug">
|
||||
<mxmlc.compile
|
||||
in="${main.application}"
|
||||
out="${main.application.debug.out}"
|
||||
additional="-debug=true -benchmark" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: clean
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target
|
||||
name="clean">
|
||||
<delete
|
||||
dir="${asdoc.output.dir}"
|
||||
failOnError="false"
|
||||
includeEmptyDirs="true" />
|
||||
<delete
|
||||
dir="${build.dir}"
|
||||
failOnError="false"
|
||||
includeEmptyDirs="true" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: init
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target
|
||||
name="init">
|
||||
<mkdir
|
||||
dir="${build.dir}"/>
|
||||
<mkdir
|
||||
dir="${release.build.dir}"/>
|
||||
<mkdir
|
||||
dir="${debug.build.dir}"/>
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: docs
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target
|
||||
name="docs">
|
||||
<mkdir
|
||||
dir="${asdoc.output.dir}"/>
|
||||
<exec executable="${asdoc.exe}"
|
||||
failonerror="true">
|
||||
<arg line='-source-path ${src.dir}'/>
|
||||
<arg line='-doc-sources ${asdoc.domainextensions}'/>
|
||||
<arg value='-load-config=${flex.config.xml}'/>
|
||||
<arg line='-output ${asdoc.output.dir}'/>
|
||||
<arg line='-templates-path ${asdoc.templates.dir}'/>
|
||||
<arg line='"-library-path+=${lib.cairngorm.swc}"'/>
|
||||
<arg line='-left-frameset-width ${asdoc.framewidth}'/>
|
||||
<arg line='-benchmark'/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<!-- = = = = = = = = = = = = = = = = =
|
||||
macrodef: mxmlc.compile
|
||||
= = = = = = = = = = = = = = = = = -->
|
||||
<macrodef name="mxmlc.compile">
|
||||
<attribute name="in" />
|
||||
<attribute name="out" />
|
||||
<attribute
|
||||
name="additional"
|
||||
default="" />
|
||||
<attribute
|
||||
name="config"
|
||||
default="${flex.config.xml}" />
|
||||
<sequential>
|
||||
<java
|
||||
jar="${mxmlc.jar}"
|
||||
fork="true"
|
||||
maxmemory="512m"
|
||||
failonerror="true">
|
||||
<arg line="-source-path ${src.dir}"/>
|
||||
<arg value="-library-path+=${lib.swc}"/>
|
||||
<arg value="+flexlib=${flex.sdk.dir}/frameworks"/>
|
||||
<arg value="-load-config=@{config}"/>
|
||||
<arg value="-output=@{out}"/>
|
||||
<arg line="@{additional}"/>
|
||||
<arg value="@{in}" />
|
||||
</java>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<!-- = = = = = = = = = = = = = = = = =
|
||||
macrodef: make.wrapper
|
||||
= = = = = = = = = = = = = = = = = -->
|
||||
<macrodef name="make.wrapper">
|
||||
<attribute name="width" default="100%" />
|
||||
<attribute name="height" default="100%" />
|
||||
<attribute name="title" default="" />
|
||||
<attribute name="version.major" default="9" />
|
||||
<attribute name="version.minor" default="0" />
|
||||
<attribute name="version.revision" default="0" />
|
||||
<attribute name="application" default="" />
|
||||
<attribute name="swf" default="" />
|
||||
<attribute name="bgcolor" default="#869ca7" />
|
||||
<attribute name="wrapper.dir" />
|
||||
<attribute name="output.dir" />
|
||||
<attribute name="output.html" />
|
||||
<sequential>
|
||||
<copy todir="@{output.dir}">
|
||||
<fileset dir="@{wrapper.dir}">
|
||||
<exclude name="**/index.template.html" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy
|
||||
file="@{wrapper.dir}/index.template.html"
|
||||
tofile="@{output.html}" />
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{width\}"
|
||||
replace="@{width}"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{height\}"
|
||||
replace="@{height}"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{title\}"
|
||||
replace="@{title}"
|
||||
encoding="utf-8"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{version_major\}"
|
||||
replace="@{version.major}"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{version_minor\}"
|
||||
replace="@{version.minor}"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{version_revision\}"
|
||||
replace="@{version.revision}"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{application\}"
|
||||
replace="@{application}"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{bgcolor\}"
|
||||
replace="@{bgcolor}"/>
|
||||
<replaceregexp
|
||||
file="@{output.html}"
|
||||
flags="gs"
|
||||
match="\$\{swf\}"
|
||||
replace="@{swf}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</project>
|
@ -40,10 +40,28 @@
|
||||
return _attributes.username;
|
||||
}
|
||||
|
||||
public function get connection():NetConnection {
|
||||
return _attributes.connection;
|
||||
}
|
||||
|
||||
public function get mode():String {
|
||||
if (_attributes.mode == null) {
|
||||
//_attributes.mode = "PLAYBACK"
|
||||
_attributes.mode = "LIVE"
|
||||
LogUtil.debug('Setting ChatModule mode: ' + _attributes.mode);
|
||||
}
|
||||
LogUtil.debug('ChatModule mode: ' + _attributes.mode);
|
||||
return _attributes.mode;
|
||||
}
|
||||
|
||||
public function get userid():Number {
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
LogUtil.debug("chat attr: " + attributes.username);
|
||||
_attributes = attributes;
|
||||
|
62
bigbluebutton-client/src/JoinModule.mxml
Normal file
62
bigbluebutton-client/src/JoinModule.mxml
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
implements="org.bigbluebutton.common.IBigBlueButtonModule"
|
||||
creationComplete="onCreationComplete()">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.join.JoinFacade;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
|
||||
private var _router:Router;
|
||||
private var _moduleId:String = "JoinModule";
|
||||
private var _moduleName:String = "Join Module";
|
||||
private var _attributes:Object;
|
||||
|
||||
private function onCreationComplete():void {
|
||||
LogUtil.debug("JoinModule Initialized");
|
||||
}
|
||||
|
||||
public function acceptRouter(router:Router):void{
|
||||
_router = router;
|
||||
}
|
||||
|
||||
public function get router():Router{
|
||||
return _router;
|
||||
}
|
||||
|
||||
public function get moduleId():String {
|
||||
return _moduleId;
|
||||
}
|
||||
|
||||
public function get moduleName():String {
|
||||
return _moduleName;
|
||||
}
|
||||
|
||||
public function get uri():String {
|
||||
return _attributes.uri;
|
||||
}
|
||||
|
||||
public function get username():String {
|
||||
return _attributes.username;
|
||||
}
|
||||
|
||||
public function get userid():Number {
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
LogUtil.debug("JoinModule start");
|
||||
_attributes = attributes;
|
||||
JoinFacade.getInstance().startup(this);
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
JoinFacade.getInstance().stop(this);
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
</mx:Module>
|
@ -14,6 +14,8 @@
|
||||
|
||||
private var _attributes:Object;
|
||||
|
||||
public var recordedMP3Url:String;
|
||||
|
||||
private function onModuleCreationComplete():void {
|
||||
LogUtil.debug("ListenersModule Initialized");
|
||||
}
|
||||
@ -46,6 +48,36 @@
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function get room():String {
|
||||
return _attributes.room;
|
||||
}
|
||||
|
||||
public function get conference():String {
|
||||
return _attributes.conference;
|
||||
}
|
||||
|
||||
public function get connection():NetConnection {
|
||||
return _attributes.connection;
|
||||
}
|
||||
|
||||
public function get mode():String {
|
||||
if (_attributes.mode == null) {
|
||||
//_attributes.mode = "PLAYBACK"
|
||||
_attributes.mode = "LIVE"
|
||||
LogUtil.debug('Setting ListenersModule mode: ' + _attributes.mode);
|
||||
}
|
||||
LogUtil.debug('ListenersModule mode: ' + _attributes.mode);
|
||||
return _attributes.mode;
|
||||
}
|
||||
|
||||
public function get recordingHost():String {
|
||||
return _attributes.recordingHost;
|
||||
}
|
||||
|
||||
public function isModerator():Boolean {
|
||||
LogUtil.debug("LISTENER-ROLE:" + _attributes.userrole);
|
||||
return _attributes.userrole == "MODERATOR";
|
||||
|
61
bigbluebutton-client/src/LoginModule.mxml
Normal file
61
bigbluebutton-client/src/LoginModule.mxml
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
implements="org.bigbluebutton.common.IBigBlueButtonModule"
|
||||
creationComplete="onCreationComplete()">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.login.LoginFacade;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
|
||||
private var _router:Router;
|
||||
private var _moduleId:String = "LoginModule";
|
||||
private var _moduleName:String = "Login Module";
|
||||
private var _attributes:Object;
|
||||
|
||||
private function onCreationComplete():void {
|
||||
LogUtil.debug("LogintModule Initialized");
|
||||
}
|
||||
|
||||
public function acceptRouter(router:Router):void{
|
||||
_router = router;
|
||||
}
|
||||
|
||||
public function get router():Router{
|
||||
return _router;
|
||||
}
|
||||
|
||||
public function get moduleId():String {
|
||||
return _moduleId;
|
||||
}
|
||||
|
||||
public function get moduleName():String {
|
||||
return _moduleName;
|
||||
}
|
||||
|
||||
public function get uri():String {
|
||||
return _attributes.uri;
|
||||
}
|
||||
|
||||
public function get username():String {
|
||||
return _attributes.username;
|
||||
}
|
||||
|
||||
public function get userid():Number {
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
_attributes = attributes;
|
||||
LoginFacade.getInstance().startup(this);
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
LoginFacade.getInstance().stop(this);
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
</mx:Module>
|
78
bigbluebutton-client/src/PhoneModule.mxml
Normal file
78
bigbluebutton-client/src/PhoneModule.mxml
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
implements="org.bigbluebutton.common.IBigBlueButtonModule"
|
||||
creationComplete="onCreationComplete()">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.phone.PhoneFacade;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
|
||||
private var _router:Router;
|
||||
private var _moduleId:String = "PhoneModule";
|
||||
private var _moduleName:String = "Phone Module";
|
||||
private var _attributes:Object;
|
||||
|
||||
private function onCreationComplete():void {
|
||||
LogUtil.debug("PhoneModule Initialized");
|
||||
}
|
||||
|
||||
public function acceptRouter(router:Router):void{
|
||||
_router = router;
|
||||
}
|
||||
|
||||
public function get router():Router{
|
||||
return _router;
|
||||
}
|
||||
|
||||
public function get moduleId():String {
|
||||
return _moduleId;
|
||||
}
|
||||
|
||||
public function get moduleName():String {
|
||||
return _moduleName;
|
||||
}
|
||||
|
||||
public function get uri():String {
|
||||
return _attributes.uri + "/" + _attributes.room;
|
||||
}
|
||||
|
||||
public function get username():String {
|
||||
return _attributes.username;
|
||||
}
|
||||
|
||||
public function get userid():Number {
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get sipusername():String {
|
||||
return _attributes.sipusername;
|
||||
}
|
||||
|
||||
public function get sippassword():String {
|
||||
return _attributes.sippassword;
|
||||
}
|
||||
|
||||
public function get sipserver():String {
|
||||
return _attributes.sipserver;
|
||||
}
|
||||
|
||||
public function get siprealm():String {
|
||||
return _attributes.siprealm;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
LogUtil.debug("phone attr: " + attributes.username);
|
||||
_attributes = attributes;
|
||||
PhoneFacade.getInstance().startup(this);
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
PhoneFacade.getInstance().stop(this);
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
</mx:Module>
|
@ -44,6 +44,10 @@
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function get host():String {
|
||||
return _attributes.host;
|
||||
}
|
||||
@ -52,6 +56,24 @@
|
||||
return _attributes.room;
|
||||
}
|
||||
|
||||
public function get conference():String {
|
||||
return _attributes.conference;
|
||||
}
|
||||
|
||||
public function get connection():NetConnection {
|
||||
return _attributes.connection;
|
||||
}
|
||||
|
||||
public function get mode():String {
|
||||
if (_attributes.mode == null) {
|
||||
//_attributes.mode = "PLAYBACK"
|
||||
_attributes.mode = "LIVE"
|
||||
LogUtil.debug('Setting PresentationModule mode: ' + _attributes.mode);
|
||||
}
|
||||
LogUtil.debug('PresentationModule mode: ' + _attributes.mode);
|
||||
return _attributes.mode;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
_attributes = attributes;
|
||||
PresentationFacade.getInstance().startup(this);
|
||||
|
78
bigbluebutton-client/src/Red5PhoneModule.mxml
Normal file
78
bigbluebutton-client/src/Red5PhoneModule.mxml
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
implements="org.bigbluebutton.common.IBigBlueButtonModule"
|
||||
creationComplete="onCreationComplete()">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.red5phone.Red5PhoneFacade;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
|
||||
private var _router:Router;
|
||||
private var _moduleId:String = "Red5PhoneModule";
|
||||
private var _moduleName:String = "Red5 Phone Module";
|
||||
private var _attributes:Object;
|
||||
|
||||
private function onCreationComplete():void {
|
||||
LogUtil.debug("Red5PhoneModule Initialized");
|
||||
}
|
||||
|
||||
public function acceptRouter(router:Router):void{
|
||||
_router = router;
|
||||
}
|
||||
|
||||
public function get router():Router{
|
||||
return _router;
|
||||
}
|
||||
|
||||
public function get moduleId():String {
|
||||
return _moduleId;
|
||||
}
|
||||
|
||||
public function get moduleName():String {
|
||||
return _moduleName;
|
||||
}
|
||||
|
||||
public function get uri():String {
|
||||
return _attributes.uri + "/" + _attributes.room;
|
||||
}
|
||||
|
||||
public function get username():String {
|
||||
return _attributes.username;
|
||||
}
|
||||
|
||||
public function get userid():Number {
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get sipusername():String {
|
||||
return _attributes.sipUsername;
|
||||
}
|
||||
|
||||
public function get sippassword():String {
|
||||
return _attributes.sipPassword;
|
||||
}
|
||||
|
||||
public function get sipserver():String {
|
||||
return _attributes.sipServer;
|
||||
}
|
||||
|
||||
public function get siprealm():String {
|
||||
return _attributes.sipRealm;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
LogUtil.debug("phone attr: " + attributes.username);
|
||||
_attributes = attributes;
|
||||
Red5PhoneFacade.getInstance().startup(this);
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
Red5PhoneFacade.getInstance().stop(this);
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
</mx:Module>
|
@ -44,6 +44,10 @@
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
return _attributes.userrole as String;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
_attributes = attributes;
|
||||
VideoModuleFacade.getInstance().startup(this);
|
||||
|
@ -35,9 +35,13 @@
|
||||
}
|
||||
|
||||
public function get uri():String {
|
||||
return _attributes.uri + "/";
|
||||
return _attributes.uri + "/" + _attributes.room;
|
||||
}
|
||||
|
||||
public function get role():String {
|
||||
LogUtil.debug("ViewersModule userrole " + _attributes.userrole);
|
||||
return _attributes.userrole;
|
||||
}
|
||||
|
||||
public function get username():String {
|
||||
return _attributes.username;
|
||||
@ -47,8 +51,59 @@
|
||||
return _attributes.userid as Number;
|
||||
}
|
||||
|
||||
public function get host():String {
|
||||
return _attributes.host;
|
||||
}
|
||||
|
||||
public function set role(r:String):void {
|
||||
_attributes.userrole = r;
|
||||
}
|
||||
|
||||
public function set username(u:String):void {
|
||||
_attributes.username = u;
|
||||
}
|
||||
|
||||
public function set userid(u:Number):void {
|
||||
_attributes.userid = u;
|
||||
}
|
||||
|
||||
public function set authToken(a:String):void {
|
||||
_attributes.authToken = a;
|
||||
}
|
||||
|
||||
public function get authToken():String {
|
||||
return _attributes.authToken;
|
||||
}
|
||||
|
||||
public function set room(r:String):void {
|
||||
_attributes.room = r;
|
||||
}
|
||||
|
||||
public function get room():String {
|
||||
return _attributes.room;
|
||||
}
|
||||
|
||||
public function set conference(c:String):void {
|
||||
_attributes.conference = c;
|
||||
}
|
||||
|
||||
public function get conference():String {
|
||||
return _attributes.conference;
|
||||
}
|
||||
|
||||
public function get mode():String {
|
||||
if (_attributes.mode == null) {
|
||||
//_attributes.mode = "PLAYBACK"
|
||||
_attributes.mode = "LIVE"
|
||||
LogUtil.debug('Setting ViewersModule mode: ' + _attributes.mode);
|
||||
}
|
||||
LogUtil.debug('ViewersModule mode: ' + _attributes.mode);
|
||||
return _attributes.mode;
|
||||
}
|
||||
|
||||
public function start(attributes:Object):void {
|
||||
_attributes = attributes;
|
||||
LogUtil.debug('Passed ViewersModule mode: ' + _attributes.mode);
|
||||
ViewersFacade.getInstance().startup(this);
|
||||
}
|
||||
|
||||
|
@ -11,5 +11,5 @@
|
||||
<module name="PresentationModule" swfpath="org/bigbluebutton/modules/presentation/PresentationModule.swf" />
|
||||
<module name="VideoModule" swfpath="org/bigbluebutton/modules/video/VideoModule.swf" />
|
||||
<module name="VoiceModule" swfpath="org/bigbluebutton/modules/voiceconference/VoiceModule.swf" />
|
||||
|
||||
<!--module name="JoinModule" url="JoinModule.swf" uri="http://localhost:8080/bigbluebutton/join/enter" /-->
|
||||
</modules>
|
@ -1,9 +1,41 @@
|
||||
<modules>
|
||||
<module name="VideoModule" url="VideoModule.swf" uri="rtmp://localhost/oflaDemo" />
|
||||
<module name="ChatModule" url="ChatModule.swf" uri="rtmp://localhost/chatServer" />
|
||||
<module name="ViewersModule" url="ViewersModule.swf" uri="rtmp://localhost/conference" />
|
||||
<module name="ListenersModule" url="ListenersModule.swf" uri="rtmp://localhost/astmeetme" />
|
||||
<module name="LoginModule" url="LoginModule.swf"
|
||||
uri="http://localhost:8080/bigbluebutton/join/signIn"
|
||||
onAppInitEvent="LOAD" loadNextModule="ChatModule"
|
||||
onAppStartEvent="START"
|
||||
onUserLogoutEvent="STOP"
|
||||
/>
|
||||
<module name="VideoModule" url="VideoModule.swf"
|
||||
uri="rtmp://localhost/oflaDemo"
|
||||
loadNextModule="ViewersModule"
|
||||
onUserJoinedEvent="START"
|
||||
onUserLogoutEvent="STOP"
|
||||
/>
|
||||
<module name="ChatModule" url="ChatModule.swf"
|
||||
uri="rtmp://localhost/bigbluebutton"
|
||||
loadNextModule="PresentationModule"
|
||||
onUserJoinedEvent="START"
|
||||
onUserLogoutEvent="STOP"
|
||||
/>
|
||||
<module name="ViewersModule" url="ViewersModule.swf"
|
||||
uri="rtmp://localhost/bigbluebutton"
|
||||
host="http://localhost:8080/bigbluebutton/join/enter"
|
||||
onUserLoggedInEvent="START"
|
||||
onUserLogoutEvent="STOP"
|
||||
/>
|
||||
<module name="ListenersModule" url="ListenersModule.swf"
|
||||
uri="rtmp://localhost/bigbluebutton"
|
||||
recordingHost="http://134.117.254.226"
|
||||
loadNextModule="VideoModule"
|
||||
onUserJoinedEvent="START"
|
||||
onUserLogoutEvent="STOP"
|
||||
/>
|
||||
<module name="WhiteboardModule" url="WhiteboardModule.swf" uri="rtmp://localhost/test" />
|
||||
<module name="PresentationModule" url="PresentationModule.swf"
|
||||
uri="rtmp://localhost/presentation" host="http://localhost:8080" />
|
||||
uri="rtmp://localhost/bigbluebutton"
|
||||
host="http://localhost:8080"
|
||||
loadNextModule="ListenersModule"
|
||||
onUserJoinedEvent="START"
|
||||
onUserLogoutEvent="STOP"
|
||||
/>
|
||||
</modules>
|
9
bigbluebutton-client/src/conf/sip-config.xml
Normal file
9
bigbluebutton-client/src/conf/sip-config.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<config>
|
||||
<red5Url>rtmp://localhost/sip</red5Url>
|
||||
<sipRealm>134.117.254.226</sipRealm>
|
||||
<sipServer>134.117.254.226</sipServer>
|
||||
<sipUsername>1002</sipUsername>
|
||||
<sipPassword>ff3j</sipPassword>
|
||||
<sipMailbox></sipMailbox>
|
||||
</config>
|
@ -30,6 +30,8 @@ package org.bigbluebutton.common
|
||||
function get username():String;
|
||||
function get userid():Number;
|
||||
function get uri():String;
|
||||
function get role():String;
|
||||
|
||||
function start(attributes:Object):void;
|
||||
function stop():void;
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ package org.bigbluebutton.common.messaging
|
||||
public static const ADD_BUTTON:String = 'ADD_BUTTON';
|
||||
public static const REMOVE_BUTTON:String = 'REMOVE_BUTTON';
|
||||
|
||||
public static const USER_LOGIN:String = 'USER_LOGIN';
|
||||
public static const LOGIN_SUCCESS:String = 'LOGIN_SUCCESS';
|
||||
public static const LOGIN_FAILED:String = 'LOGIN_FAILED';
|
||||
public static const USER_JOINED:String = 'USER_JOINED';
|
||||
public static const JOIN_FAILED:String = 'JOIN_FAILED';
|
||||
public static const USER_LOGGED_IN:String = 'USER_LOGGED_IN'
|
||||
public static const USER_LOGOUT:String = 'USER_LOGOUT';
|
||||
public static const USER_LOGGED_OUT:String = 'USER_LOGGED_OUT';
|
||||
|
@ -36,35 +36,34 @@ package org.bigbluebutton.main
|
||||
public static const OPEN_WINDOW:String = 'OPEN_WINDOW';
|
||||
public static const CLOSE_WINDOW:String = 'CLOSE_WINDOW';
|
||||
|
||||
public static const LOGIN_COMPLETE:String = "LOGIN_COMPLETE";
|
||||
public static const LOGIN_SUCCESS:String = "LOGIN_SUCCESS";
|
||||
public static const LOGIN_FAILED:String = "LOGIN_FAILED";
|
||||
public static const JOIN_SUCCESS:String = "JOIN_SUCCESS";
|
||||
public static const JOIN_FAILED:String = "JOIN_FAILED";
|
||||
|
||||
public static const CONNECTION_LOST:String = "CONNECTION_LOST"
|
||||
|
||||
public static const LOADED_MODULE:String = 'LOADED_MODULE';
|
||||
public static const MODULE_LOAD_PROGRESS:String = "MODULE_LOAD_PROGRESS";
|
||||
public static const MODULE_LOAD_READY:String = "MODULE_LOAD_READY";
|
||||
public static const MODULES_LOAD:String = 'load all modules';
|
||||
public static const MODULES_LOADED:String = 'all modules loaded';
|
||||
public static const MODULES_START:String = 'start all modules';
|
||||
public static const MODULES_STARTED:String = 'modules have started';
|
||||
public static const ALL_MODULES_LOADED:String = 'all modules loaded';
|
||||
public static const MODULE_STOP:String = 'MODULE_STOP';
|
||||
public static const MODULE_START:String = 'MODULE_START';
|
||||
public static const MODULE_STOPPED:String = 'MODULE_STOPPED';
|
||||
public static const MODULE_STARTED:String = 'MODULE_STARTED'
|
||||
public static const RESTART_MODULE:String = "RESTART_MODULE";
|
||||
|
||||
public static const MODULE_LOAD:String = 'load the module';
|
||||
public static const MODULE_LOADED:String = 'module has loaded';
|
||||
public static const MODULE_UNLOAD:String = 'unload the module';
|
||||
public static const APP_START:String = 'start main application';
|
||||
public static const APP_STARTED:String = 'app has started';
|
||||
public static const APP_MODEL_INITIALIZE:String = 'initialize app model';
|
||||
public static const APP_MODEL_INITIALIZED:String = 'app model initialized';
|
||||
public static const APP_VIEW_INITIALIZED:String = 'app view initialized';
|
||||
|
||||
public static const USER_LOGIN:String = 'user logging in';
|
||||
public static const USER_LOGGED_IN:String = 'user logged in'
|
||||
public static const USER_LOGGED_IN:String = 'user logged in';
|
||||
public static const USER_LOGOUT:String = 'user logging out';
|
||||
public static const USER_LOGGED_OUT:String = 'user logged out';
|
||||
|
||||
public static const USER_JOINED:String = 'USER_JOINED';
|
||||
public static const USER_LEFT:String = 'USER_LEFT';
|
||||
|
||||
public static const LOGOUT_EVENT:String = "LOGOUT_EVENT";
|
||||
public static const LOGOUT:String = "LOGOUT";
|
||||
}
|
||||
|
@ -19,7 +19,6 @@
|
||||
*/
|
||||
package org.bigbluebutton.main
|
||||
{
|
||||
import org.bigbluebutton.main.controller.InitializeModelCommand;
|
||||
import org.bigbluebutton.main.controller.StartupCommand;
|
||||
import org.bigbluebutton.main.view.components.MainApplicationShell;
|
||||
import org.puremvc.as3.multicore.interfaces.IFacade;
|
||||
@ -34,14 +33,7 @@ package org.bigbluebutton.main
|
||||
{
|
||||
public static const NAME:String = "MainApplicationFacade";
|
||||
|
||||
// Notification constants
|
||||
public static const STARTUP:String = 'startup';
|
||||
public static const ADD_WINDOW1:String = 'addWindow';
|
||||
public static const REMOVE_WINDOW1:String = 'removeWindow';
|
||||
|
||||
public static const ADD_MODULE:String = "Add New Module";
|
||||
public static const START_ALL_MODULES:String = "Start all Modules";
|
||||
public static const MODULES_STARTED:String = "Modules Started";
|
||||
|
||||
public function MainApplicationFacade(key:String)
|
||||
{
|
||||
@ -64,7 +56,6 @@ package org.bigbluebutton.main
|
||||
{
|
||||
super.initializeController();
|
||||
registerCommand( STARTUP, StartupCommand );
|
||||
registerCommand(MainApplicationConstants.APP_MODEL_INITIALIZE, InitializeModelCommand);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,7 +14,9 @@ package org.bigbluebutton.main
|
||||
private var listenerLoaded:Boolean = false;
|
||||
private var viewerLoaded:Boolean = false;
|
||||
private var videoLoaded:Boolean = false;
|
||||
private var whiteboardLoaded:Boolean = false;
|
||||
private var loginLoaded:Boolean = false;
|
||||
private var joinLoaded:Boolean = false;
|
||||
private var phoneLoaded:Boolean = false;
|
||||
|
||||
public function MainApplicationMediator(mediatorName:String=null, viewComponent:Object=null)
|
||||
{
|
||||
@ -24,13 +26,11 @@ package org.bigbluebutton.main
|
||||
override public function listNotificationInterests():Array
|
||||
{
|
||||
return [
|
||||
MainApplicationConstants.APP_STARTED,
|
||||
MainApplicationConstants.APP_MODEL_INITIALIZED,
|
||||
MainApplicationConstants.MODULE_LOADED,
|
||||
MainApplicationConstants.MODULES_START,
|
||||
MainApplicationConstants.MODULE_STARTED,
|
||||
MainApplicationConstants.ALL_MODULES_LOADED,
|
||||
MainApplicationConstants.RESTART_MODULE,
|
||||
MainApplicationConstants.USER_LOGGED_IN,
|
||||
MainApplicationConstants.USER_JOINED,
|
||||
MainApplicationConstants.LOGOUT
|
||||
];
|
||||
}
|
||||
@ -38,77 +38,32 @@ package org.bigbluebutton.main
|
||||
override public function handleNotification(notification:INotification):void
|
||||
{
|
||||
switch(notification.getName()){
|
||||
case MainApplicationConstants.APP_STARTED:
|
||||
LogUtil.debug(NAME + "::Received APP_STARTED");
|
||||
facade.sendNotification(MainApplicationConstants.APP_MODEL_INITIALIZE);
|
||||
break;
|
||||
case MainApplicationConstants.APP_MODEL_INITIALIZED:
|
||||
LogUtil.debug(NAME + "::Received APP_MODEL_INITIALIZED");
|
||||
//proxy.loadModule("VideoModule");
|
||||
proxy.loadModule("ChatModule");
|
||||
proxy.moduleEventHandler(MainApplicationConstants.APP_MODEL_INITIALIZED);
|
||||
break;
|
||||
case MainApplicationConstants.MODULE_LOADED:
|
||||
LogUtil.debug(NAME + "::Received MODULE_LOADED");
|
||||
var ml:String = notification.getBody() as String;
|
||||
|
||||
if (ml == "ViewersModule") {
|
||||
viewerLoaded = true;
|
||||
}
|
||||
if (ml == "ChatModule") {
|
||||
chatLoaded = true;
|
||||
proxy.loadModule("PresentationModule");
|
||||
}
|
||||
if (ml == "PresentationModule") {
|
||||
presentLoaded = true;
|
||||
proxy.loadModule("ListenersModule");
|
||||
}
|
||||
if (ml == "ListenersModule") {
|
||||
listenerLoaded = true;
|
||||
proxy.loadModule("VideoModule");
|
||||
}
|
||||
if (ml == "VideoModule") {
|
||||
videoLoaded = true;
|
||||
proxy.loadModule("ViewersModule");
|
||||
}
|
||||
if (ml == "WhiteboardModule") {
|
||||
LogUtil.debug("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZz");
|
||||
whiteboardLoaded = true;
|
||||
proxy.loadModule("WhiteboardModule");
|
||||
}
|
||||
|
||||
facade.sendNotification(MainApplicationConstants.LOADED_MODULE, ml);
|
||||
|
||||
// SHortcircuit videomodule start. This is only for refactoring of videoModule.
|
||||
//facade.sendNotification(MainApplicationConstants.MODULE_START, "VideoModule");
|
||||
|
||||
if (viewerLoaded && chatLoaded && presentLoaded && listenerLoaded) {
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_START, "ViewersModule");
|
||||
}
|
||||
|
||||
//proxy.startModule(notification.getBody() as String);
|
||||
case MainApplicationConstants.ALL_MODULES_LOADED:
|
||||
LogUtil.debug(NAME + "::Received ALL_MODULES_LOADED");
|
||||
proxy.moduleEventHandler(MainApplicationConstants.APP_START);
|
||||
break;
|
||||
case MainApplicationConstants.LOGOUT:
|
||||
LogUtil.debug(NAME + '::Received LOGOUT');
|
||||
proxy.stopModule("ChatModule");
|
||||
proxy.stopModule("PresentationModule");
|
||||
proxy.stopModule("ListenersModule");
|
||||
proxy.stopModule("VideoModule");
|
||||
proxy.stopModule("ViewersModule");
|
||||
proxy.stopModule("WhiteboardModule");
|
||||
proxy.moduleEventHandler(MainApplicationConstants.LOGOUT);
|
||||
break;
|
||||
case MainApplicationConstants.RESTART_MODULE:
|
||||
LogUtil.debug(NAME + '::Received RESTART_MODULE for ' + notification.getBody() as String);
|
||||
proxy.stopModule(notification.getBody() as String);
|
||||
// proxy.stopModule(notification.getBody() as String);
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_START, notification.getBody());
|
||||
break;
|
||||
case MainApplicationConstants.USER_LOGGED_IN:
|
||||
LogUtil.debug(NAME + '::Received USER_LOGGED_IN');
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_START, "ChatModule");
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_START, "PresentationModule");
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_START, "ListenersModule");
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_START, "VideoModule");
|
||||
proxy.moduleEventHandler(MainApplicationConstants.USER_LOGGED_IN);
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_START, "WhiteboardModule");
|
||||
break;
|
||||
case MainApplicationConstants.USER_JOINED:
|
||||
LogUtil.debug(NAME + '::Received USER_JOINED');
|
||||
proxy.moduleEventHandler(MainApplicationConstants.USER_JOINED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,12 +55,12 @@ package org.bigbluebutton.main
|
||||
case MainApplicationConstants.MODULE_START:
|
||||
var startModule:String = notification.getBody() as String;
|
||||
LogUtil.debug(NAME + "::Request to start module " + startModule);
|
||||
modulesProxy.startModule(startModule, _router);
|
||||
// modulesProxy.startModule(startModule, _router);
|
||||
break;
|
||||
case MainApplicationConstants.MODULE_STOP:
|
||||
var stopModule:String = notification.getBody() as String;
|
||||
LogUtil.debug(NAME + "::Request to stop module " + stopModule);
|
||||
modulesProxy.stopModule(stopModule);
|
||||
// modulesProxy.stopModule(stopModule);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -71,10 +71,15 @@ package org.bigbluebutton.main
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case EndpointMessageConstants.USER_JOINED:
|
||||
LogUtil.debug(NAME + "::Got USER_JOINED from " + message.getHeader().SRC as String);
|
||||
modulesProxy.user = message.getBody();
|
||||
sendNotification(MainApplicationConstants.USER_JOINED, message.getBody());
|
||||
break;
|
||||
|
||||
case EndpointMessageConstants.USER_LOGGED_IN:
|
||||
LogUtil.debug(NAME + "::Got USER_LOGGED_IN from " + message.getHeader().SRC as String);
|
||||
modulesProxy.user = message.getBody();
|
||||
sendNotification(MainApplicationConstants.USER_LOGGED_IN, message.getBody());
|
||||
sendNotification(MainApplicationConstants.USER_LOGGED_IN);
|
||||
break;
|
||||
case EndpointMessageConstants.USER_LOGGED_OUT:
|
||||
LogUtil.debug(NAME + "::Got USER_LOGGED_OUT from " + message.getHeader().SRC as String);
|
||||
@ -82,12 +87,12 @@ package org.bigbluebutton.main
|
||||
break;
|
||||
case EndpointMessageConstants.MODULE_STARTED:
|
||||
LogUtil.debug(NAME + "::Got MODULE_STARTED from " + message.getBody() as String);
|
||||
modulesProxy.moduleStarted(message.getBody() as String, true);
|
||||
// modulesProxy.moduleStarted(message.getBody() as String, true);
|
||||
break;
|
||||
case EndpointMessageConstants.MODULE_STOPPED:
|
||||
LogUtil.debug(NAME + "::Got MODULE_STOPPED from " + message.getBody() as String);
|
||||
var info:Object = message.getBody();
|
||||
modulesProxy.moduleStarted(info.moduleId, false);
|
||||
// modulesProxy.moduleStarted(info.moduleId, false);
|
||||
if ( (info.moduleId == "ChatModule") || (info.moduleId == "VideoModule") ||
|
||||
(info.moduleId == "ListenersModule") || (info.moduleId == "PresentationModule")){
|
||||
LogUtil.debug(info.moduleId + " has stopped [" + info.manual + "]");
|
||||
|
@ -1,20 +0,0 @@
|
||||
package org.bigbluebutton.main.controller
|
||||
{
|
||||
import org.bigbluebutton.main.model.ModulesProxy;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
public class InitializeModelCommand extends SimpleCommand
|
||||
{
|
||||
override public function execute(note:INotification):void
|
||||
{
|
||||
var proxy:ModulesProxy = facade.retrieveProxy(ModulesProxy.NAME) as ModulesProxy;
|
||||
if (proxy != null) {
|
||||
LogUtil.debug('InitializeModelCommand: Found ModulesProxy');
|
||||
proxy.initialize();
|
||||
} else {
|
||||
LogUtil.debug('InitializeModelCommand: ModulesProxy does not exist.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package org.bigbluebutton.main.controller
|
||||
{
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
public class LoadModuleCommand extends SimpleCommand
|
||||
{
|
||||
public function LoadModuleCommand()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package org.bigbluebutton.main.controller
|
||||
{
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
public class ModelPrepCommand extends SimpleCommand implements ICommand
|
||||
{
|
||||
public function ModelPrepCommand()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
package org.bigbluebutton.main.controller
|
||||
{
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
import org.bigbluebutton.main.model.ModulesProxy;
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
|
||||
public class StartModuleCommand extends SimpleCommand
|
||||
{
|
||||
override public function execute(note:INotification):void
|
||||
{
|
||||
var proxy:ModulesProxy = facade.retrieveProxy(ModulesProxy.NAME) as ModulesProxy;
|
||||
if (proxy != null) {
|
||||
LogUtil.debug('Found ModulesProxy');
|
||||
proxy.loadModules();
|
||||
} else {
|
||||
LogUtil.debug('ModulesProxy does not exist.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -25,7 +25,6 @@ package org.bigbluebutton.main.controller
|
||||
import org.bigbluebutton.main.view.MainApplicationShellMediator;
|
||||
import org.bigbluebutton.main.view.MainToolbarMediator;
|
||||
import org.bigbluebutton.main.view.components.MainApplicationShell;
|
||||
import org.bigbluebutton.modules.video.VideoModuleConstants;
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
@ -42,9 +41,10 @@ package org.bigbluebutton.main.controller
|
||||
facade.registerMediator( new MainApplicationShellMediator( app ) );
|
||||
facade.registerMediator( new MainToolbarMediator(app.toolbar));
|
||||
facade.registerMediator(new MainApplicationMediator());
|
||||
facade.registerMediator(new MainEndpointMediator());
|
||||
facade.registerProxy(new ModulesProxy());
|
||||
sendNotification(VideoModuleConstants.CONNECTED);
|
||||
var med:MainEndpointMediator = new MainEndpointMediator();
|
||||
facade.registerMediator(med);
|
||||
LogUtil.debug("StartupCommand mode=" + app.mode);
|
||||
facade.registerProxy(new ModulesProxy(med.router, app.mode));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package org.bigbluebutton.main.controller
|
||||
{
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
public class StopModuleCommand extends SimpleCommand
|
||||
{
|
||||
public function StopModuleCommand()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package org.bigbluebutton.main.controller
|
||||
{
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
public class UnloadModuleCommand extends SimpleCommand
|
||||
{
|
||||
public function UnloadModuleCommand()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
package org.bigbluebutton.main.model
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
import mx.modules.ModuleLoader;
|
||||
|
||||
public class BbbModuleLoader extends ModuleLoader
|
||||
{
|
||||
private var moduleName:String;
|
||||
|
||||
public function BbbModuleLoader(moduleName:String)
|
||||
{
|
||||
super();
|
||||
this.moduleName = moduleName;
|
||||
|
||||
addEventListener("urlChanged", onUrlChanged);
|
||||
addEventListener("loading", onLoading);
|
||||
addEventListener("progress", onProgress);
|
||||
addEventListener("setup", onSetup);
|
||||
addEventListener("ready", onReady);
|
||||
addEventListener("error", onError);
|
||||
addEventListener("unload", onUnload);
|
||||
}
|
||||
|
||||
public function onUrlChanged(event:Event):void {
|
||||
LogUtil.debug("Module onUrlChanged Event");
|
||||
}
|
||||
|
||||
public function onLoading(event:Event):void {
|
||||
LogUtil.debug("Module onLoading Event");
|
||||
}
|
||||
|
||||
public function onProgress(event:Event):void {
|
||||
LogUtil.debug("Module onProgress Event");
|
||||
}
|
||||
|
||||
public function onSetup(event:Event):void {
|
||||
LogUtil.debug("Module onSetup Event");
|
||||
}
|
||||
|
||||
public function onReady(event:Event):void {
|
||||
LogUtil.debug("Module onReady Event");
|
||||
}
|
||||
|
||||
public function onError(event:Event):void {
|
||||
LogUtil.debug("Module onError Event");
|
||||
}
|
||||
|
||||
public function onUnload(event:Event):void {
|
||||
LogUtil.debug("Module onUnload Event");
|
||||
}
|
||||
}
|
||||
}
|
@ -21,9 +21,13 @@ package org.bigbluebutton.main.model
|
||||
private var _numModules:int = 0;
|
||||
public var _modules:Dictionary = new Dictionary();
|
||||
private var _user:Object;
|
||||
private var _router:Router;
|
||||
private var _mode:String;
|
||||
|
||||
public function BbbModuleManager()
|
||||
public function BbbModuleManager(router:Router, mode:String)
|
||||
{
|
||||
_router = router;
|
||||
_mode = mode;
|
||||
_urlLoader = new URLLoader();
|
||||
_urlLoader.addEventListener(Event.COMPLETE, handleComplete);
|
||||
}
|
||||
@ -72,104 +76,71 @@ package org.bigbluebutton.main.model
|
||||
var item:XML;
|
||||
|
||||
for each(item in list){
|
||||
var attributes:Object = parseAttributes(item);
|
||||
var mod:ModuleDescriptor = new ModuleDescriptor(attributes);
|
||||
var mod:ModuleDescriptor = new ModuleDescriptor(item);
|
||||
_modules[item.@name] = mod;
|
||||
_numModules++;
|
||||
//LogUtil.debug("NAME!!!!!!!!!!!!!!!! " + item.@name);
|
||||
}
|
||||
}
|
||||
|
||||
public function parseAttributes(item:XML):Object {
|
||||
var atts:Object = new Object();
|
||||
var attNamesList:XMLList = item.@*;
|
||||
|
||||
for (var i:int = 0; i < attNamesList.length(); i++)
|
||||
{
|
||||
var attName:String = attNamesList[i].name();
|
||||
var attValue:String = item.attribute(attName);
|
||||
atts[attName] = attValue;
|
||||
}
|
||||
return atts;
|
||||
}
|
||||
|
||||
public function loggedInUser(user:Object):void {
|
||||
LogUtil.debug('loggedin user ' + user.username);
|
||||
_user = new Object();
|
||||
_user.userid = user.userid;
|
||||
_user.conference = user.conference;
|
||||
_user.username = user.username;
|
||||
_user.userrole = user.userrole;
|
||||
_user.room = user.room;
|
||||
_user.authToken = user.authToken;
|
||||
_user.userid = user.userid;
|
||||
_user.mode = _mode; // Assign if this is PLAYBACK or LIVE
|
||||
_user.connection = user.connection;
|
||||
}
|
||||
|
||||
public function addUserIntoAttributes(user:Object):void {
|
||||
for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
m.attributes.userid = user.userid;
|
||||
m.attributes.username = user.name;
|
||||
m.attributes.userrole = user.role;
|
||||
m.attributes.room = user.room;
|
||||
m.attributes.authToken = user.authToken;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function get numberOfModules():int {
|
||||
return _numModules;
|
||||
}
|
||||
|
||||
public function getModule(name:String):ModuleDescriptor {
|
||||
public function hasModule(name:String):Boolean {
|
||||
var m:ModuleDescriptor = getModule(name);
|
||||
if (m != null) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private function getModule(name:String):ModuleDescriptor {
|
||||
for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
if (m.attributes.name == name) {
|
||||
if (m.getAttribute("name") == name) {
|
||||
return m;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*public function loadModules():void {
|
||||
LogUtil.debug('Loading all modules');
|
||||
for (var key:Object in _modules) {
|
||||
LogUtil.debug("["+ key + "," + _modules[key].attributes.url + "]");
|
||||
loadModule(key as String);
|
||||
}
|
||||
}*/
|
||||
|
||||
public function startModules(router:Router):void {
|
||||
LogUtil.debug('Starting all modules');
|
||||
for (var key:Object in _modules) {
|
||||
LogUtil.debug('Starting ' + _modules[key].name);
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
var bbb:IBigBlueButtonModule = m.module as IBigBlueButtonModule;
|
||||
if (m.attributes.name == 'ViewersModule') {
|
||||
bbb.acceptRouter(router);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function startModule(name:String, router:Router):void {
|
||||
private function startModule(name:String):void {
|
||||
LogUtil.debug('Request to start module ' + name);
|
||||
var m:ModuleDescriptor = getModule(name);
|
||||
if (m != null) {
|
||||
LogUtil.debug('Starting ' + name);
|
||||
var bbb:IBigBlueButtonModule = m.module as IBigBlueButtonModule;
|
||||
bbb.acceptRouter(router);
|
||||
bbb.acceptRouter(_router);
|
||||
if (_user != null) {
|
||||
m.attributes.userid = _user.userid;
|
||||
m.attributes.username = _user.username;
|
||||
m.attributes.userrole = _user.userrole;
|
||||
m.attributes.room = _user.room;
|
||||
m.attributes.authToken = _user.authToken;
|
||||
LogUtil.debug(m.attributes.username + " _user.username=" + _user.username);
|
||||
}
|
||||
|
||||
m.addAttribute("conference", _user.conference);
|
||||
m.addAttribute("username", _user.username);
|
||||
m.addAttribute("userrole", _user.userrole);
|
||||
m.addAttribute("room", _user.room);
|
||||
m.addAttribute("authToken", _user.authToken);
|
||||
m.addAttribute("userid", _user.userid);
|
||||
m.addAttribute("mode", _user.mode);
|
||||
m.addAttribute("connection", _user.connection);
|
||||
} else {
|
||||
// Pass the mode that we got from the URL query string.
|
||||
m.addAttribute("mode", _mode);
|
||||
}
|
||||
bbb.start(m.attributes);
|
||||
}
|
||||
}
|
||||
|
||||
public function stopModule(name:String):void {
|
||||
private function stopModule(name:String):void {
|
||||
LogUtil.debug('Request to stop module ' + name);
|
||||
var m:ModuleDescriptor = getModule(name);
|
||||
if (m != null) {
|
||||
@ -202,9 +173,9 @@ package org.bigbluebutton.main.model
|
||||
notifyModuleLoadedListeners(MainApplicationConstants.MODULE_LOAD_PROGRESS, name, progress);
|
||||
break;
|
||||
case MainApplicationConstants.MODULE_LOAD_READY:
|
||||
m.loaded = true;
|
||||
LogUtil.debug('Loaded module ' + m.attributes.name);
|
||||
notifyModuleLoadedListeners(MainApplicationConstants.MODULE_LOAD_READY, name);
|
||||
LogUtil.debug('Module ' + m.attributes.name + " has been loaded.");
|
||||
notifyModuleLoadedListeners(MainApplicationConstants.MODULE_LOAD_READY, name);
|
||||
loadNextModule(name);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -212,6 +183,20 @@ package org.bigbluebutton.main.model
|
||||
}
|
||||
}
|
||||
|
||||
private function loadNextModule(curModule:String):void {
|
||||
var m:ModuleDescriptor = getModule(curModule);
|
||||
if (m != null) {
|
||||
var nextModule:String = m.getAttribute("loadNextModule") as String;
|
||||
if (nextModule != null) {
|
||||
LogUtil.debug("Loading " + nextModule + " next.");
|
||||
loadModule(nextModule);
|
||||
} else {
|
||||
LogUtil.debug("All modules have been loaded - " + m.getAttribute("name") as String);
|
||||
notifyModuleLoadedListeners(MainApplicationConstants.ALL_MODULES_LOADED, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function moduleStarted(name:String, started:Boolean):void {
|
||||
var m:ModuleDescriptor = getModule(name);
|
||||
if (m != null) {
|
||||
@ -223,5 +208,50 @@ package org.bigbluebutton.main.model
|
||||
public function get modules():Dictionary {
|
||||
return _modules;
|
||||
}
|
||||
|
||||
public function handleAppModelInitialized():void {
|
||||
for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
if (m.getAttribute("onAppInitEvent") != null) {
|
||||
loadModule(m.getAttribute("name") as String);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function handleAppStart():void {
|
||||
for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
if (m.getAttribute("onAppStartEvent") != null) {
|
||||
startModule(m.getAttribute("name") as String);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function handleUserLoggedIn():void {
|
||||
for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
if (m.getAttribute("onUserLoggedInEvent") != null) {
|
||||
startModule(m.getAttribute("name") as String);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function handleUserJoined():void {
|
||||
for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
if (m.getAttribute("onUserJoinedEvent") != null) {
|
||||
startModule(m.getAttribute("name") as String);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function handleLogout():void {
|
||||
for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
if (m.getAttribute("onUserLogoutEvent") != null) {
|
||||
stopModule(m.getAttribute("name") as String);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -10,57 +10,93 @@ package org.bigbluebutton.main.model
|
||||
|
||||
public class ModuleDescriptor
|
||||
{
|
||||
public var attributes:Object;
|
||||
public var loader:ModuleLoader;
|
||||
public var module:IBigBlueButtonModule;
|
||||
public var loaded:Boolean = false;
|
||||
public var started:Boolean = false;
|
||||
public var connected:Boolean = false;
|
||||
|
||||
private var _attributes:Object;
|
||||
private var _loader:ModuleLoader;
|
||||
private var _module:IBigBlueButtonModule;
|
||||
private var _loaded:Boolean = false;
|
||||
private var _started:Boolean = false;
|
||||
private var _connected:Boolean = false;
|
||||
|
||||
private var callbackHandler:Function;
|
||||
|
||||
public function ModuleDescriptor(attributes:Object)
|
||||
public function ModuleDescriptor(attributes:XML)
|
||||
{
|
||||
this.attributes = attributes;
|
||||
_attributes = new Object();
|
||||
_loader = new ModuleLoader();
|
||||
|
||||
loader = new ModuleLoader();
|
||||
parseAttributes(attributes);
|
||||
}
|
||||
|
||||
public function addAttribute(attribute:String, value:Object):void {
|
||||
_attributes[attribute] = value;
|
||||
}
|
||||
|
||||
public function getAttribute(name:String):Object {
|
||||
return _attributes[name];
|
||||
}
|
||||
|
||||
public function get attributes():Object {
|
||||
return _attributes;
|
||||
}
|
||||
|
||||
public function get module():IBigBlueButtonModule {
|
||||
return _module;
|
||||
}
|
||||
|
||||
public function get loaded():Boolean {
|
||||
return _loaded;
|
||||
}
|
||||
|
||||
public function set started(value:Boolean):void {
|
||||
_started = value;
|
||||
}
|
||||
|
||||
private function parseAttributes(item:XML):void {
|
||||
var attNamesList:XMLList = item.@*;
|
||||
|
||||
for (var i:int = 0; i < attNamesList.length(); i++)
|
||||
{
|
||||
var attName:String = attNamesList[i].name();
|
||||
var attValue:String = item.attribute(attName);
|
||||
_attributes[attName] = attValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function load(resultHandler:Function):void {
|
||||
callbackHandler = resultHandler;
|
||||
// loader.addEventListener("urlChanged", resultHandler);
|
||||
// loader.addEventListener("loading", resultHandler);
|
||||
loader.addEventListener("progress", onLoadProgress);
|
||||
_loader.addEventListener("progress", onLoadProgress);
|
||||
// loader.addEventListener("setup", resultHandler);
|
||||
loader.addEventListener("ready", onReady);
|
||||
_loader.addEventListener("ready", onReady);
|
||||
// loader.addEventListener("error", resultHandler);
|
||||
// loader.addEventListener("unload", resultHandler);
|
||||
loader.url = attributes.url;
|
||||
loader.loadModule();
|
||||
_loader.url = _attributes.url;
|
||||
_loader.loadModule();
|
||||
}
|
||||
|
||||
public function unload():void {
|
||||
loader.url = "";
|
||||
_loader.url = "";
|
||||
}
|
||||
|
||||
private function onReady(event:Event):void {
|
||||
LogUtil.debug("Module onReady Event");
|
||||
var loader:ModuleLoader = event.target as ModuleLoader;
|
||||
module = loader.child as IBigBlueButtonModule;
|
||||
if (module != null) {
|
||||
LogUtil.debug("Module " + attributes.name + " has been loaded");
|
||||
loaded = true;
|
||||
var modLoader:ModuleLoader = event.target as ModuleLoader;
|
||||
_module = modLoader.child as IBigBlueButtonModule;
|
||||
if (_module != null) {
|
||||
LogUtil.debug("Module " + _attributes.name + " has been loaded");
|
||||
_loaded = true;
|
||||
callbackHandler(MainApplicationConstants.MODULE_LOAD_READY, _attributes.name);
|
||||
} else {
|
||||
LogUtil.error("Module loaded is null.");
|
||||
}
|
||||
callbackHandler(MainApplicationConstants.MODULE_LOAD_READY, attributes.name);
|
||||
|
||||
}
|
||||
|
||||
private function onLoadProgress(e:ProgressEvent):void {
|
||||
//var loader:ModuleLoader = e.target as ModuleLoader;
|
||||
//module = loader.child as IBigBlueButtonModule;
|
||||
//if (module != null) {
|
||||
callbackHandler(MainApplicationConstants.MODULE_LOAD_PROGRESS, attributes.name, Math.round((e.bytesLoaded/e.bytesTotal) * 100));
|
||||
//}
|
||||
|
||||
callbackHandler(MainApplicationConstants.MODULE_LOAD_PROGRESS,
|
||||
_attributes.name, Math.round((e.bytesLoaded/e.bytesTotal) * 100));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,12 +1,10 @@
|
||||
package org.bigbluebutton.main.model
|
||||
{
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
import org.bigbluebutton.main.MainApplicationConstants;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
|
||||
public class ModulesProxy extends Proxy implements IProxy
|
||||
{
|
||||
public static const NAME:String = 'ModulesProxy';
|
||||
@ -14,11 +12,15 @@ package org.bigbluebutton.main.model
|
||||
private var modulesManager:BbbModuleManager;
|
||||
|
||||
private var _user:Object;
|
||||
private var _router:Router;
|
||||
private var _mode:String;
|
||||
|
||||
public function ModulesProxy(data:Object=null)
|
||||
public function ModulesProxy(router:Router, mode:String)
|
||||
{
|
||||
super(NAME, data);
|
||||
modulesManager = new BbbModuleManager();
|
||||
super(NAME);
|
||||
_router = router;
|
||||
_mode = mode;
|
||||
modulesManager = new BbbModuleManager(_router, _mode);
|
||||
modulesManager.addInitializedListener(onInitializeComplete);
|
||||
modulesManager.addModuleLoadedListener(onModuleLoadedListener);
|
||||
modulesManager.initialize();
|
||||
@ -36,40 +38,20 @@ package org.bigbluebutton.main.model
|
||||
public function set user(loggedInUser:Object):void {
|
||||
_user = loggedInUser;
|
||||
modulesManager.loggedInUser(_user);
|
||||
// Add this into the attributes of the module
|
||||
//modulesManager.addUserIntoAttributes(_user);
|
||||
}
|
||||
|
||||
/*
|
||||
public function loadModules():void {
|
||||
LogUtil.debug('Loading all modules');
|
||||
for (var key:Object in _modules) {
|
||||
LogUtil.debug(key, _modules[key].attributes.url);
|
||||
loadModule(key, loadModuleResultHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function startModules(router:Router):void {
|
||||
LogUtil.debug('Starting all modules');
|
||||
for (var key:Object in _modules) {
|
||||
LogUtil.debug('Starting ' + _modules[key].name);
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
var bbb:IBigBlueButtonModule = m.module as IBigBlueButtonModule;
|
||||
if (m.attributes.name == 'ViewersModule') {
|
||||
bbb.acceptRouter(router);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public function startModule(name:String, router:Router):void {
|
||||
LogUtil.debug('Request to start module ' + name);
|
||||
modulesManager.startModule(name, router);
|
||||
public function get username():String {
|
||||
return _user.username;
|
||||
}
|
||||
|
||||
public function stopModule(name:String):void {
|
||||
modulesManager.stopModule(name);
|
||||
}
|
||||
// public function startModule(name:String, router:Router):void {
|
||||
// LogUtil.debug('Request to start module ' + name);
|
||||
// modulesManager.startModule(name, router);
|
||||
// }
|
||||
|
||||
// public function stopModule(name:String):void {
|
||||
// modulesManager.stopModule(name);
|
||||
// }
|
||||
|
||||
public function loadModule(name:String):void {
|
||||
LogUtil.debug('Loading ' + name);
|
||||
@ -78,30 +60,37 @@ package org.bigbluebutton.main.model
|
||||
|
||||
private function onModuleLoadedListener(event:String, name:String, progress:Number=0):void {
|
||||
switch(event) {
|
||||
case MainApplicationConstants.MODULE_LOAD_PROGRESS:
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_LOAD_PROGRESS, {name:name, progress:progress});
|
||||
break;
|
||||
case MainApplicationConstants.MODULE_LOAD_READY:
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_LOADED, name);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
case MainApplicationConstants.MODULE_LOAD_PROGRESS:
|
||||
facade.sendNotification(MainApplicationConstants.MODULE_LOAD_PROGRESS, {name:name, progress:progress});
|
||||
break;
|
||||
case MainApplicationConstants.MODULE_LOAD_READY:
|
||||
facade.sendNotification(MainApplicationConstants.LOADED_MODULE, name);
|
||||
break;
|
||||
case MainApplicationConstants.ALL_MODULES_LOADED:
|
||||
LogUtil.debug(NAME + " All modules have been loaded.");
|
||||
facade.sendNotification(MainApplicationConstants.ALL_MODULES_LOADED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function moduleStarted(name:String, started:Boolean):void {
|
||||
/* for (var key:Object in _modules) {
|
||||
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
|
||||
if (m != null) {
|
||||
LogUtil.debug('Setting ' + _modules[key].name + ' started to ' + started);
|
||||
m.started = started;
|
||||
}
|
||||
}
|
||||
*/ }
|
||||
|
||||
public function get modules():Dictionary {
|
||||
return null;
|
||||
// return _modules;
|
||||
public function moduleEventHandler(event:String):void {
|
||||
switch (event) {
|
||||
case MainApplicationConstants.APP_MODEL_INITIALIZED:
|
||||
modulesManager.handleAppModelInitialized();
|
||||
break;
|
||||
case MainApplicationConstants.APP_START:
|
||||
modulesManager.handleAppStart();
|
||||
break;
|
||||
case MainApplicationConstants.USER_LOGGED_IN:
|
||||
modulesManager.handleUserLoggedIn();
|
||||
break;
|
||||
case MainApplicationConstants.USER_JOINED:
|
||||
modulesManager.handleUserJoined();
|
||||
break;
|
||||
case MainApplicationConstants.LOGOUT:
|
||||
modulesManager.handleLogout();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -28,9 +28,11 @@ package org.bigbluebutton.main.view
|
||||
|
||||
import org.bigbluebutton.common.IBbbModuleWindow;
|
||||
import org.bigbluebutton.main.MainApplicationConstants;
|
||||
import org.bigbluebutton.main.model.ModulesProxy;
|
||||
import org.bigbluebutton.main.view.components.MainApplicationShell;
|
||||
import org.bigbluebutton.main.view.components.ModuleStoppedWindow;
|
||||
import org.bigbluebutton.main.view.events.StartModuleEvent;
|
||||
import org.bigbluebutton.modules.red5phone.view.components.Red5PhoneWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
|
||||
@ -73,6 +75,7 @@ package org.bigbluebutton.main.view
|
||||
return [
|
||||
MainApplicationConstants.ADD_WINDOW_MSG,
|
||||
MainApplicationConstants.REMOVE_WINDOW_MSG,
|
||||
MainApplicationConstants.USER_JOINED,
|
||||
MainApplicationConstants.USER_LOGGED_IN,
|
||||
MainApplicationConstants.USER_LOGGED_OUT,
|
||||
MainApplicationConstants.LOADED_MODULE,
|
||||
@ -81,22 +84,42 @@ package org.bigbluebutton.main.view
|
||||
];
|
||||
}
|
||||
|
||||
private var red5phoneAdded:Boolean = false;
|
||||
private var red5PhoneWindow:Red5PhoneWindow = new Red5PhoneWindow();
|
||||
|
||||
override public function handleNotification(notification:INotification):void{
|
||||
switch(notification.getName()){
|
||||
case MainApplicationConstants.ADD_WINDOW_MSG:
|
||||
var win:IBbbModuleWindow = notification.getBody() as IBbbModuleWindow;
|
||||
//LogUtil.debug(NAME + "::putting window in " + win.xPosition + " " + win.yPosition);
|
||||
shell.mdiCanvas.windowManager.add(win as MDIWindow);
|
||||
shell.mdiCanvas.windowManager.absPos(win as MDIWindow, win.xPosition, win.yPosition);
|
||||
shell.mdiCanvas.windowManager.absPos(win as MDIWindow, win.xPosition, win.yPosition);
|
||||
break;
|
||||
case MainApplicationConstants.REMOVE_WINDOW_MSG:
|
||||
var rwin:IBbbModuleWindow = notification.getBody() as IBbbModuleWindow;
|
||||
//LogUtil.debug(NAME + "::removing window " + (rwin as MDIWindow).name);
|
||||
shell.mdiCanvas.windowManager.remove(rwin as MDIWindow);
|
||||
break;
|
||||
case MainApplicationConstants.USER_LOGGED_OUT:
|
||||
//if (red5phoneAdded) {
|
||||
// red5phoneAdded = false;
|
||||
// shell.mdiCanvas.windowManager.remove(red5PhoneWindow as MDIWindow);
|
||||
//}
|
||||
break;
|
||||
case MainApplicationConstants.USER_JOINED:
|
||||
/**
|
||||
* Workaround to pass in username for sip registration.
|
||||
*/
|
||||
red5PhoneWindow.sipusername = modulesProxy.username;
|
||||
break;
|
||||
case MainApplicationConstants.USER_LOGGED_IN:
|
||||
shell.loadedModules.text = "";
|
||||
shell.loadProgress.text = "";
|
||||
//if (!red5phoneAdded) {
|
||||
// red5phoneAdded = true;
|
||||
// shell.mdiCanvas.windowManager.add(red5PhoneWindow as MDIWindow);
|
||||
// shell.mdiCanvas.windowManager.absPos(red5PhoneWindow as MDIWindow, red5PhoneWindow.xPosition, red5PhoneWindow.yPosition);
|
||||
//}
|
||||
break;
|
||||
case MainApplicationConstants.MODULE_STOPPED:
|
||||
var info:Object = notification.getBody();
|
||||
@ -106,10 +129,10 @@ package org.bigbluebutton.main.view
|
||||
shell.loadedModules.text += notification.getBody() + "(loaded) ";
|
||||
|
||||
// Should do this properly.
|
||||
if (notification.getBody() == "ViewersModule") {
|
||||
shell.loadedModules.text = "";
|
||||
shell.loadProgress.text = "";
|
||||
}
|
||||
//if (notification.getBody() == "ViewersModule") {
|
||||
// shell.loadedModules.text = "";
|
||||
// shell.loadProgress.text = "";
|
||||
//}
|
||||
break;
|
||||
case MainApplicationConstants.MODULE_LOAD_PROGRESS:
|
||||
var mod:String = notification.getBody().name as String;
|
||||
@ -133,5 +156,9 @@ package org.bigbluebutton.main.view
|
||||
t.x = point1.x + 25;
|
||||
t.y = point1.y + 25;
|
||||
}
|
||||
|
||||
private function get modulesProxy():ModulesProxy {
|
||||
return facade.retrieveProxy(ModulesProxy.NAME) as ModulesProxy;
|
||||
}
|
||||
}
|
||||
}
|
@ -41,8 +41,8 @@ package org.bigbluebutton.main.view
|
||||
|
||||
override public function listNotificationInterests():Array{
|
||||
return [
|
||||
MainApplicationConstants.USER_LOGGED_IN,
|
||||
MainApplicationConstants.USER_LOGGED_OUT,
|
||||
MainApplicationConstants.USER_JOINED,
|
||||
MainApplicationConstants.USER_LEFT,
|
||||
MainApplicationConstants.ADD_BUTTON,
|
||||
MainApplicationConstants.REMOVE_BUTTON
|
||||
];
|
||||
@ -50,11 +50,11 @@ package org.bigbluebutton.main.view
|
||||
|
||||
override public function handleNotification(notification:INotification):void{
|
||||
switch(notification.getName()){
|
||||
case MainApplicationConstants.USER_LOGGED_IN:
|
||||
toolbar.loggedIn(notification.getBody().username, notification.getBody().room, notification.getBody().userrole);
|
||||
case MainApplicationConstants.USER_JOINED:
|
||||
toolbar.loggedIn(notification.getBody().username, notification.getBody().conference, notification.getBody().userrole);
|
||||
toolbar.visible = true;
|
||||
break;
|
||||
case MainApplicationConstants.USER_LOGGED_OUT:
|
||||
case MainApplicationConstants.USER_LEFT:
|
||||
toolbar.visible = false;
|
||||
break;
|
||||
case MainApplicationConstants.ADD_BUTTON:
|
||||
|
@ -33,13 +33,56 @@
|
||||
private var logs:Logger = new Logger();
|
||||
private var logWindow:LogWindow;
|
||||
|
||||
// LIVE or PLAYBACK
|
||||
private var _mode:String = 'LIVE';
|
||||
|
||||
[Bindable] private var fullscreen_icon:Class = images.full_screen;
|
||||
[Bindable] private var logs_icon:Class = images.logs;
|
||||
|
||||
|
||||
public function get mode():String {
|
||||
return _mode;
|
||||
}
|
||||
|
||||
private function parseString():void {
|
||||
try {
|
||||
// Remove everything before the question mark, including the question mark
|
||||
var myPattern:RegExp = /.*\?/;
|
||||
var s:String = ExternalInterface.call("window.location.search.substring", 1);
|
||||
s = s.replace(myPattern, "");
|
||||
|
||||
// Create an array of name=value Strings.
|
||||
var params:Array = s.split("&");
|
||||
|
||||
// Print the params that are in the array.
|
||||
var keyStr:String;
|
||||
var valueStr:String;
|
||||
var paramObj:Object = params;
|
||||
for (keyStr in paramObj) {
|
||||
valueStr = String(paramObj[keyStr]);
|
||||
LogUtil.debug("PARAMS: " + keyStr + ":" + valueStr + "\n");
|
||||
|
||||
for (var i:int = 0; i < params.length; i++) {
|
||||
var tempA:Array = params[i].split("=");
|
||||
if (String(tempA[0]).toUpperCase() == 'MODE') {
|
||||
if (String(tempA[1]).toUpperCase() == 'PLAYBACK') {
|
||||
LogUtil.debug('Setting to PLAYBACK mode.');
|
||||
_mode = 'PLAYBACK';
|
||||
} else {
|
||||
LogUtil.debug('Setting to LIVE mode.');
|
||||
_mode = 'LIVE';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch(e:Error) {
|
||||
trace(e);
|
||||
}
|
||||
}
|
||||
protected function initializeShell():void
|
||||
{
|
||||
logWindow = new LogWindow();
|
||||
logWindow.logs = logs;
|
||||
parseString();
|
||||
|
||||
facade.startup(this);
|
||||
}
|
||||
|
@ -78,7 +78,8 @@ package org.bigbluebutton.modules.chat
|
||||
case ChatModuleConstants.DISCONNECTED:
|
||||
LogUtil.debug('Sending Chat MODULE_STOPPED message to main');
|
||||
facade.sendNotification(ChatModuleConstants.CLOSE_WINDOW);
|
||||
var info:Object = notification.getBody();
|
||||
//var info:Object = notification.getBody();
|
||||
var info:Object = new Object()
|
||||
info["moduleId"] = _module.moduleId
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STOPPED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, info);
|
||||
|
@ -19,12 +19,11 @@
|
||||
*/
|
||||
package org.bigbluebutton.modules.chat.controller
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.modules.chat.ChatEndpointMediator;
|
||||
import org.bigbluebutton.modules.chat.ChatModuleConstants;
|
||||
import org.bigbluebutton.modules.chat.ChatModuleMediator;
|
||||
import org.bigbluebutton.modules.chat.model.business.ChatProxy;
|
||||
import org.bigbluebutton.modules.chat.view.ChatWindowMediator;
|
||||
import org.bigbluebutton.modules.chat.view.components.ChatWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
@ -37,7 +36,8 @@ package org.bigbluebutton.modules.chat.controller
|
||||
facade.registerMediator(new ChatModuleMediator(m));
|
||||
facade.registerMediator(new ChatEndpointMediator(m));
|
||||
facade.registerMediator( new ChatWindowMediator(m) );
|
||||
facade.registerProxy(new ChatProxy(m.uri));
|
||||
facade.registerProxy(new ChatProxy(m));
|
||||
sendNotification(ChatModuleConstants.CONNECTED);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package org.bigbluebutton.modules.chat.controller
|
||||
{
|
||||
import org.bigbluebutton.modules.chat.ChatModuleConstants;
|
||||
import org.bigbluebutton.modules.chat.model.business.ChatProxy;
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
@ -13,6 +14,7 @@ package org.bigbluebutton.modules.chat.controller
|
||||
if (facade.hasProxy(ChatProxy.NAME)) {
|
||||
var p:ChatProxy = facade.retrieveProxy(ChatProxy.NAME) as ChatProxy;
|
||||
p.stop();
|
||||
sendNotification(ChatModuleConstants.DISCONNECTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
package org.bigbluebutton.modules.chat.model.business
|
||||
{
|
||||
import org.bigbluebutton.modules.chat.ChatModuleConstants;
|
||||
import org.bigbluebutton.modules.chat.model.vo.*;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
@ -28,32 +27,32 @@ package org.bigbluebutton.modules.chat.model.business
|
||||
{
|
||||
public static const NAME:String = "ChatProxy";
|
||||
|
||||
private var uri:String;
|
||||
private var module:ChatModule;
|
||||
private var chatService:IChatService;
|
||||
|
||||
// Is teh disconnection due to user issuing the disconnect or is it the server
|
||||
// disconnecting due to t fault?
|
||||
private var manualDisconnect:Boolean = false;
|
||||
|
||||
public function ChatProxy(uri:String)
|
||||
public function ChatProxy(module:ChatModule)
|
||||
{
|
||||
super(NAME);
|
||||
this.uri = uri;
|
||||
this.module = module;
|
||||
start();
|
||||
}
|
||||
|
||||
public function start():void {
|
||||
chatService = new ChatSOService(uri);
|
||||
chatService = new ChatSOService(module);
|
||||
manualDisconnect = false;
|
||||
chatService.connect(uri);
|
||||
chatService.addMessageListener(newMessageHandler);
|
||||
chatService.addConnectionStatusListener(connectionStatusListener);
|
||||
// chatService.addConnectionStatusListener(connectionStatusListener);
|
||||
chatService.join();
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
// USer is issuing a disconnect.
|
||||
manualDisconnect = true;
|
||||
chatService.disconnect();
|
||||
chatService.leave();
|
||||
}
|
||||
|
||||
private function connectionStatusListener(connected:Boolean, errors:Array):void {
|
||||
|
@ -22,6 +22,8 @@ package org.bigbluebutton.modules.chat.model.business
|
||||
import flash.events.AsyncErrorEvent;
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.events.SyncEvent;
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.Responder;
|
||||
import flash.net.SharedObject;
|
||||
|
||||
public class ChatSOService implements IChatService
|
||||
@ -31,29 +33,18 @@ package org.bigbluebutton.modules.chat.model.business
|
||||
private static const TRANSCRIPT:String = "TRANSCRIPT";
|
||||
private var chatSO : SharedObject;
|
||||
private var netConnectionDelegate: NetConnectionDelegate;
|
||||
private var _uri:String;
|
||||
private var module:ChatModule;
|
||||
private var _msgListener:Function;
|
||||
private var _connectionListener:Function;
|
||||
private var _soErrors:Array;
|
||||
|
||||
private var needsTranscript:Boolean = false;
|
||||
|
||||
public function ChatSOService(uri:String)
|
||||
public function ChatSOService(module:ChatModule)
|
||||
{
|
||||
_uri = uri;
|
||||
netConnectionDelegate = new NetConnectionDelegate(uri, connectionListener);
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
public function connect(uri:String):void {
|
||||
_uri = uri
|
||||
netConnectionDelegate.connect();
|
||||
}
|
||||
|
||||
public function disconnect():void {
|
||||
leave();
|
||||
netConnectionDelegate.disconnect();
|
||||
}
|
||||
|
||||
|
||||
private function connectionListener(connected:Boolean, errors:Array=null):void {
|
||||
if (connected) {
|
||||
LogUtil.debug(NAME + ":Connected to the Chat application");
|
||||
@ -66,21 +57,22 @@ package org.bigbluebutton.modules.chat.model.business
|
||||
}
|
||||
}
|
||||
|
||||
private function join() : void
|
||||
public function join() : void
|
||||
{
|
||||
chatSO = SharedObject.getRemote("chatSO", _uri, false);
|
||||
chatSO.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
chatSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
chatSO.addEventListener(SyncEvent.SYNC, sharedObjectSyncHandler);
|
||||
chatSO = SharedObject.getRemote("chatSO", module.uri, false);
|
||||
chatSO.client = this;
|
||||
chatSO.connect(netConnectionDelegate.connection);
|
||||
chatSO.connect(module.connection);
|
||||
LogUtil.debug(NAME + ":Chat is connected to Shared object");
|
||||
|
||||
notifyConnectionStatusListener(true);
|
||||
if (module.mode == 'LIVE') {
|
||||
getChatTranscript();
|
||||
}
|
||||
}
|
||||
|
||||
private function leave():void
|
||||
public function leave():void
|
||||
{
|
||||
if (chatSO != null) chatSO.close();
|
||||
notifyConnectionStatusListener(false);
|
||||
}
|
||||
|
||||
public function addMessageListener(messageListener:Function):void {
|
||||
@ -93,26 +85,56 @@ package org.bigbluebutton.modules.chat.model.business
|
||||
|
||||
public function sendMessage(message:String):void
|
||||
{
|
||||
var trans:String = chatSO.data[TRANSCRIPT];
|
||||
if (trans != null) {
|
||||
trans += '<br/>' + message;
|
||||
} else {
|
||||
trans = message;
|
||||
}
|
||||
chatSO.setProperty(TRANSCRIPT, trans);
|
||||
chatSO.setDirty(TRANSCRIPT);
|
||||
chatSO.send("receiveNewMessage", message);
|
||||
var nc:NetConnection = module.connection;
|
||||
nc.call(
|
||||
"chat.sendMessage",// Remote function name
|
||||
new Responder(
|
||||
// On successful result
|
||||
function(result:Object):void {
|
||||
LogUtil.debug("Successfully sent message: ");
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
),//new Responder
|
||||
message
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
public function receiveNewMessage(message:String):void{
|
||||
|
||||
/**
|
||||
* Called by the server to deliver a new chat message.
|
||||
*/
|
||||
public function newChatMessage(message:String):void{
|
||||
if (_msgListener != null) {
|
||||
_msgListener( message);
|
||||
}
|
||||
}
|
||||
|
||||
public function getChatTranscript():void {
|
||||
LogUtil.debug('getting chat transcript');
|
||||
needsTranscript = true;
|
||||
var nc:NetConnection = module.connection;
|
||||
nc.call(
|
||||
"chat.getChatMessages",// Remote function name
|
||||
new Responder(
|
||||
// On successful result
|
||||
function(result:Object):void {
|
||||
LogUtil.debug("Successfully sent message: ");
|
||||
if (result != null) {
|
||||
newChatMessage(result as String);
|
||||
}
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
)//new Responder
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
private function notifyConnectionStatusListener(connected:Boolean, errors:Array=null):void {
|
||||
@ -123,69 +145,6 @@ package org.bigbluebutton.modules.chat.model.business
|
||||
LogUtil.debug("_connectionListener is null");
|
||||
}
|
||||
}
|
||||
|
||||
private function sharedObjectSyncHandler(event:SyncEvent):void
|
||||
{
|
||||
if (event.changeList.length == 1) {
|
||||
if (needsTranscript) {
|
||||
needsTranscript = false;
|
||||
}
|
||||
} else {
|
||||
for (var i : uint = 0; i < event.changeList.length; i++)
|
||||
{
|
||||
if (event.changeList[i].name == TRANSCRIPT) {
|
||||
if (needsTranscript) {
|
||||
needsTranscript = false;
|
||||
receiveNewMessage( chatSO.data[TRANSCRIPT] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function netStatusHandler (event:NetStatusEvent):void
|
||||
{
|
||||
var statusCode:String = event.info.code;
|
||||
|
||||
switch ( statusCode )
|
||||
{
|
||||
case "NetConnection.Connect.Success":
|
||||
LogUtil.debug(NAME + ":Connection Success");
|
||||
//notifyConnectionStatusListener(true);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Failed":
|
||||
addError("ChatSO connection failed");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Closed":
|
||||
addError("Connection to ChatSO was closed.");
|
||||
notifyConnectionStatusListener(false, _soErrors);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.InvalidApp":
|
||||
addError("ChatSO not found in server");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.AppShutDown":
|
||||
addError("ChatSO is shutting down");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Rejected":
|
||||
addError("No permissions to connect to the chat SO");
|
||||
break;
|
||||
|
||||
default :
|
||||
//addError("ChatSO " + event.info.code);
|
||||
LogUtil.debug(NAME + ":default - " + event.info.code );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function asyncErrorHandler (event:AsyncErrorEvent):void
|
||||
{
|
||||
addError("ChatSO asynchronous error.");
|
||||
}
|
||||
|
||||
private function addError(error:String):void {
|
||||
if (_soErrors == null) {
|
||||
|
@ -2,8 +2,8 @@ package org.bigbluebutton.modules.chat.model.business
|
||||
{
|
||||
public interface IChatService
|
||||
{
|
||||
function connect(uri:String):void;
|
||||
function disconnect():void;
|
||||
function join():void;
|
||||
function leave():void;
|
||||
function sendMessage(message:String):void;
|
||||
function getChatTranscript():void;
|
||||
function addMessageListener(msgListener:Function):void;
|
||||
|
@ -1,19 +0,0 @@
|
||||
package org.bigbluebutton.modules.chat.model.business
|
||||
{
|
||||
import flash.events.SyncEvent;
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.SharedObject;
|
||||
|
||||
import org.bigbluebutton.modules.chat.ChatModuleConstants;
|
||||
import org.bigbluebutton.modules.chat.model.vo.MessageObject;
|
||||
import org.bigbluebutton.modules.chat.model.vo.MessageVO;
|
||||
|
||||
public class PlaybackProxy
|
||||
{
|
||||
//public static const NAME:String = "Chat Playback Proxy";
|
||||
|
||||
public function PlaybackProxy(messageVO:MessageVO, nc:NetConnection = null)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.chat.model.vo
|
||||
{
|
||||
public class MessageObject
|
||||
{
|
||||
public var color:uint;
|
||||
public var message:String;
|
||||
private var userid:String;
|
||||
public var room:String;
|
||||
public var host:String;
|
||||
/**
|
||||
*
|
||||
* @param message
|
||||
* @param color
|
||||
*
|
||||
*/
|
||||
public function MessageObject(message:String, color:uint)
|
||||
{
|
||||
this.color = color;
|
||||
this.message = message;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return the color of message font
|
||||
*
|
||||
*/
|
||||
public function getColor():uint{
|
||||
return this.color;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return a string containing the last message
|
||||
*
|
||||
*/
|
||||
public function getMessage (): String {
|
||||
return this.message;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return userid
|
||||
*
|
||||
*/
|
||||
public function getUserid():String {
|
||||
return this.userid;
|
||||
}
|
||||
|
||||
public function setUserid(userid:String):void{
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -23,7 +23,6 @@ package org.bigbluebutton.modules.chat.view
|
||||
|
||||
import org.bigbluebutton.modules.chat.ChatModuleConstants;
|
||||
import org.bigbluebutton.modules.chat.model.business.ChatProxy;
|
||||
import org.bigbluebutton.modules.chat.model.vo.*;
|
||||
import org.bigbluebutton.modules.chat.view.components.ChatWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
@ -59,7 +58,7 @@ package org.bigbluebutton.modules.chat.view
|
||||
{
|
||||
var newMessage:String;
|
||||
newMessage = "<font color=\"#" + _chatWindow.cmpColorPicker.selectedColor.toString(16) + "\"><b>[" +
|
||||
_module.username +" - "+ time()+ "]</b> " + _chatWindow.txtMsg.text + "</font>";
|
||||
_module.username +" - "+ time()+ "]</b> " + _chatWindow.txtMsg.text + "</font><br/>";
|
||||
proxy.sendMessage(newMessage);
|
||||
_chatWindow.txtMsg.text = "";
|
||||
}
|
||||
@ -100,7 +99,6 @@ package org.bigbluebutton.modules.chat.view
|
||||
_chatWindow.yPosition = 0;
|
||||
facade.sendNotification(ChatModuleConstants.ADD_WINDOW, _chatWindow);
|
||||
_chatWindowOpen = true;
|
||||
proxy.getChatTranscript();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
public function showNewMessage(message:String):void
|
||||
{
|
||||
txtChatBox.htmlText += message + "\n";
|
||||
txtChatBox.htmlText += message;
|
||||
}
|
||||
|
||||
public function setFocusOn(component:UIComponent):void
|
||||
|
@ -0,0 +1,110 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.join
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.bigbluebutton.common.messaging.EndpointMessageConstants;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
|
||||
|
||||
public class JoinEndpointMediator extends Mediator implements IMediator
|
||||
{
|
||||
public static const NAME:String = "JoinEndpointMediator";
|
||||
|
||||
private var _module:IBigBlueButtonModule;
|
||||
private var _router:Router;
|
||||
private var _endpoint:Endpoint;
|
||||
private static const TO_JOIN_MODULE:String = "TO_JOIN_MODULE";
|
||||
private static const FROM_JOIN_MODULE:String = "FROM_JOIN_MODULE";
|
||||
|
||||
private static const PLAYBACK_MESSAGE:String = "PLAYBACK_MESSAGE";
|
||||
private static const PLAYBACK_MODE:String = "PLAYBACK_MODE";
|
||||
|
||||
public function JoinEndpointMediator(module:IBigBlueButtonModule)
|
||||
{
|
||||
super(NAME,module);
|
||||
_module = module;
|
||||
_router = module.router
|
||||
LogUtil.debug(NAME + "::Creating endpoint for JoinModule");
|
||||
_endpoint = new Endpoint(_router, FROM_JOIN_MODULE, TO_JOIN_MODULE, messageReceiver);
|
||||
}
|
||||
|
||||
override public function getMediatorName():String
|
||||
{
|
||||
return NAME;
|
||||
}
|
||||
|
||||
override public function listNotificationInterests():Array
|
||||
{
|
||||
return [
|
||||
JoinModuleConstants.STARTED,
|
||||
JoinModuleConstants.STOPPED,
|
||||
JoinModuleConstants.JOIN_SUCCESS,
|
||||
];
|
||||
}
|
||||
|
||||
override public function handleNotification(notification:INotification):void
|
||||
{
|
||||
LogUtil.debug(NAME + "::JoinEndPoint MSG. " + notification.getName());
|
||||
switch(notification.getName()){
|
||||
case JoinModuleConstants.JOIN_SUCCESS:
|
||||
LogUtil.debug(NAME + "::Sending Join USER_JOINED message to main");
|
||||
_endpoint.sendMessage(EndpointMessageConstants.USER_JOINED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
case JoinModuleConstants.STARTED:
|
||||
LogUtil.debug(NAME + "::Sending Join MODULE_STARTED message to main");
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STARTED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, _module.moduleId);
|
||||
break;
|
||||
case JoinModuleConstants.STOPPED:
|
||||
LogUtil.debug(NAME + '::Sending Join MODULE_STOPPED message to main');
|
||||
facade.sendNotification(JoinModuleConstants.CLOSE_WINDOW);
|
||||
var info:Object;
|
||||
info["moduleId"] = _module.moduleId
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STOPPED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, info);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function messageReceiver(message : IPipeMessage) : void
|
||||
{
|
||||
var msg : String = message.getHeader().MSG as String;
|
||||
switch(msg){
|
||||
case EndpointMessageConstants.CLOSE_WINDOW:
|
||||
facade.sendNotification(JoinModuleConstants.CLOSE_WINDOW);
|
||||
break;
|
||||
case EndpointMessageConstants.OPEN_WINDOW:
|
||||
//LogUtil.debug('Received OPEN_WINDOW message from ' + message.getHeader().SRC);
|
||||
//facade.sendNotification(ChatModuleConstants.OPEN_WINDOW);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function playMessage(message:XML):void{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package org.bigbluebutton.modules.join
|
||||
{
|
||||
import org.bigbluebutton.modules.join.controller.StartupCommand;
|
||||
import org.puremvc.as3.multicore.interfaces.IFacade;
|
||||
import org.puremvc.as3.multicore.patterns.facade.Facade;
|
||||
|
||||
public class JoinFacade extends Facade implements IFacade
|
||||
{
|
||||
public static const NAME:String = "JoinFacade";
|
||||
|
||||
public static const STARTUP:String = 'startup';
|
||||
public static const STOP:String = 'stop';
|
||||
public static const LOGIN:String = 'login';
|
||||
public static const LOGOUT:String = 'login';
|
||||
|
||||
public function JoinFacade(key:String)
|
||||
{
|
||||
//TODO: implement function
|
||||
super(key);
|
||||
}
|
||||
|
||||
public static function getInstance():JoinFacade{
|
||||
if (instanceMap[NAME] == null)
|
||||
instanceMap[NAME] = new JoinFacade(NAME);
|
||||
return instanceMap[NAME] as JoinFacade;
|
||||
}
|
||||
|
||||
override protected function initializeController():void {
|
||||
super.initializeController();
|
||||
registerCommand(STARTUP, StartupCommand);
|
||||
}
|
||||
|
||||
public function startup(module:JoinModule):void {
|
||||
LogUtil.debug('JoinFacade startup');
|
||||
sendNotification(STARTUP, module);
|
||||
}
|
||||
|
||||
public function stop(app:JoinModule):void{
|
||||
sendNotification(STOP, app);
|
||||
removeCore(NAME);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package org.bigbluebutton.modules.join
|
||||
{
|
||||
public class JoinModuleConstants
|
||||
{
|
||||
public static const START:String = "start module";
|
||||
public static const STOP:String = "stop module";
|
||||
public static const STARTED:String = "STARTED";
|
||||
public static const STOPPED:String = "STOPPED";
|
||||
public static const JOIN_FAILED:String = 'JOIN_FAILED';
|
||||
public static const JOIN_SUCCESS:String = 'JOIN_SUCCESS';
|
||||
public static const OPEN_WINDOW:String = 'OPEN_WINDOW';
|
||||
public static const CLOSE_WINDOW:String = 'CLOSE_WINDOW';
|
||||
public static const ADD_WINDOW:String = 'ADD_WINDOW';
|
||||
public static const REMOVE_WINDOW:String = 'REMOVE_WINDOW';
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.join
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
|
||||
|
||||
public class JoinModuleMediator extends Mediator implements IMediator
|
||||
{
|
||||
public static const NAME:String = 'JoinModuleMediator';
|
||||
private var _module:IBigBlueButtonModule;
|
||||
|
||||
|
||||
public function JoinModuleMediator( module:IBigBlueButtonModule )
|
||||
{
|
||||
super( NAME, module );
|
||||
_module = module;
|
||||
// facade.registerMediator(new ChatEndpointMediator(_module.router));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package org.bigbluebutton.modules.join.controller
|
||||
{
|
||||
import org.bigbluebutton.modules.join.JoinEndpointMediator;
|
||||
import org.bigbluebutton.modules.join.JoinModuleConstants;
|
||||
import org.bigbluebutton.modules.join.JoinModuleMediator;
|
||||
import org.bigbluebutton.modules.join.model.JoinProxy;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
public class StartupCommand extends SimpleCommand
|
||||
{
|
||||
public function StartupCommand()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function execute(note:INotification):void {
|
||||
var m:JoinModule = note.getBody() as JoinModule;
|
||||
|
||||
LogUtil.debug('facade.registerMediator(new JoinEndpointMediator(m));');
|
||||
facade.registerMediator(new JoinEndpointMediator(m));
|
||||
LogUtil.debug('facade.registerMediator(new JoinModuleMediator(m));');
|
||||
facade.registerMediator(new JoinModuleMediator(m));
|
||||
// LogUtil.debug('facade.registerMediator( new JoinWindowMediator(m) );');
|
||||
// facade.registerMediator( new JoinWindowMediator(m) );
|
||||
LogUtil.debug('facade.registerProxy(new JoinProxy(m.uri));');
|
||||
facade.registerProxy(new JoinProxy(m.uri));
|
||||
LogUtil.debug('JoinModule COnnected');
|
||||
facade.sendNotification(JoinModuleConstants.STARTED);
|
||||
proxy.join();
|
||||
}
|
||||
|
||||
private function get proxy():JoinProxy {
|
||||
return facade.retrieveProxy(JoinProxy.NAME) as JoinProxy;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.join.model
|
||||
{
|
||||
import org.bigbluebutton.modules.join.JoinModuleConstants;
|
||||
import org.bigbluebutton.modules.join.model.service.JoinService;
|
||||
import org.bigbluebutton.modules.login.LoginModuleConstants;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
public class JoinProxy extends Proxy implements IProxy
|
||||
{
|
||||
public static const NAME:String = "JoinProxy";
|
||||
|
||||
private var uri:String;
|
||||
private var joinService:JoinService;
|
||||
|
||||
public function JoinProxy(uri:String)
|
||||
{
|
||||
super(NAME);
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
public function join():void {
|
||||
LogUtil.debug(NAME + "::joning in ");
|
||||
joinService = new JoinService();
|
||||
joinService.addJoinResultListener(joinListener);
|
||||
joinService.load(uri);
|
||||
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
// USer is issuing a disconnect.
|
||||
// manualDisconnect = true;
|
||||
// chatService.disconnect();
|
||||
}
|
||||
|
||||
private function joinListener(success:Boolean, result:Object):void {
|
||||
if (success) {
|
||||
LogUtil.debug(NAME + '::Sending JoinModuleConstants.JOIN_SUCCESS');
|
||||
sendNotification(JoinModuleConstants.JOIN_SUCCESS, result);
|
||||
} else {
|
||||
LogUtil.debug(NAME + '::Sending JoinModuleConstants.JOIN_FAILED');
|
||||
sendNotification(JoinModuleConstants.JOIN_FAILED, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package org.bigbluebutton.modules.join.model.service
|
||||
{
|
||||
import flash.events.*;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.URLRequestMethod;
|
||||
import flash.net.URLVariables;
|
||||
|
||||
public class JoinService
|
||||
{
|
||||
private var request:URLRequest = new URLRequest();
|
||||
private var vars:URLVariables = new URLVariables();
|
||||
|
||||
private var urlLoader:URLLoader;
|
||||
private var _resultListener:Function;
|
||||
|
||||
public function JoinService()
|
||||
{
|
||||
}
|
||||
|
||||
public function load(url:String) : void
|
||||
{
|
||||
LogUtil.debug("JoinService:load(...) " + url);
|
||||
|
||||
request = new URLRequest(url);
|
||||
request.method = URLRequestMethod.GET;
|
||||
|
||||
urlLoader = new URLLoader();
|
||||
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
|
||||
urlLoader.load(request);
|
||||
}
|
||||
|
||||
public function addJoinResultListener(listener:Function):void {
|
||||
_resultListener = listener;
|
||||
}
|
||||
|
||||
private function handleComplete(e:Event):void{
|
||||
|
||||
var xml:XML = new XML(e.target.data)
|
||||
LogUtil.debug("Loading complete: " + xml);
|
||||
var returncode:String = xml.returncode;
|
||||
if (returncode == 'FAILED') {
|
||||
LogUtil.debug("Result = " + returncode + " " + xml.message);
|
||||
_resultListener(false, {message:xml.message});
|
||||
} else if (returncode == 'SUCCESS') {
|
||||
LogUtil.debug(xml.returncode + " " + xml.fullname + " " + xml.conference + " " + xml.role
|
||||
+ " " + xml.room);
|
||||
var user:Object = {username:xml.fullname, conference:xml.conference,
|
||||
userrole:xml.role, room:xml.room, authToken:xml.room};
|
||||
_resultListener(true, user);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -17,18 +17,15 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.viewers.view
|
||||
package org.bigbluebutton.modules.join.view
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.events.KeyboardEvent;
|
||||
|
||||
import mx.controls.Alert;
|
||||
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.modules.viewers.ViewersFacade;
|
||||
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
|
||||
import org.bigbluebutton.modules.viewers.model.ViewersProxy;
|
||||
import org.bigbluebutton.modules.viewers.view.components.JoinWindow;
|
||||
import org.bigbluebutton.modules.join.JoinModuleConstants;
|
||||
import org.bigbluebutton.modules.join.model.JoinProxy;
|
||||
import org.bigbluebutton.modules.join.view.components.JoinWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
@ -44,7 +41,7 @@ package org.bigbluebutton.modules.viewers.view
|
||||
|
||||
private var _module:IBigBlueButtonModule;
|
||||
private var _joinWindow:JoinWindow = new JoinWindow();
|
||||
public static const LOGIN:String = "Attempt Login";
|
||||
public static const JOIN:String = "Attempt join";
|
||||
|
||||
/**
|
||||
* the constructor. registers this mediator with the JoinWindow gui component
|
||||
@ -55,7 +52,7 @@ package org.bigbluebutton.modules.viewers.view
|
||||
{
|
||||
super(NAME, module);
|
||||
_module = module;
|
||||
_joinWindow.addEventListener(LOGIN, login);
|
||||
_joinWindow.addEventListener(JOIN, join);
|
||||
_joinWindow.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
|
||||
}
|
||||
|
||||
@ -67,9 +64,8 @@ package org.bigbluebutton.modules.viewers.view
|
||||
override public function listNotificationInterests():Array{
|
||||
|
||||
return [
|
||||
ViewersModuleConstants.OPEN_JOIN_WINDOW,
|
||||
ViewersModuleConstants.CLOSE_JOIN_WINDOW,
|
||||
ViewersModuleConstants.LOGGED_OUT
|
||||
JoinModuleConstants.OPEN_WINDOW,
|
||||
JoinModuleConstants.CLOSE_WINDOW
|
||||
];
|
||||
|
||||
|
||||
@ -84,7 +80,7 @@ package org.bigbluebutton.modules.viewers.view
|
||||
|
||||
switch(notification.getName())
|
||||
{
|
||||
case ViewersModuleConstants.OPEN_JOIN_WINDOW:
|
||||
case JoinModuleConstants.OPEN_WINDOW:
|
||||
LogUtil.debug('Received request to OPEN_JOIN_WINDOW');
|
||||
|
||||
_joinWindow.width = 350;
|
||||
@ -93,25 +89,20 @@ package org.bigbluebutton.modules.viewers.view
|
||||
_joinWindow.showCloseButton = false;
|
||||
_joinWindow.xPosition = 450;
|
||||
_joinWindow.yPosition = 150;
|
||||
facade.sendNotification(ViewersModuleConstants.ADD_WINDOW, _joinWindow);
|
||||
facade.sendNotification(JoinModuleConstants.ADD_WINDOW, _joinWindow);
|
||||
break;
|
||||
|
||||
case ViewersModuleConstants.CLOSE_JOIN_WINDOW:
|
||||
case JoinModuleConstants.CLOSE_WINDOW:
|
||||
LogUtil.debug('Received request to CLOSE_JOIN_WINDOW');
|
||||
_joinWindow.clear();
|
||||
facade.sendNotification(ViewersModuleConstants.REMOVE_WINDOW, _joinWindow);
|
||||
facade.sendNotification(JoinModuleConstants.REMOVE_WINDOW, _joinWindow);
|
||||
break;
|
||||
|
||||
case ViewersModuleConstants.LOGGED_OUT:
|
||||
_joinWindow.showError(notification.getBody() as String);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function keyPressed(event:KeyboardEvent):void{
|
||||
if (event.keyCode == 13) login(event);
|
||||
if (event.keyCode == 13) join(event);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -128,7 +119,8 @@ package org.bigbluebutton.modules.viewers.view
|
||||
* @param e
|
||||
*
|
||||
*/
|
||||
private function login(e:Event):void{
|
||||
private function join(e:Event):void{
|
||||
LogUtil.debug('Received join event');
|
||||
var name : String = _joinWindow.nameField.text;
|
||||
var room : String = _joinWindow.confField.text;
|
||||
var password : String = _joinWindow.passwdField.text
|
||||
@ -139,13 +131,12 @@ package org.bigbluebutton.modules.viewers.view
|
||||
}
|
||||
_joinWindow.lblNote.text = "Attempting to Login.";
|
||||
|
||||
var completeHost:String = _module.uri + room;
|
||||
proxy.connect(completeHost, room, name, password);
|
||||
proxy.join();
|
||||
}
|
||||
|
||||
|
||||
private function get proxy():ViewersProxy {
|
||||
return facade.retrieveProxy(ViewersProxy.NAME) as ViewersProxy;
|
||||
private function get proxy():JoinProxy {
|
||||
return facade.retrieveProxy(JoinProxy.NAME) as JoinProxy;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<viewer:MDIWindow xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
width="328" height="265" layout="absolute"
|
||||
xmlns:viewer="flexlib.mdi.containers.*"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow">
|
||||
|
||||
<MDIWindow xmlns="flexlib.mdi.containers.*"
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
width="328" height="265" layout="absolute" showCloseButton="false"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow">
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
|
||||
import org.bigbluebutton.modules.viewers.view.JoinWindowMediator;
|
||||
import mx.managers.PopUpManager;
|
||||
import org.bigbluebutton.modules.login.LoginModuleConstants;
|
||||
import org.bigbluebutton.modules.login.view.LoginWindowMediator;
|
||||
|
||||
public static const TITLE:String = "Join Conference";
|
||||
public var host : String = "localhost";
|
||||
public var message:Boolean;
|
||||
|
||||
private var _xPosition:int;
|
||||
private var _yPosition:int;
|
||||
|
||||
|
||||
public function get xPosition():int {
|
||||
return _xPosition;
|
||||
}
|
||||
@ -32,29 +27,17 @@
|
||||
public function set yPosition(y:int):void {
|
||||
_yPosition = y;
|
||||
}
|
||||
|
||||
public function showError(error:String):void
|
||||
|
||||
public function showError(error:String):void
|
||||
{
|
||||
this.lblNote.visible = true;
|
||||
switch(error){
|
||||
case ViewersModuleConstants.CONNECT_FAILED:
|
||||
case LoginModuleConstants.LOGIN_FAILED:
|
||||
this.lblNote.text = "Connection Failed. Please try again.\n";
|
||||
break;
|
||||
case ViewersModuleConstants.CONNECT_REJECTED:
|
||||
this.lblNote.text = "Please check your login information.\n";
|
||||
break;
|
||||
case ViewersModuleConstants.CONNECT_CLOSED:
|
||||
//this.lblNote.text = "Connection Closed.\n";
|
||||
break;
|
||||
case ViewersModuleConstants.CONNECT_SUCCESS:
|
||||
case LoginModuleConstants.LOGIN_SUCCESS:
|
||||
this.lblNote.text = "Connection Successful.\n";
|
||||
break;
|
||||
case ViewersModuleConstants.APP_SHUTDOWN:
|
||||
this.lblNote.text = "Application has shut down.\n";
|
||||
break;
|
||||
case ViewersModuleConstants.INVALID_APP:
|
||||
this.lblNote.text = "Application not found on server.\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,18 +47,16 @@
|
||||
passwdField.text = "";
|
||||
lblNote.text = "";
|
||||
}
|
||||
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
<mx:Label x="41" y="52" text="Name" id="nameLabel"/>
|
||||
<mx:TextInput id="nameField" x="98" y="50" tabIndex="1"/>
|
||||
<mx:Label x="10" y="91" text="Conference" id="confLabel"/>
|
||||
<mx:TextInput x="98" y="89" id="confField" tabIndex="2"/>
|
||||
<mx:Label x="22" y="132" text="Password" id="passwdLabel"/>
|
||||
<mx:TextInput x="98" y="130" id="passwdField" displayAsPassword="true" tabIndex="3"/>
|
||||
<mx:Button label="Join" x="243" y="169" click="dispatchEvent(new Event(JoinWindowMediator.LOGIN))" tabIndex="4"/>
|
||||
<mx:Button label="Join" x="243" y="169" click="dispatchEvent(new Event(LoginWindowMediator.LOGIN))" tabIndex="4"/>
|
||||
<mx:Label x="21" y="10" text="Complete form to join conference." width="256" id="messageLbl"/>
|
||||
<mx:Label x="22" y="208" width="270" id="lblNote"/>
|
||||
|
||||
</viewer:MDIWindow>
|
||||
</MDIWindow>
|
@ -58,5 +58,11 @@ package org.bigbluebutton.modules.listeners
|
||||
public static const MUTE_EVENT:String = "MUTE_EVENT";
|
||||
|
||||
public static const EJECT_LISTENER_EVENT:String = "EJECT_LISTENER_EVENT";
|
||||
|
||||
// THis is an event we send when the first listener joins the conference during playback.
|
||||
// We use this as a trigger to start playing the recorded audio. This is just a prototype.
|
||||
// Need to figure out how to play audio properly with synch. (ralam - march 26, 2009)
|
||||
public static const FIRST_LISTENER_JOINED_EVENT:String = "FIRST_LISTENER_JOINED_EVENT";
|
||||
public static const CONVERTED_RECORDED_MP3_EVENT:String = "CONVERTED_RECORDED_MP3_EVENT";
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package org.bigbluebutton.modules.listeners
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.bigbluebutton.common.messaging.EndpointMessageConstants;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
@ -14,13 +13,13 @@ package org.bigbluebutton.modules.listeners
|
||||
{
|
||||
public static const NAME:String = "ListenersModuleEndpointMediator";
|
||||
|
||||
private var _module:IBigBlueButtonModule;
|
||||
private var _module:ListenersModule;
|
||||
private var _router:Router;
|
||||
private var _endpoint:Endpoint;
|
||||
private static const TO_LISTENERS_MODULE:String = "TO_LISTENERS_MODULE";
|
||||
private static const FROM_LISTENERS_MODULE:String = "FROM_LISTENERS_MODULE";
|
||||
|
||||
public function ListenersModuleEndpointMediator(module:IBigBlueButtonModule)
|
||||
public function ListenersModuleEndpointMediator(module:ListenersModule)
|
||||
{
|
||||
super(NAME,module);
|
||||
_module = module;
|
||||
@ -52,6 +51,15 @@ package org.bigbluebutton.modules.listeners
|
||||
LogUtil.debug(NAME + ":Sending MODULE_STARTED message to main");
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STARTED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, _module.moduleId);
|
||||
|
||||
/**
|
||||
* Call the server to convert the recorded audio to MP3.
|
||||
* NOTE: THis is just a hack...need to do this properly. (ralam - march 26, 2009)
|
||||
*/
|
||||
if (_module.mode == 'PLAYBACK') {
|
||||
proxy.convertRecodingToMp3();
|
||||
}
|
||||
|
||||
facade.sendNotification(ListenersModuleConstants.OPEN_WINDOW);
|
||||
break;
|
||||
case ListenersModuleConstants.DISCONNECTED:
|
||||
|
@ -2,30 +2,33 @@ package org.bigbluebutton.modules.listeners.model
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.modules.listeners.ListenersModuleConstants;
|
||||
import org.bigbluebutton.modules.listeners.model.service.IListenersService;
|
||||
import org.bigbluebutton.modules.listeners.model.service.ListenersSOService;
|
||||
import org.bigbluebutton.modules.listeners.model.vo.IListeners;
|
||||
import org.bigbluebutton.modules.listeners.model.vo.Listeners;
|
||||
import org.bigbluebutton.modules.listeners.model.service.RecordingService;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
public class ListenersProxy extends Proxy implements IProxy
|
||||
{
|
||||
public static const NAME:String = "ListenersProxy";
|
||||
|
||||
private var _module:IBigBlueButtonModule;
|
||||
|
||||
private var recordingService:RecordingService;
|
||||
|
||||
private var _module:ListenersModule;
|
||||
private var _listenersService:IListenersService;
|
||||
private var _listeners:IListeners = null;
|
||||
// Is teh disconnection due to user issuing the disconnect or is it the server
|
||||
// disconnecting due to t fault?
|
||||
private var manualDisconnect:Boolean = false;
|
||||
|
||||
public function ListenersProxy(module:IBigBlueButtonModule)
|
||||
public function ListenersProxy(module:ListenersModule)
|
||||
{
|
||||
super(NAME);
|
||||
_module = module;
|
||||
recordingService = new RecordingService(_module);
|
||||
connect();
|
||||
}
|
||||
|
||||
@ -36,9 +39,10 @@ package org.bigbluebutton.modules.listeners.model
|
||||
|
||||
public function connect():void {
|
||||
_listeners = new Listeners();
|
||||
_listenersService = new ListenersSOService(_listeners);
|
||||
_listenersService = new ListenersSOService(_listeners, _module);
|
||||
_listenersService.addConnectionStatusListener(connectionStatusListener);
|
||||
_listenersService.addMessageSender(messageSender);
|
||||
recordingService.addMessageSender(messageSender);
|
||||
manualDisconnect = false;
|
||||
_listenersService.connect(_module.uri);
|
||||
}
|
||||
@ -57,9 +61,13 @@ package org.bigbluebutton.modules.listeners.model
|
||||
return _listeners.listeners;
|
||||
}
|
||||
|
||||
public function convertRecodingToMp3():void {
|
||||
recordingService.convertRecordedAudioToMP3();
|
||||
}
|
||||
|
||||
private function connectionStatusListener(connected:Boolean, errors:Array=null):void {
|
||||
if (connected) {
|
||||
sendNotification(ListenersModuleConstants.CONNECTED);
|
||||
// sendNotification(ListenersModuleConstants.CONNECTED);
|
||||
} else {
|
||||
_listeners = null;
|
||||
sendNotification(ListenersModuleConstants.DISCONNECTED, {manual:manualDisconnect, errors:errors});
|
||||
|
@ -21,9 +21,11 @@ package org.bigbluebutton.modules.listeners.model.service
|
||||
{
|
||||
import flash.events.AsyncErrorEvent;
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.Responder;
|
||||
import flash.net.SharedObject;
|
||||
|
||||
import org.bigbluebutton.modules.listeners.ListenersModuleConstants;
|
||||
import org.bigbluebutton.modules.listeners.model.vo.IListeners;
|
||||
import org.bigbluebutton.modules.listeners.model.vo.Listener;
|
||||
|
||||
@ -43,23 +45,21 @@ package org.bigbluebutton.modules.listeners.model.service
|
||||
private var _messageSender:Function;
|
||||
private var nc_responder : Responder;
|
||||
private var _soErrors:Array;
|
||||
|
||||
private var pingCount:int = 0;
|
||||
private var _module:ListenersModule;
|
||||
|
||||
public function ListenersSOService(listeners:IListeners)
|
||||
public function ListenersSOService(listeners:IListeners, module:ListenersModule)
|
||||
{
|
||||
_listeners = listeners;
|
||||
_listeners = listeners;
|
||||
_module = module;
|
||||
}
|
||||
|
||||
public function connect(uri:String):void {
|
||||
_uri = uri;
|
||||
netConnectionDelegate = new NetConnectionDelegate(uri, connectionListener);
|
||||
netConnectionDelegate.connect();
|
||||
join();
|
||||
}
|
||||
|
||||
public function disconnect():void {
|
||||
leave();
|
||||
netConnectionDelegate.disconnect();
|
||||
}
|
||||
|
||||
private function connectionListener(connected:Boolean, errors:Array=null):void {
|
||||
@ -75,17 +75,17 @@ package org.bigbluebutton.modules.listeners.model.service
|
||||
|
||||
private function join() : void
|
||||
{
|
||||
_listenersSO = SharedObject.getRemote(SHARED_OBJECT, _uri, false);
|
||||
trace(_module.uri);
|
||||
_listenersSO = SharedObject.getRemote(SHARED_OBJECT, _module.uri, false);
|
||||
_listenersSO.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
_listenersSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
_listenersSO.client = this;
|
||||
_listenersSO.connect(netConnectionDelegate.connection);
|
||||
_listenersSO.connect(_module.connection);
|
||||
LogUtil.debug(LOGNAME + ":Voice is connected to Shared object");
|
||||
notifyConnectionStatusListener(true);
|
||||
|
||||
// Query the server if there are already listeners in the conference.
|
||||
nc_responder = new Responder(getMeetMeUsers, null);
|
||||
netConnectionDelegate.getCurrentListeners(nc_responder);
|
||||
getCurrentUsers();
|
||||
}
|
||||
|
||||
private function leave():void
|
||||
@ -113,6 +113,16 @@ package org.bigbluebutton.modules.listeners.model.service
|
||||
n.talking = talking;
|
||||
LogUtil.info(LOGNAME + "Adding listener [" + n.callerName + "," + userId + "]");
|
||||
_listeners.addListener(n);
|
||||
/**
|
||||
* Let's send an event that the first user has joined the voice conference.
|
||||
* We use this as a trigger to playback the recorded audio.
|
||||
* NOTE: THis is just a hack...need to do this properly. (ralam - march 26, 2009)
|
||||
*/
|
||||
if (_module.mode == 'PLAYBACK') {
|
||||
if (_listeners.listeners.length == 1) {
|
||||
sendMessage(ListenersModuleConstants.FIRST_LISTENER_JOINED_EVENT);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LogUtil.debug(LOGNAME + "There is a listener with userid " + userId + " " + cidName + " in the conference.");
|
||||
}
|
||||
@ -153,19 +163,98 @@ package org.bigbluebutton.modules.listeners.model.service
|
||||
|
||||
public function muteUnmuteUser(userid:Number, mute:Boolean):void
|
||||
{
|
||||
netConnectionDelegate.muteUnmuteUser(userid, mute);
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"voice.muteUnmuteUser",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Object):void {
|
||||
LogUtil.debug("Successfully mute/unmute: " + userid);
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
),//new Responder
|
||||
userid,
|
||||
mute
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
public function muteAllUsers(mute:Boolean):void
|
||||
{
|
||||
netConnectionDelegate.muteAllUsers(mute);
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"voice.muteAllUsers",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Object):void {
|
||||
LogUtil.debug("Successfully mute/unmute all users: ");
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
),//new Responder
|
||||
mute
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
public function ejectUser(userId:Number):void
|
||||
{
|
||||
netConnectionDelegate.ejectUser(userId);
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"voice.kickUSer",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Object):void {
|
||||
LogUtil.debug("Successfully kick user: userId");
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
),//new Responder
|
||||
userId
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
private function getCurrentUsers():void {
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"voice.getMeetMeUsers",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Object):void {
|
||||
LogUtil.debug("Successfully queried participants: " + result.count);
|
||||
if (result.count > 0) {
|
||||
for(var p:Object in result.participants)
|
||||
{
|
||||
var u:Object = result.participants[p]
|
||||
userJoin(u.participant, u.name, u.name, u.muted, u.talking);
|
||||
}
|
||||
}
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
)//new Responder
|
||||
); //_netConnection.call
|
||||
}
|
||||
/*
|
||||
public function getMeetMeUsers(meetmeUser:Object):void
|
||||
{
|
||||
for(var items:String in meetmeUser)
|
||||
@ -178,7 +267,7 @@ package org.bigbluebutton.modules.listeners.model.service
|
||||
userJoin(userId, cidName, cidNum, muted, talking);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
private function notifyConnectionStatusListener(connected:Boolean, errors:Array=null):void {
|
||||
if (_connectionListener != null) {
|
||||
LogUtil.debug(LOGNAME + 'notifying connectionListener for Voice');
|
||||
|
@ -0,0 +1,90 @@
|
||||
package org.bigbluebutton.modules.listeners.model.service
|
||||
{
|
||||
import flash.events.*;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
|
||||
import mx.rpc.IResponder;
|
||||
import mx.rpc.http.HTTPService;
|
||||
|
||||
import org.bigbluebutton.modules.listeners.ListenersModuleConstants;
|
||||
|
||||
|
||||
/**
|
||||
* This class directly communicates with an HTTP service in order to send and recives files (slides
|
||||
* in this case)
|
||||
* <p>
|
||||
* This class extends the Proxy class of the pureMVC framework
|
||||
* @author dev_team@bigbluebutton.org
|
||||
*
|
||||
*/
|
||||
public class RecordingService implements IResponder
|
||||
{
|
||||
private var service : HTTPService;
|
||||
private var urlLoader:URLLoader;
|
||||
private var _messageSender:Function;
|
||||
private var _module:ListenersModule;
|
||||
|
||||
public function RecordingService(module:ListenersModule)
|
||||
{
|
||||
_module = module;
|
||||
service = new HTTPService();
|
||||
}
|
||||
|
||||
public function convertRecordedAudioToMP3():void
|
||||
{
|
||||
var confid:String = _module.conference.slice(1, _module.conference.length);
|
||||
|
||||
var url:String = _module.recordingHost + "/cgi-bin/convert.pl?id=" + confid;
|
||||
LogUtil.debug("Converting recorded audio " + url);
|
||||
service.url = url;
|
||||
urlLoader = new URLLoader();
|
||||
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
|
||||
urlLoader.load(new URLRequest(url));
|
||||
|
||||
}
|
||||
|
||||
public function addMessageSender(msgSender:Function):void {
|
||||
_messageSender = msgSender;
|
||||
}
|
||||
|
||||
private function sendMessage(msg:String, body:Object=null):void {
|
||||
if (_messageSender != null) _messageSender(msg, body);
|
||||
}
|
||||
|
||||
private function handleComplete(e:Event):void{
|
||||
LogUtil.debug("Loading complete: " + e.target.data as String);
|
||||
_module.recordedMP3Url = e.target.data as String;
|
||||
sendMessage(ListenersModuleConstants.CONVERTED_RECORDED_MP3_EVENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the response event. It is called when the PresentationService class sends a request to
|
||||
* the server. This class then responds with this event
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
public function result(event : Object):void
|
||||
{
|
||||
var xml:XML = new XML(event.result);
|
||||
var list:XMLList = xml.presentations;
|
||||
var item:XML;
|
||||
|
||||
for each(item in list){
|
||||
LogUtil.debug("Available Modules: " + item.toXMLString() + " at " + item.text());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event is called in case the call the to server wasn't successful. This method then gets called
|
||||
* instead of the result() method above
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
public function fault(event : Object):void
|
||||
{
|
||||
LogUtil.debug("Got fault [" + event.fault.toString() + "]");
|
||||
}
|
||||
}
|
||||
}
|
@ -20,6 +20,8 @@
|
||||
package org.bigbluebutton.modules.listeners.view
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.media.Sound;
|
||||
import flash.net.URLRequest;
|
||||
|
||||
import org.bigbluebutton.modules.listeners.ListenersModuleConstants;
|
||||
import org.bigbluebutton.modules.listeners.model.ListenersProxy;
|
||||
@ -44,6 +46,7 @@ package org.bigbluebutton.modules.listeners.view
|
||||
|
||||
private var _module:ListenersModule;
|
||||
private var _listenersWindow:ListenersWindow;
|
||||
private var _recordedAudio:Sound;
|
||||
|
||||
public function ListenersWindowMediator(module:ListenersModule)
|
||||
{
|
||||
@ -87,7 +90,9 @@ package org.bigbluebutton.modules.listeners.view
|
||||
ListenersModuleConstants.OPEN_WINDOW,
|
||||
ListenersModuleConstants.CLOSE_WINDOW,
|
||||
ListenersModuleConstants.USER_MUTE_NOTIFICATION,
|
||||
ListenersModuleConstants.USER_TALKING_NOTIFICATION
|
||||
ListenersModuleConstants.USER_TALKING_NOTIFICATION,
|
||||
ListenersModuleConstants.FIRST_LISTENER_JOINED_EVENT,
|
||||
ListenersModuleConstants.CONVERTED_RECORDED_MP3_EVENT
|
||||
];
|
||||
}
|
||||
|
||||
@ -96,6 +101,13 @@ package org.bigbluebutton.modules.listeners.view
|
||||
case ListenersModuleConstants.OPEN_WINDOW:
|
||||
handleOpenListenersWindow();
|
||||
break;
|
||||
case ListenersModuleConstants.CONVERTED_RECORDED_MP3_EVENT:
|
||||
/** If PLAYBACK, pre-load the recorded audio */
|
||||
if (_module.mode == 'PLAYBACK') {
|
||||
LogUtil.debug("Loading recorded audio " + _module.recordedMP3Url);
|
||||
_recordedAudio = new Sound( new URLRequest(_module.recordedMP3Url));
|
||||
}
|
||||
break;
|
||||
case ListenersModuleConstants.CLOSE_WINDOW:
|
||||
facade.sendNotification(ListenersModuleConstants.REMOVE_WINDOW, _listenersWindow);
|
||||
break;
|
||||
@ -109,6 +121,9 @@ package org.bigbluebutton.modules.listeners.view
|
||||
var talk:Boolean = notification.getBody().talk as Boolean;
|
||||
handleUserTalkingNotification(uid, talk);
|
||||
break;
|
||||
case ListenersModuleConstants.FIRST_LISTENER_JOINED_EVENT:
|
||||
_recordedAudio.play();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,123 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.login
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.bigbluebutton.common.messaging.EndpointMessageConstants;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
|
||||
|
||||
public class LoginEndpointMediator extends Mediator implements IMediator
|
||||
{
|
||||
public static const NAME:String = "LoginEndPointMediator";
|
||||
|
||||
private var _module:IBigBlueButtonModule;
|
||||
private var _router:Router;
|
||||
private var _endpoint:Endpoint;
|
||||
private static const TO_LOGIN_MODULE:String = "TO_LOGIN_MODULE";
|
||||
private static const FROM_LOGIN_MODULE:String = "FROM_LOGIN_MODULE";
|
||||
|
||||
private static const PLAYBACK_MESSAGE:String = "PLAYBACK_MESSAGE";
|
||||
private static const PLAYBACK_MODE:String = "PLAYBACK_MODE";
|
||||
|
||||
public function LoginEndpointMediator(module:IBigBlueButtonModule)
|
||||
{
|
||||
super(NAME,module);
|
||||
_module = module;
|
||||
_router = module.router
|
||||
LogUtil.debug(NAME + "::Creating endpoint for LoginModule");
|
||||
_endpoint = new Endpoint(_router, FROM_LOGIN_MODULE, TO_LOGIN_MODULE, messageReceiver);
|
||||
}
|
||||
|
||||
override public function getMediatorName():String
|
||||
{
|
||||
return NAME;
|
||||
}
|
||||
|
||||
override public function listNotificationInterests():Array
|
||||
{
|
||||
return [
|
||||
LoginModuleConstants.USER_LOGGEDIN,
|
||||
LoginModuleConstants.STARTED,
|
||||
LoginModuleConstants.STOPPED,
|
||||
LoginModuleConstants.ADD_WINDOW,
|
||||
LoginModuleConstants.REMOVE_WINDOW
|
||||
];
|
||||
}
|
||||
|
||||
override public function handleNotification(notification:INotification):void
|
||||
{
|
||||
LogUtil.debug(NAME + "::LoginEndPoint MSG. " + notification.getName());
|
||||
switch(notification.getName()){
|
||||
case LoginModuleConstants.STARTED:
|
||||
LogUtil.debug(NAME + "::Sending Login MODULE_STARTED message to main");
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STARTED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, _module.moduleId);
|
||||
facade.sendNotification(LoginModuleConstants.OPEN_WINDOW);
|
||||
break;
|
||||
case LoginModuleConstants.STOPPED:
|
||||
LogUtil.debug(NAME + '::Sending Login MODULE_STOPPED message to main');
|
||||
facade.sendNotification(LoginModuleConstants.CLOSE_WINDOW);
|
||||
var info:Object = notification.getBody();
|
||||
info["moduleId"] = _module.moduleId
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STOPPED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, info);
|
||||
break;
|
||||
case LoginModuleConstants.ADD_WINDOW:
|
||||
LogUtil.debug(NAME + '::Sending Login ADD_WINDOW message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.ADD_WINDOW,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
case LoginModuleConstants.REMOVE_WINDOW:
|
||||
LogUtil.debug(NAME + '::Sending Login REMOVE_WINDOW message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.REMOVE_WINDOW,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
case LoginModuleConstants.USER_LOGGEDIN:
|
||||
LogUtil.debug(NAME + '::Sending Login LOGIN_SUCCESS message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.USER_LOGGED_IN,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function messageReceiver(message : IPipeMessage) : void
|
||||
{
|
||||
var msg : String = message.getHeader().MSG as String;
|
||||
switch(msg){
|
||||
case EndpointMessageConstants.CLOSE_WINDOW:
|
||||
facade.sendNotification(LoginModuleConstants.CLOSE_WINDOW);
|
||||
break;
|
||||
case EndpointMessageConstants.OPEN_WINDOW:
|
||||
//LogUtil.debug('Received OPEN_WINDOW message from ' + message.getHeader().SRC);
|
||||
//facade.sendNotification(ChatModuleConstants.OPEN_WINDOW);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function playMessage(message:XML):void{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -4,35 +4,40 @@ package org.bigbluebutton.modules.login
|
||||
import org.puremvc.as3.multicore.interfaces.IFacade;
|
||||
import org.puremvc.as3.multicore.patterns.facade.Facade;
|
||||
|
||||
public class LoginModuleFacade extends Facade implements IFacade
|
||||
public class LoginFacade extends Facade implements IFacade
|
||||
{
|
||||
public static const NAME:String = "LoginModuleFacade";
|
||||
public static const NAME:String = "LoginFacade";
|
||||
|
||||
public static const STARTUP:String = 'startup';
|
||||
public static const STOP:String = 'stop';
|
||||
public static const LOGIN:String = 'login';
|
||||
public static const LOGOUT:String = 'login';
|
||||
|
||||
public function LoginModuleFacade(key:String)
|
||||
public function LoginFacade(key:String)
|
||||
{
|
||||
//TODO: implement function
|
||||
super(key);
|
||||
}
|
||||
|
||||
public static function getInstance():LoginModuleFacade{
|
||||
public static function getInstance():LoginFacade{
|
||||
if (instanceMap[NAME] == null)
|
||||
instanceMap[NAME] = new LoginModuleFacade(NAME);
|
||||
return instanceMap[NAME] as LoginModuleFacade;
|
||||
instanceMap[NAME] = new LoginFacade(NAME);
|
||||
return instanceMap[NAME] as LoginFacade;
|
||||
}
|
||||
|
||||
override protected function initializeController():void {
|
||||
super.initializeController();
|
||||
registerCommand(STARTUP, StartupCommand);
|
||||
// registerCommand(LOGIN, LoginCommand);
|
||||
// registerCommand(LOGOUT, LogoutCommand);
|
||||
}
|
||||
|
||||
public function startup(module:LoginModule):void {
|
||||
LogUtil.debug('LoginFacade startup');
|
||||
sendNotification(STARTUP, module);
|
||||
}
|
||||
|
||||
public function stop(app:LoginModule):void{
|
||||
sendNotification(STOP, app);
|
||||
removeCore(NAME);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.bigbluebutton.modules.login
|
||||
{
|
||||
public class LoginModuleConstants
|
||||
{
|
||||
public static const START:String = "start module";
|
||||
public static const STOP:String = "stop module";
|
||||
public static const STARTED:String = "STARTED";
|
||||
public static const STOPPED:String = "STOPPED";
|
||||
public static const USER_LOGGEDIN:String = 'USER_LOGGEDIN';
|
||||
public static const LOGIN_FAILED:String = 'LOGIN_FAILED';
|
||||
public static const LOGIN_SUCCESS:String = 'LOGIN_SUCCESS';
|
||||
public static const OPEN_WINDOW:String = 'OPEN_WINDOW';
|
||||
public static const CLOSE_WINDOW:String = 'CLOSE_WINDOW';
|
||||
public static const ADD_WINDOW:String = 'ADD_WINDOW';
|
||||
public static const REMOVE_WINDOW:String = 'REMOVE_WINDOW';
|
||||
}
|
||||
}
|
@ -1,17 +1,42 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.login
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
|
||||
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
|
||||
|
||||
public class LoginModuleMediator extends Mediator implements IMediator
|
||||
{
|
||||
public function LoginModuleMediator(mediatorName:String=null, viewComponent:Object=null)
|
||||
public static const NAME:String = 'LoginModuleMediator';
|
||||
private var _module:IBigBlueButtonModule;
|
||||
|
||||
|
||||
public function LoginModuleMediator( module:IBigBlueButtonModule )
|
||||
{
|
||||
//TODO: implement function
|
||||
super(mediatorName, viewComponent);
|
||||
super( NAME, module );
|
||||
_module = module;
|
||||
// facade.registerMediator(new ChatEndpointMediator(_module.router));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package org.bigbluebutton.modules.login.controller
|
||||
{
|
||||
import org.bigbluebutton.modules.login.LoginEndpointMediator;
|
||||
import org.bigbluebutton.modules.login.LoginModuleConstants;
|
||||
import org.bigbluebutton.modules.login.LoginModuleMediator;
|
||||
import org.bigbluebutton.modules.login.model.LoginProxy;
|
||||
import org.bigbluebutton.modules.login.view.LoginWindowMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
@ -13,8 +16,18 @@ package org.bigbluebutton.modules.login.controller
|
||||
}
|
||||
|
||||
override public function execute(note:INotification):void {
|
||||
facade.registerProxy(new LoginProxy());
|
||||
facade.registerMediator(new LoginModuleMediator());
|
||||
var m:LoginModule = note.getBody() as LoginModule;
|
||||
|
||||
LogUtil.debug('facade.registerMediator(new LoginEndpointMediator(m));');
|
||||
facade.registerMediator(new LoginEndpointMediator(m));
|
||||
LogUtil.debug('facade.registerMediator(new LoginModuleMediator(m));');
|
||||
facade.registerMediator(new LoginModuleMediator(m));
|
||||
LogUtil.debug('facade.registerMediator( new LoginWindowMediator(m) );');
|
||||
facade.registerMediator( new LoginWindowMediator(m) );
|
||||
LogUtil.debug('facade.registerProxy(new LoginProxy(m.uri));');
|
||||
facade.registerProxy(new LoginProxy(m.uri));
|
||||
LogUtil.debug('LoginModule COnnected');
|
||||
facade.sendNotification(LoginModuleConstants.STARTED);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +1,64 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.login.model
|
||||
{
|
||||
import org.bigbluebutton.modules.login.LoginModuleConstants;
|
||||
import org.bigbluebutton.modules.login.model.services.LoginService;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
|
||||
public class LoginProxy extends Proxy implements IProxy
|
||||
{
|
||||
public static const NAME:String = 'LoginProxy';
|
||||
public static const LOGIN_SUCCESS:String = 'loginSuccess';
|
||||
public static const LOGIN_FAILED:String = 'loginFailed';
|
||||
public static const LOGGED_OUT:String = 'loggedOut';
|
||||
public static const NAME:String = "LoginProxy";
|
||||
|
||||
public function LoginProxy(proxyName:String=null, data:Object=null)
|
||||
private var uri:String;
|
||||
private var loginService:LoginService;
|
||||
|
||||
public function LoginProxy(uri:String)
|
||||
{
|
||||
//TODO: implement function
|
||||
super(proxyName, data);
|
||||
super(NAME);
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
public function login(fullname:String, conference:String, password:String):void {
|
||||
LogUtil.debug(NAME + "::logging in " + fullname + " to " + conference);
|
||||
loginService = new LoginService();
|
||||
loginService.addLoginResultListener(loginListener);
|
||||
loginService.load(uri, fullname, conference, password);
|
||||
|
||||
}
|
||||
|
||||
public function stop():void {
|
||||
// USer is issuing a disconnect.
|
||||
// manualDisconnect = true;
|
||||
// chatService.disconnect();
|
||||
}
|
||||
|
||||
private function loginListener(success:Boolean, result:Object):void {
|
||||
if (success) {
|
||||
LogUtil.debug(NAME + '::Sending LoginModuleConstants.LOGIN_SUCCESS');
|
||||
sendNotification(LoginModuleConstants.LOGIN_SUCCESS, result);
|
||||
} else {
|
||||
LogUtil.debug(NAME + '::Sending LoginModuleConstants.LOGIN_FAILED');
|
||||
sendNotification(LoginModuleConstants.LOGIN_FAILED, result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,189 +0,0 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.login.model.services
|
||||
{
|
||||
import mx.rpc.IResponder;
|
||||
import flash.net.NetConnection;
|
||||
import flash.events.*;
|
||||
|
||||
public class ConnectionDelegate
|
||||
{
|
||||
public static const ID : String = "LoginModule::ConnectionDelegate";
|
||||
|
||||
private var _confDelegate : SharedObjectConferenceDelegate;
|
||||
private var _netConnection : NetConnection;
|
||||
|
||||
public function ConnectionDelegate(confDelegate : SharedObjectConferenceDelegate) : void
|
||||
{
|
||||
_confDelegate = confDelegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to the server using the specified parameters
|
||||
* @param host
|
||||
* @param room
|
||||
* @param username
|
||||
* @param password
|
||||
*
|
||||
*/
|
||||
public function connect(host : String , room : String,
|
||||
username : String, password : String) : void
|
||||
{
|
||||
_netConnection = _confDelegate.netConnection;
|
||||
|
||||
_netConnection.addEventListener( NetStatusEvent.NET_STATUS, netStatus );
|
||||
_netConnection.addEventListener( AsyncErrorEvent.ASYNC_ERROR, netASyncError );
|
||||
_netConnection.addEventListener( SecurityErrorEvent.SECURITY_ERROR, netSecurityError );
|
||||
_netConnection.addEventListener( IOErrorEvent.IO_ERROR, netIOError );
|
||||
|
||||
try {
|
||||
log.viewer( "Connecting to <b>" + host + "</b>");
|
||||
|
||||
_netConnection.connect(host, room, username, password );
|
||||
|
||||
} catch( e : ArgumentError ) {
|
||||
// Invalid parameters.
|
||||
switch ( e.errorID )
|
||||
{
|
||||
case 2004 :
|
||||
log.viewer( "Invalid server location: <b>" + host + "</b>");
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect from the server
|
||||
*
|
||||
*/
|
||||
public function disconnect() : void
|
||||
{
|
||||
_netConnection.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method is called when a net_status_event is received
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
protected function netStatus( event : NetStatusEvent ) : void
|
||||
{
|
||||
handleResult( event );
|
||||
}
|
||||
|
||||
/**
|
||||
* Method is called when a result is received from the server
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
public function handleResult( event : Object ) : void {
|
||||
var info : Object = event.info;
|
||||
var statusCode : String = info.code;
|
||||
|
||||
switch ( statusCode )
|
||||
{
|
||||
case "NetConnection.Connect.Success" :
|
||||
_confDelegate.connected();
|
||||
|
||||
// find out if it's a secure (HTTPS/TLS) connection
|
||||
if ( event.target.connectedProxyType == "HTTPS" || event.target.usingTLS ) {
|
||||
log.viewer( "Connected to secure server");
|
||||
} else {
|
||||
log.viewer( "Connected to server");
|
||||
}
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Failed" :
|
||||
_confDelegate.disconnected("The connection to the server failed.");
|
||||
|
||||
log.viewer("Connection to server failed");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Closed" :
|
||||
_confDelegate.disconnected("The connection to the server closed.");
|
||||
log.viewer("Connection to server closed");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.InvalidApp" :
|
||||
_confDelegate.disconnected("The application was not found on the server.")
|
||||
log.viewer("Application not found on server");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.AppShutDown" :
|
||||
_confDelegate.disconnected("The application has been shutdown.");
|
||||
log.viewer("Application has been shutdown");
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Rejected" :
|
||||
_confDelegate.disconnected("No permission to connect to the application.");
|
||||
log.viewer("No permissions to connect to the application" );
|
||||
_confDelegate.sendNotification(ViewersFacade.LOGIN_FAILED);
|
||||
break;
|
||||
|
||||
default :
|
||||
// statements
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method is called when a net_security_error is received
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
protected function netSecurityError( event : SecurityErrorEvent ) : void
|
||||
{
|
||||
handleFault( "Security error - " + event.text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Method is called when a net_io_error is received
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
protected function netIOError( event : IOErrorEvent ) : void
|
||||
{
|
||||
handleFault( "Input/output error - " + event.text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Method is called when a net_async_error is received
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
protected function netASyncError( event : AsyncErrorEvent ) : void
|
||||
{
|
||||
handleFault( "Asynchronous code error - " + event.error );
|
||||
}
|
||||
|
||||
/**
|
||||
* Method is called when a fault is received from the server
|
||||
* @param reason
|
||||
*
|
||||
*/
|
||||
public function handleFault( reason : String ) : void
|
||||
{
|
||||
_confDelegate.disconnected(reason);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,374 +0,0 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.login.model.services
|
||||
{
|
||||
import flash.events.AsyncErrorEvent;
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.events.SyncEvent;
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.SharedObject;
|
||||
|
||||
import org.bigbluebutton.modules.log.LogModuleFacade;
|
||||
import org.bigbluebutton.modules.viewers.ViewersFacade;
|
||||
import org.bigbluebutton.modules.viewers.ViewersModuleConstants;
|
||||
import org.bigbluebutton.modules.viewers.controller.notifiers.StatusNotifier;
|
||||
import org.bigbluebutton.modules.viewers.model.business.Conference;
|
||||
import org.bigbluebutton.modules.viewers.model.vo.User;
|
||||
import org.puremvc.as3.multicore.interfaces.IProxy;
|
||||
import org.puremvc.as3.multicore.patterns.proxy.Proxy;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author
|
||||
*
|
||||
*/
|
||||
public class LoginDelegate extends Proxy implements IProxy
|
||||
{
|
||||
public static const NAME:String = "SharedObjectConferenceDelegate";
|
||||
|
||||
private var _conference : Conference;
|
||||
private var _connection : NetConnection;
|
||||
private var _participantsSO : SharedObject;
|
||||
private var _ncDelegate : NetConnectionDelegate;
|
||||
private var log:LogModuleFacade = LogModuleFacade.getInstance("LogModule");
|
||||
private static const SO_NAME : String = "participantsSO";
|
||||
|
||||
/**
|
||||
* Creates a new SharedObjectConferenceDelegate object
|
||||
* @param conference - A Conference object
|
||||
*
|
||||
*/
|
||||
public function LoginDelegate(conference:Conference)
|
||||
{
|
||||
super(NAME);
|
||||
_conference = conference;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the user status in the conference object, and sends the update to the server shared object
|
||||
* @param newStatus
|
||||
*
|
||||
*/
|
||||
public function sendNewStatus(newStatus : String) : void {
|
||||
_conference.me.status = newStatus;
|
||||
|
||||
var id : Number = _conference.me.userid;
|
||||
var aUser:User = _conference.getParticipant(id);
|
||||
if (aUser != null) {
|
||||
// This sets this user's status
|
||||
aUser.status = newStatus;
|
||||
_participantsSO.setProperty(id.toString(), aUser);
|
||||
_participantsSO.setDirty(id.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the broadcast stream to the server
|
||||
* @param hasStream
|
||||
* @param streamName
|
||||
*
|
||||
*/
|
||||
public function sendBroadcastStream(hasStream : Boolean, streamName : String) : void {
|
||||
var id : Number = _conference.me.userid;
|
||||
var aUser : User = _conference.getParticipant(id);
|
||||
|
||||
if (aUser != null) {
|
||||
// This sets the users stream
|
||||
aUser.hasStream = hasStream;
|
||||
aUser.streamName = streamName;
|
||||
_participantsSO.setProperty(id.toString(), aUser);
|
||||
_participantsSO.setDirty(id.toString());
|
||||
|
||||
log.viewer( "Conference::sendBroadcastStream::found =[" + id + ","
|
||||
+ aUser.hasStream + "," + aUser.streamName + "]");
|
||||
}
|
||||
}
|
||||
|
||||
public function broadcastStream(id : Number, hasStream : Boolean, streamName : String) : void
|
||||
{
|
||||
var aUser : User = _conference.getParticipant(id);
|
||||
if (aUser != null) {
|
||||
aUser.hasStream = hasStream;
|
||||
aUser.streamName = streamName;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Join the server, connect
|
||||
* @param host
|
||||
* @param username
|
||||
* @param password
|
||||
* @param room
|
||||
*
|
||||
*/
|
||||
public function join(host : String, username : String, password : String, room : String) : void
|
||||
{
|
||||
_connection = new NetConnection();
|
||||
_connection.client = this;
|
||||
|
||||
_conference.host = host;
|
||||
_conference.room = room;
|
||||
_conference.me.name = username;
|
||||
|
||||
_ncDelegate = new NetConnectionDelegate(this);
|
||||
_ncDelegate.connect(host, room, username, password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the NetConnection object which handles the server connection details
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
public function get netConnection() : NetConnection
|
||||
{
|
||||
return _connection;
|
||||
}
|
||||
|
||||
public function disconnected(reason : String) : void
|
||||
{
|
||||
_conference.connected = false;
|
||||
_conference.connectFailReason = reason;
|
||||
sendNotification(ViewersModuleConstants.LOGIN_FAILED, reason);
|
||||
}
|
||||
|
||||
public function connected() : void
|
||||
{
|
||||
_conference.connected = true;
|
||||
_conference.connectFailReason = null;
|
||||
|
||||
joinConference();
|
||||
|
||||
sendNotification(ViewersFacade.CONNECT_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Join a conference room on the server
|
||||
*
|
||||
*/
|
||||
private function joinConference() : void
|
||||
{
|
||||
// Start with a fresh list
|
||||
_conference.removeAllParticipants();
|
||||
|
||||
_participantsSO = SharedObject.getRemote(SO_NAME, _conference.host, false);
|
||||
|
||||
_participantsSO.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
_participantsSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
_participantsSO.addEventListener(SyncEvent.SYNC, sharedObjectSyncHandler);
|
||||
|
||||
_participantsSO.client = this;
|
||||
|
||||
_participantsSO.connect(_connection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Leave the conference
|
||||
*
|
||||
*/
|
||||
public function leave() : void
|
||||
{
|
||||
removeListeners();
|
||||
_participantsSO.close();
|
||||
_ncDelegate.disconnect();
|
||||
|
||||
// Cleanup list of participants
|
||||
_conference.removeAllParticipants();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the listeners for the participantsSO shared object
|
||||
*
|
||||
*/
|
||||
private function removeListeners() : void
|
||||
{
|
||||
_participantsSO.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
_participantsSO.removeEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
_participantsSO.removeEventListener(SyncEvent.SYNC, sharedObjectSyncHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a sync_event is received for the SharedObject
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
private function sharedObjectSyncHandler( event : SyncEvent) : void
|
||||
{
|
||||
log.viewer( "Conference::sharedObjectSyncHandler " + event.changeList.length);
|
||||
|
||||
for (var i : uint = 0; i < event.changeList.length; i++)
|
||||
{
|
||||
log.viewer( "Conference::handlingChanges[" + event.changeList[i].name + "][" + i + "]");
|
||||
handleChangesToSharedObject(event.changeList[i].code,
|
||||
event.changeList[i].name, event.changeList[i].oldValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See flash.events.SyncEvent
|
||||
*/
|
||||
private function handleChangesToSharedObject(code : String, name : String, oldValue : Object) : void
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case "clear":
|
||||
/** From flash.events.SyncEvent doc
|
||||
*
|
||||
* A value of "clear" means either that you have successfully connected
|
||||
* to a remote shared object that is not persistent on the server or the
|
||||
* client, or that all the properties of the object have been deleted --
|
||||
* for example, when the client and server copies of the object are so
|
||||
* far out of sync that Flash Player resynchronizes the client object
|
||||
* with the server object. In the latter case, SyncEvent.SYNC is dispatched
|
||||
* and the "code" value is set to "change".
|
||||
*/
|
||||
|
||||
_conference.removeAllParticipants();
|
||||
|
||||
break;
|
||||
|
||||
case "success":
|
||||
/** From flash.events.SyncEvent doc
|
||||
* A value of "success" means the client changed the shared object.
|
||||
*/
|
||||
|
||||
// do nothing... just log it
|
||||
log.viewer( "Conference::success =[" + name + ","
|
||||
+ _participantsSO.data[name].status + ","
|
||||
+ _participantsSO.data[name].hasStream
|
||||
+ "]");
|
||||
break;
|
||||
|
||||
case "reject":
|
||||
/** From flash.events.SyncEvent doc
|
||||
* A value of "reject" means the client tried unsuccessfully to change the
|
||||
* object; instead, another client changed the object.
|
||||
*/
|
||||
|
||||
// do nothing... just log it
|
||||
// Or...maybe we should check if the value is the same as what we wanted it
|
||||
// to be..if not...change it?
|
||||
log.viewer( "Conference::reject =[" + code + "," + name + "," + oldValue + "]");
|
||||
break;
|
||||
|
||||
case "change":
|
||||
/** From flash.events.SyncEvent doc
|
||||
* A value of "change" means another client changed the object or the server
|
||||
* resynchronized the object.
|
||||
*/
|
||||
|
||||
if (name != null) {
|
||||
if (_conference.hasParticipant(_participantsSO.data[name].userid)) {
|
||||
var changedUser : User = _conference.getParticipant(Number(name));
|
||||
changedUser.status = _participantsSO.data[name].status;
|
||||
changedUser.hasStream = _participantsSO.data[name].hasStream;
|
||||
changedUser.streamName = _participantsSO.data[name].streamName;
|
||||
|
||||
log.viewer( "Conference::change =[" +
|
||||
name + "," + changedUser.name + "," + changedUser.hasStream + "]");
|
||||
|
||||
} else {
|
||||
// The server sent us a new user.
|
||||
var user : User = new User();
|
||||
user.userid = _participantsSO.data[name].userid;
|
||||
user.name = _participantsSO.data[name].name;
|
||||
user.status = _participantsSO.data[name].status;
|
||||
user.hasStream = _participantsSO.data[name].hasStream;
|
||||
user.streamName = _participantsSO.data[name].streamName;
|
||||
user.role = _participantsSO.data[name].role;
|
||||
|
||||
log.viewer( "Conference::change::newuser =[" +
|
||||
name + "," + user.name + "," + user.hasStream + "]");
|
||||
|
||||
_conference.addUser(user);
|
||||
}
|
||||
|
||||
} else {
|
||||
//log.warn( "Conference::SO::change is null");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
/** From flash.events.SyncEvent doc
|
||||
* A value of "delete" means the attribute was deleted.
|
||||
*/
|
||||
|
||||
log.viewer( "Conference::delete =[" + code + "," + name + "," + oldValue + "]");
|
||||
|
||||
// The participant has left. Cast name (string) into a Number.
|
||||
_conference.removeParticipant(Number(name));
|
||||
break;
|
||||
|
||||
default:
|
||||
log.viewer( "Conference::default[" + _participantsSO.data[name].userid
|
||||
+ "," + _participantsSO.data[name].name + "]");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a net_statu_event is received
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
private function netStatusHandler ( event : NetStatusEvent ) : void
|
||||
{
|
||||
log.viewer( "Conference::netStatusHandler " + event.info.code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an async_error_handler is called
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
private function asyncErrorHandler ( event : AsyncErrorEvent ) : void
|
||||
{
|
||||
log.viewer( "Conference::asyncErrorHandler " + event.error);
|
||||
}
|
||||
|
||||
/**
|
||||
* send a new user status message
|
||||
* @param userid
|
||||
* @param newStatus
|
||||
*
|
||||
*/
|
||||
public function sendNewUserStatusEvent(userid : Number, newStatus : String):void
|
||||
{
|
||||
//var event : StatusChangeEvent =
|
||||
// new StatusChangeEvent(userid, newStatus);
|
||||
//event.dispatch();
|
||||
sendNotification(ViewersFacade.CHANGE_STATUS, new StatusNotifier(userid, newStatus));
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback from server
|
||||
*/
|
||||
public function setUserIdAndRole(id : Number, role : String ) : String
|
||||
{
|
||||
log.viewer( "SOConferenceDelegate::setConnectionId: id=[" + id + "]");
|
||||
if( isNaN( id ) ) return "FAILED";
|
||||
|
||||
_conference.me.userid = id;
|
||||
_conference.me.role = role;
|
||||
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.bigbluebutton.modules.login.model.services
|
||||
{
|
||||
import flash.events.*;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.URLRequestMethod;
|
||||
import flash.net.URLVariables;
|
||||
|
||||
public class LoginService
|
||||
{
|
||||
private var request:URLRequest = new URLRequest();
|
||||
private var vars:URLVariables = new URLVariables();
|
||||
|
||||
private var urlLoader:URLLoader;
|
||||
private var _resultListener:Function;
|
||||
|
||||
public function LoginService()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Load slides from an HTTP service. Response is received in the Responder class' onResult method
|
||||
* @param url
|
||||
*
|
||||
*/
|
||||
public function load(url:String, fullname:String, conference:String, password:String) : void
|
||||
{
|
||||
LogUtil.debug("LoginService:load(...) " + url);
|
||||
|
||||
vars.fullname = fullname;
|
||||
vars.conference = conference;
|
||||
vars.password = password;
|
||||
request = new URLRequest(url);
|
||||
request.data = vars;
|
||||
request.method = URLRequestMethod.POST;
|
||||
|
||||
urlLoader = new URLLoader();
|
||||
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
|
||||
urlLoader.load(request);
|
||||
}
|
||||
|
||||
public function addLoginResultListener(listener:Function):void {
|
||||
_resultListener = listener;
|
||||
}
|
||||
|
||||
private function handleComplete(e:Event):void{
|
||||
|
||||
var xml:XML = new XML(e.target.data)
|
||||
LogUtil.debug("Loading complete: " + xml);
|
||||
var returncode:String = xml.returncode;
|
||||
if (returncode == 'FAILED') {
|
||||
LogUtil.debug("Result = " + returncode + " " + xml.message);
|
||||
_resultListener(false, {message:xml.message});
|
||||
} else if (returncode == 'SUCCESS') {
|
||||
LogUtil.debug(xml.returncode + " " + xml.fullname + " " + xml.conference + " " + xml.role
|
||||
+ " " + xml.room);
|
||||
_resultListener(true, {fullname:xml.fullname,conference:xml.conference,role:xml.role,room:xml.room});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,64 +1,154 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.login.view
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.events.KeyboardEvent;
|
||||
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.modules.login.LoginModuleConstants;
|
||||
import org.bigbluebutton.modules.login.model.LoginProxy;
|
||||
import org.bigbluebutton.modules.login.view.components.LoginWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
|
||||
|
||||
/**
|
||||
* The JoinWindowMediator is a mediator class for the JoinWindow gui component
|
||||
* @author Denis Zgonjanin
|
||||
*
|
||||
*/
|
||||
public class LoginWindowMediator extends Mediator implements IMediator
|
||||
{
|
||||
public function LoginWindowMediator(mediatorName:String=null, viewComponent:Object=null)
|
||||
public static const NAME:String = "JoinWindowMediator";
|
||||
|
||||
private var _module:IBigBlueButtonModule;
|
||||
private var _joinWindow:LoginWindow = new LoginWindow();
|
||||
public static const LOGIN:String = "Attempt Login";
|
||||
|
||||
/**
|
||||
* the constructor. registers this mediator with the JoinWindow gui component
|
||||
* @param view
|
||||
*
|
||||
*/
|
||||
public function LoginWindowMediator(module:IBigBlueButtonModule)
|
||||
{
|
||||
//TODO: implement function
|
||||
super(mediatorName, viewComponent);
|
||||
super(NAME, module);
|
||||
_module = module;
|
||||
_joinWindow.addEventListener(LOGIN, login);
|
||||
_joinWindow.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
|
||||
}
|
||||
|
||||
public function sendNotification(notificationName:String, body:Object=null, type:String=null):void
|
||||
{
|
||||
//TODO: implement function
|
||||
/**
|
||||
* Lists the notifications to which this mediator listens to
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
override public function listNotificationInterests():Array{
|
||||
|
||||
return [
|
||||
LoginModuleConstants.LOGIN_FAILED,
|
||||
LoginModuleConstants.LOGIN_SUCCESS,
|
||||
LoginModuleConstants.OPEN_WINDOW,
|
||||
LoginModuleConstants.CLOSE_WINDOW
|
||||
];
|
||||
}
|
||||
|
||||
public function initializeNotifier(key:String):void
|
||||
{
|
||||
//TODO: implement function
|
||||
/**
|
||||
* Handles specific notifications upon their reception
|
||||
* @param notification
|
||||
*
|
||||
*/
|
||||
override public function handleNotification(notification:INotification):void{
|
||||
|
||||
switch(notification.getName())
|
||||
{
|
||||
case LoginModuleConstants.OPEN_WINDOW:
|
||||
LogUtil.debug('Received request to OPEN_JOIN_WINDOW');
|
||||
|
||||
_joinWindow.width = 350;
|
||||
_joinWindow.height = 270;
|
||||
_joinWindow.title = "Login";
|
||||
_joinWindow.showCloseButton = false;
|
||||
_joinWindow.xPosition = 450;
|
||||
_joinWindow.yPosition = 150;
|
||||
facade.sendNotification(LoginModuleConstants.ADD_WINDOW, _joinWindow);
|
||||
break;
|
||||
|
||||
case LoginModuleConstants.CLOSE_WINDOW:
|
||||
LogUtil.debug('Received request to CLOSE_JOIN_WINDOW');
|
||||
_joinWindow.clear();
|
||||
facade.sendNotification(LoginModuleConstants.REMOVE_WINDOW, _joinWindow);
|
||||
break;
|
||||
|
||||
case LoginModuleConstants.LOGIN_FAILED:
|
||||
LogUtil.debug('Received request to LOGIN_FAILED');
|
||||
_joinWindow.showError(notification.getBody()["message"]);
|
||||
break;
|
||||
|
||||
case LoginModuleConstants.LOGIN_SUCCESS:
|
||||
LogUtil.debug('Received request to LOGIN_SUCCESS');
|
||||
_joinWindow.clear();
|
||||
facade.sendNotification(LoginModuleConstants.REMOVE_WINDOW, _joinWindow);
|
||||
facade.sendNotification(LoginModuleConstants.USER_LOGGEDIN);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getMediatorName():String
|
||||
{
|
||||
//TODO: implement function
|
||||
return null;
|
||||
protected function keyPressed(event:KeyboardEvent):void{
|
||||
if (event.keyCode == 13) login(event);
|
||||
}
|
||||
|
||||
public function getViewComponent():Object
|
||||
{
|
||||
//TODO: implement function
|
||||
return null;
|
||||
/**
|
||||
* Returns the gui component which this class is a mediator of
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
private function get loginWindow():LoginWindow{
|
||||
return viewComponent as LoginWindow;
|
||||
}
|
||||
|
||||
public function setViewComponent(viewComponent:Object):void
|
||||
{
|
||||
//TODO: implement function
|
||||
/**
|
||||
* Try to login.
|
||||
* @param e
|
||||
*
|
||||
*/
|
||||
private function login(e:Event):void{
|
||||
LogUtil.debug('Received login event');
|
||||
var name : String = _joinWindow.nameField.text;
|
||||
var room : String = _joinWindow.confField.text;
|
||||
var password : String = _joinWindow.passwdField.text
|
||||
|
||||
if ((name.length < 1) || (room.length < 1) || (password.length < 1)) {
|
||||
_joinWindow.lblNote.text = "Please enter all the information.";
|
||||
return;
|
||||
}
|
||||
_joinWindow.lblNote.text = "Attempting to Login.";
|
||||
|
||||
proxy.login(name, room, password);
|
||||
}
|
||||
|
||||
public function listNotificationInterests():Array
|
||||
{
|
||||
//TODO: implement function
|
||||
return null;
|
||||
}
|
||||
|
||||
public function handleNotification(notification:INotification):void
|
||||
{
|
||||
//TODO: implement function
|
||||
private function get proxy():LoginProxy {
|
||||
return facade.retrieveProxy(LoginProxy.NAME) as LoginProxy;
|
||||
}
|
||||
|
||||
public function onRegister():void
|
||||
{
|
||||
//TODO: implement function
|
||||
}
|
||||
|
||||
public function onRemove():void
|
||||
{
|
||||
//TODO: implement function
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,21 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<login:MDIWindow xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
width="328" height="265" layout="absolute"
|
||||
xmlns:login="flexlib.mdi.containers.*">
|
||||
|
||||
<MDIWindow xmlns="flexlib.mdi.containers.*"
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
width="328" height="265" layout="absolute" showCloseButton="false"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow">
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.viewers.view.mediators.JoinWindowMediator;
|
||||
import mx.managers.PopUpManager;
|
||||
import org.bigbluebutton.modules.login.LoginModuleConstants;
|
||||
import org.bigbluebutton.modules.login.view.LoginWindowMediator;
|
||||
|
||||
public static const TITLE:String = "Join Conference";
|
||||
public var host : String = "localhost";
|
||||
public var message:Boolean;
|
||||
public function showError():void
|
||||
{
|
||||
this.loginMessage.visible = true;
|
||||
private var _xPosition:int;
|
||||
private var _yPosition:int;
|
||||
|
||||
public function get xPosition():int {
|
||||
return _xPosition;
|
||||
}
|
||||
|
||||
|
||||
public function get yPosition():int {
|
||||
return _yPosition;
|
||||
}
|
||||
|
||||
public function set xPosition(x:int):void {
|
||||
_xPosition = x;
|
||||
}
|
||||
|
||||
public function set yPosition(y:int):void {
|
||||
_yPosition = y;
|
||||
}
|
||||
|
||||
public function showError(error:String):void
|
||||
{
|
||||
this.lblNote.visible = true;
|
||||
this.lblNote.text = error;
|
||||
}
|
||||
|
||||
public function clear():void {
|
||||
nameField.text = "";
|
||||
confField.text = "";
|
||||
passwdField.text = "";
|
||||
lblNote.text = "";
|
||||
}
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
<mx:Label x="41" y="52" text="Name" id="nameLabel"/>
|
||||
@ -24,11 +49,7 @@
|
||||
<mx:TextInput x="98" y="89" id="confField" tabIndex="2"/>
|
||||
<mx:Label x="22" y="132" text="Password" id="passwdLabel"/>
|
||||
<mx:TextInput x="98" y="130" id="passwdField" displayAsPassword="true" tabIndex="3"/>
|
||||
<mx:Button label="Join" x="243" y="169" click="dispatchEvent(new Event(JoinWindowMediator.LOGIN))" tabIndex="4"/>
|
||||
<mx:Button label="Join" x="243" y="169" click="dispatchEvent(new Event(LoginWindowMediator.LOGIN))" tabIndex="4"/>
|
||||
<mx:Label x="21" y="10" text="Complete form to join conference." width="256" id="messageLbl"/>
|
||||
<mx:Label x="22" y="208" width="270" id="lblNote"/>
|
||||
<mx:Label id="loginMessage" x="22" y="200"
|
||||
text="Either the password or room number is incorrect"
|
||||
visible="false" color="red"/>
|
||||
|
||||
</login:MDIWindow>
|
||||
</MDIWindow>
|
||||
|
@ -0,0 +1,130 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.phone
|
||||
{
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.bigbluebutton.common.messaging.EndpointMessageConstants;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
import org.bigbluebutton.modules.phone.view.components.PhoneWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
|
||||
|
||||
public class PhoneEndpointMediator extends Mediator implements IMediator
|
||||
{
|
||||
public static const NAME:String = "PhoneEndPointMediator";
|
||||
|
||||
private var _phoneWindow:PhoneWindow;
|
||||
private var _phoneWindowOpen:Boolean = false;
|
||||
private var _module:PhoneModule;
|
||||
private var _router:Router;
|
||||
private var _endpoint:Endpoint;
|
||||
private static const TO_PHONE_MODULE:String = "TO_PHONE_MODULE";
|
||||
private static const FROM_PHONE_MODULE:String = "FROM_PHONE_MODULE";
|
||||
|
||||
public function PhoneEndpointMediator(module:PhoneModule)
|
||||
{
|
||||
super(NAME,module);
|
||||
_module = module;
|
||||
_router = module.router;
|
||||
_phoneWindow = new PhoneWindow();
|
||||
_phoneWindow.red5URL = _module.uri;
|
||||
LogUtil.debug("Creating endpoint for PhoneModule");
|
||||
_endpoint = new Endpoint(_router, FROM_PHONE_MODULE, TO_PHONE_MODULE, messageReceiver);
|
||||
}
|
||||
|
||||
override public function getMediatorName():String
|
||||
{
|
||||
return NAME;
|
||||
}
|
||||
|
||||
override public function listNotificationInterests():Array
|
||||
{
|
||||
return [
|
||||
PhoneModuleConstants.CONNECTED,
|
||||
PhoneModuleConstants.DISCONNECTED,
|
||||
PhoneModuleConstants.ADD_WINDOW,
|
||||
PhoneModuleConstants.REMOVE_WINDOW
|
||||
];
|
||||
}
|
||||
|
||||
override public function handleNotification(notification:INotification):void
|
||||
{
|
||||
LogUtil.debug("PhoneEndPoint MSG. " + notification.getName());
|
||||
switch(notification.getName()){
|
||||
case PhoneModuleConstants.CONNECTED:
|
||||
LogUtil.debug("Sending Phone MODULE_STARTED message to main");
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STARTED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, _module.moduleId);
|
||||
openPhoneWindow();
|
||||
break;
|
||||
case PhoneModuleConstants.DISCONNECTED:
|
||||
LogUtil.debug('Sending Phone MODULE_STOPPED message to main');
|
||||
closePhoneWindow();
|
||||
var info:Object = notification.getBody();
|
||||
info["moduleId"] = _module.moduleId
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STOPPED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, info);
|
||||
break;
|
||||
case PhoneModuleConstants.ADD_WINDOW:
|
||||
LogUtil.debug('Sending Phone ADD_WINDOW message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.ADD_WINDOW,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
case PhoneModuleConstants.REMOVE_WINDOW:
|
||||
LogUtil.debug('Sending Phone REMOVE_WINDOW message to main');
|
||||
_endpoint.sendMessage(EndpointMessageConstants.REMOVE_WINDOW,
|
||||
EndpointMessageConstants.TO_MAIN_APP, notification.getBody());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function messageReceiver(message : IPipeMessage) : void
|
||||
{
|
||||
var msg : String = message.getHeader().MSG as String;
|
||||
switch(msg){
|
||||
case EndpointMessageConstants.CLOSE_WINDOW:
|
||||
facade.sendNotification(PhoneModuleConstants.CLOSE_WINDOW);
|
||||
break;
|
||||
case EndpointMessageConstants.OPEN_WINDOW:
|
||||
LogUtil.debug('Received OPEN_WINDOW message from ' + message.getHeader().SRC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function closePhoneWindow():void {
|
||||
if (_phoneWindowOpen) {
|
||||
facade.sendNotification(PhoneModuleConstants.REMOVE_WINDOW, _phoneWindow);
|
||||
_phoneWindowOpen = false;
|
||||
}
|
||||
}
|
||||
private function openPhoneWindow():void{
|
||||
_phoneWindow.width = 250;
|
||||
_phoneWindow.height = 220;
|
||||
_phoneWindow.title = "Phone Module";
|
||||
_phoneWindow.showCloseButton = false;
|
||||
_phoneWindow.xPosition = 675;
|
||||
_phoneWindow.yPosition = 230;
|
||||
facade.sendNotification(PhoneModuleConstants.ADD_WINDOW, _phoneWindow);
|
||||
_phoneWindowOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.phone
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.modules.phone.controller.StartupCommand;
|
||||
import org.bigbluebutton.modules.phone.controller.StopCommand;
|
||||
import org.puremvc.as3.multicore.interfaces.IFacade;
|
||||
import org.puremvc.as3.multicore.patterns.facade.Facade;
|
||||
|
||||
/**
|
||||
*
|
||||
* Class PhoneFacade
|
||||
*
|
||||
*/
|
||||
public class PhoneFacade extends Facade implements IFacade
|
||||
{
|
||||
public static const NAME:String = "PhoneFacade";
|
||||
public static const STARTUP:String = "startup";
|
||||
public static const STOP:String = "STOP";
|
||||
|
||||
public function PhoneFacade()
|
||||
{
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
|
||||
public static function getInstance():PhoneFacade{
|
||||
if (instanceMap[NAME] == null) instanceMap[NAME] = new PhoneFacade();
|
||||
return instanceMap[NAME] as PhoneFacade;
|
||||
|
||||
}
|
||||
|
||||
override protected function initializeController():void{
|
||||
super.initializeController();
|
||||
registerCommand(STARTUP, StartupCommand);
|
||||
registerCommand(STOP, StopCommand);
|
||||
}
|
||||
|
||||
public function startup(app:IBigBlueButtonModule):void {
|
||||
sendNotification(PhoneFacade.STARTUP, app);
|
||||
}
|
||||
|
||||
public function stop(app:IBigBlueButtonModule):void {
|
||||
sendNotification(STOP, app);
|
||||
removeCore(NAME);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.bigbluebutton.modules.phone
|
||||
{
|
||||
public class PhoneModuleConstants
|
||||
{
|
||||
public static const NEW_MESSAGE:String = "new chat message";
|
||||
|
||||
public static const START:String = "start module";
|
||||
public static const STOP:String = "stop module";
|
||||
public static const CONNECTED:String = "connected to server";
|
||||
public static const DISCONNECTED:String = "disconnected from server";
|
||||
|
||||
public static const OPEN_WINDOW:String = 'OPEN_WINDOW';
|
||||
public static const CLOSE_WINDOW:String = 'CLOSE_WINDOW';
|
||||
public static const ADD_WINDOW:String = 'ADD_WINDOW';
|
||||
public static const REMOVE_WINDOW:String = 'REMOVE_WINDOW';
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.phone
|
||||
{
|
||||
import org.bigbluebutton.common.IBigBlueButtonModule;
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
import org.puremvc.as3.multicore.utilities.pipes.interfaces.IPipeMessage;
|
||||
|
||||
/**
|
||||
* This class is a mediator for the PhoneModule viewComponent
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class PhoneModuleMediator extends Mediator implements IMediator
|
||||
{
|
||||
public static const NAME:String = 'PhoneModuleMediator';
|
||||
private var _module:IBigBlueButtonModule;
|
||||
|
||||
|
||||
public function PhoneModuleMediator( module:IBigBlueButtonModule )
|
||||
{
|
||||
super( NAME, module );
|
||||
_module = module;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -10,30 +10,28 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
* PARTICULAR PURPOSE . See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.viewers.controller
|
||||
package org.bigbluebutton.modules.phone.controller
|
||||
{
|
||||
import org.bigbluebutton.modules.viewers.view.components.JoinWindow;
|
||||
import org.bigbluebutton.modules.viewers.view.mediators.JoinWindowMediator;
|
||||
import org.bigbluebutton.modules.phone.PhoneEndpointMediator;
|
||||
import org.bigbluebutton.modules.phone.PhoneModuleConstants;
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
/**
|
||||
* The StartLoginCommand registers a JoinWindowMediator with the JoinWindow gui component
|
||||
* @author Denis Zgonjanin
|
||||
*
|
||||
*/
|
||||
public class StartLoginCommand extends SimpleCommand
|
||||
{
|
||||
override public function execute(notification:INotification):void{
|
||||
facade.registerMediator(new JoinWindowMediator());
|
||||
}
|
||||
|
||||
public class StartupCommand extends SimpleCommand implements ICommand
|
||||
{
|
||||
override public function execute(notification:INotification):void {
|
||||
var m:PhoneModule = notification.getBody() as PhoneModule;
|
||||
|
||||
facade.registerMediator(new PhoneEndpointMediator(m));
|
||||
facade.sendNotification(PhoneModuleConstants.CONNECTED);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package org.bigbluebutton.modules.phone.controller
|
||||
{
|
||||
import org.bigbluebutton.modules.phone.PhoneModuleConstants;
|
||||
import org.puremvc.as3.multicore.interfaces.ICommand;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
|
||||
|
||||
public class StopCommand extends SimpleCommand implements ICommand
|
||||
{
|
||||
|
||||
override public function execute(notification:INotification):void
|
||||
{
|
||||
facade.sendNotification(PhoneModuleConstants.DISCONNECTED);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2008 by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.phone.view
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
import org.bigbluebutton.modules.phone.PhoneModuleConstants;
|
||||
import org.bigbluebutton.modules.phone.view.components.PhoneWindow;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
|
||||
|
||||
public class PhoneWindowMediator extends Mediator implements IMediator
|
||||
{
|
||||
public static const NAME:String = "PhoneMediator";
|
||||
public static const NEW_MESSAGE:String = "newMessage";
|
||||
|
||||
private var _module:PhoneModule;
|
||||
private var _phoneWindow:PhoneWindow;
|
||||
private var _phoneWindowOpen:Boolean = false;
|
||||
|
||||
public function PhoneWindowMediator(module:PhoneModule)
|
||||
{
|
||||
super(NAME, module);
|
||||
_module = module;
|
||||
_phoneWindow = new PhoneWindow();
|
||||
_phoneWindow.red5URL = _module.uri;
|
||||
_phoneWindow.username = _module.sipUsername;
|
||||
_phoneWindow.password = _module.sipPassword;
|
||||
_phoneWindow.realm = _module.sipRealm;
|
||||
_phoneWindow.server = _module.sipServer;
|
||||
_phoneWindow.confRoom = _module.sipConfRoom;
|
||||
}
|
||||
|
||||
private function time() : String
|
||||
{
|
||||
var date:Date = new Date();
|
||||
var t:String = date.toLocaleTimeString();
|
||||
return t;
|
||||
}
|
||||
|
||||
public function onCallMessage(e:CallMessageEvent):void
|
||||
{
|
||||
proxy.call(e.phone);
|
||||
}
|
||||
|
||||
override public function listNotificationInterests():Array
|
||||
{
|
||||
return [
|
||||
PhoneModuleConstants.CLOSE_WINDOW,
|
||||
PhoneModuleConstants.OPEN_WINDOW
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Handlers for notification(s) this class is listening to
|
||||
* @param notification
|
||||
*
|
||||
*/
|
||||
override public function handleNotification(notification:INotification):void
|
||||
{
|
||||
switch(notification.getName())
|
||||
{
|
||||
case PhoneModuleConstants.CLOSE_WINDOW:
|
||||
if (_phoneWindowOpen) {
|
||||
facade.sendNotification(PhoneModuleConstants.REMOVE_WINDOW, _phoneWindow);
|
||||
_phoneWindowOpen = false;
|
||||
}
|
||||
break;
|
||||
case PhoneModuleConstants.OPEN_WINDOW:
|
||||
_phoneWindow.width = 250;
|
||||
_phoneWindow.height = 220;
|
||||
_phoneWindow.title = "Group Phone";
|
||||
_phoneWindow.showCloseButton = false;
|
||||
_phoneWindow.xPosition = 675;
|
||||
_phoneWindow.yPosition = 0;
|
||||
facade.sendNotification(PhoneModuleConstants.ADD_WINDOW, _phoneWindow);
|
||||
_phoneWindowOpen = true;
|
||||
proxy.getPhoneTranscript();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function get proxy():PhoneProxy
|
||||
{
|
||||
return facade.retrieveProxy(PhoneProxy.NAME) as PhoneProxy;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 703 B |
Binary file not shown.
After Width: | Height: | Size: 700 B |
@ -17,28 +17,17 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.modules.chat.model.vo
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Value object class
|
||||
* The message itself and some attributes of it
|
||||
*
|
||||
*/
|
||||
|
||||
package org.bigbluebutton.modules.phone.view.components
|
||||
{
|
||||
[Bindable]
|
||||
public class MessageVO
|
||||
public class Images
|
||||
{
|
||||
public var message:MessageObject;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
public function MessageVO()
|
||||
{
|
||||
message = new MessageObject("",0xffff);
|
||||
}
|
||||
|
||||
[Embed(source="../assets/images/stop.png")]
|
||||
public var stop:Class;
|
||||
|
||||
[Embed(source="../assets/images/phone_sound.png")]
|
||||
public var phone_sound_icon:Class;
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MDIWindow xmlns="flexlib.mdi.containers.*"
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
width="300" height="300" showCloseButton="false"
|
||||
creationComplete="init()"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow">
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.phone.view.components.Images;
|
||||
import flash.net.NetConnection;
|
||||
import flash.external.*;
|
||||
|
||||
[Bindable]
|
||||
private var netConnection:NetConnection = null;
|
||||
private var incomingNetStream:NetStream = null;
|
||||
private var outgoingNetStream:NetStream = null;
|
||||
|
||||
private var _xPosition:int;
|
||||
private var _yPosition:int;
|
||||
|
||||
private var isConnected:Boolean = false;
|
||||
private var mic:Microphone = null;
|
||||
public var red5URL:String = "rtmp:localhost/sip";
|
||||
public var username:String = "201";
|
||||
public var password:String = "";
|
||||
public var realm:String = "192.168.0.101";
|
||||
public var server:String = "192.168.0.101";
|
||||
|
||||
// public var username:String = "1002";
|
||||
// public var password:String = "ff3j";
|
||||
// public var realm:String = "134.117.254.226";
|
||||
// public var server:String = "134.117.254.226";
|
||||
|
||||
public var confRoom:String = "85115";
|
||||
|
||||
private var images:Images = new Images();
|
||||
[Bindable] private var call_icon:Class = images.phone_sound_icon;
|
||||
[Bindable] private var stop_icon:Class = images.stop;
|
||||
|
||||
|
||||
private function init():void {
|
||||
simpleLabel.text="Waiting....."
|
||||
|
||||
initMicrophone();
|
||||
|
||||
NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
|
||||
netConnection = new NetConnection();
|
||||
netConnection.objectEncoding = ObjectEncoding.AMF0;
|
||||
netConnection.client = this;
|
||||
netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus );
|
||||
netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
|
||||
|
||||
connect();
|
||||
register();
|
||||
register();
|
||||
}
|
||||
|
||||
private function connect():void {
|
||||
//netConnection.connect(txtRed5URL.text);
|
||||
netConnection.connect(red5URL);
|
||||
}
|
||||
|
||||
private function register():void {
|
||||
netConnection.call("register", null,username);
|
||||
}
|
||||
|
||||
private function initMicrophone():void {
|
||||
mic = Microphone.getMicrophone();
|
||||
|
||||
if(mic == null){
|
||||
trace("No available microphone");
|
||||
} else {
|
||||
mic.setUseEchoSuppression(true);
|
||||
mic.setLoopBack(false);
|
||||
mic.setSilenceLevel(10);
|
||||
mic.gain = 60;
|
||||
mic.rate = 8;
|
||||
mic.addEventListener(ActivityEvent.ACTIVITY, micActivityHandler);
|
||||
mic.addEventListener(StatusEvent.STATUS, micStatusHandler);
|
||||
}
|
||||
}
|
||||
|
||||
public function setUsername(user:String):void {
|
||||
username=user;
|
||||
}
|
||||
public function setPassword(pass:String):void {
|
||||
password=pass;
|
||||
}
|
||||
public function setConfRoom(conf:String):void {
|
||||
confRoom=conf;
|
||||
}
|
||||
|
||||
private function micActivityHandler(event:ActivityEvent):void {
|
||||
//simpleLabel.text= "activityHandler: " + event;
|
||||
}
|
||||
|
||||
|
||||
private function micStatusHandler(event:StatusEvent):void {
|
||||
switch(event.code) {
|
||||
|
||||
case "Microphone.Muted":
|
||||
break;
|
||||
case "Microphone.Unmuted":
|
||||
break;
|
||||
default:
|
||||
trace("unknown micStatusHandler event: " + event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function netStatus (evt:NetStatusEvent ):void {
|
||||
switch(evt.info.code) {
|
||||
|
||||
case "NetConnection.Connect.Success":
|
||||
simpleLabel.text="Connection success!";
|
||||
netConnection.call("login", null, username, password, realm, server);
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Failed":
|
||||
simpleLabel.text="Failed to connect";
|
||||
break;
|
||||
|
||||
case "NetConnection.Connect.Rejected":
|
||||
simpleLabel.text="Rejected";
|
||||
break;
|
||||
|
||||
case "NetStream.Play.StreamNotFound":
|
||||
simpleLabel.text="No Stream";
|
||||
break;
|
||||
|
||||
case "NetStream.Play.Failed":
|
||||
simpleLabel.text="Play error";
|
||||
netConnection.call("streamStatus", null, username, "failed");
|
||||
break;
|
||||
|
||||
case "NetStream.Play.Start":
|
||||
simpleLabel.text="Play start";
|
||||
netConnection.call("streamStatus", null, username, "start");
|
||||
|
||||
break;
|
||||
case "NetStream.Play.Stop":
|
||||
simpleLabel.text="Play stop";
|
||||
netConnection.call("streamStatus", null, username, "stop");
|
||||
break;
|
||||
|
||||
case "NetStream.Buffer.Full":
|
||||
break;
|
||||
|
||||
default:
|
||||
simpleLabel.text= evt.info.code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function asyncErrorHandler(event:AsyncErrorEvent):void {
|
||||
// ignore AsyncErrorEvent events.
|
||||
}
|
||||
|
||||
|
||||
private function securityErrorHandler(event:SecurityErrorEvent):void {
|
||||
simpleLabel.text= "securityErrorHandler: " + event;
|
||||
}
|
||||
|
||||
|
||||
public function callState(msg:String):* {
|
||||
simpleLabel.text="Call State = " + msg;
|
||||
|
||||
if (msg == "onUaCallClosed" || msg == "onUaCallCancelled" || msg == "onUaCallFailed") {
|
||||
incomingNetStream.play(false);
|
||||
outgoingNetStream.attachAudio(null);
|
||||
// outgoingNetStream.publish(false);
|
||||
|
||||
isConnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function incoming(source:String, sourceName:String, destination:String, destinationName:String):* {
|
||||
simpleLabel.text= "Incoming Call : " + (sourceName == "" ? source : sourceName);
|
||||
}
|
||||
|
||||
|
||||
public function connected(publishName:String, playName:String):* {
|
||||
simpleLabel.text= "Connected Call: " + publishName;
|
||||
|
||||
incomingNetStream = new NetStream(netConnection);
|
||||
var client1:Object = new Object();
|
||||
client1.onMetaData = onMetaData;
|
||||
client1.onBWDone = onBWDone;
|
||||
incomingNetStream.client = client1;
|
||||
incomingNetStream.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
|
||||
incomingNetStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
|
||||
outgoingNetStream = new NetStream(netConnection);
|
||||
var client2:Object = new Object();
|
||||
client2.onMetaData = onMetaData;
|
||||
client2.onBWDone = onBWDone;
|
||||
outgoingNetStream.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
|
||||
outgoingNetStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
outgoingNetStream.attachAudio(mic);
|
||||
|
||||
incomingNetStream.play(playName);
|
||||
outgoingNetStream.publish(publishName, "live");
|
||||
|
||||
isConnected = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function registrationSucess(msg:String):* {
|
||||
simpleLabel.text="Reg. Sucess = " + msg;
|
||||
}
|
||||
|
||||
|
||||
public function registrationFailure(msg:String):* {
|
||||
simpleLabel.text="Reg. Failure = " + msg;
|
||||
}
|
||||
|
||||
|
||||
public function doCall():void {
|
||||
register();
|
||||
netConnection.call("call", null, username, confRoom);
|
||||
|
||||
}
|
||||
|
||||
//This is used to dial an external phone number
|
||||
public function doPhoneCall():void {
|
||||
if (txtInput.text != "") {
|
||||
netConnection.call("call", null, username, txtInput.text);
|
||||
txtInput.text = "";
|
||||
} else {
|
||||
simpleLabel.text = "Please enter a phone number";
|
||||
}
|
||||
}
|
||||
|
||||
public function doHangUp():void {
|
||||
netConnection.call("hangup", null, username);
|
||||
}
|
||||
|
||||
|
||||
public function doAccept():void {
|
||||
netConnection.call("accept", null, username);
|
||||
}
|
||||
|
||||
private function onMetaData(obj:Object):void {
|
||||
|
||||
}
|
||||
|
||||
private function onBWDone(obj:Object):void {
|
||||
|
||||
}
|
||||
|
||||
public function get xPosition():int {
|
||||
return _xPosition;
|
||||
}
|
||||
|
||||
public function get yPosition():int {
|
||||
return _yPosition;
|
||||
}
|
||||
|
||||
public function set xPosition(x:int):void {
|
||||
_xPosition = x;
|
||||
}
|
||||
|
||||
public function set yPosition(y:int):void {
|
||||
_yPosition = y;
|
||||
}
|
||||
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
<mx:Canvas width="100%" height="100%">
|
||||
<mx:Button icon="{call_icon}" id="cmdCall" click="doCall();" x="15" width="65" y="23" toolTip="Make Call"/>
|
||||
<mx:Button icon="{stop_icon}" id="cmdHangUp" click="doHangUp();" x="99" width="65" y="23" toolTip="End Call"/>
|
||||
<mx:Label x="10" y="54" id="simpleLabel" fontSize="8" text=""/>
|
||||
|
||||
<mx:TextInput x="10" y="100" width="100" text="9" id="txtInput" fontSize="10" height="22"/>
|
||||
<mx:Button x="10" y="125" label="Call" id="cmdPhoneCall" click="doPhoneCall();" width="90" fontSize="9" height="20"/>
|
||||
</mx:Canvas>
|
||||
</MDIWindow>
|
@ -4,6 +4,7 @@ package org.bigbluebutton.modules.presentation
|
||||
import org.bigbluebutton.common.messaging.Endpoint;
|
||||
import org.bigbluebutton.common.messaging.EndpointMessageConstants;
|
||||
import org.bigbluebutton.common.messaging.Router;
|
||||
import org.bigbluebutton.modules.presentation.model.business.PresentProxy;
|
||||
import org.puremvc.as3.multicore.interfaces.IMediator;
|
||||
import org.puremvc.as3.multicore.interfaces.INotification;
|
||||
import org.puremvc.as3.multicore.patterns.mediator.Mediator;
|
||||
@ -51,6 +52,7 @@ package org.bigbluebutton.modules.presentation
|
||||
{
|
||||
switch(notification.getName()){
|
||||
case PresentModuleConstants.STARTED:
|
||||
presentProxy.connect();
|
||||
LogUtil.debug("Sending Present MODULE_STARTED message to main");
|
||||
_endpoint.sendMessage(EndpointMessageConstants.MODULE_STARTED,
|
||||
EndpointMessageConstants.TO_MAIN_APP, _module.moduleId);
|
||||
@ -92,13 +94,18 @@ package org.bigbluebutton.modules.presentation
|
||||
break;
|
||||
case EndpointMessageConstants.ASSIGN_PRESENTER:
|
||||
LogUtil.debug('Received ASSIGN_PRESENTER message from ' + message.getHeader().SRC);
|
||||
facade.sendNotification(PresentModuleConstants.PRESENTER_MODE, message.getBody());
|
||||
var p:Object = message.getBody();
|
||||
presentProxy.assignPresenter(p["assignTo"], p["name"]);
|
||||
break;
|
||||
case EndpointMessageConstants.BECOME_VIEWER:
|
||||
LogUtil.debug('Received BECOME_VIEWER message from ' + message.getHeader().SRC);
|
||||
facade.sendNotification(PresentModuleConstants.VIEWER_MODE);
|
||||
//facade.sendNotification(PresentModuleConstants.VIEWER_MODE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function get presentProxy():PresentProxy {
|
||||
return facade.retrieveProxy(PresentProxy.NAME) as PresentProxy;
|
||||
}
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@ package org.bigbluebutton.modules.presentation.model
|
||||
/**
|
||||
* The userid of this participant.
|
||||
*/
|
||||
public var userid : Number;
|
||||
// public var userid : Number;
|
||||
|
||||
// If connected to the presentation server or not
|
||||
[Bindable] public var isConnected : Boolean = false;
|
||||
@ -106,10 +106,10 @@ package org.bigbluebutton.modules.presentation.model
|
||||
decks.selected = 0;
|
||||
}
|
||||
|
||||
public function open(userid:Number):void
|
||||
{
|
||||
this.userid = userid;
|
||||
}
|
||||
// public function open1(userid:Number):void
|
||||
// {
|
||||
// this.userid = userid;
|
||||
// }
|
||||
|
||||
public function close():void
|
||||
{
|
||||
|
@ -9,14 +9,16 @@ package org.bigbluebutton.modules.presentation.model
|
||||
{
|
||||
private var _loader:URLLoader;
|
||||
private var _loaded:Boolean = false;
|
||||
private var _uri:String;
|
||||
private var _slideUri:String;
|
||||
private var _slideHandler:Function;
|
||||
private var _slideNum:Number;
|
||||
private var _thumbUri:String;
|
||||
|
||||
public function Slide(slideNum:Number, uri:String)
|
||||
public function Slide(slideNum:Number, slideUri:String, thumbUri:String)
|
||||
{
|
||||
_slideNum = slideNum;
|
||||
_uri = uri;
|
||||
_slideUri = slideUri;
|
||||
_thumbUri = thumbUri;
|
||||
_loader = new URLLoader();
|
||||
_loader.addEventListener(Event.COMPLETE, handleComplete);
|
||||
_loader.dataFormat = URLLoaderDataFormat.BINARY;
|
||||
@ -27,7 +29,7 @@ package org.bigbluebutton.modules.presentation.model
|
||||
slideLoadedHandler(_slideNum, _loader.data);
|
||||
} else {
|
||||
_slideHandler = slideLoadedHandler;
|
||||
_loader.load(new URLRequest(_uri));
|
||||
_loader.load(new URLRequest(_slideUri));
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,5 +39,14 @@ package org.bigbluebutton.modules.presentation.model
|
||||
_slideHandler(_slideNum, _loader.data);
|
||||
}
|
||||
}
|
||||
|
||||
public function get thumb():String {
|
||||
return _thumbUri;
|
||||
}
|
||||
|
||||
public function get slideNumber():Number {
|
||||
return _slideNum;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -18,16 +18,9 @@ package org.bigbluebutton.modules.presentation.model
|
||||
_slides = new Object();
|
||||
}
|
||||
|
||||
public function load(slideNum:Number, uri:String):void {
|
||||
var s:Slide = _slides[slideNum] as Slide;
|
||||
|
||||
if (s == null) {
|
||||
var n:Slide = new Slide(slideNum, uri);
|
||||
_slides[slideNum] = n;
|
||||
n.load(slideLoadListener);
|
||||
} else {
|
||||
s.load(slideLoadListener);
|
||||
}
|
||||
public function load(slide:Slide):void {
|
||||
_slides[slide.slideNumber] = slide;
|
||||
slide.load(slideLoadListener);
|
||||
}
|
||||
|
||||
public function clear():void {
|
||||
|
@ -13,5 +13,6 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
function zoom(slideHeight:Number, slideWidth:Number):void;
|
||||
function move(slideXPosition:Number, slideYPosition:Number):void;
|
||||
function getCurrentSlideNumber():void;
|
||||
function assignPresenter(userid:Number, name:String, assignedBy:Number):void;
|
||||
}
|
||||
}
|
@ -2,14 +2,16 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.modules.presentation.model.Slide;
|
||||
|
||||
public interface IPresentationSlides
|
||||
{
|
||||
function clear():void;
|
||||
function add(slide:String):void;
|
||||
function add(slide:Slide):void;
|
||||
function size():int;
|
||||
function get slides():ArrayCollection;
|
||||
function get selected():int;
|
||||
function set selected(num:int):void;
|
||||
function getSlideAt(num:int):String;
|
||||
function getSlideAt(num:int):Slide;
|
||||
}
|
||||
}
|
@ -87,7 +87,7 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
switch ( statusCode )
|
||||
{
|
||||
case "NetConnection.Connect.Success" :
|
||||
LogUtil.debug("Connection to voice application succeeded.");
|
||||
LogUtil.debug("Connection to presentation application succeeded.");
|
||||
_connectionListener(true);
|
||||
break;
|
||||
|
||||
|
@ -29,11 +29,10 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
{
|
||||
super(NAME);
|
||||
_module = module as PresentationModule;
|
||||
connect();
|
||||
}
|
||||
|
||||
public function connect():void {
|
||||
_presentService = new PresentSOService(_module.uri, _slides);
|
||||
_presentService = new PresentSOService(_module, _slides);
|
||||
_presentService.addConnectionStatusListener(connectionStatusListener);
|
||||
_presentService.addMessageSender(messageSender);
|
||||
manualDisconnect = false;
|
||||
@ -83,29 +82,36 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
* @param fileToUpload - A FileReference class of the file we wish to upload
|
||||
*
|
||||
*/
|
||||
public function uploadPresentation(fileToUpload:FileReference) : void
|
||||
public function uploadPresentation(presentationName:String, fileToUpload:FileReference) : void
|
||||
{
|
||||
LogUtil.debug("PresentationApplication::uploadPresentation()... ");
|
||||
var fullUri : String = _module.host + "/bigbluebutton/file/upload";
|
||||
var fullUri:String = _module.host + "/bigbluebutton/presentation/upload";
|
||||
|
||||
var service:FileUploadService = new FileUploadService(fullUri, _module.room);
|
||||
var service:FileUploadService = new FileUploadService(fullUri, presentationName, _module.conference, _module.room);
|
||||
service.addProgressListener(uploadProgressListener);
|
||||
LogUtil.debug("using FileUploadService..." + fullUri);
|
||||
service.upload(fileToUpload);
|
||||
service.upload(presentationName, fileToUpload);
|
||||
}
|
||||
|
||||
public function assignPresenter(assignTo:Number, name:String):void {
|
||||
_presentService.assignPresenter(assignTo, name, _module.userid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a presentation from the server. creates a new PresentationService class
|
||||
*
|
||||
*/
|
||||
public function loadPresentation() : void
|
||||
{
|
||||
var fullUri : String = _module.host + "/bigbluebutton/file/xmlslides?room=" + _module.room;
|
||||
/* HArdcode from now the presentation name to "default".*/
|
||||
var fullUri : String = _module.host + "/bigbluebutton/presentation/default/slides";
|
||||
var slideUri:String = _module.host + "/bigbluebutton/presentation/default";
|
||||
|
||||
LogUtil.debug("PresentationApplication::loadPresentation()... " + fullUri);
|
||||
|
||||
var service:PresentationService = new PresentationService();
|
||||
service.addLoadPresentationListener(loadPresentationListener);
|
||||
service.load(fullUri, _slides);
|
||||
service.load(fullUri, _slides, slideUri);
|
||||
LogUtil.debug('number of slides=' + _slides.size());
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,8 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
import flash.events.AsyncErrorEvent;
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.events.SyncEvent;
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.Responder;
|
||||
import flash.net.SharedObject;
|
||||
|
||||
import org.bigbluebutton.modules.presentation.PresentModuleConstants;
|
||||
@ -27,28 +29,31 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
private static const CONVERT_RC:String = "CONVERT";
|
||||
|
||||
private var _presentationSO:SharedObject;
|
||||
private var netConnectionDelegate:NetConnectionDelegate;
|
||||
|
||||
private var _slides:IPresentationSlides;
|
||||
private var _uri:String;
|
||||
private var _module:PresentationModule;
|
||||
private var _connectionListener:Function;
|
||||
private var _messageSender:Function;
|
||||
private var _soErrors:Array;
|
||||
|
||||
public function PresentSOService(uri:String, slides:IPresentationSlides)
|
||||
private var currentSlide:Number = -1;
|
||||
|
||||
public function PresentSOService(module:PresentationModule, slides:IPresentationSlides)
|
||||
{
|
||||
_uri = uri;
|
||||
_slides = slides;
|
||||
netConnectionDelegate = new NetConnectionDelegate(uri, connectionListener);
|
||||
_module = module;
|
||||
_slides = slides;
|
||||
}
|
||||
|
||||
public function connect():void {
|
||||
netConnectionDelegate.connect();
|
||||
// netConnectionDelegate.connect();
|
||||
join();
|
||||
notifyConnectionStatusListener(true);
|
||||
}
|
||||
|
||||
public function disconnect():void {
|
||||
leave();
|
||||
netConnectionDelegate.disconnect();
|
||||
notifyConnectionStatusListener(false, ["Disconnected to presetation application"]);
|
||||
// netConnectionDelegate.disconnect();
|
||||
}
|
||||
|
||||
private function connectionListener(connected:Boolean, errors:Array=null):void {
|
||||
@ -63,14 +68,15 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
|
||||
private function join() : void
|
||||
{
|
||||
_presentationSO = SharedObject.getRemote(SHAREDOBJECT, _uri, false);
|
||||
_presentationSO = SharedObject.getRemote(SHAREDOBJECT, _module.uri, false);
|
||||
_presentationSO.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
_presentationSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
|
||||
_presentationSO.addEventListener(SyncEvent.SYNC, sharedObjectSyncHandler);
|
||||
_presentationSO.client = this;
|
||||
_presentationSO.connect(netConnectionDelegate.connection);
|
||||
_presentationSO.connect(_module.connection);
|
||||
LogUtil.debug(NAME + ": PresentationModule is connected to Shared object");
|
||||
notifyConnectionStatusListener(true);
|
||||
notifyConnectionStatusListener(true);
|
||||
if (_module.mode == 'LIVE') getPresentationInfo();
|
||||
}
|
||||
|
||||
private function leave():void
|
||||
@ -179,12 +185,73 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
public function setPresenterName(presenterName:String):void {
|
||||
_presentationSO.setProperty(PRESENTER, presenterName);
|
||||
}
|
||||
|
||||
private function time():String
|
||||
{
|
||||
var date:Date = new Date();
|
||||
var t:String = date.toLocaleTimeString();
|
||||
return t;
|
||||
|
||||
public function getPresentationInfo():void {
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"presentation.getPresentationInfo",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Object):void {
|
||||
LogUtil.debug("Successfully querried for presentation information.");
|
||||
if (result.presenter.hasPresenter) {
|
||||
sendMessage(PresentModuleConstants.VIEWER_MODE);
|
||||
}
|
||||
|
||||
if (result.presentation.sharing) {
|
||||
currentSlide = Number(result.presentation.slide);
|
||||
sendMessage(PresentModuleConstants.START_SHARE);
|
||||
}
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
) //new Responder
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
public function assignPresenter(userid:Number, name:String, assignedBy:Number):void {
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"presentation.assignPresenter",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Boolean):void {
|
||||
|
||||
if (result) {
|
||||
LogUtil.debug("Successfully assigned presenter to: " + userid);
|
||||
}
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
), //new Responder
|
||||
userid,
|
||||
name,
|
||||
assignedBy
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the server to assign a presenter
|
||||
*/
|
||||
public function assignPresenterCallback(userid:Number, name:String, assignedBy:Number):void {
|
||||
LogUtil.debug("assignPresenterCallback " + userid + "," + name + "," + assignedBy);
|
||||
if (userid == _module.userid) {
|
||||
LogUtil.debug("assignPresenterCallback - sending presenter mode");
|
||||
sendMessage(PresentModuleConstants.PRESENTER_MODE, {userid:userid, presenterName:name, assignedBy:assignedBy});
|
||||
} else {
|
||||
LogUtil.debug("assignPresenterCallback - sending viewer mode");
|
||||
sendMessage(PresentModuleConstants.VIEWER_MODE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -194,10 +261,27 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
*/
|
||||
public function gotoSlide(num:int) : void
|
||||
{
|
||||
LogUtil.info("[" + time() + " - Showing slide (" + num + ")]");
|
||||
_presentationSO.send("gotoPageCallback", num);
|
||||
|
||||
_presentationSO.setProperty(CURRENT_PAGE, num);
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"presentation.gotoSlide",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Boolean):void {
|
||||
|
||||
if (result) {
|
||||
LogUtil.debug("Successfully moved page to: " + num);
|
||||
}
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
), //new Responder
|
||||
num
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
/**
|
||||
@ -206,24 +290,48 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
* @param page
|
||||
*
|
||||
*/
|
||||
public function gotoPageCallback(page : Number) : void
|
||||
public function gotoSlideCallback(page : Number) : void
|
||||
{
|
||||
sendMessage(PresentModuleConstants.DISPLAY_SLIDE, page);
|
||||
}
|
||||
|
||||
public function getCurrentSlideNumber():void {
|
||||
if (_presentationSO.data[CURRENT_PAGE] != null) {
|
||||
sendMessage(PresentModuleConstants.DISPLAY_SLIDE, _presentationSO.data[CURRENT_PAGE]);
|
||||
if (currentSlide >= 0) {
|
||||
sendMessage(PresentModuleConstants.DISPLAY_SLIDE, currentSlide);
|
||||
}
|
||||
}
|
||||
|
||||
public function sharePresentation(share:Boolean):void {
|
||||
LogUtil.debug('SO Sharing presentation = ' + share);
|
||||
_presentationSO.data[SHARING] = share;
|
||||
_presentationSO.setDirty(SHARING);
|
||||
var nc:NetConnection = _module.connection;
|
||||
nc.call(
|
||||
"presentation.sharePresentation",// Remote function name
|
||||
new Responder(
|
||||
// participants - On successful result
|
||||
function(result:Boolean):void {
|
||||
|
||||
if (result) {
|
||||
LogUtil.debug("Successfully shared presentation");
|
||||
}
|
||||
},
|
||||
// status - On error occurred
|
||||
function(status:Object):void {
|
||||
LogUtil.error("Error occurred:");
|
||||
for (var x:Object in status) {
|
||||
LogUtil.error(x + " : " + status[x]);
|
||||
}
|
||||
}
|
||||
), //new Responder
|
||||
"default", // hardocde this for now...this will be used later to pre-upload multiple presentation
|
||||
share
|
||||
); //_netConnection.call
|
||||
}
|
||||
|
||||
|
||||
public function sharePresentationCallback(presentationName:String, share:Boolean):void {
|
||||
LogUtil.debug("sharePresentationCallback " + presentationName + "," + share);
|
||||
if (share) {
|
||||
sendMessage(PresentModuleConstants.START_SHARE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event called automatically once a SharedObject Sync method is received
|
||||
@ -292,9 +400,9 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
switch (returnCode)
|
||||
{
|
||||
case SUCCESS_RC:
|
||||
LogUtil.debug("PresentationDelegate - SUCCESS_RC");
|
||||
message = _presentationSO.data.updateMessage.message;
|
||||
sendMessage(PresentModuleConstants.CONVERT_SUCCESS_EVENT, message);
|
||||
//LogUtil.debug("PresentationDelegate - SUCCESS_RC");
|
||||
break;
|
||||
|
||||
case UPDATE_RC:
|
||||
@ -309,8 +417,7 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
case EXTRACT_RC:
|
||||
totalSlides = _presentationSO.data.updateMessage.totalSlides;
|
||||
completedSlides = _presentationSO.data.updateMessage.completedSlides;
|
||||
//LogUtil.debug( "EXTRACTING = [" + completedSlides + " of " + totalSlides + "]");
|
||||
|
||||
LogUtil.debug( "EXTRACTING = [" + completedSlides + " of " + totalSlides + "]");
|
||||
sendMessage(PresentModuleConstants.EXTRACT_PROGRESS_EVENT,
|
||||
new ProgressNotifier(totalSlides,completedSlides));
|
||||
|
||||
@ -318,8 +425,7 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
case CONVERT_RC:
|
||||
totalSlides = _presentationSO.data.updateMessage.totalSlides;
|
||||
completedSlides = _presentationSO.data.updateMessage.completedSlides;
|
||||
//LogUtil.debug( "CONVERTING = [" + completedSlides + " of " + totalSlides + "]");
|
||||
|
||||
LogUtil.debug( "CONVERTING = [" + completedSlides + " of " + totalSlides + "]");
|
||||
sendMessage(PresentModuleConstants.CONVERT_PROGRESS_EVENT,
|
||||
new ProgressNotifier(totalSlides, completedSlides));
|
||||
break;
|
||||
|
@ -2,6 +2,8 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.modules.presentation.model.Slide;
|
||||
|
||||
public class PresentationSlides implements IPresentationSlides
|
||||
{
|
||||
private var _slides:ArrayCollection = new ArrayCollection();
|
||||
@ -23,15 +25,15 @@ package org.bigbluebutton.modules.presentation.model.business
|
||||
_selected = num;
|
||||
}
|
||||
|
||||
public function getSlideAt(num:int):String {
|
||||
return _slides.getItemAt(num) as String;
|
||||
public function getSlideAt(num:int):Slide {
|
||||
return _slides.getItemAt(num) as Slide;
|
||||
}
|
||||
|
||||
public function clear():void {
|
||||
_slides.removeAll();
|
||||
}
|
||||
|
||||
public function add(slide:String):void {
|
||||
public function add(slide:Slide):void {
|
||||
//LogUtil.debug('Adding slide ' + slide);
|
||||
_slides.addItem(slide);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
import flash.events.SecurityErrorEvent;
|
||||
import flash.net.FileReference;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.URLRequestMethod;
|
||||
import flash.net.URLVariables;
|
||||
|
||||
import org.bigbluebutton.modules.presentation.PresentModuleConstants;
|
||||
@ -38,8 +39,8 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
public static const UPLOAD_IO_ERROR:String = "UPLOAD_IO_ERROR";
|
||||
public static const UPLOAD_SECURITY_ERROR:String = "UPLOAD_SECURITY_ERROR";
|
||||
|
||||
private var request : URLRequest = new URLRequest();
|
||||
private var sendVars : URLVariables = new URLVariables();
|
||||
private var request:URLRequest = new URLRequest();
|
||||
private var sendVars:URLVariables = new URLVariables();
|
||||
|
||||
private var _progressListener:Function;
|
||||
|
||||
@ -49,9 +50,11 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
* @param room - a room in the server we're connecting to
|
||||
*
|
||||
*/
|
||||
public function FileUploadService(url:String, room:String) : void
|
||||
public function FileUploadService(url:String, presentationName:String, conference:String, room:String) : void
|
||||
{
|
||||
sendVars.room = room;
|
||||
sendVars.presentation_name = presentationName;
|
||||
sendVars.conference = conference;
|
||||
sendVars.room = room;
|
||||
request.url = url;
|
||||
request.data = sendVars;
|
||||
}
|
||||
@ -65,7 +68,7 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
* @param file - The FileReference class of the file we wish to send
|
||||
*
|
||||
*/
|
||||
public function upload(file:FileReference):void
|
||||
public function upload(presName:String, file:FileReference):void
|
||||
{
|
||||
var fileToUpload : FileReference = new FileReference();
|
||||
fileToUpload = file;
|
||||
@ -75,8 +78,10 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
fileToUpload.addEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
|
||||
fileToUpload.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
|
||||
|
||||
// "pres" is the variable name of the uploaded file in the server
|
||||
fileToUpload.upload(request, "pres", false);
|
||||
request.method = URLRequestMethod.POST;
|
||||
|
||||
// "fileUpload" is the variable name of the uploaded file in the server
|
||||
fileToUpload.upload(request, "fileUpload", false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,108 @@
|
||||
package org.bigbluebutton.modules.presentation.model.services
|
||||
{
|
||||
import flash.events.*;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
|
||||
import mx.rpc.IResponder;
|
||||
import mx.rpc.http.HTTPService;
|
||||
|
||||
import org.bigbluebutton.modules.presentation.model.business.IPresentationSlides;
|
||||
|
||||
/**
|
||||
* This class directly communicates with an HTTP service in order to send and recives files (slides
|
||||
* in this case)
|
||||
* <p>
|
||||
* This class extends the Proxy class of the pureMVC framework
|
||||
* @author dev_team@bigbluebutton.org
|
||||
*
|
||||
*/
|
||||
public class PresentationListService implements IResponder
|
||||
{
|
||||
private var service : HTTPService;
|
||||
private var _slides:IPresentationSlides;
|
||||
private var urlLoader:URLLoader;
|
||||
private var _loadListener:Function;
|
||||
|
||||
public function PresentationListService()
|
||||
{
|
||||
service = new HTTPService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load slides from an HTTP service. Response is received in the Responder class' onResult method
|
||||
* @param url
|
||||
*
|
||||
*/
|
||||
public function load(url:String, slides:IPresentationSlides) : void
|
||||
{
|
||||
_slides = slides;
|
||||
service.url = url;
|
||||
urlLoader = new URLLoader();
|
||||
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
|
||||
urlLoader.load(new URLRequest(url));
|
||||
|
||||
}
|
||||
|
||||
public function addLoadPresentationListener(listener:Function):void {
|
||||
_loadListener = listener;
|
||||
}
|
||||
|
||||
private function handleComplete(e:Event):void{
|
||||
LogUtil.debug("Loading complete");
|
||||
parse(new XML(e.target.data));
|
||||
}
|
||||
|
||||
public function parse(xml:XML):void{
|
||||
var list:XMLList = xml.presentation.slide;
|
||||
var item:XML;
|
||||
|
||||
// Make sure we start with a clean set.
|
||||
_slides.clear();
|
||||
|
||||
for each(item in list){
|
||||
//LogUtil.debug("Available Modules: " + item.name + " at ");
|
||||
_slides.add(item.source);
|
||||
}
|
||||
|
||||
//LogUtil.debug("number of slide=" + _slides.size());
|
||||
if (_slides.size() > 0) {
|
||||
if (_loadListener != null) {
|
||||
_loadListener(true);
|
||||
}
|
||||
} else {
|
||||
_loadListener(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the response event. It is called when the PresentationService class sends a request to
|
||||
* the server. This class then responds with this event
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
public function result(event : Object):void
|
||||
{
|
||||
var xml:XML = new XML(event.result);
|
||||
var list:XMLList = xml.presentations;
|
||||
var item:XML;
|
||||
|
||||
for each(item in list){
|
||||
LogUtil.debug("Available Modules: " + item.toXMLString() + " at " + item.text());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event is called in case the call the to server wasn't successful. This method then gets called
|
||||
* instead of the result() method above
|
||||
* @param event
|
||||
*
|
||||
*/
|
||||
public function fault(event : Object):void
|
||||
{
|
||||
LogUtil.debug("Got fault [" + event.fault.toString() + "]");
|
||||
}
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
import mx.rpc.IResponder;
|
||||
import mx.rpc.http.HTTPService;
|
||||
|
||||
import org.bigbluebutton.modules.presentation.model.Slide;
|
||||
import org.bigbluebutton.modules.presentation.model.business.IPresentationSlides;
|
||||
|
||||
/**
|
||||
@ -23,6 +24,7 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
private var _slides:IPresentationSlides;
|
||||
private var urlLoader:URLLoader;
|
||||
private var _loadListener:Function;
|
||||
private var slideUri:String;
|
||||
|
||||
public function PresentationService()
|
||||
{
|
||||
@ -34,9 +36,10 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
* @param url
|
||||
*
|
||||
*/
|
||||
public function load(url:String, slides:IPresentationSlides) : void
|
||||
public function load(url:String, slides:IPresentationSlides, slideUri:String) : void
|
||||
{
|
||||
_slides = slides;
|
||||
this.slideUri = slideUri;
|
||||
service.url = url;
|
||||
urlLoader = new URLLoader();
|
||||
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
|
||||
@ -54,15 +57,22 @@ package org.bigbluebutton.modules.presentation.model.services
|
||||
}
|
||||
|
||||
public function parse(xml:XML):void{
|
||||
var list:XMLList = xml.presentation.slide;
|
||||
var list:XMLList = xml.presentation.slides.slide;
|
||||
var item:XML;
|
||||
LogUtil.debug("Slides: " + xml);
|
||||
|
||||
// Make sure we start with a clean set.
|
||||
_slides.clear();
|
||||
|
||||
for each(item in list){
|
||||
//LogUtil.debug("Available Modules: " + item.name + " at ");
|
||||
_slides.add(item.source);
|
||||
LogUtil.debug("Slides list: " + list);
|
||||
|
||||
for each(item in list){
|
||||
var sUri:String = slideUri + "/" + item.@name;
|
||||
var thumbUri:String = slideUri + "/" + item.@thumb;
|
||||
var slide:Slide = new Slide(item.@number, sUri, thumbUri);
|
||||
_slides.add(slide);
|
||||
LogUtil.debug("Available slide: " + sUri + " number = " + item.@number);
|
||||
LogUtil.debug("Available thumb: " + thumbUri);
|
||||
}
|
||||
|
||||
//LogUtil.debug("number of slide=" + _slides.size());
|
||||
|
@ -79,7 +79,10 @@ package org.bigbluebutton.modules.presentation.view
|
||||
private function startUpload(e:Event):void{
|
||||
LogUtil.debug("In startUpload()...")
|
||||
var proxy:PresentProxy = facade.retrieveProxy(PresentProxy.NAME) as PresentProxy;
|
||||
proxy.uploadPresentation(fileToUpload);
|
||||
/* Hardocde presentationName to "default" for now since we only support one presentation at a time.
|
||||
* We need to remove it later when we implement ability to pre-upload several presentations.
|
||||
*/
|
||||
proxy.uploadPresentation("default", fileToUpload);
|
||||
_fileWin.progBarLbl.visible = true;
|
||||
_fileWin.progressBar.visible = true;
|
||||
|
||||
|
@ -30,6 +30,7 @@ package org.bigbluebutton.modules.presentation.view
|
||||
import org.bigbluebutton.modules.presentation.PresentModuleConstants;
|
||||
import org.bigbluebutton.modules.presentation.controller.ZoomSlideCommand;
|
||||
import org.bigbluebutton.modules.presentation.controller.notifiers.ZoomNotifier;
|
||||
import org.bigbluebutton.modules.presentation.model.Slide;
|
||||
import org.bigbluebutton.modules.presentation.model.SlideProxy;
|
||||
import org.bigbluebutton.modules.presentation.model.business.PresentProxy;
|
||||
import org.bigbluebutton.modules.presentation.view.components.FileUploadWindow;
|
||||
@ -223,7 +224,7 @@ package org.bigbluebutton.modules.presentation.view
|
||||
_presWin.slideNumLbl.text = (slidenum + 1) + " of " + _presWin.slideView.slides.length;
|
||||
|
||||
var slideProxy:SlideProxy = facade.retrieveProxy(SlideProxy.NAME) as SlideProxy;
|
||||
slideProxy.load(slidenum, _presWin.slideView.slides.getItemAt(slidenum) as String);
|
||||
slideProxy.load(_presWin.slideView.slides.getItemAt(slidenum) as Slide);
|
||||
|
||||
if (slidenum == 0) {
|
||||
_presWin.backButton.enabled = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
creationComplete="init()" xmlns:controls="org.bigbluebutton.modules.presentation.view.fisheye.controls.*"
|
||||
mouseMove="displayIndex()">
|
||||
width="100%" mouseMove="displayIndex()">
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
@ -13,18 +13,17 @@
|
||||
public static const SLIDE_SELECTED:String = "SLIDE_SELECTED";
|
||||
public static const SLIDE_HIGHLIGHTED:String = "SLIDE_HIGHLIGHTED";
|
||||
|
||||
private var imgHeight:Number = 100;
|
||||
private var imgWidth:Number = 100;
|
||||
private var imgHeight1:Number = 50;
|
||||
private var imgWidth1:Number = 50;
|
||||
|
||||
[Bindable]
|
||||
public var selected:Number;
|
||||
public var highlighted:Number;
|
||||
[Bindable] public var selected:Number;
|
||||
[Bindable] public var slideNumber:Number;
|
||||
|
||||
private function init():void{
|
||||
fisheye.setStyle("hilightScaleRadius",2);
|
||||
fisheye.setStyle("animationSpeed",0.8);
|
||||
fisheye.setStyle("defaultScale",0.4);
|
||||
fisheye.setStyle("hilightMaxScale",1.0);
|
||||
fisheye.setStyle("defaultScale",0.2);
|
||||
fisheye.setStyle("hilightMaxScale",2.0);
|
||||
}
|
||||
|
||||
public function setDataProvider(dp:ArrayCollection):void{
|
||||
@ -35,9 +34,10 @@
|
||||
//set the itemRenderer of the thumbnails
|
||||
fisheye.dataProvider = this.images;
|
||||
fisheye.itemRenderer = imageRenderer;
|
||||
var itemCount:Number = images.length;
|
||||
}
|
||||
|
||||
public function setThumbRatio(ratio:Number):void{
|
||||
public function setThumbRatio1(ratio:Number):void{
|
||||
if (ratio > 0 && ratio < 1){
|
||||
fisheye.setStyle("defaultScale",ratio);
|
||||
fisheye.setStyle("hilightMaxScale",ratio*2);
|
||||
@ -50,26 +50,31 @@
|
||||
|
||||
public function displayIndex():void{
|
||||
if (this.visible){
|
||||
highlighted = fisheye.getHighlightedIndex(fisheye.mouseX, fisheye.mouseY);
|
||||
dispatchEvent(new Event(SLIDE_HIGHLIGHTED));
|
||||
slideNumber = fisheye.getHighlightedIndex(fisheye.mouseX, fisheye.mouseY);
|
||||
//dispatchEvent(new Event(SLIDE_HIGHLIGHTED));
|
||||
}
|
||||
}
|
||||
|
||||
private function getSlideNumber():Number {
|
||||
return slideNumber;
|
||||
}
|
||||
|
||||
// private function alignToParent(e:Event):void{
|
||||
// this.x = - (fisheye.midPointFor(1));
|
||||
// }
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
<mx:HBox width="100%" horizontalGap="0" height="100%" styleName="insetBox" clipContent="true" >
|
||||
|
||||
|
||||
<mx:HBox width="100%" horizontalGap="0" height="100%" styleName="insetBox" clipContent="true" >
|
||||
<controls:Fisheye id="fisheye" width="100%" height="100%" dataProvider="{images}" click="selectSlide()"
|
||||
stateProperty="currentState" rolloverValue="hilighted" defaultValue="" selectedValue="selected"
|
||||
verticalAlign="bottom"
|
||||
horizontalAlign="center" >
|
||||
verticalAlign="bottom" horizontalAlign="center" >
|
||||
<controls:itemRenderer>
|
||||
<mx:Component id="imageRenderer">
|
||||
<controls:BitmapTile>
|
||||
<controls:states>
|
||||
<mx:State name="selected">
|
||||
<mx:State name="selected" id="selectedImage">
|
||||
<mx:SetStyle name="borderColor" value="#E27C0E" />
|
||||
<mx:SetStyle name="borderAlpha" value="1" />
|
||||
<mx:SetStyle name="borderWidth" value="3" />
|
||||
@ -81,8 +86,7 @@
|
||||
</controls:states>
|
||||
</controls:BitmapTile>
|
||||
</mx:Component>
|
||||
</controls:itemRenderer>
|
||||
|
||||
</controls:itemRenderer>
|
||||
</controls:Fisheye>
|
||||
</mx:HBox>
|
||||
</mx:Canvas>
|
||||
|
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
title="Presentations"
|
||||
x="168" y="86" layout="absolute" width="500" height="292">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import org.bigbluebutton.modules.presentation.view.FileUploadWindowMediator;
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
<mx:Button id="uploadBtn" label="Upload" toolTip="Upload another presentation."
|
||||
click="dispatchEvent(new Event(FileUploadWindowMediator.START_UPLOAD))" enabled="false"
|
||||
icon="@Embed('../assets/bullet_go.png')" x="320" y="28"/>
|
||||
|
||||
<mx:DataGrid x="10" y="10" height="196">
|
||||
<mx:columns>
|
||||
<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
|
||||
<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
|
||||
<mx:DataGridColumn headerText="Column 3" dataField="col3"/>
|
||||
</mx:columns>
|
||||
</mx:DataGrid>
|
||||
|
||||
<mx:ControlBar horizontalAlign="center" verticalAlign="middle" x="0" y="130">
|
||||
<mx:Spacer width="100%"/>
|
||||
<mx:Button id="okCancelBtn" label="Cancel" click="dispatchEvent(new Event(FileUploadWindowMediator.CLOSE_UPLOAD_WINDOW))"/>
|
||||
</mx:ControlBar>
|
||||
</mx:TitleWindow>
|
@ -13,7 +13,7 @@
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import mx.controls.Text;
|
||||
|
||||
import org.bigbluebutton.modules.presentation.view.PresentationWindowMediator;
|
||||
import mx.core.Application;
|
||||
import org.bigbluebutton.modules.presentation.view.components.Images;
|
||||
@ -47,6 +47,7 @@
|
||||
private function init():void{
|
||||
positionThumbnails();
|
||||
thumbnailWindow.addEventListener(FisheyeThumbnail.SLIDE_HIGHLIGHTED, onSlideHighlighted);
|
||||
thumbY = this.height - 160;
|
||||
}
|
||||
|
||||
private function positionThumbnails():void{
|
||||
@ -75,13 +76,12 @@
|
||||
thumbnailWindow.visible = true;
|
||||
} else if (slideView.slides != null){
|
||||
slideNumLbl.text = "" + (slideView.selectedSlide + 1) + " of " + slideView.slides.length;
|
||||
thumbnailWindow.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private function onSlideHighlighted(e:Event):void{
|
||||
if (slideView.visible)
|
||||
slideNumLbl.text = "" + (thumbnailWindow.highlighted+1) + " of " + slideView.slides.length;
|
||||
slideNumLbl.text = "" + (thumbnailWindow.slideNumber+1) + " of " + slideView.slides.length;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,6 +94,14 @@
|
||||
thumbnailWindow.visible = false;
|
||||
}
|
||||
|
||||
private function showThumbs():void {
|
||||
if (isPresenter){
|
||||
//readjust the position of the thumbnails in case the window was resized
|
||||
//Note: this is necessary because the MDIWindow does not let you listen to the resize() event!
|
||||
thumbY = this.height - 150;
|
||||
thumbnailWindow.visible = true;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
@ -103,8 +111,8 @@
|
||||
<mx:Canvas id="mainCanvas" width="100%" height="100%" resize="positionThumbnails()" mouseDown="mouseDown = true"
|
||||
mouseUp="mouseDown = false" verticalScrollPolicy="off" horizontalScrollPolicy="off">
|
||||
<thumb:SlideView id="slideView" width="100%" height="100%" visible="false"/>
|
||||
<thumb:FisheyeThumbnail id="thumbnailWindow" width="100%" visible="false" backgroundAlpha="1"
|
||||
verticalScrollPolicy="off" horizontalScrollPolicy="off"/>
|
||||
<thumb:FisheyeThumbnail y="{thumbY}" id="thumbnailWindow" width="100%" height="100%" visible="false" backgroundAlpha="1"
|
||||
verticalScrollPolicy="off" horizontalScrollPolicy="off" verticalCenter="top"/>
|
||||
</mx:Canvas>
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user