Merge branch 'development' into tab-indexer

Conflicts:
	bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml
This commit is contained in:
Ghazi Triki 2015-07-31 09:36:59 +01:00
commit d906e6599e
256 changed files with 5627 additions and 4131 deletions

View File

@ -18,8 +18,8 @@ object PollFactory {
private def processYesNoPollType(qType: String): Question = {
val answers = new Array[Answer](2)
answers(0) = new Answer(0, "N", Some("No"))
answers(1) = new Answer(1, "Y", Some("Yes"))
answers(0) = new Answer(0, "No", Some("No"))
answers(1) = new Answer(1, "Yes", Some("Yes"))
new Question(0, PollType.YesNoPollType, false, None, answers)
}
@ -27,8 +27,8 @@ object PollFactory {
private def processTrueFalsePollType(qType: String): Question = {
val answers = new Array[Answer](2)
answers(0) = new Answer(0, "F", Some("False"))
answers(1) = new Answer(1, "T", Some("True"))
answers(0) = new Answer(0, "False", Some("False"))
answers(1) = new Answer(1, "True", Some("True"))
new Question(0, PollType.TrueFalsePollType, false, None, answers)
}

View File

@ -68,6 +68,9 @@ trait PollApp {
val shape = new scala.collection.mutable.HashMap[String, Object]()
shape += "num_respondents" -> new Integer(result.numRespondents)
shape += "num_responders" -> new Integer(result.numResponders)
shape += "type" -> "poll_result"
shape += "id" -> result.id
shape += "status" -> "DRAW_END"
val answers = new ArrayBuffer[java.util.HashMap[String, Object]];
result.answers.foreach(ans => {

View File

@ -228,6 +228,7 @@ trait UsersApp {
}
usersModel.removeUser(msg.userId)
usersModel.removeRegUser(msg.userId)
log.info("Ejecting user from meeting: mid=[" + mProps.meetingID + "]uid=[" + msg.userId + "]")
outGW.send(new UserEjectedFromMeeting(mProps.meetingID, mProps.recorded, msg.userId, msg.ejectedBy))
@ -273,7 +274,20 @@ trait UsersApp {
def handleUserJoin(msg: UserJoining): Unit = {
val regUser = usersModel.getRegisteredUserWithToken(msg.authToken)
regUser foreach { ru =>
val vu = new VoiceUser(msg.userID, msg.userID, ru.name, ru.name, false, false, false, false)
// if there was a phoneUser with the same userID, reuse the VoiceUser value object
val vu = usersModel.getUser(msg.userID) match {
case Some(u) => {
if (u.voiceUser.joined) {
u.voiceUser.copy()
} else {
new VoiceUser(msg.userID, msg.userID, ru.name, ru.name, false, false, false, false)
}
}
case None => {
new VoiceUser(msg.userID, msg.userID, ru.name, ru.name, false, false, false, false)
}
}
val uvo = new UserVO(msg.userID, ru.externId, ru.name,
ru.role, raiseHand = false, presenter = false,
hasStream = false, locked = getInitialLockStatus(ru.role),
@ -289,7 +303,7 @@ trait UsersApp {
outGW.send(new MeetingState(mProps.meetingID, mProps.recorded, uvo.userID, meetingModel.getPermissions(), meetingModel.isMeetingMuted()))
// Become presenter if the only moderator
if (usersModel.numModerators == 1) {
if ((usersModel.numModerators == 1) || (usersModel.noPresenter())) {
if (ru.role == Role.MODERATOR) {
assignNewPresenter(msg.userID, ru.name, msg.userID)
}
@ -312,14 +326,18 @@ trait UsersApp {
/* The current presenter has left the meeting. Find a moderator and make
* him presenter. This way, if there is a moderator in the meeting, there
* will always be a presenter.
* will always be a presenter.
*/
val moderator = usersModel.findAModerator()
moderator.foreach { mod =>
log.info("Presenter left meeting: mid=[" + mProps.meetingID + "] uid=[" + u.userID + "]. Making user=[" + mod.userID + "] presenter.")
assignNewPresenter(mod.userID, mod.name, mod.userID)
}
}
// add VoiceUser again to the list as a phone user since we still didn't get the event from FreeSWITCH
val vu = u.voiceUser
if (vu.joined) {
this.context.self ! (new UserJoinedVoiceConfMessage(mProps.voiceBridge, vu.userId, msg.userID, vu.callerName, vu.callerNum, vu.muted, vu.talking));
}
}
@ -338,12 +356,16 @@ trait UsersApp {
log.info("Voice user=[" + msg.voiceUserId + "] is already in conf=[" + mProps.voiceBridge + "]. Must be duplicate message.")
}
case None => {
// No current web user. This means that the user called in through
// the phone. We need to generate a new user as we are not able
// to match with a web user.
val webUserId = usersModel.generateWebUserId
val webUserId = if (msg.userId != msg.callerIdName) {
msg.userId
} else {
// No current web user. This means that the user called in through
// the phone. We need to generate a new user as we are not able
// to match with a web user.
usersModel.generateWebUserId
}
val vu = new VoiceUser(msg.voiceUserId, webUserId, msg.callerIdName, msg.callerIdNum,
true, false, false, false)
true, false, msg.muted, msg.talking)
val sessionId = "PHONE-" + webUserId;

View File

@ -96,6 +96,10 @@ class UsersModel {
uservos.values find (u => u.role == MODERATOR)
}
def noPresenter(): Boolean = {
!getCurrentPresenter().isDefined
}
def getCurrentPresenter(): Option[UserVO] = {
uservos.values find (u => u.presenter == true)
}
@ -127,4 +131,17 @@ class UsersModel {
def getViewers(): Array[UserVO] = {
uservos.values filter (u => u.role == VIEWER) toArray
}
def getRegisteredUserWithUserID(userID: String): Option[RegisteredUser] = {
regUsers.values find (ru => userID contains ru.id)
}
def removeRegUser(userID: String) {
getRegisteredUserWithUserID(userID) match {
case Some(ru) => {
regUsers -= ru.authToken
}
case None =>
}
}
}

View File

@ -42,6 +42,8 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter {
private ConnectionInvokerService connInvokerService;
private MessagePublisher red5InGW;
private final UserConnectionMapper userConnections = new UserConnectionMapper();
private final String APP = "BBB";
private final String CONN = "RED5-";
@ -166,6 +168,8 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter {
log.info("User joining bbb-apps: data={}", logStr);
userConnections.addUserConnection(userId, connId);
return super.roomConnect(connection, params);
}
@ -214,10 +218,15 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter {
Gson gson = new Gson();
String logStr = gson.toJson(logData);
log.info("User leaving bbb-apps: data={}", logStr);
red5InGW.userLeft(bbbSession.getRoom(), getBbbSession().getInternalUserID(), sessionId);
boolean removeUser = userConnections.userDisconnected(userId, connId);
if (removeUser) {
log.info("User leaving bbb-apps: data={}", logStr);
red5InGW.userLeft(bbbSession.getRoom(), getBbbSession().getInternalUserID(), sessionId);
} else {
log.info("User not leaving bbb-apps but just disconnected: data={}", logStr);
}
super.roomDisconnect(conn);
}

View File

@ -0,0 +1,70 @@
package org.bigbluebutton.red5;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* This class maintains the connections mapping of a user.
* This tracks the connections for a user to manage auto-reconnects.
* @author ralam
*
*/
public class UserConnectionMapper {
private ConcurrentMap<String, UserConnection> users = new ConcurrentHashMap<String, UserConnection>(8, 0.9f, 1);;
/**
* Adds a connection for a user.
* @param userId
* @param connId
*/
public synchronized void addUserConnection(String userId, String connId) {
if (users.containsKey(userId)) {
UserConnection user = users.get(userId);
user.add(connId);
} else {
UserConnection user = new UserConnection();
user.add(connId);
users.put(userId, user);
}
}
/**
* Removed a connection for a user. Returns true if the user doesn't have any
* connection left and thus can be removed.
* @param userId
* @param connId
* @return boolean - no more connections
*/
public synchronized boolean userDisconnected(String userId, String connId) {
if (users.containsKey(userId)) {
UserConnection user = users.get(userId);
user.remove(connId);
if (user.isEmpty()) {
users.remove(userId);
return true;
}
return false;
}
return true;
}
private class UserConnection {
private final Set<String> connections = new HashSet<String>();
public void add(String connId) {
connections.add(connId);
}
public void remove(String connId) {
connections.remove(connId);
}
public boolean isEmpty() {
return connections.isEmpty();
}
}
}

View File

@ -855,6 +855,7 @@ Alert {
successImage: Embed(source='assets/images/status_success.png');
warningImage: Embed(source='assets/images/status_warning.png');
failImage: Embed(source='assets/images/status_fail.png');
refreshImage: Embed(source='assets/images/status_refresh.png');
}
.warningButtonStyle {
@ -871,3 +872,8 @@ Alert {
fontSize: 12;
paddingTop: 0;
}
.statusTimeStyle {
fontSize: 10;
paddingTop: 0;
}

View File

@ -35,4 +35,7 @@ purchase a royalty-free license.
I'm unavailable for custom icon design work. But your
suggestions are always welcome!
<mailto:p@yusukekamiyamane.com>
====================
====================
Some of the client icons were generated using the following online tool:
http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html#foreground.type=clipart&foreground.space.trim=1&foreground.space.pad=0.15&foreground.clipart=res%2Fclipart%2Ficons%2Fnavigation_refresh.svg&foreColor=4b4b4b%2C0&crop=0&backgroundShape=none&backColor=ffffff%2C100&effects=none

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

View File

@ -235,6 +235,7 @@ bbb.chat.minimizeBtn.accessibilityName = Minimize the Chat Window
bbb.chat.maximizeRestoreBtn.accessibilityName = Maximize the Chat Window
bbb.chat.closeBtn.accessibilityName = Close the Chat Window
bbb.chat.chatTabs.accessibleNotice = New messages in this tab.
bbb.chat.chatMessage.systemMessage = System
bbb.publishVideo.changeCameraBtn.labelText = Change Webcam
bbb.publishVideo.changeCameraBtn.toolTip = Open the change webcam dialog box
bbb.publishVideo.cmbResolution.tooltip = Select a webcam resolution
@ -344,6 +345,13 @@ bbb.logout.confirm.title = Confirm Logout
bbb.logout.confirm.message = Are you sure you want to log out?
bbb.logout.confirm.yes = Yes
bbb.logout.confirm.no = No
bbb.connection.failure=Network failure
bbb.connection.reconnecting=Reconnecting
bbb.connection.reestablished=Connection reestablished
bbb.connection.bigbluebutton=BigBlueButton
bbb.connection.sip=SIP
bbb.connection.video=Video
bbb.connection.deskshare=Deskshare
bbb.notes.title = Notes
bbb.notes.cmpColorPicker.toolTip = Text Color
bbb.notes.saveBtn = Save
@ -496,10 +504,10 @@ bbb.polling.closeButton.label = Close
bbb.polling.pollModal.title = Poll
bbb.polling.respondersLabel.novotes = No Users Responded
bbb.polling.respondersLabel.text = {0} Users Responded
bbb.polling.answer.Y = Yes
bbb.polling.answer.N = No
bbb.polling.answer.T = True
bbb.polling.answer.F = False
bbb.polling.answer.Yes = Yes
bbb.polling.answer.No = No
bbb.polling.answer.True = True
bbb.polling.answer.False = False
bbb.polling.answer.A = A
bbb.polling.answer.B = B
bbb.polling.answer.C = C
@ -507,6 +515,8 @@ bbb.polling.answer.D = D
bbb.polling.answer.E = E
bbb.polling.answer.F = F
bbb.polling.answer.G = G
bbb.polling.results.accessible.header = Poll Results.
bbb.polling.results.accessible.answer = Answer {0} had {1} votes.
bbb.publishVideo.startPublishBtn.labelText = Start Sharing
bbb.publishVideo.changeCameraBtn.labelText = Change Webcam Settings

View File

@ -16,6 +16,7 @@
showLogoutWindow="true" showLayoutTools="true" confirmLogout="true"
showRecordingNotification="true"/>
<meeting muteOnStart="false" />
<logging enabled="true" target="trace"/>
<lock disableCamForLockedUsers="false" disableMicForLockedUsers="false" disablePrivateChatForLockedUsers="false"
disablePublicChatForLockedUsers="false" lockLayoutForLockedUsers="false" lockOnJoin="true" lockOnJoinConfigurable="false"/>

View File

@ -74,6 +74,7 @@
<script src="lib/sip.js?v=VERSION" language="javascript"></script>
<script src="lib/bbb_webrtc_bridge_sip.js?v=VERSION" language="javascript"></script>
<script src="lib/weburl_regex.js?v=VERSION" language="javascript"></script>
<script src="lib/jsnlog.min.js?v=VERSION" language="javascript"></script>
<script>
window.chatLinkClicked = function(url) {
window.open(url, '_blank');

View File

@ -3,6 +3,9 @@ if (!window.console.log) window.console.log = function () { };
function startApplet(IP, useTLS , roomNumber, fullScreen, useSVC2)
{
var deskshareElement = document.getElementById("deskshare");
if (deskshareElement == null) {
console.log("Starting deskshare applet.");
var div = document.createElement("div");
div.id = "deskshare";
@ -21,15 +24,40 @@ function startApplet(IP, useTLS , roomNumber, fullScreen, useSVC2)
"<param name=\"permissions\" value=\"all-permissions\"/>" +
"</applet>";
document.body.appendChild(div);
} else {
console.log("Deskshare applet element already exists.");
var div = document.getElementById("deskshare");
if (div.parentNode) {
// Just rewrite the applet tag to kick off the applet. We don't remove the applet tag
// when desktop sharing is stopped to prevent Firefox (38.0.5) from asking for user permissions
// again resulting in the page reloading. (ralam june 17, 2015)
// https://code.google.com/p/bigbluebutton/issues/detail?id=1953
div.innerHTML =
"<applet code=\"org.bigbluebutton.deskshare.client.DeskShareApplet.class\"" +
"id=\"DeskShareApplet\" width=\"100\" height=\"10\" archive=\"bbb-deskshare-applet-0.9.0.jar\">" +
"<param name=\"ROOM\" value=\"" + roomNumber + "\"/>" +
"<param name=\"IP\" value=\"" + IP + "\"/>" +
"<param name=\"PORT\" value=\"9123\"/>" +
"<param name=\"SCALE\" value=\"0.8\"/>" +
"<param name=\"FULL_SCREEN\" value=\"" + fullScreen + "\"/>" +
"<param name=\"SVC2\" value=\"" + useSVC2 + "\"/>" +
"<param name=\"JavaVersion\" value=\"1.7.0_51\"/>" +
"<param name=\"permissions\" value=\"all-permissions\"/>" +
"</applet>";
}
}
}
function removeFrame () {
var div = document.getElementById("deskshare");
if (div.parentNode) {
// Need to set the innerHTML otherwise the applet will restart in IE.
// see https://code.google.com/p/bigbluebutton/issues/detail?id=1776
div.innerHTML = "";
div.parentNode.removeChild(div);
// Do NOT remove the applet tag as it makes Firefox (38.0.5) prompt for
// permissions again resulting in the page reloading. (ralam june 17, 2015)
// div.innerHTML = "";
// div.parentNode.removeChild(div);
}
}
@ -143,4 +171,4 @@ function checkJavaVersion(minJavaVersion) {
}
}
}
}

View File

@ -0,0 +1,16 @@
var __extends=this.__extends||function(b,d){function n(){this.constructor=b}for(var f in d)d.hasOwnProperty(f)&&(b[f]=d[f]);n.prototype=d.prototype;b.prototype=new n};
function JL(b){if(!b)return JL.__;Array.prototype.reduce||(Array.prototype.reduce=function(b,d){for(var l=d,g=0;g<this.length;g++)l=b(l,this[g],g,this);return l});var d="";return("."+b).split(".").reduce(function(b,f,l,g){d=d?d+("."+f):f;f=b["__"+d];void 0===f&&(JL.Logger.prototype=b,f=new JL.Logger(d),b["__"+d]=f);return f},JL.__)}
(function(b){function d(a,c,h){void 0!==c[a]&&(null===c[a]?delete h[a]:h[a]=c[a])}function n(a){if(null!=b.enabled&&!b.enabled||null!=b.maxMessages&&1>b.maxMessages)return!1;try{if(a.userAgentRegex&&!RegExp(a.userAgentRegex).test(navigator.userAgent))return!1}catch(c){}try{if(a.ipRegex&&b.clientIP&&!RegExp(a.ipRegex).test(b.clientIP))return!1}catch(h){}return!0}function f(a,c){try{if(a.disallow&&RegExp(a.disallow).test(c))return!1}catch(h){}return!0}function l(a){return"function"==typeof a?a instanceof
RegExp?a.toString():a():a}function g(a){a=l(a);switch(typeof a){case "string":return new m(a,null,a);case "number":return a=a.toString(),new m(a,null,a);case "boolean":return a=a.toString(),new m(a,null,a);case "undefined":return new m("undefined",null,"undefined");case "object":return a instanceof RegExp||a instanceof String||a instanceof Number||a instanceof Boolean?(a=a.toString(),new m(a,null,a)):new m(null,a,JSON.stringify(a));default:return new m("unknown",null,"unknown")}}b.enabled;b.maxMessages;
b.defaultAjaxUrl;b.clientIP;b.defaultBeforeSend;b.requestId="";var m=function(){return function(a,c,h){this.msg=a;this.meta=c;this.finalString=h}}();b.setOptions=function(a){d("enabled",a,this);d("maxMessages",a,this);d("defaultAjaxUrl",a,this);d("clientIP",a,this);d("requestId",a,this);d("defaultBeforeSend",a,this);return this};b.getAllLevel=function(){return-2147483648};b.getTraceLevel=function(){return 1E3};b.getDebugLevel=function(){return 2E3};b.getInfoLevel=function(){return 3E3};b.getWarnLevel=
function(){return 4E3};b.getErrorLevel=function(){return 5E3};b.getFatalLevel=function(){return 6E3};b.getOffLevel=function(){return 2147483647};var e=function(){return function(a,c){this.inner=c;this.name="JL.Exception";this.message=g(a).finalString}}();b.Exception=e;e.prototype=Error();var r=function(){return function(a,c,h,b){this.l=a;this.m=c;this.n=h;this.t=b}}();b.LogItem=r;e=function(){function a(c,a){this.appenderName=c;this.sendLogItems=a;this.level=b.getTraceLevel();this.sendWithBufferLevel=
2147483647;this.storeInBufferLevel=-2147483648;this.bufferSize=0;this.batchSize=1;this.buffer=[];this.batchBuffer=[]}a.prototype.setOptions=function(c){d("level",c,this);d("ipRegex",c,this);d("userAgentRegex",c,this);d("disallow",c,this);d("sendWithBufferLevel",c,this);d("storeInBufferLevel",c,this);d("bufferSize",c,this);d("batchSize",c,this);this.bufferSize<this.buffer.length&&(this.buffer.length=this.bufferSize);return this};a.prototype.log=function(c,a,b,d,k,e,g){!n(this)||!f(this,e)||k<this.storeInBufferLevel||
(c=new r(k,e,g,(new Date).getTime()),k<this.level?0<this.bufferSize&&(this.buffer.push(c),this.buffer.length>this.bufferSize&&this.buffer.shift()):(k<this.sendWithBufferLevel||!this.buffer.length||(this.batchBuffer=this.batchBuffer.concat(this.buffer),this.buffer.length=0),this.batchBuffer.push(c),this.batchBuffer.length>=this.batchSize&&this.sendBatch()))};a.prototype.sendBatch=function(){0==this.batchBuffer.length||null!=b.maxMessages&&1>b.maxMessages||(null!=b.maxMessages&&(b.maxMessages-=this.batchBuffer.length),
this.sendLogItems(this.batchBuffer),this.batchBuffer.length=0)};return a}();b.Appender=e;var p=function(a){function c(b){a.call(this,b,c.prototype.sendLogItemsAjax)}__extends(c,a);c.prototype.setOptions=function(c){d("url",c,this);d("beforeSend",c,this);a.prototype.setOptions.call(this,c);return this};c.prototype.sendLogItemsAjax=function(c){try{var a="/jsnlog.logger";null!=b.defaultAjaxUrl&&(a=b.defaultAjaxUrl);this.url&&(a=this.url);var d=JSON.stringify({r:b.requestId,lg:c}),k=this.getXhr(a);"function"===
typeof this.beforeSend?this.beforeSend(k):"function"===typeof b.defaultBeforeSend&&b.defaultBeforeSend(k);k.send(d)}catch(f){}};c.prototype.getXhr=function(c){var a=new XMLHttpRequest;if(!("withCredentials"in a)&&"undefined"!=typeof XDomainRequest)return a=new XDomainRequest,a.open("POST",c),a;a.open("POST",c);a.setRequestHeader("Content-Type","application/json");a.setRequestHeader("JSNLog-RequestId",b.requestId);return a};return c}(e);b.AjaxAppender=p;var q=function(a){function c(b){a.call(this,
b,c.prototype.sendLogItemsConsole)}__extends(c,a);c.prototype.clog=function(a){console.log(a)};c.prototype.cerror=function(a){console.error?console.error(a):this.clog(a)};c.prototype.cwarn=function(a){console.warn?console.warn(a):this.clog(a)};c.prototype.cinfo=function(a){console.info?console.info(a):this.clog(a)};c.prototype.cdebug=function(a){console.debug?console.debug(a):this.cinfo(a)};c.prototype.sendLogItemsConsole=function(a){try{if(console){var c;for(c=0;c<a.length;++c){var d=a[c],f=d.n+
": "+d.m;"undefined"===typeof window&&(f=new Date(d.t)+" | "+f);d.l<=b.getDebugLevel()?this.cdebug(f):d.l<=b.getInfoLevel()?this.cinfo(f):d.l<=b.getWarnLevel()?this.cwarn(f):this.cerror(f)}}}catch(e){}};return c}(e);b.ConsoleAppender=q;e=function(){function a(a){this.loggerName=a;this.seenRegexes=[]}a.prototype.setOptions=function(a){d("level",a,this);d("userAgentRegex",a,this);d("disallow",a,this);d("ipRegex",a,this);d("appenders",a,this);d("onceOnly",a,this);this.seenRegexes=[];return this};a.prototype.buildExceptionObject=
function(a){var b={};a.stack?b.stack=a.stack:b.e=a;a.message&&(b.message=a.message);a.name&&(b.name=a.name);a.data&&(b.data=a.data);a.inner&&(b.inner=this.buildExceptionObject(a.inner));return b};a.prototype.log=function(a,b,d){var e=0;if(!this.appenders)return this;if(a>=this.level&&n(this)&&(d?(e=this.buildExceptionObject(d),e.logData=l(b)):e=b,b=g(e),f(this,b.finalString))){if(this.onceOnly)for(e=this.onceOnly.length-1;0<=e;){if(RegExp(this.onceOnly[e]).test(b.finalString)){if(this.seenRegexes[e])return this;
this.seenRegexes[e]=!0}e--}b.meta=b.meta||{};b.meta.loggerName=this.loggerName;for(e=this.appenders.length-1;0<=e;)this.appenders[e].log(1E3>=a?"trace":2E3>=a?"debug":3E3>=a?"info":4E3>=a?"warn":5E3>=a?"error":"fatal",b.msg,b.meta,function(){},a,b.finalString,this.loggerName),e--}return this};a.prototype.trace=function(a){return this.log(1E3,a)};a.prototype.debug=function(a){return this.log(2E3,a)};a.prototype.info=function(a){return this.log(3E3,a)};a.prototype.warn=function(a){return this.log(4E3,
a)};a.prototype.error=function(a){return this.log(5E3,a)};a.prototype.fatal=function(a){return this.log(6E3,a)};a.prototype.fatalException=function(a,b){return this.log(6E3,a,b)};return a}();b.Logger=e;b.createAjaxAppender=function(a){return new p(a)};b.createConsoleAppender=function(a){return new q(a)};e=new p("");"undefined"===typeof window&&(e=new q(""));b.__=new b.Logger("");b.__.setOptions({level:b.getDebugLevel(),appenders:[e]})})(JL||(JL={}));var exports;
"undefined"!==typeof exports&&(exports.JL=JL);var define;"function"==typeof define&&define.amd&&define("jsnlog",[],function(){return JL});"function"==typeof __jsnlog_configure&&__jsnlog_configure(JL);

View File

@ -22,8 +22,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:views="*"
pageTitle="BigBlueButton"
layout="absolute"
layout="absolute"
preinitialize="LogUtil.initLogging(true)"
preloader="org.bigbluebutton.main.model.BigBlueButtonPreloader">
<mx:Script>
<![CDATA[
import org.bigbluebutton.common.LogUtil;
]]>
</mx:Script>
<views:BigBlueButtonMainContainer id="bbbShell"/>

View File

@ -38,21 +38,23 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import flash.events.Event;
import mx.managers.HistoryManager;
import mx.managers.IDragManager;
import mx.managers.ToolTipManager;
import mx.utils.URLUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.AddUIComponentToMainCanvas;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.EventBroadcaster;
import org.bigbluebutton.core.managers.ConfigManager2;
import org.bigbluebutton.main.api.ExternalApiCallbacks;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.ShortcutOptions;
import org.bigbluebutton.main.views.MainApplicationShell;
import org.bigbluebutton.util.i18n.ResourceUtil;
private var langResources:ResourceUtil = null;
private static const LOGGER:ILogger = getClassLogger(BigBlueButtonMainContainer);
private var langResources:ResourceUtil = null;
private var globalModifier:String;
/**
@ -60,7 +62,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
* http://gregjessup.com/flex-3-advanceddatagrid-cannot-convert-mxmanagersdragmanagerimpl-to-mxmanagersidragmanager/
* http://butterfliesandbugs.wordpress.com/2007/10/25/workaround-for-error-when-loading-popups-from-modules/
*/
import mx.managers.IDragManager;
private var iDragManager:IDragManager;
/** another workaround - for this issue: https://bugs.adobe.com/jira/browse/SDK-13121*/
@ -68,7 +69,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var globalDispatcher:Dispatcher = new Dispatcher();
protected function init():void {
protected function init():void {
setupTooltips();
setupAPI();
EventBroadcaster.getInstance().addEventListener("configLoadedEvent", configLoadedEventHandler);
@ -78,7 +79,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function configLoadedEventHandler(e:Event):void {
LogUtil.debug("***** Config Loaded ****");
LogUtil.initLogging();
LOGGER.debug("***** Config Loaded ****");
mainShell.initOptions(null);
ShortcutOptions.initialize();
}
@ -89,7 +91,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
langResources = ResourceUtil.getInstance();
api = new ExternalApiCallbacks();
Security.allowDomain(determineHTMLURL());
LogUtil.debug("Security.allowDomain(" + determineHTMLURL() + ");");
LOGGER.debug("Security.allowDomain({0});", [determineHTMLURL()]);
}
private function determineHTMLURL():String {
@ -98,9 +100,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
try {
var htmlURL:String = String(ExternalInterface.call("window.location.href.toString"));
serverName = URLUtil.getServerName(htmlURL);
trace("HTML URL [" + htmlURL + "]");
LOGGER.debug("HTML URL [{0}]", [htmlURL]);
} catch(s:Error) {
trace("Cannot determine HTML URL");
LOGGER.debug("Cannot determine HTML URL");
}
}
@ -176,10 +178,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function hotkeyCapture():void{
trace("Entering hotkeyCapture");
LOGGER.debug("Entering hotkeyCapture");
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
ResourceUtil.getInstance().addEventListener(Event.CHANGE, localeChanged); // Listen for locale changing
trace("Leaving hotkeyCapture");
LOGGER.debug("Leaving hotkeyCapture");
}
// Handle general-access hotkeys, regardless of what window the user is focused in
@ -189,7 +191,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") + (e.altKey ? "alt+" : "") + e.keyCode;
if (e.keyCode < 64 || e.keyCode > 90){
trace("Keypress debugging: KeyCode " + e.keyCode + " is nonalphabetic (probably)");
LOGGER.debug("Keypress debugging: KeyCode {0} is nonalphabetic (probably)", [e.keyCode]);
}
if (keyCombos[keyPress]) {

View File

@ -34,10 +34,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import com.asfusion.mate.events.Dispatcher;
import mx.managers.HistoryManager;
import mx.managers.IDragManager;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.views.MainApplicationShell;
import org.bigbluebutton.util.i18n.ResourceUtil;
private var langResources:ResourceUtil = ResourceUtil.getInstance();
@ -49,7 +48,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
* http://gregjessup.com/flex-3-advanceddatagrid-cannot-convert-mxmanagersdragmanagerimpl-to-mxmanagersidragmanager/
* http://butterfliesandbugs.wordpress.com/2007/10/25/workaround-for-error-when-loading-popups-from-modules/
*/
import mx.managers.IDragManager;
private var iDragManager:IDragManager;
/** another workaround - for this issue: https://bugs.adobe.com/jira/browse/SDK-13121*/

15
bigbluebutton-client/src/BroadcastModule.mxml Executable file → Normal file
View File

@ -30,15 +30,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
private static const LOGGER:ILogger = getClassLogger(BroadcastModule);
private var _moduleName:String = "Broadcast Module";
private var _attributes:Object;
private var dispatcher:Dispatcher = new Dispatcher();
private function onCreationComplete():void {
LogUtil.debug("BrodcastModule Initialized");
LOGGER.debug("BrodcastModule Initialized");
}
public function get moduleName():String {
@ -46,12 +51,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function start(attributes:Object):void {
LogUtil.debug("***Starting BroadcastModule");
LOGGER.debug("***Starting BroadcastModule");
dispatcher.dispatchEvent(new Event("BroadcastModuleStartEvent"));
}
public function stop():void {
LogUtil.debug("Stop Broadcast Module");
LOGGER.debug("Stop Broadcast Module");
}

41
bigbluebutton-client/src/ChatModule.mxml Executable file → Normal file
View File

@ -30,27 +30,24 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.controls.Alert;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.chat.ChatUtil;
import org.bigbluebutton.modules.chat.events.ChatEvent;
import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent;
import org.bigbluebutton.modules.chat.events.StartChatModuleEvent;
import org.bigbluebutton.modules.chat.events.StopChatModuleEvent;
import org.bigbluebutton.modules.chat.events.TranscriptEvent;
import org.bigbluebutton.modules.chat.vo.ChatMessageVO;
import org.bigbluebutton.modules.chat.views.ChatBox;
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.chat.events.StartChatModuleEvent;
import org.bigbluebutton.modules.chat.events.StopChatModuleEvent;
private static const LOGGER:ILogger = getClassLogger(ChatModule);
private var _moduleName:String = "Chat Module";
private var _attributes:Object;
private var dispatcher:Dispatcher = new Dispatcher();
private function onCreationComplete():void {
LogUtil.debug("ChatModule Initialized");
LOGGER.debug("ChatModule Initialized");
}
public function get moduleName():String {
@ -73,9 +70,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (_attributes.mode == null) {
//_attributes.mode = "PLAYBACK"
_attributes.mode = "LIVE"
LogUtil.debug('Setting ChatModule mode: ' + _attributes.mode);
LOGGER.debug('Setting ChatModule mode: {0}', [_attributes.mode]);
}
LogUtil.debug('ChatModule mode: ' + _attributes.mode);
LOGGER.debug('ChatModule mode: {0}', [_attributes.mode]);
return _attributes.mode;
}
@ -87,10 +84,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return _attributes.userrole as String;
}
public function start(attributes:Object):void {
LogUtil.debug("chat attr: " + attributes.username);
_attributes = attributes;
LogUtil.debug("Dispatching StartChatModuleEvent");
public function start(attributes:Object):void {
LOGGER.debug("chat attr: ", [attributes.username]);
_attributes = attributes;
LOGGER.debug("Dispatching StartChatModuleEvent");
var event:StartChatModuleEvent = new StartChatModuleEvent(StartChatModuleEvent.START_CHAT_MODULE_EVENT)
event.start = true;
@ -99,13 +96,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function stop():void {
LogUtil.debug("Dispatching StopChatModuleEvent");
LOGGER.debug("Dispatching StopChatModuleEvent");
var event:StopChatModuleEvent = new StopChatModuleEvent(StopChatModuleEvent.STOP_CHAT_MODULE_EVENT);
dispatcher.dispatchEvent(event);
}
private function handlePrivateChatMessageEvent(event:Event):void {
trace("Received PRIVATE CHAT MESSAGE EVENT");
LOGGER.debug("Received PRIVATE CHAT MESSAGE EVENT");
}
]]>

View File

@ -41,7 +41,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.classyaudio.events.StartClassAudioEvent;
import org.bigbluebutton.modules.classyaudio.events.StopClassAudioEvent;

31
bigbluebutton-client/src/DeskShareModule.mxml Executable file → Normal file
View File

@ -31,19 +31,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.modules.deskshare.events.ModuleEvent;
import org.bigbluebutton.modules.deskshare.maps.DeskshareEventMap;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.deskshare.events.ModuleEvent;
private static const LOGGER:ILogger = getClassLogger(DeskShareModule);
private var _moduleName:String = "Desk Share";
private var _attributes:Object;
private var globalDispatcher:Dispatcher = new Dispatcher();;
private function onCreationComplete():void{
LogUtil.debug("DeskShareModule initialized");
LOGGER.debug("DeskShareModule initialized");
}
public function get moduleName():String{
@ -60,10 +61,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function get mode():String{
if (_attributes.mode == null){
_attributes.mode = "LIVE";
LogUtil.debug("Setting DeskShare mode: " + _attributes.mode);
}
LogUtil.debug("DeskShare mode: " + _attributes.mode);
_attributes.mode = "LIVE";
LOGGER.debug("Setting DeskShare mode: {0}", [_attributes.mode]);
}
LOGGER.debug("DeskShare mode: {0}", [_attributes.mode]);
return _attributes.mode;
}
@ -75,8 +76,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return _attributes.userrole as String;
}
public function start(attributes:Object):void{
LogUtil.debug("desk share attr: " + attributes.username);
public function start(attributes:Object):void{
LOGGER.debug("desk share attr: {0}", [attributes.username]);
_attributes = attributes;
var startEvent:ModuleEvent = new ModuleEvent(ModuleEvent.START);
@ -85,7 +86,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function stop():void{
LogUtil.debug("STOPPING DESKSHARE MODULE!!!");
LOGGER.debug("STOPPING DESKSHARE MODULE!!!");
var stopEvent:ModuleEvent = new ModuleEvent(ModuleEvent.STOP);
globalDispatcher.dispatchEvent(stopEvent);
}
@ -100,7 +101,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function tunnel():Boolean {
if (_attributes.protocol == "RTMPT") {
LogUtil.debug("Use tunneling for desktop sharing");
LOGGER.debug("Use tunneling for desktop sharing");
return true;
}
return false;

71
bigbluebutton-client/src/DeskshareStandalone.mxml Executable file → Normal file
View File

@ -35,20 +35,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import mx.containers.Canvas;
import mx.controls.Button;
import mx.controls.Image;
import mx.controls.Label;
import mx.core.UIComponent;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.modules.deskshare.events.AppletStartedEvent;
import org.bigbluebutton.modules.deskshare.events.CursorEvent;
import org.bigbluebutton.modules.deskshare.events.ViewStreamEvent;
import org.bigbluebutton.modules.deskshare.services.DeskshareService;
import org.bigbluebutton.modules.deskshare.services.red5.Connection;
import org.bigbluebutton.modules.deskshare.services.red5.ConnectionEvent;
import org.bigbluebutton.util.QueryStringParameters;
import mx.core.UIComponent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.modules.deskshare.events.AppletStartedEvent;
import org.bigbluebutton.modules.deskshare.events.CursorEvent;
import org.bigbluebutton.modules.deskshare.events.ViewStreamEvent;
import org.bigbluebutton.modules.deskshare.services.DeskshareService;
import org.bigbluebutton.modules.deskshare.services.red5.ConnectionEvent;
import org.bigbluebutton.util.QueryStringParameters;
private static const LOGGER:ILogger = getClassLogger(DeskshareStandalone);
private var videoHolder:UIComponent;
private var cursor:Shape = new Shape();;
@ -87,17 +87,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onAppletStart(event:AppletStartedEvent):void{
trace("DeskshareSA::onAppletStart.");
LOGGER.debug("DeskshareSA::onAppletStart.");
startVideo(service.getConnection(), room, event.videoWidth, event.videoHeight);
}
private function onViewStreamStart(event:ViewStreamEvent):void {
trace("DeskshareSA::onViewStreamStart.");
LOGGER.debug("DeskshareSA::onViewStreamStart.");
startVideo(service.getConnection(), room, event.videoWidth, event.videoHeight);
}
private function onAppletStop(event:ViewStreamEvent):void {
trace("DeskshareSA::onAppletStop.");
LOGGER.debug("DeskshareSA::onAppletStop.");
var url:URLRequest = new URLRequest(logoutURL);
navigateToURL(url, '_self');
}
@ -152,7 +152,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
showStatusText(warningText, true, "0x000000");
trace("CONNECT STATUS EVENT [" + event.status + "]");
LOGGER.debug("CONNECT STATUS EVENT [{0}]", [event.status]);
}
private function startVideo(connection:NetConnection, stream:String, videoWidth:Number, videoHeight:Number):void{
@ -171,7 +171,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
videoHolder = new UIComponent();
trace("DeskshareSA::Determine how to display video = [" + videoWidth + "x" + videoHeight + "] display=[" + this.width + "x" + this.height + "]");
LOGGER.debug("DeskshareSA::Determine how to display video = [{0}x{1}] display=[{2}x{3}]", [videoWidth, videoHeight, this.width, this.height]);
determineHowToDisplayVideo();
ns.play(stream);
@ -179,7 +179,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onMetaData(info:Object):void {
trace("DeskshareSA:: ****metadata: width=" + info.width + " height=" + info.height);
LOGGER.debug("DeskshareSA:: ****metadata: width={0} height={1}", [info.width, info.height]);
videoWidth = info.width;
videoHeight = info.height;
@ -211,18 +211,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onAsyncError(e:AsyncErrorEvent):void{
trace("DeskshareSA::::asyncerror " + e.toString());
LOGGER.debug("DeskshareSA::::asyncerror {0}", [e.toString()]);
}
private function onNetStatus(e:NetStatusEvent):void{
switch(e.info.code){
case "NetStream.Play.Start":
trace("DeskshareSA::NetStream.Publish.Start for broadcast stream " + stream);
trace("DeskshareSA::Dispatching start viewing event");
LOGGER.debug("DeskshareSA::NetStream.Publish.Start for broadcast stream {0}", [stream]);
LOGGER.debug("DeskshareSA::Dispatching start viewing event");
service.sendStartedViewingNotification(stream);
break;
case "NetStream.Play.UnpublishNotify":
trace("DeskshareSA::NetStream.Play.UnpublishNotify for broadcast stream " + stream);
LOGGER.debug("DeskshareSA::NetStream.Play.UnpublishNotify for broadcast stream {0}", [stream]);
stopViewing();
break;
case "NetStream.DRM.UpdateNeeded":
@ -235,7 +235,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
break;
}
trace("NET STATUS EVENT [" + e.info.code + "]");
LOGGER.debug("NET STATUS EVENT [{0}]", [e.info.code]);
}
//----------------------------
@ -245,9 +245,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
videoHolder.x = video.x = (this.width - video.width) / 4;
videoHolder.y = video.y = (this.height - video.height) / 4;
trace("DeskshareSA::Center video = [" + video.width + "x" + video.height
+ "] display=[" + this.width + "x" + this.height + "]"
+ "loc=[" + videoHolder.x + "," + videoHolder.y + "]");
LOGGER.debug("DeskshareSA::Center video = [{0}x{1}] display=[{2}x{3}]" + "loc=[{4},{5}]",
[video.width, video.height, this.width, this.height, videoHolder.x, videoHolder.y]);
videoHolder.addChild(video);
videoHolder.addChild(cursor);
@ -269,16 +268,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function fitToWidthAndAdjustHeightToMaintainAspectRatio():void {
trace("DeskshareSA::fitToWidthAndAdjustHeightToMaintainAspectRatio");
LOGGER.debug("DeskshareSA::fitToWidthAndAdjustHeightToMaintainAspectRatio");
videoHolder.width = video.width = width;
// Maintain aspect-ratio
videoHolder.height = video.height = (videoHeight * video.width) / videoWidth;
videoHolder.x = video.x = 0;
videoHolder.y = video.y = 0;
trace("DeskshareSA::Disp video = [" + video.width + "x" + video.height
+ "] display=[" + this.width + "x" + this.height + "]"
+ "loc=[" + videoHolder.x + "," + videoHolder.y + "]");
LOGGER.debug("DeskshareSA::Disp video = [{0}x{1}] display=[{2}x{3}]" + "loc=[{4},{5}]",
[video.width, video.height, this.width, this.height, videoHolder.x, videoHolder.y]);
videoHolder.addChild(video);
videoHolder.addChild(cursor);
@ -288,7 +286,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function fitToHeightAndAdjustWidthToMaintainAspectRatio():void {
trace("DeskshareSA::fitToHeightAndAdjustWidthToMaintainAspectRatio");
LOGGER.debug("DeskshareSA::fitToHeightAndAdjustWidthToMaintainAspectRatio");
videoHolder.height = video.height = height;
// Maintain aspect-ratio
videoHolder.width = video.width = (videoWidth * video.height) / videoHeight;
@ -301,11 +299,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
videoHolder.x = video.x = (width - video.width) / 4;
videoHolder.y = video.y = (height - video.height) / 4;
trace("DeskshareSA::Disp video = [" + video.width + "x" + video.height
+ "] display=[" + this.width + "x" + this.height + "]"
+ "loc=[" + videoHolder.x + "," + videoHolder.y + "]");
videoHolder.addChild(video);
LOGGER.debug("DeskshareSA::Disp video = [{0}x{1}] display=[{2}x{3}]" + "loc=[{4},{5}]",
[video.width, video.height, this.width, this.height, videoHolder.x, videoHolder.y]);
videoHolder.addChild(video);
videoHolder.addChild(cursor);
videoHolder.addChild(cursorImg);

View File

@ -35,9 +35,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.core.UIComponent;
import org.bigbluebutton.common.IBbbToolbarComponent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.common.events.ToolbarButtonEvent;
import org.bigbluebutton.modules.dynamicinfo.DynamicInfoButton;
import org.bigbluebutton.modules.dynamicinfo.DynamicInfoComboBox;

View File

@ -27,7 +27,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.modules.example.ExampleChatWindow;

14
bigbluebutton-client/src/LayoutModule.mxml Executable file → Normal file
View File

@ -27,16 +27,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.layout.events.StartLayoutModuleEvent;
import org.bigbluebutton.modules.layout.events.LayoutEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.layout.events.LayoutEvent;
import org.bigbluebutton.modules.layout.events.StartLayoutModuleEvent;
private static const LOGGER:ILogger = getClassLogger(LayoutModule);
private var _moduleName:String = "Layout Module";
private var _globalDispatcher:Dispatcher = new Dispatcher();
private function onCreationComplete():void {
LogUtil.debug(_moduleName + " initialized");
LOGGER.debug("{0} initialized", [_moduleName]);
}
public function get moduleName():String {

View File

@ -9,9 +9,9 @@
<mx:Script>
<![CDATA[
import org.bigbluebutton.common.LogUtil;
import mx.controls.Alert;
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.main.events.BBBEvent;
private var _moduleId:String = "MonitoringModule";

View File

@ -28,16 +28,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.notes.events.NotesModuleStartEvent;
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.notes.events.NotesModuleStartEvent;
private static const LOGGER:ILogger = getClassLogger(NotesModule);
private var _moduleName:String = "Layout Module";
private var _dispatcher:Dispatcher = new Dispatcher();
private function onCreationComplete():void {
LogUtil.debug(_moduleName + " initialized");
LOGGER.debug("{0} initialized", [_moduleName]);
}
public function get moduleName():String {

19
bigbluebutton-client/src/PhoneModule.mxml Executable file → Normal file
View File

@ -32,18 +32,23 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.phone.events.StartPhoneModuleEvent;
import org.bigbluebutton.modules.phone.events.StopPhoneModuleEvent;
private static const LOGGER:ILogger = getClassLogger(PhoneModule);
private var _moduleName:String = "Phone";
private var _attributes:Object;
private var dispatcher:Dispatcher = new Dispatcher();
private function onCreationComplete():void {
LogUtil.debug("PhoneModule Initialized");
LOGGER.debug("PhoneModule Initialized");
}
public function get moduleName():String {
@ -86,8 +91,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return _attributes.voicebridge;
}
public function start(attributes:Object):void {
LogUtil.debug("phone attr: " + attributes.username);
public function start(attributes:Object):void {
LOGGER.debug("phone attr: {0}", [attributes.username]);
_attributes = attributes;
var event:StartPhoneModuleEvent = new StartPhoneModuleEvent(StartPhoneModuleEvent.START_PHONE_MODULE_EVENT);
@ -96,7 +101,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function stop():void {
trace("Stopping phone module");
LOGGER.debug("Stopping phone module");
var event:StopPhoneModuleEvent = new StopPhoneModuleEvent(StopPhoneModuleEvent.STOP_PHONE_MODULE_EVENT);
dispatcher.dispatchEvent(event);
}

36
bigbluebutton-client/src/PollingModule.mxml Executable file → Normal file
View File

@ -23,30 +23,29 @@
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
implements="org.bigbluebutton.common.IBigBlueButtonModule"
xmlns:polling="org.bigbluebutton.modules.polling.*"
xmlns:maps="org.bigbluebutton.modules.polling.maps.*"
creationComplete="onCreationComplete()">
xmlns:maps="org.bigbluebutton.modules.polling.maps.*"
creationComplete="onCreationComplete()">
<maps:PollEventMap id="pollEventMap"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.modules.polling.events.ModuleEvent;
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.polling.events.ModuleEvent;
private static const LOGGER:ILogger = getClassLogger(PollingModule);
private var _moduleName:String = "Polling";
private var _attributes:Object;
public var globalDispatcher:Dispatcher = new Dispatcher();
public static const LOGNAME:String = "[PollingModule] ";
private function onCreationComplete():void {
LogUtil.debug(LOGNAME + "initialized");
LOGGER.debug("module initialized");
}
public function get moduleName():String {
@ -63,11 +62,10 @@
return _attributes.username;
}
public function getRoom():String{
public function getRoom():String{
return _attributes.room;
}
public function get userid():Number {
return _attributes.userid as Number;
}
@ -77,22 +75,18 @@
}
public function start(attributes:Object):void {
trace(LOGNAME +" started [Username: " + attributes.username + " Role: " +attributes.userrole + " Room:" +attributes.room+ "]" );
LOGGER.debug("PollingModule started [Username: {0} Role: {1} Room:{2}]", [attributes.username, attributes.userrole, attributes.room]);
_attributes = attributes;
//eventMap.module = this;
trace(LOGNAME + "inside start() dispatching ModuleEvent");
LOGGER.debug("inside start() dispatching ModuleEvent");
var startEvent:ModuleEvent = new ModuleEvent(ModuleEvent.START);
startEvent.module = this;
globalDispatcher.dispatchEvent(startEvent);
}
public function stop():void {
trace(LOGNAME + "STOPPING Polling MODULE");
LOGGER.debug("STOPPING Polling MODULE");
}
public function getMeetingInfo():String{

15
bigbluebutton-client/src/PresentModule.mxml Executable file → Normal file
View File

@ -30,12 +30,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.controls.Alert;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.present.events.PresentModuleEvent;
import org.bigbluebutton.modules.present.maps.PresentEventMap;
private static const LOGGER:ILogger = getClassLogger(PresentModule);
private var globalDispatcher:Dispatcher = new Dispatcher();
private var _moduleName:String = "Presentation";
@ -61,9 +62,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function get mode():String{
if (_attributes.mode == null){
_attributes.mode = "LIVE";
LogUtil.debug("Setting Present mode: " + _attributes.mode);
LOGGER.debug("Setting Present mode: {0}", [_attributes.mode]);
}
LogUtil.debug("Present mode: " + _attributes.mode);
LOGGER.debug("Present mode: {0}" + [_attributes.mode]);
return _attributes.mode;
}
@ -76,7 +77,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function start(attributes:Object):void{
LogUtil.debug("present attr: " + attributes.username);
LOGGER.debug("present attr: {0}", [attributes.username]);
_attributes = attributes;
var e:PresentModuleEvent = new PresentModuleEvent(PresentModuleEvent.START_MODULE);

View File

@ -25,14 +25,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.IBbbModuleWindow;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.common.events.ToolbarButtonEvent;
import org.bigbluebutton.modules.sharednotes.SharedNotesWindow;
import org.bigbluebutton.modules.sharednotes.ToolbarButton;
import org.bigbluebutton.modules.sharednotes.infrastructure.Client;
import org.bigbluebutton.modules.sharednotes.infrastructure.HTTPServerConnection;
private var _moduleName:String = "Notes Module";

12
bigbluebutton-client/src/UsersModule.mxml Executable file → Normal file
View File

@ -29,17 +29,21 @@
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.users.events.StartUsersModuleEvent;
import org.bigbluebutton.modules.users.events.StopUsersModuleEvent;
private static const LOGGER:ILogger = getClassLogger(UsersModule);
private var _moduleName:String = "Users Module";
private var _attributes:Object;
private var dispatcher:Dispatcher;
private function onCreationComplete():void {
LogUtil.debug("UsersModule Initialized");
LOGGER.debug("UsersModule Initialized");
}
public function get moduleName():String {
@ -64,7 +68,7 @@
}
public function stop():void {
LogUtil.debug("UsersModule is stopping");
LOGGER.debug("UsersModule is stopping");
var endEvent:StopUsersModuleEvent = new StopUsersModuleEvent(StopUsersModuleEvent.STOP_USERS_MODULE);
dispatcher.dispatchEvent(endEvent);

27
bigbluebutton-client/src/VideoconfModule.mxml Executable file → Normal file
View File

@ -22,22 +22,21 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
xmlns:maps="org.bigbluebutton.modules.videoconf.maps.*" implements="org.bigbluebutton.common.IBigBlueButtonModule">
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.modules.videoconf.business.VideoProxy;
import org.bigbluebutton.modules.videoconf.events.CloseAllWindowsEvent;
import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent;
import org.bigbluebutton.modules.videoconf.events.VideoModuleStartEvent;
import org.bigbluebutton.modules.videoconf.events.VideoModuleStopEvent;
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.videoconf.events.VideoModuleStartEvent;
import org.bigbluebutton.modules.videoconf.events.VideoModuleStopEvent;
private static const LOGGER:ILogger = getClassLogger(VideoconfModule);
private var _moduleName:String = "Videoconf Module";
private var _attributes:Object;
private function onCreationComplete():void {
LogUtil.debug("VideoconfModule initialized");
LOGGER.debug("VideoconfModule initialized");
}
public function get moduleName():String {
@ -56,9 +55,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (_attributes.mode == null) {
//_attributes.mode = "PLAYBACK"
_attributes.mode = "LIVE"
LogUtil.debug('Setting NotesModule mode: ' + _attributes.mode);
LOGGER.debug('Setting NotesModule mode: {0}', [_attributes.mode]);
}
LogUtil.debug('VideoconfVModule mode: ' + _attributes.mode);
LOGGER.debug('VideoconfVModule mode: {0}', [_attributes.mode]);
return _attributes.mode;
}
@ -76,7 +75,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function start(attributes:Object):void {
trace("Starting Video Module");
LOGGER.debug("Starting Video Module");
_attributes = attributes;
var globalDispatcher:Dispatcher = new Dispatcher();

16
bigbluebutton-client/src/WhiteboardModule.mxml Executable file → Normal file
View File

@ -24,19 +24,23 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
creationComplete="init()" xmlns:mate="http://mate.asfusion.com/">
<mx:Script>
<![CDATA[
import org.bigbluebutton.common.LogUtil;
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.modules.whiteboard.events.StartWhiteboardModuleEvent;
import org.bigbluebutton.modules.whiteboard.events.StopWhiteboardModuleEvent;
private static const LOGGER:ILogger = getClassLogger(WhiteboardModule);
private var _moduleName:String = "Highlighter Module";
private var _attributes:Object;
private var globalDispatcher:Dispatcher;
private function init():void{
LogUtil.debug("HighlighterModule::init");
LOGGER.debug("HighlighterModule::init");
}
public function get moduleName():String {
@ -59,8 +63,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return _attributes.userrole as String;
}
public function start(attributes:Object):void {
LogUtil.debug("highlighter attr: " + attributes.username);
public function start(attributes:Object):void {
LOGGER.debug("highlighter attr: {0}", [attributes.username]);
_attributes = attributes;
globalDispatcher = new Dispatcher();
//eventMap.createHighlighterCanvas();

View File

@ -1,70 +1,101 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.common
{
import mx.logging.ILogger;
import mx.logging.Log;
import org.as3commons.logging.api.LOGGER_FACTORY;
import org.as3commons.logging.setup.SimpleTargetSetup;
import org.as3commons.logging.setup.target.IFormattingLogTarget;
import org.as3commons.logging.setup.target.TraceTarget;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.util.logging.JSNLogTarget;
import org.bigbluebutton.util.logging.LogWindowTarget;
public class LogUtil
{
public static const LOGGER:String = "BBBLOGGER";
public static function debug(message:String):void
{
logger.debug(message);
}
public static const TRACE:String="trace";
public static const LOG_WINDOW:String="logwindow";
public static const JSNLOG:String="jsnlog";
public static function info(message:String):void
{
logger.info(message);
}
public static function error(message:String):void
{
logger.error(message);
}
private static const DEFAULT_FORMAT:String="{dateUTC} {time} :: {name} :: [{logLevel}] {message}";
public static function fatal(message:String):void
private static var loggingEnabled:Boolean;
private static var loggingTargetName:String="trace";
/**
* Initialises logging from the application configuration.
*/
public static function initLogging(force:Boolean = false):void
{
logger.fatal(message);
}
public static function warn(message:String):void
{
logger.warn(message);
}
public static function traceObject(obj : *, level : int = 0):void
{
var tabs : String = "";
for ( var i : int = 0 ; i < level ; ++i ) {
tabs += " "
var logTarget:IFormattingLogTarget;
if (force)
{
logTarget=new TraceTarget();
}
for ( var prop : String in obj ){
debug( tabs + "[" + prop + "] -> " + obj[ prop ] );
traceObject( obj[ prop ], level + 1 );
else
{
var lxml:XML=BBB.initConfigManager().config.logging;
if (lxml.@enabled != undefined)
{
loggingEnabled=(lxml.@enabled.toString().toUpperCase() == "TRUE") ? true : false;
}
if (lxml.@target != undefined)
{
loggingTargetName=lxml.@target.toString().toLowerCase();
}
if (loggingEnabled)
{
switch (loggingTargetName)
{
case TRACE:
logTarget=new TraceTarget();
break;
case LOG_WINDOW:
logTarget=new LogWindowTarget();
break;
case JSNLOG:
logTarget=new JSNLogTarget();
break;
default:
// no logging target set
break;
}
}
}
if (logTarget)
{
logTarget.format=DEFAULT_FORMAT;
LOGGER_FACTORY.setup=new SimpleTargetSetup(logTarget);
}
else
{
disableLogging();
}
}
private static function get logger():ILogger {
return Log.getLogger(LOGGER);
/**
* Disables logging across the applicatio.
*/
public static function disableLogging():void
{
LOGGER_FACTORY.setup=null;
}
}
}
}

View File

@ -18,8 +18,13 @@
*/
package org.bigbluebutton.common
{
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
public class Role
{
private static const LOGGER:ILogger = getClassLogger(Role);
public static const VIEWER:String = "VIEWER";
public static const PRESENTER:String = "PRESENTER";
public static const MODERATOR:String = "MODERATOR";
@ -43,7 +48,7 @@ package org.bigbluebutton.common
Role.userrole = PRESENTER;
Role.isPresenter = true;
}
else LogUtil.error("TRYING TO SET INVALID USER ROLE:" + role);
LOGGER.error("TRYING TO SET INVALID USER ROLE: {0}", [role]);
}
/**

View File

@ -20,12 +20,16 @@ package org.bigbluebutton.core
{
import flash.events.EventDispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
public class EventBroadcaster extends EventDispatcher {
private static var _instance:EventBroadcaster = new EventBroadcaster();
private static const LOGGER:ILogger = getClassLogger(EventBroadcaster);
private static var _instance:EventBroadcaster = new EventBroadcaster();
public function EventBroadcaster() {
if (_instance != null) {
trace ("Error: an instance of EventBroadcaster() already exists.");
LOGGER.error("Error: an instance of EventBroadcaster() already exists.");
}
}

View File

@ -20,7 +20,8 @@ package org.bigbluebutton.core
{
import mx.collections.ArrayCollection;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.vo.CameraSettingsVO;
import org.bigbluebutton.main.model.users.BBBUser;
@ -28,6 +29,8 @@ package org.bigbluebutton.core
public class UsersUtil
{
private static const LOGGER:ILogger = getClassLogger(UsersUtil);
public static function isUserLeaving(userID:String):Boolean {
var user:BBBUser = getUser(userID);
if (user != null) {
@ -152,21 +155,20 @@ package org.bigbluebutton.core
public static function internalUserIDToExternalUserID(userID:String):String {
var user:BBBUser = UserManager.getInstance().getConference().getUser(userID);
if (user != null) {
LogUtil.debug("Found externUserID [" + user.externUserID + "] for userID [" + userID + "]");
LOGGER.debug("Found externUserID [{0}] for userID [{1}]", [user.externUserID, userID]);
return user.externUserID;
}
LogUtil.warn("Could not find externUserID for userID [" + userID + "]");
trace("Could not find externUserID for userID [" + userID + "]");
LOGGER.warn("Could not find externUserID for userID [{0}]", [userID]);
return "";
}
public static function externalUserIDToInternalUserID(externUserID:String):String {
var user:BBBUser = UserManager.getInstance().getConference().getUserWithExternUserID(externUserID);
if (user != null) {
LogUtil.debug("Found userID [" + user.userID + "] for externUserID [" + externUserID + "]");
LOGGER.debug("Found userID [{0}] for externUserID [{1}]", [user.userID, externUserID]);
return user.userID;
}
LogUtil.warn("Could not find userID for externUserID [" + externUserID + "]");
LOGGER.warn("Could not find userID for externUserID [{0}]", [externUserID]);
return null;
}

View File

@ -24,20 +24,20 @@ package org.bigbluebutton.core.managers
import flash.events.EventDispatcher;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import mx.core.FlexGlobals;
import mx.utils.URLUtil;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.EventBroadcaster;
import org.bigbluebutton.core.model.Config;
import org.bigbluebutton.main.events.MeetingNotFoundEvent;
public class ConfigManager2 extends EventDispatcher {
private static const LOG:String = "Main::ConfigManager2 - ";
private static const LOGGER:ILogger = getClassLogger(ConfigManager2);
public static const CONFIG_XML:String = "bigbluebutton/api/configXML";
public static const CONFIG_XML:String = "bigbluebutton/api/configXML";
private var _config:Config = null;
@ -46,7 +46,7 @@ package org.bigbluebutton.core.managers
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
var date:Date = new Date();
var localeReqURL:String = buildRequestURL() + "?a=" + date.time;
trace(LOG + "::loadConfig [" + localeReqURL + "]");
LOGGER.debug("::loadConfig [{0}]", [localeReqURL]);
urlLoader.load(new URLRequest(localeReqURL));
}
@ -58,17 +58,17 @@ package org.bigbluebutton.core.managers
}
private function handleComplete(e:Event):void{
trace(LOG + "handleComplete [" + new XML(e.target.data) + "]");
LOGGER.debug("handleComplete [{0}]", [new XML(e.target.data)]);
var xml:XML = new XML(e.target.data)
if (xml.returncode == "FAILED") {
trace(LOG + "Getting configXML failed [" + xml + "]");
LOGGER.debug("Getting configXML failed [{0}]", [xml]);
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new MeetingNotFoundEvent(xml.response.logoutURL));
} else {
trace(LOG + "Getting configXML passed [" + xml + "]");
LOGGER.debug("Getting configXML passed [{0}]", [xml]);
_config = new Config(new XML(e.target.data));
EventBroadcaster.getInstance().dispatchEvent(new Event("configLoadedEvent", true));
}

View File

@ -0,0 +1,199 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2015 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.managers
{
import com.asfusion.mate.events.Dispatcher;
import flash.display.DisplayObject;
import flash.events.TimerEvent;
import flash.utils.Dictionary;
import flash.utils.Timer;
import mx.collections.ArrayCollection;
import mx.core.FlexGlobals;
import mx.core.IFlexDisplayObject;
import mx.managers.PopUpManager;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ClientStatusEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.model.users.AutoReconnect;
import org.bigbluebutton.main.views.ReconnectionPopup;
import org.bigbluebutton.util.i18n.ResourceUtil;
public class ReconnectionManager
{
private static const LOGGER:ILogger = getClassLogger(AutoReconnect);
public static const BIGBLUEBUTTON_CONNECTION:String = "BIGBLUEBUTTON_CONNECTION";
public static const SIP_CONNECTION:String = "SIP_CONNECTION";
public static const VIDEO_CONNECTION:String = "VIDEO_CONNECTION";
public static const DESKSHARE_CONNECTION:String = "DESKSHARE_CONNECTION";
private var _connections:Dictionary = new Dictionary();
private var _reestablished:ArrayCollection = new ArrayCollection();
private var _reconnectTimer:Timer = new Timer(10000, 1);
private var _reconnectTimeout:Timer = new Timer(5000, 1);
private var _dispatcher:Dispatcher = new Dispatcher();
private var _popup:IFlexDisplayObject = null;
private var _canceled:Boolean = false;
public function ReconnectionManager() {
_reconnectTimer.addEventListener(TimerEvent.TIMER_COMPLETE, reconnect);
_reconnectTimeout.addEventListener(TimerEvent.TIMER_COMPLETE, timeout);
}
private function reconnect(e:TimerEvent = null):void {
if (_connections.hasOwnProperty(BIGBLUEBUTTON_CONNECTION)) {
reconnectHelper(BIGBLUEBUTTON_CONNECTION);
} else {
for (var type:String in _connections) {
reconnectHelper(type);
}
}
if (!_reconnectTimeout.running)
_reconnectTimeout.start();
}
private function timeout(e:TimerEvent = null):void {
LOGGER.debug("timeout");
_dispatcher.dispatchEvent(new BBBEvent(BBBEvent.CANCEL_RECONNECTION_EVENT));
_dispatcher.dispatchEvent(new LogoutEvent(LogoutEvent.USER_LOGGED_OUT));
}
private function reconnectHelper(type:String):void {
var obj:Object = _connections[type];
obj.reconnect = new AutoReconnect();
obj.reconnect.onDisconnect(obj.callback, obj.callbackParameters);
}
public function onDisconnected(type:String, callback:Function, parameters:Array):void {
if (!_canceled) {
LOGGER.warn("onDisconnected, type={0}, parameters={1}" + [type, parameters.toString()]);
var obj:Object = new Object();
obj.callback = callback;
obj.callbackParameters = parameters;
_connections[type] = obj;
if (!_reconnectTimer.running) {
_popup = PopUpManager.createPopUp(FlexGlobals.topLevelApplication as DisplayObject, ReconnectionPopup, true);
PopUpManager.centerPopUp(_popup);
_reconnectTimer.reset();
_reconnectTimer.start();
}
}
}
public function onConnectionAttemptFailed(type:String):void {
LOGGER.warn("onConnectionAttemptFailed, type={0}", [type]);
if (_connections.hasOwnProperty(type)) {
_connections[type].reconnect.onConnectionAttemptFailed();
}
}
private function get connectionDictEmpty():Boolean {
for (var key:Object in _connections) {
return false;
}
return true;
}
private function dispatchReconnectionSucceededEvent(type:String):void {
var map:Object = {
BIGBLUEBUTTON_CONNECTION: BBBEvent.RECONNECT_BIGBLUEBUTTON_SUCCEEDED_EVENT,
SIP_CONNECTION: BBBEvent.RECONNECT_SIP_SUCCEEDED_EVENT,
VIDEO_CONNECTION: BBBEvent.RECONNECT_VIDEO_SUCCEEDED_EVENT,
DESKSHARE_CONNECTION: BBBEvent.RECONNECT_DESKSHARE_SUCCEEDED_EVENT
};
if (map.hasOwnProperty(type)) {
LOGGER.debug("dispatchReconnectionSucceededEvent, type={0}", [type]);
_dispatcher.dispatchEvent(new BBBEvent(map[type]));
} else {
LOGGER.debug("dispatchReconnectionSucceededEvent, couldn't find a map value for type {0}", [type]);
}
}
public function onConnectionAttemptSucceeded(type:String):void {
LOGGER.debug("onConnectionAttemptSucceeded, type={0}", [type]);
dispatchReconnectionSucceededEvent(type);
delete _connections[type];
if (type == BIGBLUEBUTTON_CONNECTION) {
reconnect();
}
_reestablished.addItem(type);
if (connectionDictEmpty) {
var msg:String = connectionReestablishedMessage();
_dispatcher.dispatchEvent(new ClientStatusEvent(ClientStatusEvent.SUCCESS_MESSAGE_EVENT,
ResourceUtil.getInstance().getString('bbb.connection.reestablished'),
msg));
_reconnectTimeout.reset();
removePopUp();
}
}
public function onCancelReconnection():void {
_canceled = true;
for (var type:Object in _connections) delete _connections[type];
removePopUp();
}
private function removePopUp():void {
if (_popup != null) {
PopUpManager.removePopUp(_popup);
_popup = null;
}
}
private function connectionReestablishedMessage():String {
var msg:String = "";
for each (var conn:String in _reestablished) {
switch (conn) {
case BIGBLUEBUTTON_CONNECTION:
msg += ResourceUtil.getInstance().getString('bbb.connection.bigbluebutton');
break;
case SIP_CONNECTION:
msg += ResourceUtil.getInstance().getString('bbb.connection.sip');
break;
case VIDEO_CONNECTION:
msg += ResourceUtil.getInstance().getString('bbb.connection.video');
break;
case DESKSHARE_CONNECTION:
msg += ResourceUtil.getInstance().getString('bbb.connection.deskshare');
break;
default:
break;
}
msg += " ";
}
_reestablished.removeAll();
return msg;
}
}
}

View File

@ -18,8 +18,6 @@
*/
package org.bigbluebutton.core.managers
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.net.URLLoader;
@ -28,12 +26,13 @@ package org.bigbluebutton.core.managers
import mx.core.FlexGlobals;
import mx.utils.URLUtil;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.EventBroadcaster;
import org.bigbluebutton.core.model.VideoProfile;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.model.VideoProfile;
public class VideoProfileManager extends EventDispatcher {
private static const LOGGER:ILogger = getClassLogger(VideoProfileManager);
public static const PROFILES_XML:String = "client/conf/profiles.xml";
public static const DEFAULT_FALLBACK_LOCALE:String = "en_US";
private var _profiles:Array = new Array();
@ -43,7 +42,7 @@ package org.bigbluebutton.core.managers
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
var date:Date = new Date();
var localeReqURL:String = buildRequestURL() + "?a=" + date.time;
trace("VideoProfileManager::loadProfiles [" + localeReqURL + "]");
LOGGER.debug("VideoProfileManager::loadProfiles [{0}]", [localeReqURL]);
urlLoader.load(new URLRequest(localeReqURL));
}
@ -55,7 +54,7 @@ package org.bigbluebutton.core.managers
}
private function handleComplete(e:Event):void{
trace("VideoProfileManager::handleComplete [" + new XML(e.target.data) + "]");
LOGGER.debug("VideoProfileManager::handleComplete [{0}]", [new XML(e.target.data)]);
// first clear the array
_profiles.splice(0);

View File

@ -18,8 +18,6 @@
*/
package org.bigbluebutton.core.model
{
import org.bigbluebutton.common.LogUtil;
public class Config
{
private var config:XML = null;
@ -88,13 +86,17 @@ package org.bigbluebutton.core.model
return new XML(config.browserVersions.toXMLString());
}
public function get layout():XML {
return new XML(config.layout.toXMLString());
}
public function get layout():XML {
return new XML(config.layout.toXMLString());
}
public function get meeting():XML {
return new XML(config.meeting.toXMLString());
}
public function get logging():XML {
return new XML(config.logging.toXMLString());
}
public function get lock():XML {
if(config.lock == null) return null;

View File

@ -18,13 +18,17 @@
*/
package org.bigbluebutton.core.model
{
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.util.i18n.ResourceUtil;
import flash.utils.Dictionary;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.util.i18n.ResourceUtil;
public class VideoProfile
{
private var _fallbackLanguage:String;
private static const LOGGER:ILogger = getClassLogger(VideoProfile);
private var _fallbackLanguage:String;
private static var _nextId:int = -1;
private var _id:String;
@ -85,8 +89,8 @@ package org.bigbluebutton.core.model
_h264Profile = vxml.h264Profile.toString();
}
trace("This is a new video profile");
trace(this.toString());
LOGGER.debug("This is a new video profile");
LOGGER.debug(this.toString());
}
public function toString():String {

View File

@ -24,16 +24,16 @@ package org.bigbluebutton.core.services
import flash.net.NetConnection;
import flash.utils.Timer;
import mx.utils.ObjectUtil;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.model.NetworkStatsData;
import org.red5.flash.bwcheck.ClientServerBandwidth;
import org.red5.flash.bwcheck.ServerClientBandwidth;
import org.red5.flash.bwcheck.events.BandwidthDetectEvent;
public class BandwidthMonitor {
private static const LOGGER:ILogger = getClassLogger(BandwidthMonitor);
private var _serverURL:String = "localhost";
private var _serverApplication:String = "video";
private var _clientServerService:String = "checkBandwidthUp";
@ -70,7 +70,7 @@ package org.bigbluebutton.core.services
private function onAsyncError(event:AsyncErrorEvent):void
{
LogUtil.debug(event.error.toString());
LOGGER.debug(event.error.toString());
}
private function onStatus(event:NetStatusEvent):void
@ -78,24 +78,24 @@ package org.bigbluebutton.core.services
switch (event.info.code)
{
case "NetConnection.Connect.Success":
LogUtil.debug("Starting to monitor bandwidth between client and server");
LOGGER.debug("Starting to monitor bandwidth between client and server");
// monitor();
break;
default:
LogUtil.debug("Cannot establish the connection to measure bandwidth");
LOGGER.debug("Cannot establish the connection to measure bandwidth");
break;
}
}
private function monitor():void {
LogUtil.debug("Starting to monitor bandwidth");
LOGGER.debug("Starting to monitor bandwidth");
bwTestTimer = new Timer(30000);
bwTestTimer.addEventListener(TimerEvent.TIMER, rtmptRetryTimerHandler);
bwTestTimer.start();
}
private function rtmptRetryTimerHandler(event:TimerEvent):void {
LogUtil.debug("Starting to detect bandwidth from server to client");
LOGGER.debug("Starting to detect bandwidth from server to client");
ServerClient();
}
@ -125,7 +125,7 @@ package org.bigbluebutton.core.services
public function onDetectFailed(event:BandwidthDetectEvent):void
{
LogUtil.debug("Detection failed with error: " + event.info.application + " " + event.info.description);
LOGGER.debug("Detection failed with error: {0} {1}", [event.info.application, event.info.description]);
}
public function onClientServerComplete(event:BandwidthDetectEvent):void

View File

@ -20,20 +20,19 @@ package org.bigbluebutton.core.services
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.NetDataEvent;
import flash.events.NetMonitorEvent;
import flash.events.NetStatusEvent;
import flash.events.NetDataEvent;
import flash.events.NetMonitorEvent;
import flash.events.NetStatusEvent;
import flash.events.StatusEvent;
import flash.events.TimerEvent;
import flash.net.NetMonitor;
import flash.net.NetStream;
import flash.utils.Dictionary;
import flash.net.NetMonitor;
import flash.net.NetStream;
import flash.utils.Dictionary;
import flash.utils.Timer;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.events.NetworkStatsEvent;
import flash.utils.describeType;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.model.NetworkStatsData;
public class StreamMonitor
@ -53,6 +52,8 @@ package org.bigbluebutton.core.services
* http://osflash.org/pipermail/red5_osflash.org/2009-January/028906.html
*/
private static const LOGGER:ILogger = getClassLogger(StreamMonitor);
private var _netmon:NetMonitor;
private var _heartbeat:Timer = new Timer( 2000 );
private var _globalDispatcher:Dispatcher = new Dispatcher();
@ -219,13 +220,12 @@ package org.bigbluebutton.core.services
static public function printDictionary(dict:Dictionary):void {
for (var key:Object in dict) {
LogUtil.debug(key + ": " + dict[key]);
LOGGER.debug(key + ": " + dict[key]);
}
}
private function log(s:String):void {
//LogUtil.debug("[StreamMonitor] " + s);
trace("[StreamMonitor] " + s);
LOGGER.debug(s);
}
}
}

View File

@ -1,14 +1,16 @@
package org.bigbluebutton.core.services
{
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.vo.UserVO;
import org.bigbluebutton.core.vo.VoiceUserVO;
public class UsersMessageProcessor
{
private static const LOG:String = "Users::UsersMessageProcessor - ";
private static const LOGGER:ILogger = getClassLogger(UsersMessageProcessor);
public function processUserJoinedVoiceMessage(voiceUser:Object):VoiceUserVO {
trace(LOG + "*** processUserJoinedVoiceMessage **** \n");
LOGGER.debug("*** processUserJoinedVoiceMessage **** \n");
if (voiceUser != null) {
return processVoiceUser(voiceUser);
}
@ -17,7 +19,7 @@ package org.bigbluebutton.core.services
}
public function processUserLeftVoiceMessage(voiceUser:Object):VoiceUserVO {
trace(LOG + "*** processUserLeftVoiceMessage **** \n");
LOGGER.debug("*** processUserLeftVoiceMessage **** \n");
if (voiceUser != null) {
return processVoiceUser(voiceUser);
}

View File

@ -1,12 +1,14 @@
package org.bigbluebutton.core.services
{
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.model.users.UsersModel;
import org.bigbluebutton.core.vo.UserVO;
import org.bigbluebutton.core.vo.VoiceUserVO;
public class UsersService
{
private static const LOG:String = "Users::UsersService - ";
private static const LOGGER:ILogger = getClassLogger(UsersService);
private static var instance:UsersService = null;
@ -30,13 +32,13 @@ package org.bigbluebutton.core.services
var vu: VoiceUserVO = msgProc.processUserJoinedVoiceMessage(user);
if (vu != null) {
trace(LOG + "*** got voice user joined. name=[" + vu.name + "] **** \n");
LOGGER.debug("*** got voice user joined. name=[{0}] **** \n", [vu.name]);
var u: UserVO = UsersModel.getInstance().userJoinedVoice(vu);
if (u != null) {
// dispatch event
}
} else {
trace(LOG + "*** failed to get voice user name=[" + vu.name + "] **** \n");
LOGGER.debug("*** failed to get voice user name=[{0}] **** \n", [vu.name]);
}
}
@ -44,13 +46,13 @@ package org.bigbluebutton.core.services
var vu: VoiceUserVO = msgProc.processUserLeftVoiceMessage(user);
if (vu != null) {
trace(LOG + "*** got voice user left. name=[" + vu.name + "] **** \n");
LOGGER.debug("*** got voice user left. name=[{0}] **** \n", [vu.name]);
var u: UserVO = UsersModel.getInstance().userLeftVoice(vu);
if (u != null) {
// dispatch event
}
} else {
trace(LOG + "*** failed to get voice user name=[" + vu.name + "] **** \n");
LOGGER.debug("*** failed to get voice user name=[{0}] **** \n", [vu.name]);
}
}
@ -58,13 +60,13 @@ package org.bigbluebutton.core.services
var vu: UserVO = msgProc.processUserJoinedMessage(user);
if (vu != null) {
trace(LOG + "*** got user joined. name=[" + vu.name + "] **** \n");
LOGGER.debug("*** got user joined. name=[{0}] **** \n", [vu.name]);
var u: UserVO = UsersModel.getInstance().userJoined(vu);
if (u != null) {
// dispatch event
}
} else {
trace(LOG + "*** failed to get voice user name=[" + vu.name + "] **** \n");
LOGGER.debug("*** failed to get user name=[{0}] **** \n", [vu.name]);
}
}
@ -72,13 +74,13 @@ package org.bigbluebutton.core.services
var vu:UserVO = msgProc.processUserLeftMessage(user);
if (vu != null) {
trace(LOG + "*** got user left. name=[" + vu.name + "] **** \n");
LOGGER.debug("*** got user left. name=[{0}] **** \n", [vu.name]);
var u: UserVO = UsersModel.getInstance().userLeft(vu);
if (u != null) {
// dispatch event
}
} else {
trace(LOG + "*** failed to get voice user name=[" + vu.name + "] **** \n");
LOGGER.debug("*** failed to get voice user name=[{0}] **** \n", [vu.name]);
}
}
@ -86,13 +88,13 @@ package org.bigbluebutton.core.services
var vu: Object = msgProc.processUserMutedMessage(msg);
if (vu != null) {
trace(LOG + "*** got user name=[" + vu.userId + "] **** \n");
LOGGER.debug("*** got user name=[{0}] **** \n", [vu.userId]);
var u: UserVO = UsersModel.getInstance().userMuted(vu.userId, vu.voiceId, vu.muted);
if (u != null) {
// dispatch event
}
} else {
trace(LOG + "*** failed to get voice user name=[" + vu.userId + "] **** \n");
LOGGER.debug("*** failed to get voice user name=[{0}] **** \n", [vu.userId]);
}
}
@ -100,17 +102,17 @@ package org.bigbluebutton.core.services
var vu: Object = msgProc.processUserTalkingMessage(msg);
if (vu != null) {
trace(LOG + "*** got user name=[" + vu.userId + "] **** \n");
LOGGER.debug("*** got user name=[{0}] **** \n", [vu.userId]);
var u: UserVO = UsersModel.getInstance().userTalking(vu.userId, vu.voiceId, vu.talking);
if (u != null) {
// dispatch event
}
} else {
trace(LOG + "*** failed to get voice user name=[" + vu.userId + "] **** \n");
LOGGER.debug("*** failed to get voice user name=[{0}] **** \n", [vu.userId]);
}
}
}
}
class UsersServiceSingletonEnforcer{}
class UsersServiceSingletonEnforcer{}

View File

@ -22,7 +22,8 @@ package org.bigbluebutton.main.api
import flash.external.ExternalInterface;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.AmIPresenterQueryEvent;
@ -38,10 +39,7 @@ package org.bigbluebutton.main.api
import org.bigbluebutton.main.model.users.events.RaiseHandEvent;
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
import org.bigbluebutton.modules.deskshare.events.DeskshareAppletLaunchedEvent;
import org.bigbluebutton.modules.deskshare.utils.JavaCheck;
import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent;
import org.bigbluebutton.modules.phone.events.FlashCallConnectedEvent;
import org.bigbluebutton.modules.phone.events.FlashCallDisconnectedEvent;
import org.bigbluebutton.modules.phone.events.WebRTCCallEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent;
import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent;
@ -53,7 +51,7 @@ package org.bigbluebutton.main.api
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
public class ExternalApiCallbacks {
private static const LOG:String = "ExternalApiCallbacks - ";
private static const LOGGER:ILogger = getClassLogger(ExternalApiCallbacks);
private var _dispatcher:Dispatcher;
public function ExternalApiCallbacks() {
@ -136,12 +134,12 @@ package org.bigbluebutton.main.api
if (event.userID != null) {
_dispatcher.dispatchEvent(event);
} else {
LogUtil.warn("Cannot find user with external userID [" + userID + "] to query is sharing webcam or not.");
LOGGER.warn("Cannot find user with external userID [{0-}] to query is sharing webcam or not.", [userID]);
}
}
private function handleRaiseHandRequest(handRaised:Boolean):void {
trace(LOG + "Received raise hand request from JS API [" + handRaised + "]");
LOGGER.debug("Received raise hand request from JS API [{0}]", [handRaised]);
var e:RaiseHandEvent = new RaiseHandEvent(RaiseHandEvent.RAISE_HAND);
e.raised = handRaised;
_dispatcher.dispatchEvent(e);
@ -176,7 +174,7 @@ package org.bigbluebutton.main.api
}
private function handleGetMyUserInfoSynch():Object {
trace(LOG + " handleGetMyUserInfoSynch");
LOGGER.debug("handleGetMyUserInfoSynch");
var obj:Object = new Object();
obj.myUserID = UsersUtil.internalUserIDToExternalUserID(UsersUtil.getMyUserID());
obj.myUsername = UsersUtil.getMyUsername();
@ -225,7 +223,7 @@ package org.bigbluebutton.main.api
private function handleSwitchPresenterRequest(userID:String):void {
var intUserID:String = UsersUtil.externalUserIDToInternalUserID(userID);
trace("Switching presenter to [" + intUserID + "] [" + UsersUtil.getUserName(intUserID) + "]");
LOGGER.debug("Switching presenter to [{0}] [{1}]", [intUserID, UsersUtil.getUserName(intUserID)]);
var e:RoleChangeEvent = new RoleChangeEvent(RoleChangeEvent.ASSIGN_PRESENTER);
e.userid = intUserID;
@ -234,12 +232,12 @@ package org.bigbluebutton.main.api
}
private function handleGetMyUserID():String {
trace(LOG + " handleGetMyUserID");
LOGGER.debug("handleGetMyUserID");
return UsersUtil.internalUserIDToExternalUserID(UsersUtil.getMyUserID());
}
private function handleGetPresenterUserID():String {
trace(LOG + " handleGetPresenterUserID");
LOGGER.debug("handleGetPresenterUserID");
var presUserID:String = UsersUtil.getPresenterUserID();
if (presUserID != "") {
return UsersUtil.internalUserIDToExternalUserID(presUserID);
@ -278,7 +276,7 @@ package org.bigbluebutton.main.api
*
*/
private function handleSendPublicChatRequest(fontColor:String, localeLang:String, message:String):void {
trace("handleSendPublicChatRequest");
LOGGER.debug("handleSendPublicChatRequest");
var chatEvent:CoreEvent = new CoreEvent(EventConstants.SEND_PUBLIC_CHAT_REQ);
var payload:Object = new Object();
payload.fromColor = fontColor;
@ -370,12 +368,12 @@ package org.bigbluebutton.main.api
}
private function handleGetMyRoleRequestAsynch():void {
trace("handleGetMyRoleRequestAsynch");
LOGGER.debug("handleGetMyRoleRequestAsynch");
_dispatcher.dispatchEvent(new CoreEvent(EventConstants.GET_MY_ROLE_REQ));
}
private function handleJoinVoiceRequest():void {
trace("handleJoinVoiceRequest");
LOGGER.debug("handleJoinVoiceRequest");
_dispatcher.dispatchEvent(new AudioSelectionWindowEvent(AudioSelectionWindowEvent.SHOW_AUDIO_SELECTION));
}
@ -386,7 +384,7 @@ package org.bigbluebutton.main.api
}
private function onShareVideoCamera(publishInClient:Boolean=true):void {
trace("Sharing webcam: publishInClient = [" + publishInClient + "]");
LOGGER.debug("Sharing webcam: publishInClient = [{0}]", [publishInClient]);
var event:ShareCameraRequestEvent = new ShareCameraRequestEvent();
event.publishInClient = publishInClient;
@ -394,7 +392,7 @@ package org.bigbluebutton.main.api
}
private function handleWebRTCCallStarted(inEchoTest:Boolean):void {
trace(LOG + "handleWebRTCCallStarted: received, inEchoTest: " + inEchoTest);
LOGGER.debug("handleWebRTCCallStarted: received, inEchoTest: {0}", [inEchoTest]);
if (inEchoTest) {
_dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_STARTED));
} else {
@ -403,7 +401,7 @@ package org.bigbluebutton.main.api
}
private function handleWebRTCCallConnecting(inEchoTest:Boolean):void {
trace(LOG + "handleWebRTCCallConnecting: received, inEchoTest: " + inEchoTest);
LOGGER.debug("handleWebRTCCallConnecting: received, inEchoTest: {0}", [inEchoTest]);
if (inEchoTest) {
_dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_CONNECTING));
} else {
@ -412,7 +410,7 @@ package org.bigbluebutton.main.api
}
private function handleWebRTCCallEnded(inEchoTest:Boolean):void {
trace(LOG + "handleWebRTCCallEnded: received, inEchoTest: " + inEchoTest);
LOGGER.debug("handleWebRTCCallEnded: received, inEchoTest: {0}", [inEchoTest]);
if (inEchoTest) {
_dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_ENDED));
} else {
@ -421,7 +419,7 @@ package org.bigbluebutton.main.api
}
private function handleWebRTCCallFailed(inEchoTest:Boolean, errorCode:Number, cause:String):void {
trace(LOG + "handleWebRTCCallFailed: received, inEchoTest: " + inEchoTest + ", errorCode=[" + errorCode + "]");
LOGGER.debug("handleWebRTCCallFailed: received, inEchoTest: {0}, errorCode=[{1}]", [inEchoTest, errorCode]);
if (inEchoTest) {
_dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_FAILED, errorCode, cause));
} else {
@ -430,7 +428,7 @@ package org.bigbluebutton.main.api
}
private function handleWebRTCCallWaitingForICE(inEchoTest:Boolean):void {
trace(LOG + "handleWebRTCCallWaitingForICE: received, inEchoTest: " + inEchoTest);
LOGGER.debug("handleWebRTCCallWaitingForICE: received, inEchoTest: {0}", [inEchoTest]);
if (inEchoTest) {
_dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_WAITING_FOR_ICE));
} else {
@ -439,30 +437,30 @@ package org.bigbluebutton.main.api
}
private function handleWebRTCCallTransferring(inEchoTest:Boolean):void {
trace(LOG + "handleWebRTCCallTransferring: received, inEchoTest: " + inEchoTest);
LOGGER.debug("handleWebRTCCallTransferring: received, inEchoTest: " + inEchoTest);
if (inEchoTest) {
_dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_TRANSFERRING));
}
}
private function handleWebRTCMediaRequest():void {
trace(LOG + "handleWebRTCMediaRequest: received");
LOGGER.debug("handleWebRTCMediaRequest: received");
_dispatcher.dispatchEvent(new WebRTCMediaEvent(WebRTCMediaEvent.WEBRTC_MEDIA_REQUEST));
}
private function handleWebRTCMediaSuccess():void {
trace(LOG + "handleWebRTCMediaSuccess: received");
LOGGER.debug("handleWebRTCMediaSuccess: received");
_dispatcher.dispatchEvent(new WebRTCMediaEvent(WebRTCMediaEvent.WEBRTC_MEDIA_SUCCESS));
}
private function handleWebRTCMediaFail():void {
trace(LOG + "handleWebRTCMediaFail: received");
LOGGER.debug("handleWebRTCMediaFail: received");
_dispatcher.dispatchEvent(new WebRTCMediaEvent(WebRTCMediaEvent.WEBRTC_MEDIA_FAIL));
}
private function handleJavaAppletLaunched():void
{
trace(LOG + "handleJavaAppletLaunched: received");
LOGGER.debug("handleJavaAppletLaunched: received");
_dispatcher.dispatchEvent(new DeskshareAppletLaunchedEvent(DeskshareAppletLaunchedEvent.APPLET_LAUNCHED));
}
}

View File

@ -18,8 +18,10 @@
*/
package org.bigbluebutton.main.api
{
import flash.external.ExternalInterface;
import org.bigbluebutton.common.LogUtil;
import flash.external.ExternalInterface;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.UsersUtil;
@ -54,7 +56,7 @@ package org.bigbluebutton.main.api
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
public class ExternalApiCalls {
private static const LOG:String = "ExternalApiCalls - ";
private static const LOGGER:ILogger = getClassLogger(ExternalApiCalls);
public function handleOpenExternalUploadWindow(event:UploadEvent):void {
var payload:Object = new Object();
@ -65,7 +67,7 @@ package org.bigbluebutton.main.api
public function handleUserKickedOutEvent(event:LogoutEvent):void {
trace(LOG + " handleUserKickedOutEvent");
LOGGER.debug("handleUserKickedOutEvent");
var payload:Object = new Object();
payload.userID = UsersUtil.internalUserIDToExternalUserID(event.userID);
payload.eventName = EventConstants.USER_KICKED_OUT;
@ -73,7 +75,7 @@ package org.bigbluebutton.main.api
}
public function handleIsUserPublishingCamRequest(event:IsUserPublishingCamRequest):void {
trace(LOG + " handleIsUserPublishingCamRequest");
LOGGER.debug("handleIsUserPublishingCamRequest");
var payload:Object = new Object();
var isUserPublishing:Boolean = false;
@ -94,7 +96,7 @@ package org.bigbluebutton.main.api
}
public function handleGetMyUserInfoRequest(event:GetMyUserInfoRequestEvent):void {
trace(LOG + " handleGetMyUserInfoRequest");
LOGGER.debug("handleGetMyUserInfoRequest");
var payload:Object = new Object();
payload.eventName = EventConstants.GET_MY_USER_INFO_REP;
@ -119,7 +121,7 @@ package org.bigbluebutton.main.api
}
public function handleStreamStartedEvent(event:StreamStartedEvent):void {
trace(LOG + " handleStreamStartedEvent");
LOGGER.debug("handleStreamStartedEvent");
var vidConf:VideoConfOptions = new VideoConfOptions();
var payload:Object = new Object();
@ -185,7 +187,7 @@ package org.bigbluebutton.main.api
}
public function handleSwitchToNewRoleEvent(event:SwitchedPresenterEvent):void {
trace(LOG + "Got NEW ROLE EVENT presenter = [" + event.amIPresenter + "]");
LOGGER.debug("Got NEW ROLE EVENT presenter = [{0}]", [event.amIPresenter]);
var payload:Object = new Object();
payload.eventName = EventConstants.SWITCHED_PRESENTER;
payload.amIPresenter = event.amIPresenter;
@ -203,7 +205,7 @@ package org.bigbluebutton.main.api
}
public function handleStartPrivateChatEvent(event:CoreEvent):void {
trace(LOG + " handleStartPrivateChatEvent");
LOGGER.debug("handleStartPrivateChatEvent");
var payload:Object = new Object();
payload.eventName = EventConstants.START_PRIVATE_CHAT;
payload.chatWith = UsersUtil.internalUserIDToExternalUserID(event.message.chatWith);
@ -218,51 +220,51 @@ package org.bigbluebutton.main.api
}
public function handleUserJoinedVoiceEvent(event:BBBEvent):void {
trace(LOG + " handleUserJoinedVoiceEvent");
LOGGER.debug("handleUserJoinedVoiceEvent");
var payload:Object = new Object();
payload.eventName = EventConstants.USER_JOINED_VOICE;
payload.userID = UsersUtil.internalUserIDToExternalUserID(event.payload.userID);
trace(LOG + "Notifying external API that [" + UsersUtil.getUserName(event.payload.userID) + "] has joined the voice conference.");
LOGGER.debug("Notifying external API that [{0}] has joined the voice conference.", [UsersUtil.getUserName(event.payload.userID)]);
broadcastEvent(payload);
}
public function handleUserVoiceMutedEvent(event:BBBEvent):void {
trace(LOG + " handleUserVoiceMutedEvent");
LOGGER.debug("handleUserVoiceMutedEvent");
var payload:Object = new Object();
payload.eventName = EventConstants.USER_MUTED_VOICE;
payload.userID = UsersUtil.internalUserIDToExternalUserID(event.payload.userID);
payload.muted = event.payload.muted;
trace(LOG + "Notifying external API that [" + UsersUtil.getUserName(event.payload.userID) + "] is now muted=[" + payload.muted + "]");
LOGGER.debug("Notifying external API that [{0}] is now muted=[{1}]", [UsersUtil.getUserName(event.payload.userID), payload.muted]);
broadcastEvent(payload);
}
public function handleUserLockedEvent(event:BBBEvent):void {
trace(LOG + " handleUserLockedEvent");
LOGGER.debug("handleUserLockedEvent");
var payload:Object = new Object();
payload.eventName = EventConstants.USER_LOCKED;
payload.userID = UsersUtil.internalUserIDToExternalUserID(event.payload.userID);
payload.locked = event.payload.locked;
trace(LOG + "Notifying external API that [" + UsersUtil.getUserName(event.payload.userID) + "] is now locked=[" + payload.locked + "]");
LOGGER.debug("Notifying external API that [{0}] is now locked=[{1}]", [UsersUtil.getUserName(event.payload.userID), payload.locked]);
broadcastEvent(payload);
}
public function handleUserVoiceLeftEvent(event:BBBEvent):void {
trace(LOG + " handleUserVoiceLeftEvent");
LOGGER.debug("handleUserVoiceLeftEvent");
var payload:Object = new Object();
payload.eventName = EventConstants.USER_LEFT_VOICE;
payload.userID = UsersUtil.internalUserIDToExternalUserID(event.payload.userID);
trace(LOG + "Notifying external API that [" + UsersUtil.getUserName(event.payload.userID) + "] has left the voice conference.");
LOGGER.debug("Notifying external API that [{0}] has left the voice conference.", [UsersUtil.getUserName(event.payload.userID)]);
broadcastEvent(payload);
}
public function handleNewPublicChatEvent(event:CoreEvent):void {
trace(LOG + " handleNewPublicChatEvent");
LOGGER.debug("handleNewPublicChatEvent");
var payload:Object = new Object();
payload.eventName = EventConstants.NEW_PUBLIC_CHAT;
payload.chatType = event.message.chatType;
@ -281,7 +283,7 @@ package org.bigbluebutton.main.api
}
public function handleNewPrivateChatEvent(event:CoreEvent):void {
trace(LOG + " handleNewPrivateChatEvent");
LOGGER.debug("handleNewPrivateChatEvent");
var payload:Object = new Object();
payload.eventName = EventConstants.NEW_PRIVATE_CHAT;
payload.chatType = event.message.chatType;
@ -302,12 +304,12 @@ package org.bigbluebutton.main.api
}
public function handleUserJoinedEvent(event:UserJoinedEvent):void {
trace(LOG + " handleUserJoinedEvent");
LOGGER.debug("handleUserJoinedEvent");
var payload:Object = new Object();
var user:BBBUser = UserManager.getInstance().getConference().getUser(event.userID);
if (user == null) {
LogUtil.warn("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [" + event.userID + "]");
LOGGER.warn("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [{0}]", [event.userID]);
return;
}
@ -319,21 +321,20 @@ package org.bigbluebutton.main.api
}
public function handleUserLeftEvent(event:UserLeftEvent):void {
trace(LOG + "Got notification that user [" + event.userID + "] has left the meeting");
LOGGER.debug("Got notification that user [{0}] has left the meeting", [event.userID]);
var payload:Object = new Object();
var user:BBBUser = UserManager.getInstance().getConference().getUser(event.userID);
if (user == null) {
trace("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [" + event.userID + "]");
LogUtil.warn("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [" + event.userID + "]");
LOGGER.warn("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [{0}]", [event.userID]);
return;
}
payload.eventName = EventConstants.USER_LEFT;
payload.userID = UsersUtil.internalUserIDToExternalUserID(user.userID);
trace("Notifying JS API that user [" + payload.userID + "] has left the meeting");
LOGGER.debug("Notifying JS API that user [{0}] has left the meeting", [payload.userID]);
broadcastEvent(payload);
}

View File

@ -1,9 +1,12 @@
package org.bigbluebutton.main.api
{
import flash.external.ExternalInterface;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
public class JSAPI {
private static const LOG:String = "JSAPI - ";
private static const LOGGER:ILogger = getClassLogger(JSAPI);
private static var instance:JSAPI = null;

View File

View File

View File

@ -43,6 +43,17 @@ package org.bigbluebutton.main.events {
public static const JOIN_VOICE_FOCUS_HEAD:String = "JOIN_VOICE_FOCUS_HEAD";
public static const CHANGE_RECORDING_STATUS:String = "CHANGE_RECORDING_STATUS";
public static const RECONNECT_DISCONNECTED_EVENT:String = "RECONNECT_ON_DISCONNECTED_EVENT";
public static const RECONNECT_CONNECTION_ATTEMPT_FAILED_EVENT:String = "RECONNECT_CONNECTION_ATTEMPT_FAILED_EVENT";
public static const RECONNECT_CONNECTION_ATTEMPT_SUCCEEDED_EVENT:String = "RECONNECT_CONNECTION_ATTEMPT_SUCCEEDED_EVENT";
public static const RECONNECT_BIGBLUEBUTTON_SUCCEEDED_EVENT:String = "RECONNECT_BIGBLUEBUTTON_SUCCEEDED_EVENT";
public static const RECONNECT_VIDEO_SUCCEEDED_EVENT:String = "RECONNECT_VIDEO_SUCCEEDED_EVENT";
public static const RECONNECT_SIP_SUCCEEDED_EVENT:String = "RECONNECT_SIP_SUCCEEDED_EVENT";
public static const RECONNECT_DESKSHARE_SUCCEEDED_EVENT:String = "RECONNECT_DESKSHARE_SUCCEEDED_EVENT";
public static const CANCEL_RECONNECTION_EVENT:String = "CANCEL_RECONNECTION_EVENT";
public var message:String;
public var payload:Object = new Object();
@ -51,4 +62,4 @@ package org.bigbluebutton.main.events {
this.message = message;
}
}
}
}

View File

@ -30,6 +30,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
-->
<ObjectBuilder generator="{ModulesProxy}" cache="global" />
<ObjectBuilder generator="{ConfigManager}" cache="global" />
<ObjectBuilder generator="{ReconnectionManager}" cache="global" />
<!--
Disabling temporarily the stream monitor
-->
@ -69,6 +70,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{ModulesProxy}" method="startAllModules" />
</EventHandlers>
<EventHandlers type="{BBBEvent.RECONNECT_DISCONNECTED_EVENT}">
<MethodInvoker generator="{ReconnectionManager}" method="onDisconnected" arguments="{[event.payload.type, event.payload.callback, event.payload.callbackParameters]}"/>
</EventHandlers>
<EventHandlers type="{BBBEvent.RECONNECT_CONNECTION_ATTEMPT_FAILED_EVENT}">
<MethodInvoker generator="{ReconnectionManager}" method="onConnectionAttemptFailed" arguments="{event.payload.type}"/>
</EventHandlers>
<EventHandlers type="{BBBEvent.RECONNECT_CONNECTION_ATTEMPT_SUCCEEDED_EVENT}">
<MethodInvoker generator="{ReconnectionManager}" method="onConnectionAttemptSucceeded" arguments="{event.payload.type}"/>
</EventHandlers>
<EventHandlers type="{BBBEvent.CANCEL_RECONNECTION_EVENT}">
<MethodInvoker generator="{ReconnectionManager}" method="onCancelReconnection" />
</EventHandlers>
<mx:Script>
@ -76,15 +93,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.events.FlexEvent;
import org.bigbluebutton.core.managers.ConfigManager;
import org.bigbluebutton.core.managers.ReconnectionManager;
import org.bigbluebutton.core.services.SkinningService;
import org.bigbluebutton.core.services.StreamMonitor;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.model.PortTestProxy;
import org.bigbluebutton.main.model.modules.ModulesProxy;
]]>

View File

@ -23,19 +23,19 @@ package org.bigbluebutton.main.model
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.system.ApplicationDomain;
import flash.utils.Dictionary;
import mx.core.Application;
import mx.core.FlexGlobals;
import mx.managers.BrowserManager;
import mx.utils.URLUtil;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.model.modules.ModuleDescriptor;
public class ConfigParameters {
public static const CONFIG_XML:String = "bigbluebutton/api/configXML";
private static const LOGGER:ILogger = getClassLogger(ConfigParameters);
public static const CONFIG_XML:String = "bigbluebutton/api/configXML";
private var _urlLoader:URLLoader;
@ -69,7 +69,7 @@ package org.bigbluebutton.main.model
var date:Date = new Date();
var localeReqURL:String = buildRequestURL() + "?a=" + date.time;
trace("ConfigParameters:: [" + localeReqURL + "]");
LOGGER.debug("ConfigParameters:: [{0}]", [localeReqURL]);
_urlLoader.load(new URLRequest(localeReqURL));
}
@ -87,7 +87,7 @@ package org.bigbluebutton.main.model
}
private function parse(xml:XML):void{
trace("ConfigParameters:: parse [" + xml + "]");
LOGGER.debug("ConfigParameters:: parse [{0}]", [xml]);
rawXML = xml;
portTestHost = xml.porttest.@host;

View File

@ -19,11 +19,6 @@
package org.bigbluebutton.main.model
{
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.events.NetworkStatsEvent;
import flash.events.EventDispatcher;
public class NetworkStatsData extends EventDispatcher

View File

@ -1,3 +1,3 @@
/** * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ * * Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later * version. * * BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>. * */ package org.bigbluebutton.main.model { import flash.events.NetStatusEvent; import flash.net.NetConnection; import flash.net.ObjectEncoding; import flash.utils.Timer; import flash.events.TimerEvent; [Bindable] /** * Test RTMP port. * * @author Thijs Triemstra ( info@collab.nl ) */ public class PortTest net.NetConnection; import flash.utils.Timer; /** * Protocol name. */ private var protocol : String; /** * Protocol name (uppercase). */ public var protocolName : String; /** * RTMP hostname. */ private var hostname : String; /** * RTMP port. */ public var port : String; /** * RTMP port. */ public var portName : String = "Default"; /** * RTMP application. */ private var application : String; /** * Base RTMP URI. */ private var baseURI : String; /** * RTMP connection. */ public var nc : NetConnection; /** * Connection status. */ public var status : String; private var _connectionListener:Function; /** * Timer to control timeout of connection test */ private var testTimeout:Number = 0; /** * Timer to control timeout of connection test */ private var connectionTimer:Timer; /** * Set default encoding to AMF0 so FMS also understands. */ NetConnection.defaultObjectEncoding = ObjectEncoding.AMF0; /** * Create new port test and connect to the RTMP server. * * @param protocol * @param hostname * @param port * @param application * @testTimeout timeout of test in milliseconds */ public function PortTest( protocol : String = "", hostname : String = "", port : String = "", application : String = "", testTimeout : Number = 10000 ) { this.protocol = protocol; this.protocolName = protocol.toUpperCase(); this.hostname = hostname; this.application = application; this.testTimeout = testTimeout; if ( port.length > 0 ) { this.portName = port; this.port = ":" + port; } else { this.port = port; } // Construct URI. this.baseURI = this.protocol + "://" + this.hostname + this.port + "/" + this.application; // } /** * Start connection. */ public function connect() : void { this.nc = new NetConnection(); this.nc.client = this;
/** * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ * * Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later * version. * * BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>. * */ package org.bigbluebutton.main.model { import flash.events.NetStatusEvent; import flash.net.NetConnection; import flash.events.TimerEvent; import flash.net.NetConnection; import flash.net.ObjectEncoding; import flash.utils.Timer; import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; [Bindable] /** * Test RTMP port. * * @author Thijs Triemstra ( info@collab.nl ) */ public class PortTest net.NetConnection; * Test RTMP port. private static const LOGGER:ILogger = getClassLogger(PortTest); /** * Protocol name. */ private var protocol : String; /** * Protocol name (uppercase). */ public var protocolName : String; /** * RTMP hostname. */ private var hostname : String; /** * RTMP port. */ public var port : String; /** * RTMP port. */ public var portName : String = "Default"; /** * RTMP application. */ private var application : String; /** * Base RTMP URI. */ private var baseURI : String; /** * RTMP connection. */ public var nc : NetConnection; /** * Connection status. */ public var status : String; private var _connectionListener:Function; /** * Timer to control timeout of connection test */ private var testTimeout:Number = 0; /** * Timer to control timeout of connection test */ private var connectionTimer:Timer; /** * Set default encoding to AMF0 so FMS also understands. */ NetConnection.defaultObjectEncoding = ObjectEncoding.AMF0; /** * Create new port test and connect to the RTMP server. * * @param protocol * @param hostname * @param port * @param application * @testTimeout timeout of test in milliseconds */ public function PortTest( protocol : String = "", hostname : String = "", port : String = "", application : String = "", testTimeout : Number = 10000 ) { this.protocol = protocol; this.protocolName = protocol.toUpperCase(); this.hostname = hostname; this.application = application; this.testTimeout = testTimeout; if ( port.length > 0 ) { this.portName = port; this.port = ":" + port; } else { this.port = port; } // Construct URI. this.baseURI = this.protocol + "://" + this.hostname + this.port + "/" + this.application; // } /** * Start connection. */ public function connect() : void { this.nc = new NetConnection(); this.nc.client = this;
this.nc.proxyType = "best";
this.nc.addEventListener( NetStatusEvent.NET_STATUS, netStatus ); // connect to server try { // Create connection with the server. this.nc.connect( this.baseURI, "portTestMeetingId", "portTestDummyUserId" ); status = "Connecting..."; connectionTimer = new Timer(testTimeout, 1); connectionTimer.addEventListener(TimerEvent.TIMER, connectionTimeout); connectionTimer.start(); } catch( e : ArgumentError ) { // Invalid parameters. status = "ERROR: " + e.message; } } /** * Method called when connection timed out */ public function connectionTimeout (e:TimerEvent) : void { status = "FAILED"; _connectionListener(status, protocol, hostname, port, application); close(); } /** * Close connection. */ public function close() : void { //Stop timeout timer when connected/rejected connectionTimer.stop(); // Remove listener. this.nc.removeEventListener( NetStatusEvent.NET_STATUS, netStatus ); // Close the NetConnection. this.nc.close(); } /** * Catch NetStatusEvents. * * @param event */ protected function netStatus( event : NetStatusEvent ) : void { var info : Object = event.info; var statusCode : String = info.code; // if ( statusCode == "NetConnection.Connect.Success" ) { status = "SUCCESS"; _connectionListener(status, protocol, hostname, port, application); } else if ( statusCode == "NetConnection.Connect.Rejected" || statusCode == "NetConnection.Connect.Failed" || statusCode == "NetConnection.Connect.Closed" ) { status = "FAILED"; _connectionListener(status, protocol, hostname, port, application); } // Close NetConnection. close(); } public function onBWCheck(... rest):Number { return 0; } public function onBWDone(... rest):void { var p_bw:Number; if (rest.length > 0) p_bw = rest[0]; // your application should do something here // when the bandwidth check is complete trace("bandwidth = " + p_bw + " Kbps."); } public function addConnectionSuccessListener(listener:Function):void { _connectionListener = listener; } } }
this.nc.addEventListener( NetStatusEvent.NET_STATUS, netStatus ); // connect to server try { // Create connection with the server. this.nc.connect( this.baseURI, "portTestMeetingId", "portTestDummyUserId" ); status = "Connecting..."; connectionTimer = new Timer(testTimeout, 1); connectionTimer.addEventListener(TimerEvent.TIMER, connectionTimeout); connectionTimer.start(); } catch( e : ArgumentError ) { // Invalid parameters. status = "ERROR: " + e.message; } } /** * Method called when connection timed out */ public function connectionTimeout (e:TimerEvent) : void { status = "FAILED"; _connectionListener(status, protocol, hostname, port, application); close(); } /** * Close connection. */ public function close() : void { //Stop timeout timer when connected/rejected connectionTimer.stop(); // Remove listener. this.nc.removeEventListener( NetStatusEvent.NET_STATUS, netStatus ); // Close the NetConnection. this.nc.close(); } /** * Catch NetStatusEvents. * * @param event */ protected function netStatus( event : NetStatusEvent ) : void { var info : Object = event.info; var statusCode : String = info.code; // if ( statusCode == "NetConnection.Connect.Success" ) { status = "SUCCESS"; _connectionListener(status, protocol, hostname, port, application); } else if ( statusCode == "NetConnection.Connect.Rejected" || statusCode == "NetConnection.Connect.Failed" || statusCode == "NetConnection.Connect.Closed" ) { status = "FAILED"; _connectionListener(status, protocol, hostname, port, application); } // Close NetConnection. close(); } public function onBWCheck(... rest):Number { return 0; } public function onBWDone(... rest):void { var p_bw:Number; if (rest.length > 0) p_bw = rest[0]; // your application should do something here // when the bandwidth check is complete LOGGER.debug("bandwidth = {0} Kbps.", [p_bw]); } public function addConnectionSuccessListener(listener:Function):void { _connectionListener = listener; } } }

View File

@ -17,15 +17,15 @@
*
*/
package org.bigbluebutton.main.model {
import com.asfusion.mate.events.Dispatcher;
import flash.events.NetStatusEvent;
import flash.net.NetConnection;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.events.PortTestEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.model.modules.ModulesDispatcher;
public class PortTestProxy {
private static const LOG:String = "Main::PortTestProxy - ";
private static const LOGGER:ILogger = getClassLogger(PortTestProxy);
private var nc:NetConnection;
private var protocol:String;
@ -44,7 +44,7 @@ package org.bigbluebutton.main.model {
portTest.addConnectionSuccessListener(connectionListener);
var red5Url:String = protocol + "://" + hostname + "/" + application;
trace(LOG + "Connecting to [" + red5Url + "]");
LOGGER.debug("Connecting to [{0}]", [red5Url]);
portTest.connect();
}
@ -52,12 +52,10 @@ package org.bigbluebutton.main.model {
private function connectionListener(status:String, protocol:String, hostname:String, port:String, application:String):void {
uri = protocol + "://" + hostname + "/" + application;
if (status == "SUCCESS") {
LogUtil.debug(LOG + "::connectionListener - Successfully connected to " + uri);
trace(LOG + "::connectionListener - Successfully connected to [" + uri + "]");
LOGGER.debug("::connectionListener - Successfully connected to {0}", [uri]);
modulesDispatcher.sendPortTestSuccessEvent(port, hostname, protocol, application);
} else {
LogUtil.error(LOG + "::connectionListener - Failed to " + uri);
trace(LOG + "::connectionListener - Failed to [" + uri + "]");
LOGGER.error("::connectionListener - Failed to {0}", [uri]);
modulesDispatcher.sendPortTestFailedEvent(port, hostname, protocol, application);
}
}
@ -72,15 +70,15 @@ package org.bigbluebutton.main.model {
var statusCode : String = info.code;
if (statusCode == "NetConnection.Connect.Success") {
trace(LOG + "::netStatusEventHandler - Successfully connected to " + uri);
LOGGER.debug("::netStatusEventHandler - Successfully connected to {0}", [uri]);
modulesDispatcher.sendPortTestSuccessEvent(port, hostname, protocol, application);
} else if (statusCode == "NetConnection.Connect.Rejected" ||
statusCode == "NetConnection.Connect.Failed" ||
statusCode == "NetConnection.Connect.Closed" ) {
trace(LOG + "::netStatusEventHandler - Failed to connect to " + uri);
LOGGER.error("::netStatusEventHandler - Failed to connect to {0}", [uri]);
modulesDispatcher.sendPortTestFailedEvent(port, hostname, protocol, application);
} else {
LogUtil.error("Failed to connect to " + uri + " due to " + statusCode);
LOGGER.error("Failed to connect to {0} due to {1}", [uri, statusCode]);
}
// Close NetConnection.
close();

View File

@ -1,7 +1,6 @@
package org.bigbluebutton.main.model
{
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.common.LogUtil;
public class ShortcutOptions
{
private static var users:Boolean = true;

View File

@ -21,18 +21,16 @@ package org.bigbluebutton.main.model.modules
import flash.utils.Dictionary;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
public class DependancyResolver
{
private static const LOGGER:ILogger = getClassLogger(DependancyResolver);
private var _modules:Dictionary;
public function DependancyResolver()
{
}
/**
* Creates a dependency tree for modules using a topological sort algorithm (Khan, 1962, http://portal.acm.org/beta/citation.cfm?doid=368996.369025)
*/
@ -66,9 +64,9 @@ package org.bigbluebutton.main.model.modules
m2.getName() + " depends on " + m2.unresolvedDependancies.toString());
}
}
LogUtil.debug("Dependency Order: ");
LOGGER.debug("Dependency Order: ");
for (var u:int = 0; u<sorted.length; u++){
LogUtil.debug(((sorted.getItemAt(u) as ModuleDescriptor).getName()));
LOGGER.debug(((sorted.getItemAt(u) as ModuleDescriptor).getName()));
//Alert.show((sorted.getItemAt(u) as ModuleDescriptor).getAttribute("name") as String);
}

View File

@ -2,28 +2,22 @@ package org.bigbluebutton.main.model.modules
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.*;
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import flash.net.navigateToURL;
import mx.collections.ArrayCollection;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.model.Me;
import org.bigbluebutton.core.model.MeBuilder;
import org.bigbluebutton.core.model.MeetingBuilder;
import org.bigbluebutton.core.model.MeetingModel;
import org.bigbluebutton.core.model.StunOption;
import org.bigbluebutton.core.model.users.User;
import org.bigbluebutton.core.model.users.UsersModel;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.as3commons.logging.util.jsonXify;
import org.bigbluebutton.main.events.MeetingNotFoundEvent;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
public class EnterApiService
{
private static const LOG:String = "Modules::EnterApiService - ";
{
private static const LOGGER:ILogger = getClassLogger(EnterApiService);
private var request:URLRequest = new URLRequest();
private var vars:URLVariables = new URLVariables();
@ -38,7 +32,7 @@ package org.bigbluebutton.main.model.modules
public function load(url:String):void {
var date:Date = new Date();
trace(LOG + "load " + url);
LOGGER.debug("load {0}", [url]);
request = new URLRequest(url);
request.method = URLRequestMethod.GET;
@ -53,25 +47,25 @@ package org.bigbluebutton.main.model.modules
}
private function httpStatusHandler(event:HTTPStatusEvent):void {
LogUtil.debug(LOG + "httpStatusHandler: " + event);
LOGGER.debug("httpStatusHandler: {0}", [event]);
}
private function ioErrorHandler(event:IOErrorEvent):void {
trace(LOG + "ioErrorHandler: " + event);
LOGGER.error("ioErrorHandler: {0}", [event]);
if (_resultListener != null) _resultListener(false, null);
}
private function handleComplete(e:Event):void {
var result:Object = JSON.parse(e.target.data);
trace(LOG + "Enter response = " + JSON.stringify(result));
LOGGER.debug("Enter response = {0}", [jsonXify(result)]);
var returncode:String = result.response.returncode;
if (returncode == 'FAILED') {
trace(LOG + "Enter API call FAILED = " + JSON.stringify(result));
LOGGER.error("Enter API call FAILED = {0}", [jsonXify(result)]);
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new MeetingNotFoundEvent(result.response.logoutURL));
} else if (returncode == 'SUCCESS') {
trace(LOG + "Enter API call SUCESS = " + JSON.stringify(result));
LOGGER.debug("Enter API call SUCESS = {0}", [jsonXify(result)]);
var response:Object = new Object();
response.username = result.response.fullname;
response.userId = result.response.internalUserID;

View File

@ -21,21 +21,21 @@ package org.bigbluebutton.main.model.modules
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.system.ApplicationDomain;
import flash.utils.Dictionary;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.IFlexModuleFactory;
import mx.events.ModuleEvent;
import mx.modules.ModuleLoader;
import mx.utils.StringUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.model.ConferenceParameters;
public class ModuleDescriptor
{
private static const LOGGER:ILogger = getClassLogger(ModuleDescriptor);
private var _attributes:Object;
private var _loader:BigBlueButtonModuleLoader;
private var _module:IBigBlueButtonModule;
@ -113,12 +113,12 @@ package org.bigbluebutton.main.model.modules
_loader.addEventListener("ready", onReady);
_loader.addEventListener("error", onErrorLoading);
_loader.url = _attributes.url;
LogUtil.debug("Loading " + _attributes.url);
LOGGER.debug("Loading {0}", [_attributes.url]);
_loader.loadModule();
}
private function onReady(event:Event):void {
LogUtil.debug(getName() + "finished loading");
LOGGER.debug("{0} finished loading", [getName()]);
var modLoader:ModuleLoader = event.target as ModuleLoader;
if (!(modLoader.child is IBigBlueButtonModule)) throw new Error(getName() + " is not a valid BigBlueButton module");
_module = modLoader.child as IBigBlueButtonModule;
@ -126,18 +126,18 @@ package org.bigbluebutton.main.model.modules
_loaded = true;
callbackHandler(ModuleManager.MODULE_LOAD_READY, _attributes.name);
} else {
LogUtil.error("Module loaded is null.");
LOGGER.error("Module loaded is null.");
}
}
private function onLoadProgress(e:ProgressEvent):void {
callbackHandler(ModuleManager.MODULE_LOAD_PROGRESS,
_attributes.name, Math.round((e.bytesLoaded/e.bytesTotal) * 100));
_attributes.name, Math.round((e.bytesLoaded/e.bytesTotal) * 100));
}
private function onErrorLoading(e:ModuleEvent):void{
LogUtil.error("Error loading " + getName() + e.errorText);
LOGGER.error("Error loading {0}", [getName() + e.errorText]);
}
private function onLoading(e:Event):void{
@ -148,7 +148,7 @@ package org.bigbluebutton.main.model.modules
if (_attributes.uri == null) return;
_attributes.uri = _attributes.uri.replace(/rtmp:/gi, protocol + ":");
LogUtil.debug(_attributes.name + " uri = " + _attributes.uri);
LOGGER.debug("{0} uri = {1}", [_attributes.name, _attributes.uri]);
}
public function removeDependancy(module:String):void{

View File

@ -25,8 +25,9 @@ package org.bigbluebutton.main.model.modules
import mx.collections.ArrayCollection;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.main.events.AppVersionEvent;
import org.bigbluebutton.main.model.ConferenceParameters;
@ -34,7 +35,7 @@ package org.bigbluebutton.main.model.modules
public class ModuleManager
{
private static const LOG:String = "Core::ModuleManager - ";
private static const LOGGER:ILogger = getClassLogger(ModuleManager);
public static const MODULE_LOAD_READY:String = "MODULE_LOAD_READY";
public static const MODULE_LOAD_PROGRESS:String = "MODULE_LOAD_PROGRESS";
@ -96,7 +97,7 @@ package org.bigbluebutton.main.model.modules
private function startModule(name:String):void {
var m:ModuleDescriptor = getModule(name);
if (m != null) {
trace(LOG + 'Starting module ' + name);
LOGGER.debug('Starting module {0}', [name]);
var bbb:IBigBlueButtonModule = m.module as IBigBlueButtonModule;
m.loadConfigAttributes(conferenceParameters, _protocol);
bbb.start(m.attributes);
@ -104,14 +105,14 @@ package org.bigbluebutton.main.model.modules
}
private function stopModule(name:String):void {
trace(LOG + 'Stopping module ' + name);
LOGGER.debug('Stopping module {0}', [name]);
var m:ModuleDescriptor = getModule(name);
if (m != null) {
LogUtil.debug('Stopping ' + name);
LOGGER.debug('Stopping {0}', [name]);
var bbb:IBigBlueButtonModule = m.module as IBigBlueButtonModule;
if(bbb == null) { //Still has null object reference on logout sometimes.
LogUtil.debug('Module ' + name + ' was null skipping');
LOGGER.debug('Module {0} was null skipping', [name]);
return;
}
bbb.stop();
@ -119,14 +120,14 @@ package org.bigbluebutton.main.model.modules
}
public function loadModule(name:String):void {
trace(LOG + 'BBBManager Loading ' + name);
LOGGER.debug('BBBManager Loading {0}', [name]);
var m:ModuleDescriptor = getModule(name);
if (m != null) {
if (!m.loaded) {
m.load(loadModuleResultHandler);
}
} else {
LogUtil.debug(name + " not found.");
LOGGER.debug("{0} not found.", [name]);
}
}
@ -138,12 +139,12 @@ package org.bigbluebutton.main.model.modules
modulesDispatcher.sendLoadProgressEvent(name, progress);
break;
case MODULE_LOAD_READY:
trace(LOG + 'Module ' + name + " loaded.");
LOGGER.debug("Module {0} loaded.", [name]);
modulesDispatcher.sendModuleLoadReadyEvent(name)
break;
}
} else {
LogUtil.debug(name + " not found.");
LOGGER.warn("{0} not found.", [name]);
}
if (allModulesLoaded()) {
@ -166,13 +167,13 @@ package org.bigbluebutton.main.model.modules
public function moduleStarted(name:String, started:Boolean):void {
var m:ModuleDescriptor = getModule(name);
if (m != null) {
trace(LOG + 'Setting ' + name + ' started to ' + started);
LOGGER.debug('Setting {0} started to {1}', [name, started]);
}
}
public function startUserServices():void {
configParameters.application = configParameters.application.replace(/rtmp:/gi, _protocol + ":");
trace(LOG + "**** Using " + _protocol + " to connect to " + configParameters.application + "******");
LOGGER.debug("**** Using {0} to connect to {1}******", [_protocol, configParameters.application]);
modulesDispatcher.sendStartUserServicesEvent(configParameters.application, configParameters.host, _protocol.toUpperCase() == "RTMPT");
}

View File

@ -1,195 +1,197 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.model.modules
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.TimerEvent;
import flash.utils.Timer;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.vo.Config;
import org.bigbluebutton.core.vo.ConfigBuilder;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.main.events.UserServicesEvent;
import org.bigbluebutton.main.model.ConfigParameters;
import org.bigbluebutton.main.model.modules.EnterApiService;
public class ModulesDispatcher
{
private static const LOG:String = "Main::ModulesDispatcher - ";
private var dispatcher:Dispatcher;
private var enterApiService: EnterApiService;
private var meetingInfo:Object = new Object();
private var enterApiUrl:String;
public function ModulesDispatcher()
{
dispatcher = new Dispatcher();
}
public function sendLoadProgressEvent(moduleName:String, loadProgress:Number):void{
var loadEvent:ModuleLoadEvent = new ModuleLoadEvent(ModuleLoadEvent.MODULE_LOAD_PROGRESS);
loadEvent.moduleName = moduleName;
loadEvent.progress = loadProgress;
dispatcher.dispatchEvent(loadEvent);
}
public function sendModuleLoadReadyEvent(moduleName:String):void{
var loadReadyEvent:ModuleLoadEvent = new ModuleLoadEvent(ModuleLoadEvent.MODULE_LOAD_READY);
loadReadyEvent.moduleName = moduleName;
dispatcher.dispatchEvent(loadReadyEvent);
}
public function sendAllModulesLoadedEvent():void{
dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.ALL_MODULES_LOADED));
var loginEvent:BBBEvent = new BBBEvent(BBBEvent.LOGIN_EVENT);
dispatcher.dispatchEvent(loginEvent);
}
public function sendStartUserServicesEvent(application:String, host:String, isTunnelling:Boolean):void{
var e:UserServicesEvent = new UserServicesEvent(UserServicesEvent.START_USER_SERVICES);
e.applicationURI = application;
e.hostURI = host;
e.isTunnelling = isTunnelling;
dispatcher.dispatchEvent(e);
}
public function sendPortTestEvent():void {
getMeetingAndUserInfo();
}
private function getMeetingAndUserInfo():void {
enterApiService = new EnterApiService();
enterApiService.addResultListener(resultListener);
enterApiService.load(enterApiUrl);
}
private function resultListener(success:Boolean, result:Object):void {
if (success) {
trace(LOG + "Saving meeting and user info " + JSON.stringify(result));
meetingInfo.username = result.username;
meetingInfo.userId = result.userId;
meetingInfo.meetingName = result.meetingName;
meetingInfo.meetingId = result.meetingId;
doPortTesting();
} else {
var logData:Object = new Object();
JSLog.critical("Failed to get meeting and user info from Enter API", logData);
dispatcher.dispatchEvent(new PortTestEvent(PortTestEvent.TUNNELING_FAILED));
}
}
private function doPortTesting():void {
trace(LOG + "Sending TEST_RTMP Event");
var e:PortTestEvent = new PortTestEvent(PortTestEvent.TEST_RTMP);
dispatcher.dispatchEvent(e);
}
private function timerHandler(e:TimerEvent):void{
trace(LOG + "Sending PORT_TEST_UPDATE Event");
var evt:PortTestEvent = new PortTestEvent(PortTestEvent.PORT_TEST_UPDATE);
dispatcher.dispatchEvent(evt);
}
public function sendTunnelingFailedEvent(server: String, app: String):void{
trace(LOG + "Sending TunnelingFailed Event");
var logData:Object = new Object();
logData.server = server;
logData.app = app;
logData.userId = meetingInfo.userId;
logData.username = meetingInfo.username;
logData.meetingName = meetingInfo.meetingName;
logData.meetingId = meetingInfo.meetingId;
trace(LOG + "Cannot connect to Red5 using RTMP and RTMPT", JSON.stringify(logData));
JSLog.critical("Cannot connect to Red5 using RTMP and RTMPT", logData);
dispatcher.dispatchEvent(new PortTestEvent(PortTestEvent.TUNNELING_FAILED));
}
public function sendPortTestSuccessEvent(port:String, host:String, protocol:String, app:String):void{
trace(LOG + "Sending PORT_TEST_SUCCESS Event");
var logData:Object = new Object();
logData.port = port;
logData.server = host;
logData.protocol = protocol;
logData.app = app;
logData.userId = meetingInfo.userId;
logData.username = meetingInfo.username;
logData.meetingName = meetingInfo.meetingName;
logData.meetingId = meetingInfo.meetingId;
JSLog.debug("Successfully connected on test connection.", logData);
var portEvent:PortTestEvent = new PortTestEvent(PortTestEvent.PORT_TEST_SUCCESS);
portEvent.port = port;
portEvent.hostname = host;
portEvent.protocol = protocol;
portEvent.app = app;
dispatcher.dispatchEvent(portEvent);
}
public function sendPortTestFailedEvent(port:String, host:String, protocol:String, app:String):void{
trace(LOG + "Sending PORT_TEST_FAILED Event");
var portFailEvent:PortTestEvent = new PortTestEvent(PortTestEvent.PORT_TEST_FAILED);
portFailEvent.port = port;
portFailEvent.hostname = host;
portFailEvent.protocol = protocol;
portFailEvent.app = app;
dispatcher.dispatchEvent(portFailEvent);
}
public function sendModuleLoadingStartedEvent(modules:XMLList):void{
var event:ModuleLoadEvent = new ModuleLoadEvent(ModuleLoadEvent.MODULE_LOADING_STARTED);
event.modules = modules;
dispatcher.dispatchEvent(event);
}
public function sendConfigParameters(c:ConfigParameters):void{
enterApiUrl = c.host;
var event:ConfigEvent = new ConfigEvent(ConfigEvent.CONFIG_EVENT);
var config:Config;
config = new ConfigBuilder(c.version, c.localeVersion)
.withApplication(c.application)
.withHelpUrl(c.helpURL)
.withHost(c.host)
.withLanguageEnabled(c.languageEnabled)
.withShortcutKeysShowButton(c.shortcutKeysShowButton)
.withNumModule(c.numModules)
.withPortTestApplication(c.portTestApplication)
.withPortTestHost(c.portTestHost)
.withShowDebug(c.showDebug)
.withSkinning(c.skinning)
.build()
event.config = config;
dispatcher.dispatchEvent(event);
}
}
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.model.modules
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.TimerEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.as3commons.logging.util.jsonXify;
import org.bigbluebutton.core.vo.Config;
import org.bigbluebutton.core.vo.ConfigBuilder;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.main.events.UserServicesEvent;
import org.bigbluebutton.main.model.ConfigParameters;
public class ModulesDispatcher
{
private static const LOGGER:ILogger = getClassLogger(ModulesDispatcher);
private var dispatcher:Dispatcher;
private var enterApiService: EnterApiService;
private var meetingInfo:Object = new Object();
private var enterApiUrl:String;
public function ModulesDispatcher()
{
dispatcher = new Dispatcher();
}
public function sendLoadProgressEvent(moduleName:String, loadProgress:Number):void{
var loadEvent:ModuleLoadEvent = new ModuleLoadEvent(ModuleLoadEvent.MODULE_LOAD_PROGRESS);
loadEvent.moduleName = moduleName;
loadEvent.progress = loadProgress;
dispatcher.dispatchEvent(loadEvent);
}
public function sendModuleLoadReadyEvent(moduleName:String):void{
var loadReadyEvent:ModuleLoadEvent = new ModuleLoadEvent(ModuleLoadEvent.MODULE_LOAD_READY);
loadReadyEvent.moduleName = moduleName;
dispatcher.dispatchEvent(loadReadyEvent);
}
public function sendAllModulesLoadedEvent():void{
dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.ALL_MODULES_LOADED));
var loginEvent:BBBEvent = new BBBEvent(BBBEvent.LOGIN_EVENT);
dispatcher.dispatchEvent(loginEvent);
}
public function sendStartUserServicesEvent(application:String, host:String, isTunnelling:Boolean):void{
var e:UserServicesEvent = new UserServicesEvent(UserServicesEvent.START_USER_SERVICES);
e.applicationURI = application;
e.hostURI = host;
e.isTunnelling = isTunnelling;
dispatcher.dispatchEvent(e);
}
public function sendPortTestEvent():void {
getMeetingAndUserInfo();
}
private function getMeetingAndUserInfo():void {
enterApiService = new EnterApiService();
enterApiService.addResultListener(resultListener);
enterApiService.load(enterApiUrl);
}
private function resultListener(success:Boolean, result:Object):void {
if (success) {
LOGGER.debug("Saving meeting and user info {0}", [jsonXify(result)]);
meetingInfo.username = result.username;
meetingInfo.userId = result.userId;
meetingInfo.meetingName = result.meetingName;
meetingInfo.meetingId = result.meetingId;
doPortTesting();
} else {
var logData:Object = new Object();
JSLog.critical("Failed to get meeting and user info from Enter API", logData);
dispatcher.dispatchEvent(new PortTestEvent(PortTestEvent.TUNNELING_FAILED));
}
}
private function doPortTesting():void {
LOGGER.debug("Sending TEST_RTMP Event");
var e:PortTestEvent = new PortTestEvent(PortTestEvent.TEST_RTMP);
dispatcher.dispatchEvent(e);
}
private function timerHandler(e:TimerEvent):void{
LOGGER.debug("Sending PORT_TEST_UPDATE Event");
var evt:PortTestEvent = new PortTestEvent(PortTestEvent.PORT_TEST_UPDATE);
dispatcher.dispatchEvent(evt);
}
public function sendTunnelingFailedEvent(server: String, app: String):void{
LOGGER.debug("Sending TunnelingFailed Event");
var logData:Object = new Object();
logData.server = server;
logData.app = app;
logData.userId = meetingInfo.userId;
logData.username = meetingInfo.username;
logData.meetingName = meetingInfo.meetingName;
logData.meetingId = meetingInfo.meetingId;
LOGGER.fatal("Cannot connect to Red5 using RTMP and RTMPT {0}", [jsonXify(logData)]);
JSLog.critical("Cannot connect to Red5 using RTMP and RTMPT", logData);
dispatcher.dispatchEvent(new PortTestEvent(PortTestEvent.TUNNELING_FAILED));
}
public function sendPortTestSuccessEvent(port:String, host:String, protocol:String, app:String):void{
LOGGER.debug("Sending PORT_TEST_SUCCESS Event");
var logData:Object = new Object();
logData.port = port;
logData.server = host;
logData.protocol = protocol;
logData.app = app;
logData.userId = meetingInfo.userId;
logData.username = meetingInfo.username;
logData.meetingName = meetingInfo.meetingName;
logData.meetingId = meetingInfo.meetingId;
LOGGER.debug("Successfully connected on test connection. {0}", [jsonXify(logData)]);
JSLog.debug("Successfully connected on test connection.", logData);
var portEvent:PortTestEvent = new PortTestEvent(PortTestEvent.PORT_TEST_SUCCESS);
portEvent.port = port;
portEvent.hostname = host;
portEvent.protocol = protocol;
portEvent.app = app;
dispatcher.dispatchEvent(portEvent);
}
public function sendPortTestFailedEvent(port:String, host:String, protocol:String, app:String):void{
LOGGER.debug("Sending PORT_TEST_FAILED Event");
var portFailEvent:PortTestEvent = new PortTestEvent(PortTestEvent.PORT_TEST_FAILED);
portFailEvent.port = port;
portFailEvent.hostname = host;
portFailEvent.protocol = protocol;
portFailEvent.app = app;
dispatcher.dispatchEvent(portFailEvent);
}
public function sendModuleLoadingStartedEvent(modules:XMLList):void{
var event:ModuleLoadEvent = new ModuleLoadEvent(ModuleLoadEvent.MODULE_LOADING_STARTED);
event.modules = modules;
dispatcher.dispatchEvent(event);
}
public function sendConfigParameters(c:ConfigParameters):void{
enterApiUrl = c.host;
var event:ConfigEvent = new ConfigEvent(ConfigEvent.CONFIG_EVENT);
var config:Config;
config = new ConfigBuilder(c.version, c.localeVersion)
.withApplication(c.application)
.withHelpUrl(c.helpURL)
.withHost(c.host)
.withLanguageEnabled(c.languageEnabled)
.withShortcutKeysShowButton(c.shortcutKeysShowButton)
.withNumModule(c.numModules)
.withPortTestApplication(c.portTestApplication)
.withPortTestHost(c.portTestHost)
.withShowDebug(c.showDebug)
.withSkinning(c.skinning)
.build()
event.config = config;
dispatcher.dispatchEvent(event);
}
}
}

View File

@ -18,20 +18,19 @@
*/
package org.bigbluebutton.main.model.modules
{
import com.asfusion.mate.events.Dispatcher;
import mx.controls.Alert;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.events.PortTestEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.model.ConferenceParameters;
import org.bigbluebutton.main.model.PortTestProxy;
public class ModulesProxy {
private static const LOGGER:ILogger = getClassLogger(ModulesProxy);
private var modulesManager:ModuleManager;
private var portTestProxy:PortTestProxy;
private var modulesDispatcher:ModulesDispatcher;
private var _user:Object;
private var _user:Object;
public function ModulesProxy() {
modulesDispatcher = new ModulesDispatcher();
@ -49,7 +48,7 @@ package org.bigbluebutton.main.model.modules
}
public function loadModule(name:String):void {
trace('Loading ' + name);
LOGGER.debug('Loading {0}', [name]);
modulesManager.loadModule(name);
}
@ -82,9 +81,9 @@ package org.bigbluebutton.main.model.modules
modulesManager.handleLogout();
}
public function startLayoutModule():void{
modulesManager.startLayoutModule();
}
public function startLayoutModule():void{
modulesManager.startLayoutModule();
}
public function startAllModules():void{
modulesManager.startAllModules();

View File

@ -0,0 +1,58 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2015 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.model.users
{
import flash.events.TimerEvent;
import flash.utils.Timer;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
public class AutoReconnect
{
private static const LOGGER:ILogger = getClassLogger(AutoReconnect);
private var _backoff:Number = 2000;
private var _reconnectCallback:Function;
private var _reconnectParameters:Array;
public function onDisconnect(callback:Function, parameters:Array):void {
LOGGER.debug("onDisconnect, parameters={0}", [parameters.toString()]);
_reconnectCallback = callback;
_reconnectParameters = parameters;
attemptReconnect(0);
}
public function onConnectionAttemptFailed():void {
LOGGER.warn("onConnectionAttemptFailed");
attemptReconnect(_backoff);
}
private function attemptReconnect(backoff:Number):void {
LOGGER.debug("attemptReconnect backoff={0}", [backoff]);
var retryTimer:Timer = new Timer(backoff, 1);
retryTimer.addEventListener(TimerEvent.TIMER, function():void {
LOGGER.debug("Reconnecting");
_reconnectCallback.apply(null, _reconnectParameters);
});
retryTimer.start();
if (_backoff < 16000) _backoff = Math.max(backoff, 500) *2;
}
}
}

View File

@ -20,6 +20,8 @@ package org.bigbluebutton.main.model.users
{
import com.asfusion.mate.events.Dispatcher;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.core.events.VoiceConfEvent;
@ -28,9 +30,10 @@ package org.bigbluebutton.main.model.users
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
import org.bigbluebutton.modules.videoconf.events.ClosePublishWindowEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
public class BBBUser {
private static const LOGGER:ILogger = getClassLogger(BBBUser);
public static const MODERATOR:String = "MODERATOR";
public static const VIEWER:String = "VIEWER";
public static const PRESENTER:String = "PRESENTER";
@ -70,23 +73,23 @@ package org.bigbluebutton.main.model.users
throw new Error("Please use the helpers addViewingStream or removeViewingStream to handle viewingStream");
}
public function addViewingStream(streamName:String):Boolean {
trace("Before adding the stream " + streamName + ": " + _viewingStream);
LOGGER.debug("Before adding the stream {0}: {1}", [streamName, _viewingStream]);
if (isViewingStream(streamName)) {
return false;
}
_viewingStream.push(streamName);
trace("After adding the stream " + streamName + ": " + _viewingStream);
LOGGER.debug("After adding the stream {0}: {1}", [streamName, _viewingStream]);
return true;
}
public function removeViewingStream(streamName:String):Boolean {
trace("Before removing the stream " + streamName + ": " + _viewingStream);
LOGGER.debug("Before removing the stream {0}: {1}", [streamName, _viewingStream]);
if (!isViewingStream(streamName)) {
return false;
}
_viewingStream = _viewingStream.filter(function(item:*, index:int, array:Array):Boolean { return item != streamName; });
trace("After removing the stream " + streamName + ": " + _viewingStream);
LOGGER.debug("After removing the stream {0}: {1}", [streamName, _viewingStream]);
return true;
}
private function isViewingStream(streamName:String):Boolean {
@ -273,14 +276,14 @@ package org.bigbluebutton.main.model.users
}
public function lockStatusChanged(locked: Boolean):void {
trace("lockStatusChanged -> " + locked);
LOGGER.debug("lockStatusChanged -> {0}", [locked]);
userLocked = locked;
applyLockSettings();
buildStatus();
}
public function changeStatus(status:Status):void {
trace("changeStatus -> " + status.name);
LOGGER.debug("changeStatus -> {0}", [status.name]);
//_status.changeStatus(status);
if (status.name == "presenter") {
presenter = (status.value.toString().toUpperCase() == "TRUE") ? true : false;

File diff suppressed because it is too large Load Diff

View File

@ -20,28 +20,27 @@ package org.bigbluebutton.main.model.users
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.*;
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import flash.net.navigateToURL;
import mx.collections.ArrayCollection;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.model.Me;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.as3commons.logging.util.jsonXify;
import org.bigbluebutton.core.model.MeBuilder;
import org.bigbluebutton.core.model.MeetingBuilder;
import org.bigbluebutton.core.model.MeetingModel;
import org.bigbluebutton.core.model.StunOption;
import org.bigbluebutton.core.model.users.User;
import org.bigbluebutton.core.model.users.UsersModel;
import org.bigbluebutton.main.events.MeetingNotFoundEvent;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
public class JoinService
{
private static const LOG:String = "Users::JoinService - ";
private static const LOGGER:ILogger = getClassLogger(JoinService);
private var request:URLRequest = new URLRequest();
private var vars:URLVariables = new URLVariables();
@ -56,7 +55,7 @@ package org.bigbluebutton.main.model.users
public function load(url:String):void {
var date:Date = new Date();
// url += "?a=" + date.time
LogUtil.debug("JoinService:load(...) " + url);
LOGGER.debug("JoinService:load(...) {0}", [url]);
request = new URLRequest(url);
request.method = URLRequestMethod.GET;
@ -71,11 +70,11 @@ package org.bigbluebutton.main.model.users
}
private function httpStatusHandler(event:HTTPStatusEvent):void {
LogUtil.debug("httpStatusHandler: " + event);
LOGGER.debug("httpStatusHandler: {0}", [event]);
}
private function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
LOGGER.error("ioErrorHandler: {0}", [event]);
var e:ConnectionFailedEvent = new ConnectionFailedEvent(ConnectionFailedEvent.USER_LOGGED_OUT);
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(e);
@ -83,15 +82,15 @@ package org.bigbluebutton.main.model.users
private function handleComplete(e:Event):void {
var result:Object = JSON.parse(e.target.data);
trace(LOG + "Enter response = " + JSON.stringify(result));
LOGGER.debug("Enter response = {0}" + [jsonXify(result)]);
var returncode:String = result.response.returncode;
if (returncode == 'FAILED') {
trace(LOG + "Join FAILED = " + JSON.stringify(result));
LOGGER.error("Join FAILED = {0}", [jsonXify(result)]);
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new MeetingNotFoundEvent(result.response.logoutURL));
} else if (returncode == 'SUCCESS') {
trace("Join SUCESS = " + JSON.stringify(result));
LOGGER.debug("Join SUCESS = {0}", [jsonXify(result)]);
var response:Object = new Object();
response.username = result.response.fullname;
response.conference = result.response.conference;
@ -123,12 +122,12 @@ package org.bigbluebutton.main.model.users
if (result.response.customdata) {
var cdata:Array = result.response.customdata as Array;
trace(LOG + "num custom data = " + cdata.length);
LOGGER.debug("num custom data = {0}", [cdata.length]);
for each (var item:Object in cdata) {
trace(LOG + item.toString());
LOGGER.debug(item.toString());
for (var id:String in item) {
var value:String = item[id] as String;
trace(id + " = " + value);
LOGGER.debug("{0} = {1}", [id, value]);
response.customdata[id] = value;
}
}

View File

@ -1,401 +1,435 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.model.users
{
import com.adobe.protocols.dict.events.ErrorEvent;
import com.asfusion.mate.events.Dispatcher;
import flash.events.*;
import flash.net.NetConnection;
import flash.net.Responder;
import flash.utils.Timer;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.services.BandwidthMonitor;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.main.events.InvalidAuthTokenEvent;
import org.bigbluebutton.main.model.ConferenceParameters;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.main.model.users.events.UsersConnectionEvent;
public class NetConnectionDelegate
{
public static const LOG:String = "NetConnectionDelegate - ";
private var _netConnection:NetConnection;
private var connectionId:Number;
private var connected:Boolean = false;
private var _userid:Number = -1;
private var _role:String = "unknown";
private var _applicationURI:String;
private var _conferenceParameters:ConferenceParameters;
// These two are just placeholders. We'll get this from the server later and
// then pass to other modules.
private var _authToken:String = "AUTHORIZED";
private var _room:String;
private var tried_tunneling:Boolean = false;
private var logoutOnUserCommand:Boolean = false;
private var backoff:Number = 2000;
private var dispatcher:Dispatcher;
private var _messageListeners:Array = new Array();
private var authenticated: Boolean = false;
public function NetConnectionDelegate():void
{
dispatcher = new Dispatcher();
_netConnection = new NetConnection();
_netConnection.proxyType = "best";
_netConnection.client = this;
_netConnection.addEventListener( NetStatusEvent.NET_STATUS, netStatus );
_netConnection.addEventListener( AsyncErrorEvent.ASYNC_ERROR, netASyncError );
_netConnection.addEventListener( SecurityErrorEvent.SECURITY_ERROR, netSecurityError );
_netConnection.addEventListener( IOErrorEvent.IO_ERROR, netIOError );
}
public function setUri(uri:String):void {
_applicationURI = uri;
}
public function get connection():NetConnection {
return _netConnection;
}
public function addMessageListener(listener:IMessageListener):void {
_messageListeners.push(listener);
}
public function removeMessageListener(listener:IMessageListener):void {
for (var ob:int=0; ob<_messageListeners.length; ob++) {
if (_messageListeners[ob] == listener) {
_messageListeners.splice (ob,1);
break;
}
}
}
private function notifyListeners(messageName:String, message:Object):void {
if (messageName != null && messageName != "") {
for (var notify:String in _messageListeners) {
_messageListeners[notify].onMessage(messageName, message);
}
} else {
LogUtil.debug("Message name is undefined");
}
}
public function onMessageFromServer(messageName:String, msg:Object):void {
trace(LOG + "Got message from server [" + messageName + "] user=[" + UsersUtil.getMyUsername() + "]");
if (!authenticated && (messageName == "validateAuthTokenReply")) {
handleValidateAuthTokenReply(msg)
} else if (messageName == "validateAuthTokenTimedOut") {
handleValidateAuthTokenTimedOut(msg)
} else if (authenticated) {
notifyListeners(messageName, msg);
} else {
trace(LOG + "Ignoring message=[" + messageName + "] as our token hasn't been validated yet.");
}
}
private function validateToken():void {
var message:Object = new Object();
message["userId"] = _conferenceParameters.internalUserID;
message["authToken"] = _conferenceParameters.authToken;
sendMessage(
"validateToken",// Remote function name
// result - On successful result
function(result:Object):void {
trace(LOG + "validating token for [" + _conferenceParameters.internalUserID + "]");
},
// status - On error occurred
function(status:Object):void {
LogUtil.error("Error occurred:");
for (var x:Object in status) {
LogUtil.error(x + " : " + status[x]);
}
},
message
); //_netConnection.call
}
private function handleValidateAuthTokenTimedOut(msg: Object):void {
trace(LOG + "*** handleValidateAuthTokenTimedOut " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
var tokenValid: Boolean = map.valid as Boolean;
var userId: String = map.userId as String;
var logData:Object = new Object();
logData.user = UsersUtil.getUserData();
JSLog.critical("Validate auth token timed out.", logData);
if (tokenValid) {
authenticated = true;
trace(LOG + "*** handleValidateAuthTokenTimedOut. valid=[ " + tokenValid + "] **** \n");
} else {
trace(LOG + "*** handleValidateAuthTokenTimedOut. valid=[ " + tokenValid + "] **** \n");
dispatcher.dispatchEvent(new InvalidAuthTokenEvent());
}
}
private function handleValidateAuthTokenReply(msg: Object):void {
trace(LOG + "*** handleValidateAuthTokenReply " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
var tokenValid: Boolean = map.valid as Boolean;
var userId: String = map.userId as String;
if (tokenValid) {
authenticated = true;
trace(LOG + "*** handleValidateAuthTokenReply. valid=[ " + tokenValid + "] **** \n");
} else {
trace(LOG + "*** handleValidateAuthTokenReply. valid=[ " + tokenValid + "] **** \n");
dispatcher.dispatchEvent(new InvalidAuthTokenEvent());
}
}
private function sendConnectionSuccessEvent(userid:String):void{
var e:UsersConnectionEvent = new UsersConnectionEvent(UsersConnectionEvent.CONNECTION_SUCCESS);
e.userid = userid;
dispatcher.dispatchEvent(e);
}
public function sendMessage(service:String, onSuccess:Function, onFailure:Function, message:Object=null):void {
trace(LOG + "SENDING [" + service + "]");
var responder:Responder = new Responder(
function(result:Object):void { // On successful result
onSuccess("Successfully sent [" + service + "].");
},
function(status:Object):void { // status - On error occurred
var errorReason:String = "Failed to send [" + service + "]:\n";
for (var x:Object in status) {
errorReason += "\t" + x + " : " + status[x];
}
}
);
if (message == null) {
_netConnection.call(service, responder);
} else {
_netConnection.call(service, responder, message);
}
}
/**
* Connect to the server.
* uri: The uri to the conference application.
* username: Fullname of the participant.
* role: MODERATOR/VIEWER
* conference: The conference room
* mode: LIVE/PLAYBACK - Live:when used to collaborate, Playback:when being used to playback a recorded conference.
* room: Need the room number when playing back a recorded conference. When LIVE, the room is taken from the URI.
*/
public function connect(params:ConferenceParameters, tunnel:Boolean = false):void {
_conferenceParameters = params;
tried_tunneling = tunnel;
try {
var uri:String = _applicationURI + "/" + _conferenceParameters.room;
trace(LOG + "::Connecting to " + uri + " [" + _conferenceParameters.username + "," + _conferenceParameters.role + "," +
_conferenceParameters.conference + "," + _conferenceParameters.record + "," + _conferenceParameters.room + ", " + _conferenceParameters.lockSettings.lockOnJoin + "]");
_netConnection.connect(uri, _conferenceParameters.username, _conferenceParameters.role,
_conferenceParameters.room, _conferenceParameters.voicebridge,
_conferenceParameters.record, _conferenceParameters.externUserID,
_conferenceParameters.internalUserID, _conferenceParameters.muteOnStart, _conferenceParameters.lockSettings);
} catch(e:ArgumentError) {
// Invalid parameters.
switch (e.errorID) {
case 2004 :
LogUtil.debug("Error! Invalid server location: " + uri);
break;
default :
LogUtil.debug("UNKNOWN Error! Invalid server location: " + uri);
break;
}
}
}
public function disconnect(logoutOnUserCommand:Boolean):void {
this.logoutOnUserCommand = logoutOnUserCommand;
_netConnection.close();
}
public function forceClose():void {
_netConnection.close();
}
protected function netStatus(event:NetStatusEvent):void {
handleResult( event );
}
private var _bwMon:BandwidthMonitor = new BandwidthMonitor();
private function startMonitoringBandwidth():void {
trace("Start monitoring bandwidth.");
var pattern:RegExp = /(?P<protocol>.+):\/\/(?P<server>.+)\/(?P<app>.+)/;
var result:Array = pattern.exec(_applicationURI);
_bwMon.serverURL = result.server;
_bwMon.serverApplication = "video";
_bwMon.start();
}
private var autoReconnectTimer:Timer = new Timer(1000, 1);
public function handleResult(event:Object):void {
var info : Object = event.info;
var statusCode : String = info.code;
var logData:Object = new Object();
logData.user = UsersUtil.getUserData();
switch (statusCode) {
case "NetConnection.Connect.Success":
trace(LOG + ":Connection to viewers application succeeded.");
JSLog.debug("Successfully connected to BBB App.", logData);
validateToken();
break;
case "NetConnection.Connect.Failed":
if (tried_tunneling) {
trace(LOG + ":Connection to viewers application failed...even when tunneling");
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_FAILED);
} else {
disconnect(false);
trace(LOG + ":Connection to viewers application failed...try tunneling");
var rtmptRetryTimer:Timer = new Timer(1000, 1);
rtmptRetryTimer.addEventListener("timer", rtmptRetryTimerHandler);
rtmptRetryTimer.start();
}
break;
case "NetConnection.Connect.Closed":
trace(LOG + "Connection to viewers application closed");
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_CLOSED);
break;
case "NetConnection.Connect.InvalidApp":
trace(LOG + ":viewers application not found on server");
sendConnectionFailedEvent(ConnectionFailedEvent.INVALID_APP);
break;
case "NetConnection.Connect.AppShutDown":
trace(LOG + ":viewers application has been shutdown");
sendConnectionFailedEvent(ConnectionFailedEvent.APP_SHUTDOWN);
break;
case "NetConnection.Connect.Rejected":
trace(LOG + ":Connection to the server rejected. Uri: " + _applicationURI + ". Check if the red5 specified in the uri exists and is running" );
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_REJECTED);
break;
case "NetConnection.Connect.NetworkChange":
JSLog.warn("Detected network change to BBB App", logData);
trace(LOG + "Detected network change. User might be on a wireless and temporarily dropped connection. Doing nothing. Just making a note.");
break;
default :
trace(LOG + ":Default status to the viewers application" );
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
break;
}
}
private function autoReconnectTimerHandler(event:TimerEvent):void {
trace(LOG + "autoReconnectTimerHandler: " + event);
connect(_conferenceParameters, tried_tunneling);
}
private function rtmptRetryTimerHandler(event:TimerEvent):void {
trace(LOG + "rtmptRetryTimerHandler: " + event);
connect(_conferenceParameters, true);
}
protected function netSecurityError(event: SecurityErrorEvent):void {
trace(LOG + "Security error - " + event.text);
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
}
protected function netIOError(event: IOErrorEvent):void {
trace(LOG + "Input/output error - " + event.text);
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
}
protected function netASyncError(event: AsyncErrorEvent):void {
trace(LOG + "Asynchronous code error - " + event.toString() );
LogUtil.debug("Asynchronous code error - " + event.toString() );
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
}
private function sendConnectionFailedEvent(reason:String):void{
var logData:Object = new Object();
if (this.logoutOnUserCommand) {
logData.reason = "User requested.";
logData.user = UsersUtil.getUserData();
JSLog.debug("User logged out from BBB App.", logData);
sendUserLoggedOutEvent();
} else {
logData.reason = reason;
logData.user = UsersUtil.getUserData();
JSLog.warn("User disconnected from BBB App.", logData);
var e:ConnectionFailedEvent = new ConnectionFailedEvent(reason);
dispatcher.dispatchEvent(e);
}
}
private function sendUserLoggedOutEvent():void{
var e:ConnectionFailedEvent = new ConnectionFailedEvent(ConnectionFailedEvent.USER_LOGGED_OUT);
dispatcher.dispatchEvent(e);
}
private function attemptReconnect(backoff:Number):void{
var retryTimer:Timer = new Timer(backoff, 1);
retryTimer.addEventListener(TimerEvent.TIMER, function():void{
connect(_conferenceParameters, tried_tunneling);
});
retryTimer.start();
if (this.backoff < 16000) this.backoff = backoff *2;
}
public function onBWCheck(... rest):Number {
return 0;
}
public function onBWDone(... rest):void {
var p_bw:Number;
if (rest.length > 0) p_bw = rest[0];
// your application should do something here
// when the bandwidth check is complete
trace("bandwidth = " + p_bw + " Kbps.");
}
}
}
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.model.users
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.AsyncErrorEvent;
import flash.events.IOErrorEvent;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.events.TimerEvent;
import flash.net.NetConnection;
import flash.net.Responder;
import flash.utils.Timer;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.as3commons.logging.util.jsonXify;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.managers.ReconnectionManager;
import org.bigbluebutton.core.services.BandwidthMonitor;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.InvalidAuthTokenEvent;
import org.bigbluebutton.main.model.ConferenceParameters;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.main.model.users.events.UsersConnectionEvent;
public class NetConnectionDelegate
{
private static const LOGGER:ILogger = getClassLogger(NetConnectionDelegate);
private var _netConnection:NetConnection;
private var connectionId:Number;
private var connected:Boolean = false;
private var _userid:Number = -1;
private var _role:String = "unknown";
private var _applicationURI:String;
private var _conferenceParameters:ConferenceParameters;
// These two are just placeholders. We'll get this from the server later and
// then pass to other modules.
private var _authToken:String = "AUTHORIZED";
private var _room:String;
private var tried_tunneling:Boolean = false;
private var logoutOnUserCommand:Boolean = false;
private var backoff:Number = 2000;
private var dispatcher:Dispatcher;
private var _messageListeners:Array = new Array();
private var authenticated: Boolean = false;
private var reconnecting:Boolean = false;
public function NetConnectionDelegate():void
{
dispatcher = new Dispatcher();
_netConnection = new NetConnection();
_netConnection.proxyType = "best";
_netConnection.client = this;
_netConnection.addEventListener( NetStatusEvent.NET_STATUS, netStatus );
_netConnection.addEventListener( AsyncErrorEvent.ASYNC_ERROR, netASyncError );
_netConnection.addEventListener( SecurityErrorEvent.SECURITY_ERROR, netSecurityError );
_netConnection.addEventListener( IOErrorEvent.IO_ERROR, netIOError );
}
public function setUri(uri:String):void {
_applicationURI = uri;
}
public function get connection():NetConnection {
return _netConnection;
}
public function addMessageListener(listener:IMessageListener):void {
_messageListeners.push(listener);
}
public function removeMessageListener(listener:IMessageListener):void {
for (var ob:int=0; ob<_messageListeners.length; ob++) {
if (_messageListeners[ob] == listener) {
_messageListeners.splice (ob,1);
break;
}
}
}
private function notifyListeners(messageName:String, message:Object):void {
if (messageName != null && messageName != "") {
for (var notify:String in _messageListeners) {
_messageListeners[notify].onMessage(messageName, message);
}
} else {
LOGGER.debug("Message name is undefined");
}
}
public function onMessageFromServer(messageName:String, msg:Object):void {
LOGGER.debug("Got message from server [{0}] user=[{1}]", [messageName, UsersUtil.getMyUsername()]);
if (!authenticated && (messageName == "validateAuthTokenReply")) {
handleValidateAuthTokenReply(msg)
} else if (messageName == "validateAuthTokenTimedOut") {
handleValidateAuthTokenTimedOut(msg)
} else if (authenticated) {
notifyListeners(messageName, msg);
} else {
LOGGER.debug("Ignoring message=[{0}] as our token hasn't been validated yet.", [messageName]);
}
}
private function validateToken():void {
var message:Object = new Object();
message["userId"] = _conferenceParameters.internalUserID;
message["authToken"] = _conferenceParameters.authToken;
sendMessage(
"validateToken",// Remote function name
// result - On successful result
function(result:Object):void {
LOGGER.debug("validating token for [{0}]", [_conferenceParameters.internalUserID]);
},
// status - On error occurred
function(status:Object):void {
LOGGER.error("Error occurred:");
for (var x:Object in status) {
LOGGER.error(x + " : " + status[x]);
}
},
message
); //_netConnection.call
}
private function handleValidateAuthTokenTimedOut(msg: Object):void {
LOGGER.debug("*** handleValidateAuthTokenTimedOut {0} **** \n", [msg.msg]);
var map:Object = JSON.parse(msg.msg);
var tokenValid: Boolean = map.valid as Boolean;
var userId: String = map.userId as String;
var logData:Object = new Object();
logData.user = UsersUtil.getUserData();
JSLog.critical("Validate auth token timed out.", logData);
if (tokenValid) {
authenticated = true;
LOGGER.debug("*** handleValidateAuthTokenTimedOut. valid=[{0}] **** \n", [tokenValid]);
} else {
LOGGER.debug("*** handleValidateAuthTokenTimedOut. valid=[{0}] **** \n", [tokenValid]);
dispatcher.dispatchEvent(new InvalidAuthTokenEvent());
}
if (reconnecting) {
onReconnect();
reconnecting = false;
}
}
private function handleValidateAuthTokenReply(msg: Object):void {
LOGGER.debug("*** handleValidateAuthTokenReply {0} **** \n", [msg.msg]);
var map:Object = JSON.parse(msg.msg);
var tokenValid: Boolean = map.valid as Boolean;
var userId: String = map.userId as String;
if (tokenValid) {
authenticated = true;
LOGGER.debug("*** handleValidateAuthTokenReply. valid=[{0}] **** \n", [tokenValid]);
} else {
LOGGER.debug("*** handleValidateAuthTokenReply. valid=[{0}] **** \n", [tokenValid]);
dispatcher.dispatchEvent(new InvalidAuthTokenEvent());
}
if (reconnecting) {
onReconnect();
reconnecting = false;
}
}
private function onReconnect():void {
if (authenticated) {
onReconnectSuccess();
} else {
onReconnectFailed();
}
}
private function onReconnectSuccess():void {
var attemptSucceeded:BBBEvent = new BBBEvent(BBBEvent.RECONNECT_CONNECTION_ATTEMPT_SUCCEEDED_EVENT);
attemptSucceeded.payload.type = ReconnectionManager.BIGBLUEBUTTON_CONNECTION;
dispatcher.dispatchEvent(attemptSucceeded);
}
private function onReconnectFailed():void {
sendUserLoggedOutEvent();
}
private function sendConnectionSuccessEvent(userid:String):void{
var e:UsersConnectionEvent = new UsersConnectionEvent(UsersConnectionEvent.CONNECTION_SUCCESS);
e.userid = userid;
dispatcher.dispatchEvent(e);
}
public function sendMessage(service:String, onSuccess:Function, onFailure:Function, message:Object=null):void {
LOGGER.debug("SENDING [{0}]", [service]);
var responder:Responder = new Responder(
function(result:Object):void { // On successful result
onSuccess("Successfully sent [" + service + "].");
},
function(status:Object):void { // status - On error occurred
var errorReason:String = "Failed to send [" + service + "]:\n";
for (var x:Object in status) {
errorReason += "\t" + x + " : " + status[x];
}
}
);
if (message == null) {
_netConnection.call(service, responder);
} else {
_netConnection.call(service, responder, message);
}
}
/**
* Connect to the server.
* uri: The uri to the conference application.
* username: Fullname of the participant.
* role: MODERATOR/VIEWER
* conference: The conference room
* mode: LIVE/PLAYBACK - Live:when used to collaborate, Playback:when being used to playback a recorded conference.
* room: Need the room number when playing back a recorded conference. When LIVE, the room is taken from the URI.
*/
public function connect(params:ConferenceParameters, tunnel:Boolean = false):void {
_conferenceParameters = params;
tried_tunneling = tunnel;
try {
var uri:String = _applicationURI + "/" + _conferenceParameters.room;
LOGGER.debug("::Connecting to {0} [{1}]", [uri, jsonXify(_conferenceParameters)]);
_netConnection.connect(uri, _conferenceParameters.username, _conferenceParameters.role,
_conferenceParameters.room, _conferenceParameters.voicebridge,
_conferenceParameters.record, _conferenceParameters.externUserID,
_conferenceParameters.internalUserID, _conferenceParameters.muteOnStart, _conferenceParameters.lockSettings);
} catch(e:ArgumentError) {
// Invalid parameters.
switch (e.errorID) {
case 2004 :
LOGGER.debug("Error! Invalid server location: {0}", [uri]);
break;
default :
LOGGER.debug("UNKNOWN Error! Invalid server location: {0}", [uri]);
break;
}
}
}
public function disconnect(logoutOnUserCommand:Boolean):void {
this.logoutOnUserCommand = logoutOnUserCommand;
_netConnection.close();
}
public function forceClose():void {
_netConnection.close();
}
protected function netStatus(event:NetStatusEvent):void {
handleResult( event );
}
private var _bwMon:BandwidthMonitor = new BandwidthMonitor();
private function startMonitoringBandwidth():void {
LOGGER.info("Start monitoring bandwidth.");
var pattern:RegExp = /(?P<protocol>.+):\/\/(?P<server>.+)\/(?P<app>.+)/;
var result:Array = pattern.exec(_applicationURI);
_bwMon.serverURL = result.server;
_bwMon.serverApplication = "video";
_bwMon.start();
}
public function handleResult(event:Object):void {
var info : Object = event.info;
var statusCode : String = info.code;
var logData:Object = new Object();
logData.user = UsersUtil.getUserData();
switch (statusCode) {
case "NetConnection.Connect.Success":
LOGGER.debug("Connection to viewers application succeeded.");
JSLog.debug("Successfully connected to BBB App.", logData);
validateToken();
break;
case "NetConnection.Connect.Failed":
if (tried_tunneling) {
LOGGER.error(":Connection to viewers application failed...even when tunneling");
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_FAILED);
} else {
disconnect(false);
LOGGER.error(":Connection to viewers application failed...try tunneling");
var rtmptRetryTimer:Timer = new Timer(1000, 1);
rtmptRetryTimer.addEventListener("timer", rtmptRetryTimerHandler);
rtmptRetryTimer.start();
}
break;
case "NetConnection.Connect.Closed":
LOGGER.debug("Connection to viewers application closed");
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_CLOSED);
break;
case "NetConnection.Connect.InvalidApp":
LOGGER.debug(":viewers application not found on server");
sendConnectionFailedEvent(ConnectionFailedEvent.INVALID_APP);
break;
case "NetConnection.Connect.AppShutDown":
LOGGER.debug(":viewers application has been shutdown");
sendConnectionFailedEvent(ConnectionFailedEvent.APP_SHUTDOWN);
break;
case "NetConnection.Connect.Rejected":
LOGGER.debug(":Connection to the server rejected. Uri: {0}. Check if the red5 specified in the uri exists and is running", [_applicationURI]);
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_REJECTED);
break;
case "NetConnection.Connect.NetworkChange":
JSLog.warn("Detected network change to BBB App", logData);
LOGGER.debug("Detected network change. User might be on a wireless and temporarily dropped connection. Doing nothing. Just making a note.");
break;
default :
LOGGER.debug(":Default status to the viewers application" );
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
break;
}
}
private function rtmptRetryTimerHandler(event:TimerEvent):void {
LOGGER.debug("rtmptRetryTimerHandler: {0}", [event]);
connect(_conferenceParameters, true);
}
protected function netSecurityError(event: SecurityErrorEvent):void {
LOGGER.error("Security error - {0}", [event.text]);
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
}
protected function netIOError(event: IOErrorEvent):void {
LOGGER.error("Input/output error - {0}", [event.text]);
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
}
protected function netASyncError(event: AsyncErrorEvent):void {
LOGGER.debug("Asynchronous code error - {0}", [event.toString()]);
LOGGER.debug("Asynchronous code error - {0}", [event.toString()]);
sendConnectionFailedEvent(ConnectionFailedEvent.UNKNOWN_REASON);
}
private function sendConnectionFailedEvent(reason:String):void{
var logData:Object = new Object();
if (this.logoutOnUserCommand) {
logData.reason = "User requested.";
logData.user = UsersUtil.getUserData();
JSLog.debug("User logged out from BBB App.", logData);
sendUserLoggedOutEvent();
} else if (reason == ConnectionFailedEvent.CONNECTION_CLOSED) {
// do not try to reconnect if the connection failed is different than CONNECTION_CLOSED
logData.reason = reason;
logData.user = UsersUtil.getUserData();
JSLog.warn("User disconnected from BBB App.", logData);
if (reconnecting) {
var attemptFailedEvent:BBBEvent = new BBBEvent(BBBEvent.RECONNECT_CONNECTION_ATTEMPT_FAILED_EVENT);
attemptFailedEvent.payload.type = ReconnectionManager.BIGBLUEBUTTON_CONNECTION;
dispatcher.dispatchEvent(attemptFailedEvent);
} else {
reconnecting = true;
authenticated = false;
var disconnectedEvent:BBBEvent = new BBBEvent(BBBEvent.RECONNECT_DISCONNECTED_EVENT);
disconnectedEvent.payload.type = ReconnectionManager.BIGBLUEBUTTON_CONNECTION;
disconnectedEvent.payload.callback = connect;
disconnectedEvent.payload.callbackParameters = new Array(_conferenceParameters, tried_tunneling);
dispatcher.dispatchEvent(disconnectedEvent);
}
} else {
var e:ConnectionFailedEvent = new ConnectionFailedEvent(reason);
dispatcher.dispatchEvent(e);
}
}
private function sendUserLoggedOutEvent():void{
var e:ConnectionFailedEvent = new ConnectionFailedEvent(ConnectionFailedEvent.USER_LOGGED_OUT);
dispatcher.dispatchEvent(e);
}
public function onBWCheck(... rest):Number {
return 0;
}
public function onBWDone(... rest):void {
var p_bw:Number;
if (rest.length > 0) p_bw = rest[0];
// your application should do something here
// when the bandwidth check is complete
LOGGER.debug("bandwidth = {0} Kbps.", [p_bw]);
}
}
}

View File

@ -20,24 +20,20 @@ package org.bigbluebutton.main.model.users
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.TimerEvent;
import flash.external.ExternalInterface;
import flash.net.NetConnection;
import flash.utils.Timer;
import mx.collections.ArrayCollection;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.core.events.VoiceConfEvent;
import org.bigbluebutton.core.managers.ConfigManager;
import org.bigbluebutton.core.managers.ConnectionManager;
import org.bigbluebutton.core.managers.UserConfigManager;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.model.Config;
import org.bigbluebutton.core.model.MeetingModel;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.events.UserServicesEvent;
@ -54,7 +50,7 @@ package org.bigbluebutton.main.model.users
import org.bigbluebutton.modules.users.services.MessageSender;
public class UserService {
private static const LOG:String = "Users::UserService - ";
private static const LOGGER:ILogger = getClassLogger(UserService);
private var joinService:JoinService;
private var _conferenceParameters:ConferenceParameters;
@ -112,7 +108,7 @@ package org.bigbluebutton.main.model.users
_conferenceParameters.username = result.username;
_conferenceParameters.role = result.role;
_conferenceParameters.room = result.room;
_conferenceParameters.authToken = result.authToken;
_conferenceParameters.authToken = result.authToken;
_conferenceParameters.webvoiceconf = result.webvoiceconf;
_conferenceParameters.voicebridge = result.voicebridge;
_conferenceParameters.welcome = result.welcome;
@ -132,12 +128,12 @@ package org.bigbluebutton.main.model.users
_conferenceParameters.muteOnStart = muteOnStart;
_conferenceParameters.lockSettings = UserManager.getInstance().getConference().getLockSettings().toMap();
trace("_conferenceParameters.muteOnStart = " + _conferenceParameters.muteOnStart);
LOGGER.debug("_conferenceParameters.muteOnStart = {0}", [_conferenceParameters.muteOnStart]);
// assign the meeting name to the document title
ExternalInterface.call("setTitle", _conferenceParameters.meetingName);
trace(LOG + " Got the user info from web api.");
LOGGER.debug(" Got the user info from web api.");
/**
* Temporarily store the parameters in global BBB so we get easy access to it.
*/
@ -170,7 +166,7 @@ package org.bigbluebutton.main.model.users
}
public function changeRecordingStatus(e:BBBEvent):void {
trace(LOG + "changeRecordingStatus")
LOGGER.debug("changeRecordingStatus")
if (this.isModerator() && !e.payload.remote) {
var myUserId: String = UserManager.getInstance().getConference().getMyUserId();
sender.changeRecordingStatus(myUserId, e.payload.recording);
@ -178,7 +174,7 @@ package org.bigbluebutton.main.model.users
}
public function userLoggedIn(e:UsersConnectionEvent):void{
trace(LOG + "userLoggedIn - Setting my userid to [" + e.userid + "]");
LOGGER.debug("userLoggedIn - Setting my userid to [{0}]", [e.userid]);
UserManager.getInstance().getConference().setMyUserid(e.userid);
_conferenceParameters.userid = e.userid;

View File

@ -36,17 +36,19 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.managers.PopUpManager;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.vo.LockSettingsVO;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.modules.phone.PhoneOptions;
import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent;
import org.bigbluebutton.modules.phone.events.JoinVoiceConferenceCommand;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(AudioSelectionWindow);
private var phoneOptions:PhoneOptions = new PhoneOptions;
private function init():void {
@ -72,7 +74,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onMicClick():void {
trace("AudioSelectionWindow - Share Microphone Clicked");
LOGGER.debug("AudioSelectionWindow - Share Microphone Clicked");
var dispatcher:Dispatcher = new Dispatcher();
var command:JoinVoiceConferenceCommand = new JoinVoiceConferenceCommand();
command.mic = true;
@ -82,7 +84,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onListenClick():void {
trace("AudioSelectionWindow - Share Microphone Clicked");
LOGGER.debug("AudioSelectionWindow - Share Microphone Clicked");
var dispatcher:Dispatcher = new Dispatcher();
var command:JoinVoiceConferenceCommand = new JoinVoiceConferenceCommand();
command.mic = false;
@ -92,7 +94,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onCancelClicked():void {
trace("AudioSelectionWindow - Cancel clicked");
LOGGER.debug("AudioSelectionWindow - Cancel clicked");
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new AudioSelectionWindowEvent(AudioSelectionWindowEvent.CLOSED_AUDIO_SELECTION));

View File

@ -34,16 +34,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import mx.collections.ArrayCollection;
import mx.collections.ArrayList;
import mx.events.CloseEvent;
import mx.events.ItemClickEvent;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.model.VideoProfile;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
static public var PADDING_HORIZONTAL:Number = 6;

View File

@ -34,12 +34,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import mx.managers.PopUpManager;
import org.bigbluebutton.modules.phone.events.UseFlashModeCommand;
import org.bigbluebutton.util.i18n.ResourceUtil;
private function connectUsingFlashClicked():void {
dispatchEvent(new UseFlashModeCommand());

View File

@ -39,12 +39,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent;
import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;

View File

@ -20,7 +20,11 @@
break
}
titleLbl.text = value.title;
if (value.occurrences > 1) {
titleLbl.text = "(" + value.occurrences + ") " + titleLbl.text;
}
messageTxt.htmlText = value.message;
timeLbl.text = value.time;
validateNow();
}
@ -31,4 +35,7 @@
<mx:Label id="titleLbl" width="100%" styleName="statusTitleStyle"/>
<mx:Text id="messageTxt" width="100%" styleName="statusMessageStyle"/>
</mx:VBox>
<mx:VBox height="100%" verticalAlign="bottom">
<mx:Label id="timeLbl" width="100%" styleName="statusTimeStyle"/>
</mx:VBox>
</mx:HBox>

View File

@ -38,15 +38,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.modules.phone.events.UseFlashModeCommand;
import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private function handleWebRTCMediaSuccessEvent(e:WebRTCMediaEvent):void {
PopUpManager.removePopUp(this);

View File

@ -39,11 +39,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent;
import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;

View File

@ -36,25 +36,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import flash.system.Security;
import flash.system.SecurityPanel;
import flash.ui.Keyboard;
import com.asfusion.mate.events.Dispatcher;
import flash.ui.Keyboard;
import mx.controls.sliderClasses.Slider;
import mx.core.IFlexDisplayObject;
import mx.events.CloseEvent;
import mx.events.ItemClickEvent;
import mx.events.SliderEvent;
import mx.managers.PopUpManager;
import mx.managers.PopUpManager;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.modules.phone.PhoneOptions;
import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent;
import org.bigbluebutton.modules.phone.events.CallEchoTestAppEvent;
import org.bigbluebutton.modules.phone.events.FlashEchoTestFailedEvent;
import org.bigbluebutton.modules.phone.events.FlashEchoTestHasAudioEvent;
import org.bigbluebutton.modules.phone.events.FlashEchoTestNoAudioEvent;
@ -65,7 +60,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.phone.events.FlashStopEchoTestCommand;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOG:String = "Phone::FlashMicSettings - ";
private static const LOGGER:ILogger = getClassLogger(FlashMicSettings);
[Bindable] private var FLASH_MIC_SETTING_STATE:String = "flashMicSettingsState";
[Bindable] private var FLASH_ECHO_TEST_STATE:String = "flashEchoTestState";
@ -122,7 +117,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
reInitialize();
mic = Microphone.getMicrophone(comboMicList.selectedIndex);
trace(LOG + "Changing microphone. mic.index[" + mic.index + "] name=[" + mic.name + "]");
LOGGER.debug("Changing microphone. mic.index[{0}] name=[{1}]", [mic.index, mic.name]);
mic.addEventListener(StatusEvent.STATUS, micStatusEventHandler)
nsStream.attachAudio(mic);
@ -134,11 +129,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function micStatusEventHandler(event:StatusEvent):void {
switch(event.code) {
case "Microphone.Muted":
trace(LOG + "Access to microphone has been denied.");
LOGGER.debug("Access to microphone has been denied.");
statusText.text = "You did not allow Flash to access your mic.";
break;
case "Microphone.Unmuted":
trace(LOG + "Access to the microphone has been allowed.");
LOGGER.debug("Access to the microphone has been allowed.");
// Comment these next 2-lines. We don't want the user hearing audio
// while testing mic levels. (richard mar 26, 2014)
// mic.setLoopBack(true);
@ -149,7 +144,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
microphoneList = Microphone.names;
break;
default:
LogUtil.debug("unknown micStatusHandler event: " + event);
LOGGER.debug("unknown micStatusHandler event: {0}", [event]);
}
}
@ -160,7 +155,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onCreationComplete():void {
trace(LOG + "onCreationComplete. Seeting state to [flashMicSettingsTest]");
LOGGER.debug("onCreationComplete. Seeting state to [flashMicSettingsTest]");
microphoneList = Microphone.names;
setupForMicLoopbackTest();
}
@ -256,7 +251,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onCancelClicked():void {
trace(LOG + "onCancelClicked closing popup");
LOGGER.debug("onCancelClicked closing popup");
cleanUp();
stopEchoTest();
var dispatcher:Dispatcher = new Dispatcher();
@ -296,7 +291,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function yesButtonClicked():void {
trace(LOG + "Echo test passed.");
LOGGER.debug("Echo test passed.");
cleanUp();
dispatchEvent(new FlashEchoTestHasAudioEvent());
var dispatcher:Dispatcher = new Dispatcher();
@ -305,21 +300,21 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function noButtonClicked():void {
trace(LOG + "Echo test failed.");
LOGGER.debug("Echo test failed.");
dispatchEvent(new FlashEchoTestNoAudioEvent());
testMicrophoneLoopback();
setupForMicLoopbackTest();
}
private function flashMicSettingsCreated():void {
trace(LOG + "Available microphones: " + microphoneList);
LOGGER.debug("Available microphones: {0}", [microphoneList]);
testMicrophoneLoopback();
}
private function setupForEchoTestFailed():void
{
dotTimer.stop();
trace(LOG + "Setting state to " + FLASH_MIC_TEST_FAILED_STATE);
LOGGER.debug("Setting state to {0}", [FLASH_MIC_TEST_FAILED_STATE]);
setCurrentState(FLASH_MIC_TEST_FAILED_STATE);
}

View File

@ -60,7 +60,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.common.LogUtil;
private function changeLanguage():void {
ResourceUtil.getInstance().setPreferredLocale(ResourceUtil.getInstance().getLocaleCodeForIndex(selectedIndex));

View File

@ -31,13 +31,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(LoadingBar);
private var modules:Dictionary = new Dictionary();
private var numModules:int = 0;
private var portUpdateStr:String = 'Connecting to the server';
@ -47,11 +48,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
var item:XML;
numModules = 0;
trace("LoadingBar.mxml numModules=[" + numModules + "]");
LOGGER.debug("LoadingBar.mxml numModules=[{0}]", [numModules]);
for each(item in list){
modules[item.@name] = 0;
numModules++;
trace("LoadingBar.mxml numModules=[" + numModules + "] modulename=[" + item.@name + "]");
LOGGER.debug("LoadingBar.mxml numModules=[{0}] modulename=[{1}]", [numModules, item.@name]);
}
this.label = ResourceUtil.getInstance().getString('bbb.mainshell.statusProgress.loading', [numModules]);
@ -71,11 +72,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
//LogUtil.debug("Progress: " + totalProgress);
this.setProgress(totalProgress/numModules, 100);
}
private function allModulesLoaded(e:ModuleLoadEvent):void{
parent.removeChild(this);
if (parent != null) parent.removeChild(this);
}
private function testRTMP(e:PortTestEvent):void{
//- Cannot get locale string this early in loading process
portUpdateStr += "."

View File

@ -28,30 +28,32 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import mx.controls.TextArea;
import flexlib.controls.Highlighter;
import org.bigbluebutton.util.logging.Logger;
import mx.logging.Log;
import mx.logging.LogEventLevel;
import mx.collections.ArrayCollection;
import mx.managers.PopUpManager;
[Bindable]
public var logs:Logger;
import flexlib.controls.Highlighter;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.LOGGER_FACTORY;
import org.as3commons.logging.api.getClassLogger;
import org.as3commons.logging.setup.SimpleTargetSetup;
import org.bigbluebutton.util.logging.LogWindowTarget;
private static const LOGGER:ILogger = getClassLogger(LogWindow);
private var highlighter:Highlighter;
private var textField:TextField;
private function changeTarget():void {
if (!chkFlag.selected) {
logs.enableLogging(true)
var logWindowTarget : LogWindowTarget = new LogWindowTarget();
logWindowTarget.format = "{dateUTC} {time} :: {name} :: [{logLevel}] {message}";
LOGGER_FACTORY.setup = new SimpleTargetSetup(logWindowTarget);
} else {
logs.enableLogging(false)
LOGGER_FACTORY.setup = null;
}
}
private function displayLogMessages():void {
this.textField = this.getTextField(this.txtOutput);
highlighter = new Highlighter(this.textField);
txtOutput.text = logs.messages;
}
private function filter():void{

View File

@ -23,17 +23,19 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
title="{ResourceUtil.getInstance().getString('bbb.logout.title')}" showCloseButton="false" creationComplete="init()"
verticalScrollPolicy="off" horizontalScrollPolicy="off"
x="168" y="86" layout="vertical" width="400" height="200" horizontalAlign="center">
x="168" y="86" layout="vertical" width="400" height="110" horizontalAlign="center">
<mx:Script>
<![CDATA[
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
private static const LOG:String = "Main::LoggedOutWindow - ";
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(LoggedOutWindow);
[Bindable] private var message:String = "You have logged out of the conference";
private var urlLoader:URLLoader;
@ -46,17 +48,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
var pageHost:String = FlexGlobals.topLevelApplication.url.split("/")[0];
var pageURL:String = FlexGlobals.topLevelApplication.url.split("/")[2];
var request:URLRequest = new URLRequest(pageHost + "//" + pageURL + "/bigbluebutton/api/signOut");
LogUtil.debug("Log out url: " + pageHost + "//" + pageURL + "/bigbluebutton/api/signOut");
LOGGER.debug("Log out url: {0}//{1}/bigbluebutton/api/signOut", [pageHost, pageURL]);
request.method = URLRequestMethod.GET;
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, handleComplete);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, handleRedirectError);
urlLoader.load(request);
}
public function getLogoutUrl():String {
var logoutUrl:String = BBB.initUserConfigManager().getLogoutUrl();
if (logoutUrl == null) {
trace(LOG + "URL=[" + FlexGlobals.topLevelApplication.url + "]");
LOGGER.debug("URL=[{0}]", [FlexGlobals.topLevelApplication.url]);
var pageHost:String = FlexGlobals.topLevelApplication.url.split("/")[0];
var pageURL:String = FlexGlobals.topLevelApplication.url.split("/")[2];
logoutUrl = pageHost + "//" + pageURL;
@ -65,16 +68,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return logoutUrl;
}
private function handleComplete(e:Event):void {
trace(LOG + "Client URL=[" + FlexGlobals.topLevelApplication.url + "]");
private function handleComplete(e:Event):void {
LOGGER.debug("Client URL=[{0}]", [FlexGlobals.topLevelApplication.url]);
var request:URLRequest = new URLRequest(getLogoutUrl());
trace(LOG + "Logging out to: " + getLogoutUrl());
navigateToURL(request, '_self');
var request:URLRequest = new URLRequest(getLogoutUrl());
LOGGER.debug("Logging out to: {0}", [getLogoutUrl()]);
navigateToURL(request, '_self');
PopUpManager.removePopUp(this);
}
private function handleRedirectError(e:IOErrorEvent):void {
PopUpManager.removePopUp(this);
}
private function onUserLoggedOutWindowClose(e:Event):void {
PopUpManager.removePopUp(this);
}
@ -108,17 +115,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
break;
}
}
private function reconnect():void {
ExternalInterface.call("document.location.reload", true);
}
]]>
</mx:Script>
<mx:VBox width="100%" height="100%" horizontalAlign="center">
<mx:Text text="{message}"/>
<mx:Button id="okBtn" label="{ResourceUtil.getInstance().getString('bbb.logout.button.label')}" click="redirect()"/>
<mx:HRule width="100%" />
<mx:Text width="380" textAlign="center" text="{ResourceUtil.getInstance().getString('bbb.logout.refresh.message')}" />
<mx:Button id="reconnectBtn" label="{ResourceUtil.getInstance().getString('bbb.logout.refresh.label')}" click="reconnect()" />
</mx:VBox>
</mx:TitleWindow>
</mx:TitleWindow>

View File

@ -63,24 +63,26 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.events.FullScreenEvent;
import flash.events.IOErrorEvent;
import flash.events.TextEvent;
import flash.geom.Point;
import flexlib.mdi.effects.effectsLib.MDIVistaEffects;
import mx.collections.ArrayCollection;
import mx.containers.TitleWindow;
import mx.controls.Alert;
import mx.core.FlexGlobals;
import mx.core.IFlexDisplayObject;
import mx.core.UIComponent;
import mx.events.CloseEvent;
import mx.events.FlexEvent;
import mx.managers.PopUpManager;
import flexlib.mdi.effects.effectsLib.MDIVistaEffects;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBbbModuleWindow;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.AddUIComponentToMainCanvas;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
@ -92,35 +94,28 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.AppVersionEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ClientStatusEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.InvalidAuthTokenEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.MeetingNotFoundEvent;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent;
import org.bigbluebutton.modules.phone.events.FlashMicSettingsEvent;
import org.bigbluebutton.modules.phone.events.PerformEchoTestEvent;
import org.bigbluebutton.modules.phone.events.WebRTCAskUserToChangeMicEvent;
import org.bigbluebutton.modules.phone.events.WebRTCCallEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent;
import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent;
import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.util.logging.Logger;
private static const LOG:String = "Main::MainApplicationShell - ";
private static const LOGGER:ILogger = getClassLogger(MainApplicationShell);
private var globalDispatcher:Dispatcher;
private var dispState:String; //full-screen?
private var images:Images = new Images();
private var stoppedModules:ArrayCollection;
private var logs:Logger = new Logger();
private var logWindow:LogWindow;
private var scWindow:ShortcutHelpWindow;
private var logoutWindow:LoggedOutWindow;
@ -156,6 +151,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var confirmingLogout:Boolean = false;
private var chromeBrowser:ChromeWebcamPermissionImage = null;
public function getLogWindow() : LogWindow
{
if (logWindow == null){
logWindow = new LogWindow();
}
return logWindow;
}
public function initOptions(e:Event):void {
UserManager.getInstance().getConference().configLockSettings();
@ -196,14 +199,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
receivedConfigLocaleVer = true;
appVersion = event.appVersion;
localeVersion = event.localeVersion;
trace("Received locale version fron config.xml");
LOGGER.debug("Received locale version fron config.xml");
} else {
receivedResourceLocaleVer = true;
trace("Received locale version fron locale file.");
LOGGER.debug("Received locale version fron locale file.");
}
if (receivedConfigLocaleVer && receivedResourceLocaleVer) {
trace("Comparing locale versions.");
LOGGER.debug("Comparing locale versions.");
if (!event.suppressLocaleWarning) checkLocaleVersion(localeVersion);
if (sendStartModulesEvent) {
@ -214,7 +217,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function sendStartAllModulesEvent():void{
trace("Sending start all modules event");
LOGGER.debug("Sending start all modules event");
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.START_ALL_MODULES));
}
@ -222,21 +225,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function fullScreenHandler(evt:FullScreenEvent):void {
dispState = stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")";
if (evt.fullScreen) {
LogUtil.debug("Switching to full screen");
LOGGER.debug("Switching to full screen");
/* Do something specific here if we switched to full screen mode. */
} else {
LogUtil.debug("Switching to normal screen");
LOGGER.debug("Switching to normal screen");
/* Do something specific here if we switched to normal mode. */
}
}
private function openLogWindow():void {
if (logWindow == null){
logWindow = new LogWindow();
logWindow.logs = logs;
}
mdiCanvas.windowManager.add(logWindow);
mdiCanvas.windowManager.add(getLogWindow());
mdiCanvas.windowManager.absPos(logWindow, 50, 50);
logWindow.width = mdiCanvas.width - 100;
logWindow.height = mdiCanvas.height - 100;
@ -262,16 +261,16 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function toggleFullScreen():void{
LogUtil.debug("Toggling fullscreen");
LOGGER.debug("Toggling fullscreen");
try {
switch (stage.displayState) {
case StageDisplayState.FULL_SCREEN:
LogUtil.debug("full screen mode");
LOGGER.debug("full screen mode");
// If already in full screen mode, switch to normal mode.
stage.displayState = StageDisplayState.NORMAL;
break;
default:
LogUtil.debug("Normal screen mode");
LOGGER.debug("Normal screen mode");
// If not in full screen mode, switch to full screen mode.
stage.displayState = StageDisplayState.FULL_SCREEN;
break;
@ -353,7 +352,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
Alert.okLabel ="OK";
var version:String = "old-locales";
version = ResourceUtil.getInstance().getString('bbb.mainshell.locale.version');
trace("Locale from config=" + localeVersion + ", from locale file=" + version);
LOGGER.debug("Locale from config={0}, from locale file={1}", [localeVersion, version]);
if ((version == "old-locales") || (version == "") || (version == null)) {
wrongLocaleVersion();
@ -509,7 +508,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
mdiCanvas.removeAllWindows();
var pageHost:String = FlexGlobals.topLevelApplication.url.split("/")[0];
var pageURL:String = FlexGlobals.topLevelApplication.url.split("/")[2];
trace(LOG + "SingOut to [" + pageHost + "//" + pageURL + "/bigbluebutton/api/signOut]");
LOGGER.debug("SingOut to [{0}//{1}/bigbluebutton/api/signOut]", [pageHost, pageURL]);
var request:URLRequest = new URLRequest(pageHost + "//" + pageURL + "/bigbluebutton/api/signOut");
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, handleLogoutComplete);
@ -521,7 +520,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function getLogoutUrl():String {
var logoutUrl:String = BBB.initUserConfigManager().getLogoutUrl();
if (logoutUrl == null) {
trace(LOG + "URL=[" + FlexGlobals.topLevelApplication.url + "]");
LOGGER.debug("URL=[{0}]", [FlexGlobals.topLevelApplication.url]);
var pageHost:String = FlexGlobals.topLevelApplication.url.split("/")[0];
var pageURL:String = FlexGlobals.topLevelApplication.url.split("/")[2];
logoutUrl = pageHost + "//" + pageURL;
@ -537,20 +536,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function redirectToLogoutUrl ():void {
var logoutURL:String = getLogoutUrl();
var logoutURL:String = getLogoutUrl();
var request:URLRequest = new URLRequest(logoutURL);
trace(LOG + "Logging out to: " + logoutURL);
LOGGER.debug("Logging out to: {0}", [logoutURL]);
navigateToURL(request, '_self');
}
private function handleLogoutError(e:Event):void {
LogUtil.debug("Call to signOut URL failed.");
LOGGER.debug("Call to signOut URL failed.");
redirectToLogoutUrl();
}
private function handleLogoutComplete(e:Event):void {
LogUtil.debug("Call to signOut URL succeeded.");
LOGGER.debug("Call to signOut URL succeeded.");
redirectToLogoutUrl();
}
@ -582,6 +581,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function handleInvalidAuthToken(event:InvalidAuthTokenEvent):void {
showlogoutWindow(ResourceUtil.getInstance().getString('bbb.mainshell.invalidAuthToken'));
globalDispatcher.dispatchEvent(new BBBEvent(BBBEvent.CANCEL_RECONNECTION_EVENT));
}
private function handleRemoveToolbarComponent(event:ToolbarButtonEvent):void {
@ -631,7 +631,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onFooterLinkClicked(e:TextEvent):void{
trace("Clicked on link[" + e.text + "] from footer");
LOGGER.debug("Clicked on link[{0}] from footer", [e.text]);
if (ExternalInterface.available) {
ExternalInterface.call("chatLinkClicked", e.text);
}

View File

@ -24,11 +24,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import flexlib.mdi.containers.MDIWindow;
import mx.controls.Alert;
import mx.utils.ArrayUtil;
import flexlib.mdi.containers.MDIWindow;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBbbModuleWindow;
import org.bigbluebutton.common.LogUtil;
public static const TOP_2_3:String = "top-two-thirds";
public static const BOTTOM_1_3:String = "bottom-one-third";
@ -42,6 +44,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public static const POPUP:String = "popup";
public static const ABSOLUTE:String = "absolute";
private static const LOGGER:ILogger = getClassLogger(MainCanvas);
public static const DESKTOP_SHARING_VIEW:String = "POP_UP_DESKSHARE_VIEW";
public static const DESKTOP_SHARING_PUBLISH:String = "POP_UP_DESKSHARE_PUBLISH";
@ -71,7 +75,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
if (ArrayUtil.getItemIndex(window, windowManager.windowList) != -1) {
windowManager.remove(window as MDIWindow);
} else {
LogUtil.debug("Trying to remove the window [ " + window + " ] but it's not a MainCanvas child");
LOGGER.debug("Trying to remove the window [ {0} ] but it's not a MainCanvas child", [window]);
}
}

View File

@ -42,28 +42,29 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.accessibility.AlertAccImpl;
import mx.controls.Alert;
import mx.core.UIComponent;
import mx.events.CloseEvent;
import org.bigbluebutton.common.IBbbToolbarComponent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.common.events.ToolbarButtonEvent;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.services.BandwidthMonitor;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.SettingsEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.users.events.ConferenceCreatedEvent;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import com.asfusion.mate.events.Dispatcher;
import mx.accessibility.AlertAccImpl;
import mx.controls.Alert;
import mx.core.UIComponent;
import mx.events.CloseEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBbbToolbarComponent;
import org.bigbluebutton.common.events.ToolbarButtonEvent;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.SettingsEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.users.events.ConferenceCreatedEvent;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(MainToolbar);
private var DEFAULT_HELP_URL:String = "http://www.bigbluebutton.org/content/videos";
@ -170,7 +171,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function handleEndMeetingEvent(event:BBBEvent):void {
trace("Received end meeting event.");
LOGGER.debug("Received end meeting event.");
doLogout();
}

View File

@ -44,31 +44,32 @@ $Id: $
<mx:Script>
<![CDATA[
import mx.binding.utils.BindingUtils;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.core.events.VoiceConfEvent;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.util.i18n.ResourceUtil;
import flash.filters.BitmapFilterQuality;
private static const LOG:String = "Main::View::MuteMeButton - ";
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.core.events.VoiceConfEvent;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(MuteMeButton);
private var muteMeRolled:Boolean = false;
[Bindable] private var images:Images = new Images();
private function onCreationComplete():void {
trace(LOG + " initialized");
LOGGER.debug("initialized");
}
private function handleUserTalking(e:CoreEvent):void {
@ -97,7 +98,7 @@ $Id: $
private function handleJoinedVoiceConferenceEvent(event:BBBEvent):void {
if (UsersUtil.isMe(event.payload.userID)) {
trace(LOG + "User has joined the conference using flash");
LOGGER.debug("User has joined the conference using flash");
updateMuteMeBtn();
muteMeBtnImg.filters = [];
}
@ -105,7 +106,7 @@ $Id: $
private function handleLeftVoiceConferenceEvent(event:BBBEvent):void {
if (UsersUtil.isMe(event.payload.userID)) {
trace(LOG + "User has left the conference using flash");
LOGGER.debug("User has left the conference using flash");
updateMuteMeBtn();
}
}
@ -114,7 +115,7 @@ $Id: $
var userManager:UserManager = UserManager.getInstance();
var conference:Conference = userManager.getConference();
var me:BBBUser = conference.getMyUser();
// trace(LOG + "allowMuteUnmute [ voiceJoined=[" + conference.voiceJoined + "], disableMic=[" + me.disableMyMic + "]");
// LOGGER.debug("allowMuteUnmute [ voiceJoined=[" + conference.voiceJoined + "], disableMic=[" + me.disableMyMic + "]");
return (conference.voiceJoined && !me.disableMyMic);
}
@ -158,7 +159,7 @@ $Id: $
private function handleVoiceMutedEvent(event:BBBEvent):void {
if (UsersUtil.isMe(event.payload.userID)) {
trace(LOG + "User has been muted/unmuted");
LOGGER.debug("User has been muted/unmuted");
if (muteMeRolled) {
if (! event.payload.muted) {
muteMeBtnImg.source = images.audio;

View File

@ -33,19 +33,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import flash.utils.Timer;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.main.model.NetworkStatsData;
import mx.effects.Fade;
import mx.events.EffectEvent;
import mx.formatters.NumberFormatter;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBbbModuleWindow;
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.main.model.NetworkStatsData;
private static const LOGGER:ILogger = getClassLogger(NetworkStatsWindow);
private var _globalDispatcher:Dispatcher = new Dispatcher();
private var _updateTimer:Timer = new Timer(1000);
@ -82,7 +85,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function onResize():void {
LogUtil.debug("width=" + width + " height=" + height);
LOGGER.debug("width={0} height={1}", [width, height]);
}
public function appear():void {

View File

@ -25,14 +25,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
x="168" y="86" layout="vertical" width="400" height="150" horizontalAlign="center">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(OldLocaleWarnWindow);
private const windowTitleDefault:String = "Warning: Old Language Version";
private const reminder1Default:String = "You have an old language translation of BigBlueButton.";
private const reminder2Default:String = "Please clear your browser cache and try again.";
@ -60,7 +61,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
var pageHost:String = FlexGlobals.topLevelApplication.url.split("/")[0];
var pageURL:String = FlexGlobals.topLevelApplication.url.split("/")[2];
var request:URLRequest = new URLRequest(pageHost + "//" + pageURL + "/bigbluebutton/api/signOut");
LogUtil.debug("Log out url: " + pageHost + "//" + pageURL + "/bigbluebutton/api/signOut");
LOGGER.debug("Log out url: {0}//{1}/bigbluebutton/api/signOut", [pageHost, pageURL]);
request.method = URLRequestMethod.GET;
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, handleComplete);

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2015 BigBlueButton Inc. and 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 3.0 of the License, or (at your option) any later
version.
BigBlueButton 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 BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
-->
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:mate="http://mate.asfusion.com/"
verticalScrollPolicy="off"
horizontalScrollPolicy="off"
horizontalAlign="center"
width="250"
title="{ResourceUtil.getInstance().getString('bbb.connection.failure')}">
<mx:Script>
<![CDATA[
import org.bigbluebutton.util.i18n.ResourceUtil;
]]>
</mx:Script>
<mx:HBox width="100%" height="100%" verticalAlign="middle">
<mx:Box
paddingBottom="10"
paddingTop="10"
paddingLeft="10"
paddingRight="10"
>
<mx:Image id="typeImg" source="{typeImg.getStyle('refreshImage')}" width="34" height="34" styleName="statusImageStyle" />
</mx:Box>
<mx:Text
selectable="false"
text="{ResourceUtil.getInstance().getString('bbb.connection.reconnecting')}"
width="100%"/>
</mx:HBox>
</mx:Panel>

View File

@ -41,18 +41,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{WebRTCCallEvent.WEBRTC_CALL_STARTED}" method="handleWebRTCCallStarted" />
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.controls.Alert;
import mx.events.CloseEvent;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.model.MeetingModel;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.modules.phone.events.FlashJoinedVoiceConferenceEvent;
import org.bigbluebutton.modules.phone.events.WebRTCCallEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import com.asfusion.mate.events.Dispatcher;
import mx.controls.Alert;
import mx.events.CloseEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.model.MeetingModel;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.modules.phone.events.FlashJoinedVoiceConferenceEvent;
import org.bigbluebutton.modules.phone.events.WebRTCCallEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(RecordButton);
private var recordingFlag:Boolean;
private var firstAudioJoin:Boolean = true;
@ -66,7 +70,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function confirmChangeRecordingStatus():void {
trace("Confirming recording status change!!!!");
LOGGER.debug("Confirming recording status change!!!!");
// need to save the flag in case of any remote update on the recording status
recordingFlag = !this.selected;
@ -107,7 +111,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
this.enabled = false;
trace("RecordButton:doChangeRecordingStatus changing record status to " + event.payload.recording);
LOGGER.debug("RecordButton:doChangeRecordingStatus changing record status to {0}", [event.payload.recording]);
}
private function onRecordingStatusChanged(event:BBBEvent):void {
@ -120,7 +124,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
this.enabled = true;
}
trace("RecordButton:onRecordingStatusChanged changing record status to " + event.payload.recording);
LOGGER.debug("RecordButton:onRecordingStatusChanged changing record status to {0}", [event.payload.recording]);
}
}

View File

@ -34,16 +34,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import flash.events.Event;
import com.asfusion.mate.events.Dispatcher;
import flexlib.mdi.events.MDIWindowEvent;
import flexlib.controls.textClasses.StringBoundaries;
import flash.events.MouseEvent;
import mx.collections.ArrayCollection;
import mx.collections.ArrayList;
import org.bigbluebutton.common.LogUtil;
import flexlib.mdi.events.MDIWindowEvent;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.ShortcutOptions;
@ -56,6 +57,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var pollKeys:ArrayList;
private var pollVoteKeys:ArrayList;
private static const LOGGER:ILogger = getClassLogger(ShortcutHelpWindow);
[Bindable] private var generalString:String = ResourceUtil.getInstance().getString("bbb.shortcuthelp.dropdown.general");
[Bindable] private var presentationString:String = ResourceUtil.getInstance().getString("bbb.shortcuthelp.dropdown.presentation");
[Bindable] private var chatString:String = ResourceUtil.getInstance().getString("bbb.shortcuthelp.dropdown.chat");
@ -255,7 +258,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
public function focusButton(e:MDIWindowEvent):void{
LogUtil.debug("Caught close event from window");
LOGGER.debug("Caught close event from window");
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new ShortcutEvent(ShortcutEvent.FOCUS_SHORTCUT_BUTTON));
}

View File

@ -1,27 +1,28 @@
package org.bigbluebutton.main.views
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.ActivityEvent;
import flash.events.StatusEvent;
import flash.events.TimerEvent;
import flash.events.ActivityEvent;
import flash.media.Camera;
import flash.media.Video
import flash.media.Video;
import flash.net.NetStream;
import flash.system.Security;
import flash.system.SecurityPanel;
import flash.utils.Timer;
import mx.containers.Canvas;
import mx.controls.Text;
import mx.core.UIComponent;
import mx.events.FlexEvent;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.model.VideoProfile;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.util.i18n.ResourceUtil;
public class VideoWithWarnings extends VideoWithWarningsBase {
private var hideWarningTimer:Timer = null;
private static const LOGGER:ILogger = getClassLogger(VideoWithWarnings);
private var hideWarningTimer:Timer = null;
private var _camera:Camera = null;
private var _activationTimer:Timer = null;
private var _waitingForActivation:Boolean = false;
@ -83,7 +84,7 @@ package org.bigbluebutton.main.views
// _text.text = "The quick brown fox jumps over the lazy dog";
_text.setStyle("styleName", styleName);
_text.visible = true;
trace("Showing warning: " + text);
LOGGER.debug("Showing warning: {0}", [text]);
}
private function showError(resourceName:String, autoHide:Boolean=false):void {
@ -157,16 +158,16 @@ package org.bigbluebutton.main.views
}
private function displayVideoPreview():void {
trace("Using this video profile:: " + _videoProfile.toString());
LOGGER.debug("Using this video profile:: {0}", [_videoProfile.toString()]);
_camera.setMotionLevel(5, 1000);
_camera.setKeyFrameInterval(_videoProfile.keyFrameInterval);
_camera.setMode(_videoProfile.width, _videoProfile.height, _videoProfile.modeFps);
_camera.setQuality(_videoProfile.qualityBandwidth, _videoProfile.qualityPicture);
if (_camera.width != _videoProfile.width || _camera.height != _videoProfile.height)
trace("Resolution " + _videoProfile.width + "x" + _videoProfile.height + " is not supported, using " + _camera.width + "x" + _camera.height + " instead");
LOGGER.debug("Resolution {0}x{1} is not supported, using {2}x{3} instead", [_videoProfile.width, _videoProfile.height, _camera.width, _camera.height]);
_video.attachCamera(_camera);
_video.attachCamera(_camera);
}
override protected function updateDisplayList(w:Number, h:Number):void {

View File

@ -33,16 +33,21 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import flash.globalization.DateTimeFormatter;
import flash.globalization.DateTimeStyle;
import flash.globalization.LocaleID;
import mx.controls.ToolTip;
import mx.core.FlexGlobals;
import mx.events.FlexEvent;
import mx.managers.PopUpManager;
import mx.managers.ToolTipManager;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.main.events.ClientStatusEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOG:String = "WarningButton - ";
private static const LOGGER:ILogger = getClassLogger(WarningButton);
[Bindable]
private var messages:Array = new Array();
@ -57,24 +62,38 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function handleSuccessMessageEvent(e:ClientStatusEvent):void {
if(isUniqueMessage("success", e.title, e.message)) {
messages.push({type:"success",title:e.title,message:e.message});
showNotification();
}
handleMessageEvent("success", e);
}
private function handleWarningMessageEvent(e:ClientStatusEvent):void {
if(isUniqueMessage("warning", e.title, e.message)) {
messages.push({type:"warning",title:e.title,message:e.message});
showNotification();
}
handleMessageEvent("warning", e);
}
private function handleFailMessageEvent(e:ClientStatusEvent):void {
if(isUniqueMessage("fail", e.title, e.message)) {
messages.push({type:"fail",title:e.title,message:e.message});
showNotification();
handleMessageEvent("fail", e);
}
private function handleMessageEvent(type:String, e:ClientStatusEvent):void {
var index:Number = getMessageIndex(type, e.title, e.message);
var obj:Object;
if (index != -1) {
obj = messages.splice(index, 1)[0];
obj.occurrences++;
} else {
obj = {
type: type,
title: e.title,
message: e.message,
occurrences: 1
};
}
var dtf:DateTimeFormatter = new DateTimeFormatter(LocaleID.DEFAULT, DateTimeStyle.NONE, DateTimeStyle.MEDIUM);
var time:String = dtf.format(new Date());
obj.time = time;
messages.push(obj);
showNotification();
}
private function showNotification():void {
@ -91,12 +110,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
}
private function isUniqueMessage(type:String, title:String, message:String):Boolean {
private function getMessageIndex(type:String, title:String, message:String):int {
for (var i:Number=0; i<messages.length; i++) {
if (messages[i].type == type && messages[i].title == title && messages[i].message == message)
return false;
return i;
}
return true;
return -1;
}
private function handleButtonClick():void {

View File

@ -39,23 +39,24 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.managers.PopUpManager;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.api.JSAPI;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.modules.phone.PhoneModel;
import org.bigbluebutton.modules.phone.PhoneOptions;
import org.bigbluebutton.modules.phone.events.WebRTCCallEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestStartedEvent;
import org.bigbluebutton.modules.phone.events.WebRTCJoinedVoiceConferenceEvent;
import org.bigbluebutton.modules.phone.models.Constants;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.core.UsersUtil;
import com.asfusion.mate.events.Dispatcher;
import mx.managers.PopUpManager;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.modules.phone.PhoneModel;
import org.bigbluebutton.modules.phone.events.WebRTCCallEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent;
import org.bigbluebutton.modules.phone.events.WebRTCEchoTestStartedEvent;
import org.bigbluebutton.modules.phone.events.WebRTCJoinedVoiceConferenceEvent;
import org.bigbluebutton.modules.phone.models.Constants;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOG:String = "Phone::WebRTCEchoTest - ";
private static const LOGGER:ILogger = getClassLogger(WebRTCEchoTest);
private static var DEFAULT_HELP_URL:String = "http://www.bigbluebutton.org/content/videos";
private var dotTimer:Timer;
@ -98,7 +99,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function yesButtonClicked():void {
userClosed = true;
trace(LOG + "Echo test passed.");
LOGGER.debug("Echo test passed.");
var logData:Object = new Object();
logData.reason = "User requested.";
@ -114,13 +115,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function noButtonClicked():void {
userClosed = true;
trace(LOG + "Echo test failed.");
var logData:Object = new Object();
logData.reason = "User requested.";
logData.user = UsersUtil.getUserData();
JSLog.info("WebRtc Echo test failed.", logData);
LOGGER.warn("Echo test failed.");
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new WebRTCEchoTestEvent(WebRTCEchoTestEvent.WEBRTC_ECHO_TEST_NO_AUDIO));
onCancelClicked();

View File

@ -20,19 +20,9 @@ package org.bigbluebutton.modules.broadcast.managers
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.AsyncErrorEvent;
import flash.events.Event;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import mx.core.UIComponent;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.modules.broadcast.models.BroadcastOptions;
@ -43,6 +33,8 @@ package org.bigbluebutton.modules.broadcast.managers
import org.bigbluebutton.modules.broadcast.views.BroadcastWindow;
public class BroadcastManager {
private static const LOGGER:ILogger = getClassLogger(BroadcastManager);
private var broadcastWindow:BroadcastWindow;
private var dispatcher:Dispatcher;
private var broadcastService:BroadcastService = new BroadcastService();
@ -55,11 +47,11 @@ package org.bigbluebutton.modules.broadcast.managers
public function BroadcastManager() {
streamService = new StreamsService(this);
LogUtil.debug("BroadcastManager Created");
LOGGER.debug("BroadcastManager Created");
}
public function start():void {
LogUtil.debug("BroadcastManager Start");
LOGGER.debug("BroadcastManager Start");
opt = new BroadcastOptions();
dispatcher = new Dispatcher();
streamService.queryAvailableStreams(opt.streamsUri);
@ -67,7 +59,7 @@ package org.bigbluebutton.modules.broadcast.managers
public function handleStreamsListLoadedEvent():void {
if (broadcastWindow == null){
trace("*** BroadcastManager Opening BroadcastModule Window");
LOGGER.debug("*** BroadcastManager Opening BroadcastModule Window");
broadcastWindow = new BroadcastWindow();
broadcastWindow.options = opt;
@ -80,7 +72,7 @@ package org.bigbluebutton.modules.broadcast.managers
dispatcher.dispatchEvent(e);
} else {
trace("***BroadcastManager Not Opening BroadcastModule Window");
LOGGER.debug("***BroadcastManager Not Opening BroadcastModule Window");
}
sendWhatIsTheCurrentStreamRequest();
@ -106,12 +98,12 @@ package org.bigbluebutton.modules.broadcast.managers
}
public function playVideo(index:int):void {
trace("BroadcastManager::playVideo [" + streams.streamUrls[index] + "],[" + streams.streamIds[index] + "],[" + streams.streamNames[index] + "]");
LOGGER.debug("BroadcastManager::playVideo [{0}],[{1}],[{2}]", [streams.streamUrls[index], streams.streamIds[index], streams.streamNames[index]]);
broadcastService.playStream(streams.streamUrls[index], streams.streamIds[index], streams.streamNames[index]);
}
public function stopVideo():void {
trace("BroadcastManager::stopVideo");
LOGGER.debug("BroadcastManager::stopVideo");
broadcastService.stopStream();
}
@ -120,21 +112,18 @@ package org.bigbluebutton.modules.broadcast.managers
}
public function handleWhatIsTheCurrentStreamRequest(event:BBBEvent):void {
trace("BroadcastManager:: handleWhatIsTheCurrentStreamRequest " + event.payload["requestedBy"] );
LOGGER.debug("BroadcastManager:: handleWhatIsTheCurrentStreamRequest {0}", [event.payload["requestedBy"]]);
var isPresenter:Boolean = UserManager.getInstance().getConference().amIPresenter;
if (isPresenter && curStream != null) {
trace("MessageSender:: sendWhatIsTheCurrentStreamReply [" + event.payload["requestedBy"]
+ "," + curStream.getStreamId() + "]");
LOGGER.debug("MessageSender:: sendWhatIsTheCurrentStreamReply [{0},{1}]", [event.payload["requestedBy"], curStream.getStreamId()]);
broadcastService.sendWhatIsTheCurrentStreamReply(event.payload["requestedBy"], curStream.getStreamId());
}
}
public function handleWhatIsTheCurrentStreamReply(event:BBBEvent):void {
trace("BroadcastManager:: handleWhatIsTheCurrentStreamReply [" + event.payload["requestedBy"]
+ "," + event.payload["streamID"] + "]");
LOGGER.debug("BroadcastManager:: handleWhatIsTheCurrentStreamReply [{0},{1}]",[event.payload["requestedBy"], event.payload["streamID"]]);
var amIRequester:Boolean = UserManager.getInstance().getConference().amIThisUser(event.payload["requestedBy"]);
trace("BroadcastManager:: handleWhatIsTheCurrentStreamReply [my id=" + UserManager.getInstance().getConference().getMyUserId()
+ ", requester=" + event.payload["requestedBy"] + "]");
LOGGER.debug("BroadcastManager:: handleWhatIsTheCurrentStreamReply [my id={0}, requester={1}]", [UserManager.getInstance().getConference().getMyUserId(), event.payload["requestedBy"]]);
if (amIRequester) {
var streamId:String = event.payload["streamID"];
var info:Object = streams.getStreamNameAndUrl(streamId);
@ -145,19 +134,19 @@ package org.bigbluebutton.modules.broadcast.managers
}
private function playStream(url:String, streamId:String, streamName:String):void {
trace("BroadcastManager::playStream [" + url + "], [" + streamId + "], [" + streamName + "]");
LOGGER.debug("BroadcastManager::playStream [{0}], [{1}], [{2}]", [url, streamId, streamName]);
curStream = new Stream(url, streamId, streamName);
broadcastWindow.curStream = curStream;
curStream.play(broadcastWindow);
}
public function handlePlayStreamRequest(event:BBBEvent):void {
trace("BroadcastManager Received " + event.payload["messageID"]);
LOGGER.debug("BroadcastManager Received {0}", [event.payload["messageID"]]);
playStream(event.payload["uri"], event.payload["streamID"], event.payload["streamName"]);
}
public function handleStopStreamRequest(event:BBBEvent):void {
trace("BroadcastManager Received " + event.payload["messageID"]);
LOGGER.debug("BroadcastManager Received {0}", [event.payload["messageID"]]);
stopPlayingStream();
}

View File

@ -27,10 +27,13 @@ package org.bigbluebutton.modules.broadcast.models
import mx.core.UIComponent;
import org.bigbluebutton.common.LogUtil;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.modules.broadcast.views.BroadcastWindow;
public class Stream {
private static const LOGGER:ILogger = getClassLogger(Stream);
private var uri:String;
private var streamId:String;
private var streamName:String;
@ -85,30 +88,30 @@ package org.bigbluebutton.modules.broadcast.models
private function netstreamStatus(evt:NetStatusEvent):void {
switch(evt.info.code) {
case "NetStream.Play.StreamNotFound":
LogUtil.debug("NetStream.Play.StreamNotFound");
LOGGER.warn("NetStream.Play.StreamNotFound");
break;
case "NetStream.Play.Failed":
LogUtil.debug("NetStream.Play.Failed");
LOGGER.error("NetStream.Play.Failed");
break;
case "NetStream.Play.Start":
LogUtil.debug("NetStream.Play.Start");
LOGGER.debug("NetStream.Play.Start");
break;
case "NetStream.Play.Stop":
LogUtil.debug("NetStream.Play.Stop");
LOGGER.debug("NetStream.Play.Stop");
break;
case "NetStream.Buffer.Full":
LogUtil.debug("NetStream.Buffer.Full");
LOGGER.warn("NetStream.Buffer.Full");
break;
default:
}
}
private function nsAsyncErrorHandler(event:AsyncErrorEvent):void {
LogUtil.debug("nsAsyncErrorHandler: " + event);
LOGGER.debug("nsAsyncErrorHandler: {0}", [event]);
}
private function connect():void {
LogUtil.debug("Connecting " + uri);
LOGGER.debug("Connecting {0}", [uri]);
nc = new NetConnection();
nc.proxyType = "best";
nc.connect(uri);
@ -120,25 +123,25 @@ package org.bigbluebutton.modules.broadcast.models
private function netStatus(evt:NetStatusEvent ):void {
switch(evt.info.code) {
case "NetConnection.Connect.Success":
LogUtil.debug("Successfully connected to broadcast application.");
LOGGER.debug("Successfully connected to broadcast application.");
displayVideo();
break;
case "NetConnection.Connect.Failed":
LogUtil.debug("Failed to connect to broadcast application.");
LOGGER.error("Failed to connect to broadcast application.");
break;
case "NetConnection.Connect.Closed":
trace("Connection to broadcast application has closed.");
LOGGER.debug("Connection to broadcast application has closed.");
break;
case "NetConnection.Connect.Rejected":
LogUtil.debug("Connection to broadcast application was rejected.");
LOGGER.warn("Connection to broadcast application was rejected.");
break;
default:
LogUtil.debug("Connection to broadcast application failed. " + evt.info.code);
LOGGER.error("Connection to broadcast application failed. {0}", [evt.info.code]);
}
}
private function securityErrorHandler(event:SecurityErrorEvent):void {
LogUtil.debug("securityErrorHandler: " + event);
LOGGER.debug("securityErrorHandler: {0}", [event]);
}
public function onBWCheck(... rest):Number {
@ -150,7 +153,7 @@ package org.bigbluebutton.modules.broadcast.models
if (rest.length > 0) p_bw = rest[0];
// your application should do something here
// when the bandwidth check is complete
LogUtil.debug("bandwidth = " + p_bw + " Kbps.");
LOGGER.debug("bandwidth = {0} Kbps.", [p_bw]);
}
public function stop():void {
@ -162,12 +165,11 @@ package org.bigbluebutton.modules.broadcast.models
}
public function onCuePoint(infoObject:Object):void {
LogUtil.debug("onCuePoint");
LOGGER.debug("onCuePoint");
}
public function onMetaData(info:Object):void {
LogUtil.debug("****metadata: width=" + info.width + " height=" + info.height);
trace("****metadata: width=" + info.width + " height=" + info.height);
LOGGER.debug("****metadata: width={0} height={1}" + [info.width, info.height]);
videoWidth = info.width;
videoHeight = info.height;
@ -181,7 +183,7 @@ package org.bigbluebutton.modules.broadcast.models
}
public function onPlayStatus(infoObject:Object):void {
LogUtil.debug("onPlayStatus");
LOGGER.debug("onPlayStatus");
}
private function centerToWindow():void{

Some files were not shown because too many files have changed in this diff Show More