Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- query presentation

  • Loading branch information...
commit 1419234ad5dc70aae1b3845ed24d9c7f33430320 1 parent b8d67e4
@ritzalam ritzalam authored
Showing with 1,428 additions and 96 deletions.
  1. +4 −4 bigbluebutton-client/build.xml
  2. +1 −1  bigbluebutton-client/resources/config.xml.template
  3. +10 −5 bigbluebutton-client/src/BreakoutModule.mxml
  4. +5 −1 bigbluebutton-client/src/ChatModule.mxml
  5. +5 −1 bigbluebutton-client/src/ClassroomAudioModule.mxml
  6. +6 −2 bigbluebutton-client/src/DeskShareModule.mxml
  7. +5 −1 bigbluebutton-client/src/DynamicInfoModule.mxml
  8. +5 −1 bigbluebutton-client/src/ExampleChatModule.mxml
  9. +6 −1 bigbluebutton-client/src/ListenersModule.mxml
  10. +6 −2 bigbluebutton-client/src/PhoneModule.mxml
  11. +11 −56 bigbluebutton-client/src/PresentModule.mxml
  12. +5 −1 bigbluebutton-client/src/SettingsModule.mxml
  13. +6 −1 bigbluebutton-client/src/SharedNotesModule.mxml
  14. +5 −1 bigbluebutton-client/src/VideoconfModule.mxml
  15. +5 −1 bigbluebutton-client/src/VideodockModule.mxml
  16. +6 −2 bigbluebutton-client/src/ViewersModule.mxml
  17. +5 −1 bigbluebutton-client/src/WhiteboardModule.mxml
  18. +1 −1  bigbluebutton-client/src/org/bigbluebutton/common/IBigBlueButtonModule.as
  19. +11 −1 bigbluebutton-client/src/org/bigbluebutton/core/controllers/maps/BigBlueButtonAppEventMap.mxml
  20. +2 −0  bigbluebutton-client/src/org/bigbluebutton/core/model/ConfigModel.as
  21. +1 −1  bigbluebutton-client/src/org/bigbluebutton/core/model/MeetingModel.as
  22. +3 −0  bigbluebutton-client/src/org/bigbluebutton/core/model/ModuleModel.as
  23. +4 −0 bigbluebutton-client/src/org/bigbluebutton/core/services/UsersService.as
  24. +1 −1  bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as
  25. +1 −9 bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentationService.as
  26. +67 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/controllers/maps/PresentationEventMap.mxml
  27. +25 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/controllers/maps/PresentationEventMapDelegate.as
  28. +0 −1  bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/Slide.as
  29. +36 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Page.as
  30. +9 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Pages.as
  31. +39 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Presentation.as
  32. +44 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/PresentationConfigModel.as
  33. +25 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/PresentationModel.as
  34. +19 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Presentations.as
  35. +34 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as
  36. +111 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationLoaderService.as
  37. +615 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationSOService.as
  38. +116 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationUploadService.as
  39. +34 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/ThumbnailLoaderService.as
  40. +125 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindowEventMap.mxml
  41. +9 −0 bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindowEventMapDelegate.as
View
8 bigbluebutton-client/build.xml
@@ -232,16 +232,16 @@
</target>
<!-- just a grouping of modules to compile -->
- <!-- build-bbb-main-test, , build-breakout -->
+ <!-- build-bbb-main-test, , build-breakout build-chat, build-listeners,-->
<target name="build-main-chat-viewers-listeners-present"
- depends="build-bbb-main, build-chat, build-viewers, build-listeners, build-present"
+ depends="build-bbb-main, build-viewers, build-present"
description="Compile main, chat, viewers, listeners, present, breakout modules">
</target>
<!-- just a grouping of modules to compile -->
- <!-- , build-dyn, build-classroom-audio, build-settings -->
+ <!-- , build-dyn, build-classroom-audio, build-settings build-phone, build-video, build-videodock, build-deskshare,-->
<target name="build-deskshare-phone-video-whiteboard-dyn"
- depends="build-deskshare, build-phone, build-video, build-videodock, build-whiteboard"
+ depends=" build-whiteboard"
description="Compile deskshare, phone, video, whiteboard, dynamic info modules">
</target>
View
2  bigbluebutton-client/resources/config.xml.template
@@ -77,7 +77,7 @@
<module name="PresentModule" url="PresentModule.swf?v=VERSION"
uri="rtmp://HOST/bigbluebutton"
- host="http://HOST"
+ presentationService="http://HOST/bigbluebutton/presentation"
showPresentWindow="true"
showWindowControls="true"
dependsOn="ViewersModule"
View
15 bigbluebutton-client/src/BreakoutModule.mxml
@@ -21,14 +21,15 @@
-->
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
- implements="org.bigbluebutton.common.IBigBlueButtonModule" xmlns:maps="org.bigbluebutton.modules.breakout.maps.*"
+ implements="org.bigbluebutton.common.IBigBlueButtonModule"
+ xmlns:maps="org.bigbluebutton.modules.breakout.maps.*"
>
<mx:Script>
<![CDATA[
- import com.asfusion.mate.events.Dispatcher;
-
- import org.bigbluebutton.modules.breakout.events.StartBreakoutModule;
+ import com.asfusion.mate.events.Dispatcher;
+ import org.bigbluebutton.common.LogUtil;
+ import org.bigbluebutton.modules.breakout.events.StartBreakoutModule;
private var globalDispatcher:Dispatcher;
@@ -63,7 +64,11 @@
return _attributes.userrole as String;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Breakout module starting.");
+ }
+
+ public function start1(attributes:Object):void {
_attributes = attributes;
globalDispatcher = new Dispatcher();
View
6 bigbluebutton-client/src/ChatModule.mxml
@@ -102,7 +102,11 @@
else return true;
}
- public function start(attributes:Object):void {
+ public function start():void {
+ LogUtil.debug("Staring Chat Module.");
+ }
+
+ public function start1(attributes:Object):void {
LogUtil.debug("chat attr: " + attributes.username);
_attributes = attributes;
LogUtil.debug("Dispatching StartChatModuleEvent");
View
6 bigbluebutton-client/src/ClassroomAudioModule.mxml 100644 → 100755
@@ -99,7 +99,11 @@ $Id: $
else return false;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Classroom module starting.");
+ }
+
+ public function start1(attributes:Object):void {
_attributes = attributes;
var startEvent:StartClassAudioEvent = new StartClassAudioEvent();
View
8 bigbluebutton-client/src/DeskShareModule.mxml
@@ -80,8 +80,12 @@
public function get role():String{
return _attributes.userrole as String;
}
-
- public function start(attributes:Object):void{
+
+ public function start():void{
+ LogUtil.debug("Deskshare module starting.");
+ }
+
+ public function start1(attributes:Object):void{
LogUtil.debug("desk share attr: " + attributes.username);
_attributes = attributes;
View
6 bigbluebutton-client/src/DynamicInfoModule.mxml
@@ -77,7 +77,11 @@
return _attributes.userrole as String;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Dynamic info module starting.");
+ }
+
+ public function start1(attributes:Object):void {
_attributes = attributes;
// debugging code:
View
6 bigbluebutton-client/src/ExampleChatModule.mxml
@@ -78,7 +78,11 @@
return _attributes.userrole as String;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Example module starting.");
+ }
+
+ public function start1(attributes:Object):void {
this._attributes = attributes;
var window:ExampleChatWindow = new ExampleChatWindow();
window.moduleAttributes = _attributes;
View
7 bigbluebutton-client/src/ListenersModule.mxml
@@ -105,7 +105,12 @@
LogUtil.debug("LISTENER-ROLE:" + _attributes.userrole);
return _attributes.userrole == "MODERATOR";
}
- public function start(attributes:Object):void {
+
+ public function start():void{
+ LogUtil.debug("Listeners module starting.");
+ }
+
+ public function start1(attributes:Object):void {
_attributes = attributes;
globalDispatcher = new Dispatcher();
View
8 bigbluebutton-client/src/PhoneModule.mxml
@@ -86,8 +86,12 @@
public function get voicebridge():String {
return _attributes.voicebridge;
}
-
- public function start(attributes:Object):void {
+
+ public function start():void{
+ LogUtil.debug("Phone module starting.");
+ }
+
+ public function start1(attributes:Object):void {
LogUtil.debug("phone attr: " + attributes.username);
_attributes = attributes;
View
67 bigbluebutton-client/src/PresentModule.mxml
@@ -22,14 +22,11 @@
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
implements="org.bigbluebutton.common.IBigBlueButtonModule"
- creationComplete="onCreationComplete()" xmlns:maps="org.bigbluebutton.modules.present.maps.*">
+ xmlns:maps="org.bigbluebutton.modules.present.controllers.maps.*">
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
-
- import mx.controls.Alert;
-
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.present.events.PresentModuleEvent;
import org.bigbluebutton.modules.present.maps.PresentEventMap;
@@ -37,69 +34,27 @@
private var globalDispatcher:Dispatcher = new Dispatcher();
private var _moduleName:String = "Presentation";
- private var _attributes:Object;
-
- private function onCreationComplete():void{
- }
public function get moduleName():String{
return _moduleName;
}
-
- public function get uri():String{
- if (_attributes.mode == "PLAYBACK")
- return _attributes.uri + "/" + _attributes.playbackRoom;
- return _attributes.uri + "/" + _attributes.room;
- }
-
- public function get username():String{
- return _attributes.username;
- }
-
- public function get connection():NetConnection{
- return _attributes.connection;
- }
-
- public function get mode():String{
- if (_attributes.mode == null){
- _attributes.mode = "LIVE";
- LogUtil.debug("Setting Present mode: " + _attributes.mode);
- }
- LogUtil.debug("Present mode: " + _attributes.mode);
- return _attributes.mode;
- }
-
- public function get userid():Number{
- return _attributes.userid as Number;
- }
-
- public function get role():String{
- return _attributes.userrole as String;
- }
-
- public function start(attributes:Object):void{
- LogUtil.debug("present attr: " + attributes.username);
- _attributes = attributes;
-
- var e:PresentModuleEvent = new PresentModuleEvent(PresentModuleEvent.START_MODULE);
- e.data = attributes;
- globalDispatcher.dispatchEvent(e);
- }
+
+ public function start():void{
+ LogUtil.debug("Present module starting.");
+ var e:PresentModuleEvent = new PresentModuleEvent(PresentModuleEvent.START_MODULE);
+ // e.data = attributes;
+ globalDispatcher.dispatchEvent(e);
+ }
+
+
public function stop():void{
var e:PresentModuleEvent = new PresentModuleEvent(PresentModuleEvent.STOP_MODULE);
globalDispatcher.dispatchEvent(e);
}
- public function getRoom():String{
- return _attributes.room;
- }
-
- public function getRed5ServerUri():String{
- return _attributes.uri;
- }
]]>
</mx:Script>
- <maps:PresentEventMap id="eventMap" />
+ <maps:PresentationEventMap id="eventMap" />
</mx:Module>
View
6 bigbluebutton-client/src/SettingsModule.mxml
@@ -68,7 +68,11 @@ $Id: $
return _attributes.userrole as String;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Settings module starting.");
+ }
+
+ public function start1(attributes:Object):void {
_attributes = attributes;
globalDispatcher = new Dispatcher();
Requirements.setRequirements(attributes);
View
7 bigbluebutton-client/src/SharedNotesModule.mxml 100644 → 100755
@@ -84,8 +84,13 @@
public function get role():String {
return _attributes.userrole as String;
}
+
+ public function start():void{
+ LogUtil.debug("Shared notes module starting.");
+ }
+
- public function start(attributes:Object):void {
+ public function start1(attributes:Object):void {
LogUtil.debug("notes attr: " + attributes.username);
_attributes = attributes;
SharedNotesWindow.document = _attributes.room;
View
6 bigbluebutton-client/src/VideoconfModule.mxml
@@ -78,7 +78,11 @@
else return false;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Video module starting.");
+ }
+
+ public function start1(attributes:Object):void {
LogUtil.debug("Videoconf attr: " + attributes.username);
_attributes = attributes;
proxy = new VideoProxy(uri);
View
6 bigbluebutton-client/src/VideodockModule.mxml
@@ -15,7 +15,11 @@
return _moduleName;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Video dock module starting.");
+ }
+
+ public function start1(attributes:Object):void {
LogUtil.debug("Videodock attr: " + attributes.username);
eventMap.startModule();
View
8 bigbluebutton-client/src/ViewersModule.mxml
@@ -186,8 +186,12 @@
if (_attributes.allowKickUser == "true") return true;
else return false;
}
-
- public function start(attributes:Object):void {
+
+ public function start():void{
+ LogUtil.debug("Viewers module starting.");
+ }
+
+ public function start1(attributes:Object):void {
_attributes = attributes;
var now:Date = new Date();
_playbackRoom = now.getTime().toString();
View
6 bigbluebutton-client/src/WhiteboardModule.mxml
@@ -63,7 +63,11 @@
return _attributes.userrole as String;
}
- public function start(attributes:Object):void {
+ public function start():void{
+ LogUtil.debug("Whiteboard module starting.");
+ }
+
+ public function start1(attributes:Object):void {
LogUtil.debug("highlighter attr: " + attributes.username);
_attributes = attributes;
globalDispatcher = new Dispatcher();
View
2  bigbluebutton-client/src/org/bigbluebutton/common/IBigBlueButtonModule.as
@@ -38,7 +38,7 @@ package org.bigbluebutton.common
* the client's config.xml file for your module will be passed to the module as well. The attributes object is dynamic
* however and should not be cast into any other class.
*/
- function start(attributes:Object):void;
+ function start():void;
function stop():void;
}
}
View
12 bigbluebutton-client/src/org/bigbluebutton/core/controllers/maps/BigBlueButtonAppEventMap.mxml
@@ -24,6 +24,7 @@
<mx:Script>
<![CDATA[
import org.bigbluebutton.core.controllers.events.ConfigLoadEvent;
+ import org.bigbluebutton.core.controllers.events.GotAllUsersEvent;
import org.bigbluebutton.core.controllers.events.LocaleEvent;
import org.bigbluebutton.core.controllers.events.ModuleLoadedEvent;
import org.bigbluebutton.core.controllers.events.UserAuthenticatedEvent;
@@ -37,6 +38,7 @@
import org.bigbluebutton.core.services.LocaleLoaderService;
import org.bigbluebutton.core.services.Red5BBBAppConnectionService;
import org.bigbluebutton.core.services.UsersService;
+ import org.bigbluebutton.main.events.BBBEvent;
]]>
</mx:Script>
<!--
@@ -78,12 +80,20 @@
</EventHandlers>
<EventHandlers type="{UserAuthenticatedEvent.USER_AUTHENTICATED_EVENT}">
- <MethodInvoker generator="{Red5BBBAppConnectionService}" method="connect"/>
+ <MethodInvoker generator="{Red5BBBAppConnectionService}" method="connect"/>
</EventHandlers>
+ <EventHandlers type="{GotAllUsersEvent.GOT_ALL_USERS_EVENT}">
+ <MethodInvoker generator="{ModuleModel}" method="startAllModules"/>
+ </EventHandlers>
+
<EventHandlers type="{UsersConnectionEvent.CONNECTION_SUCCESS}">
<MethodInvoker generator="{UsersService}" method="getAllUsers"/>
</EventHandlers>
+
+ <EventHandlers type="{BBBEvent.PRESENTATION_CONVERTED}">
+ <MethodInvoker generator="{UsersService}" method="presentationConverted"/>
+ </EventHandlers>
<EventHandlers type="{ConfigLoadEvent.CONFIG_LOADED_EVENT}">
<MethodInvoker generator="{ConfigModel}" method="setConfig" arguments="{event.config}"/>
View
2  bigbluebutton-client/src/org/bigbluebutton/core/model/ConfigModel.as
@@ -1,5 +1,6 @@
package org.bigbluebutton.core.model
{
+ import org.bigbluebutton.common.LogUtil;
public class ConfigModel
{
@@ -84,6 +85,7 @@ package org.bigbluebutton.core.model
if (isModulePresent(moduleName)) {
return new XML(_config.modules.module.(@name.toUpperCase() == moduleName.toUpperCase()).toXMLString());
}
+ LogUtil.debug("Cannot find module " + moduleName);
return null;
}
}
View
2  bigbluebutton-client/src/org/bigbluebutton/core/model/MeetingModel.as
@@ -54,7 +54,7 @@ package org.bigbluebutton.core.model {
for (var i:int = 0; i < u.length; i++) {
addUser(User.copy(u.getItemAt(i) as User));
}
- LogUtil.debug("Dispatching GotAllUsersEvent");
+ LogUtil.debug("Got current users in the meeting.");
_dispatcher.dispatchEvent(new GotAllUsersEvent());
}
View
3  bigbluebutton-client/src/org/bigbluebutton/core/model/ModuleModel.as
@@ -5,6 +5,7 @@ package org.bigbluebutton.core.model
import mx.collections.ArrayCollection;
+ import org.bigbluebutton.common.IBigBlueButtonModule;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.controllers.events.ModuleLoadedEvent;
@@ -77,6 +78,8 @@ package org.bigbluebutton.core.model
var m:ModuleDescriptor = _modules[key] as ModuleDescriptor;
if (m.module != null) {
LogUtil.debug('Starting module ' + m.name);
+ var bbbm:IBigBlueButtonModule = m.module as IBigBlueButtonModule;
+ bbbm.start();
} else {
LogUtil.debug("No modules to start");
}
View
4 bigbluebutton-client/src/org/bigbluebutton/core/services/UsersService.as
@@ -63,6 +63,10 @@ package org.bigbluebutton.core.services
if (_participantsSO != null) _participantsSO.close();
}
+ public function presentationConverted():void {
+ LogUtil.debug("***** BOOOOOOOO YAAAAHHHHHH ****");
+ }
+
public function listenForUserMessages():void {
LogUtil.debug("invoking listen for user messages");
_participantsSO = SharedObject.getRemote(SO_NAME, red5Conn.connectionUri, false);
View
2  bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as
@@ -117,7 +117,7 @@ package org.bigbluebutton.modules.present.business
{
var presentationName:String = e.presentationName;
LogUtil.debug("PresentProxy::loadPresentation: presentationName=" + presentationName);
- var fullUri : String = host + "/bigbluebutton/presentation/" + conference + "/" + room + "/" + presentationName+"/slides";
+ var fullUri : String = host + "/bigbluebutton/presentation/" + conference + "/" + room + "/" + presentationName + "/slides";
var slideUri:String = host + "/bigbluebutton/presentation/" + conference + "/" + room + "/" + presentationName;
LogUtil.debug("PresentationApplication::loadPresentation()... " + fullUri);
View
10 bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentationService.as
@@ -31,15 +31,7 @@ package org.bigbluebutton.modules.present.business
import org.bigbluebutton.modules.present.managers.PresentationSlides;
import org.bigbluebutton.modules.present.managers.Slide;
import org.bigbluebutton.common.LogUtil;
-
- /**
- * This class directly communicates with an HTTP service in order to send and recives files (slides
- * in this case)
- * <p>
- * This class extends the Proxy class of the pureMVC framework
- * @author dev_team@bigbluebutton.org
- *
- */
+
public class PresentationService implements IResponder
{
private var service : HTTPService;
View
67 bigbluebutton-client/src/org/bigbluebutton/modules/present/controllers/maps/PresentationEventMap.mxml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ BigBlueButton open source conferencing system - http://www.bigbluebutton.org
+
+ Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below).
+
+ BigBlueButton is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later
+ version.
+
+ 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/>.
+
+ $Id: $
+-->
+<EventMap xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="http://mate.asfusion.com/">
+
+ <mx:Script>
+ <![CDATA[
+ import mx.events.FlexEvent;
+
+ import org.bigbluebutton.core.model.ConfigModel;
+ import org.bigbluebutton.core.model.MeetingModel;
+ import org.bigbluebutton.core.model.UsersModel;
+ import org.bigbluebutton.core.services.Red5BBBAppConnectionService;
+ import org.bigbluebutton.modules.present.events.PresentModuleEvent;
+ import org.bigbluebutton.modules.present.models.PresentationConfigModel;
+ import org.bigbluebutton.modules.present.models.PresentationModel;
+ import org.bigbluebutton.modules.present.services.PresentationSOService;
+ ]]>
+ </mx:Script>
+
+ <EventHandlers type="{FlexEvent.PREINITIALIZE}">
+
+ </EventHandlers>
+
+ <EventHandlers type="{PresentModuleEvent.START_MODULE}">
+ <ObjectBuilder generator="{PresentationEventMapDelegate}" cache="global" constructorArguments="{scope.dispatcher}"/>
+ <MethodInvoker generator="{PresentationEventMapDelegate}" method="start"/>
+ <ObjectBuilder generator="{PresentationSOService}" cache="global" constructorArguments="{scope.dispatcher}"/>
+ <MethodInvoker generator="{PresentationSOService}" method="connect"/>
+ </EventHandlers>
+
+ <Injectors target="{PresentationEventMapDelegate}">
+ <PropertyInjector targetKey="configModel" source="{PresentationConfigModel}"/>
+ </Injectors>
+
+ <Injectors target="{PresentationSOService}">
+ <PropertyInjector targetKey="red5Conn" source="{Red5BBBAppConnectionService}"/>
+ <PropertyInjector targetKey="meetingModel" source="{MeetingModel}"/>
+ </Injectors>
+
+ <Injectors target="{PresentationConfigModel}">
+ <PropertyInjector targetKey="configModel" source="{ConfigModel}"/>
+ </Injectors>
+
+ <Injectors target="{PresentationModel}">
+ <PropertyInjector targetKey="configModel" source="{PresentationConfigModel}"/>
+ <PropertyInjector targetKey="meetingModel" source="{MeetingModel}"/>
+ <PropertyInjector targetKey="usersModel" source="{UsersModel}"/>
+ </Injectors>
+</EventMap>
View
25 bigbluebutton-client/src/org/bigbluebutton/modules/present/controllers/maps/PresentationEventMapDelegate.as
@@ -0,0 +1,25 @@
+package org.bigbluebutton.modules.present.controllers.maps
+{
+ import flash.events.IEventDispatcher;
+
+ import org.bigbluebutton.common.LogUtil;
+ import org.bigbluebutton.main.events.BBBEvent;
+ import org.bigbluebutton.modules.present.models.PresentationConfigModel;
+
+ public class PresentationEventMapDelegate
+ {
+ public var configModel:PresentationConfigModel;
+
+ private var _dispatcher:IEventDispatcher;
+
+ public function PresentationEventMapDelegate(dispatcher:IEventDispatcher)
+ {
+ _dispatcher = dispatcher;
+ }
+
+ public function start():void {
+ LogUtil.debug("***FOOOOO!!!!***");
+ LogUtil.debug("OPTIONS " + configModel.showWindowControls);
+ }
+ }
+}
View
1  bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/Slide.as
@@ -35,7 +35,6 @@ package org.bigbluebutton.modules.present.managers
private var _slideNum:Number;
private var _thumbUri:String;
-
public function Slide(slideNum:Number, slideUri:String, thumbUri:String)
{
View
36 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Page.as
@@ -0,0 +1,36 @@
+package org.bigbluebutton.modules.present.models
+{
+ import flash.utils.ByteArray;
+
+ import org.bigbluebutton.modules.present.services.PageLoaderService;
+ import org.bigbluebutton.modules.present.services.ThumbnailLoaderService;
+
+ public class Page
+ {
+ public var page:ByteArray;
+ public var thumbnail:ByteArray;
+
+ private var _number:uint;
+ private var _pageURI:String;
+ private var _thumbURI:String;
+
+ private var _pageLoader:PageLoaderService;
+ private var _thumbLoader:ThumbnailLoaderService;
+
+ public function Page(number:uint, pageURI:String, thumbURI:String):void {
+ _number = number;
+ _pageURI = pageURI;
+ _thumbURI = thumbURI;
+ _pageLoader = new PageLoaderService(this);
+ _thumbLoader = new ThumbnailLoaderService(this);
+ }
+
+ public function loadPage():void {
+ _pageLoader.load(_pageURI);
+ }
+
+ public function loadThumbnail():void {
+ _thumbLoader.load(_thumbURI);
+ }
+ }
+}
View
9 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Pages.as
@@ -0,0 +1,9 @@
+package org.bigbluebutton.modules.present.models
+{
+ public class Pages
+ {
+ public function Pages()
+ {
+ }
+ }
+}
View
39 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Presentation.as
@@ -0,0 +1,39 @@
+package org.bigbluebutton.modules.present.models
+{
+ import flash.events.IEventDispatcher;
+
+ import mx.collections.ArrayCollection;
+
+ import org.bigbluebutton.modules.present.services.PresentationLoaderService;
+
+ public class Presentation
+ {
+ private var _id:String;
+ private var _name:String;
+ private var _presentationService:String;
+ private var _meetingID:String;
+
+ public var currentPage:int;
+ public var pages:ArrayCollection = new ArrayCollection();
+
+ private var _dispatcher:IEventDispatcher;
+ private var _loader:PresentationLoaderService;
+
+ public function Presentation(id:String, presentationService:String, meetingID:String)
+ {
+ _id = id;
+ _presentationService = presentationService;
+ _meetingID = meetingID;
+ _loader = new PresentationLoaderService(this);
+ }
+
+ public function addPage(number:uint, page:String, thumb:String):void {
+ var p:Page = new Page(number, page, thumb);
+ }
+
+ public function load():void {
+ var fullURI:String = _presentationService + "/" + _meetingID + "/" + _meetingID + "/" + _id + "/slides";
+ _loader.load(fullURI);
+ }
+ }
+}
View
44 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/PresentationConfigModel.as
@@ -0,0 +1,44 @@
+package org.bigbluebutton.modules.present.models
+{
+ import org.bigbluebutton.common.LogUtil;
+ import org.bigbluebutton.core.model.ConfigModel;
+
+ public class PresentationConfigModel
+ {
+ public var configModel:ConfigModel;
+
+ public function get showWindowControls():Boolean {
+ var vxml:XML = getConfig();
+ if (vxml != null) {
+ if (vxml.@showWindowControls != undefined) {
+ return (vxml.@showWindowControls.toString().toUpperCase() == "TRUE") ? true : false;
+ }
+ }
+ return true;
+ }
+
+ public function get showPresentWindow():Boolean {
+ var vxml:XML = getConfig();
+ if (vxml != null) {
+ if (vxml.@showPresentWindow != undefined) {
+ return (vxml.@showPresentWindow.toString().toUpperCase() == "TRUE") ? true : false;
+ }
+ }
+ return true;
+ }
+
+ public function get presentationService():String {
+ var vxml:XML = getConfig();
+ if (vxml != null) {
+ if (vxml.@presentationService != undefined) {
+ return vxml.@presentationService.toString();
+ }
+ }
+ return null;
+ }
+
+ private function getConfig():XML {
+ return configModel.getConfigFor("PresentModule");
+ }
+ }
+}
View
25 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/PresentationModel.as
@@ -0,0 +1,25 @@
+package org.bigbluebutton.modules.present.models
+{
+ import flash.events.IEventDispatcher;
+
+ import mx.collections.ArrayCollection;
+
+ public class PresentationModel
+ {
+ private var _presentations:ArrayCollection = new ArrayCollection();
+
+ private var _dispatcher:IEventDispatcher;
+
+ public function PresentationModel(dispatcher:IEventDispatcher)
+ {
+ _dispatcher = dispatcher;
+ }
+
+ public function addPresentation(id:String):void {
+// var p:Presentation = new Presentation(id);
+ // _presentations.addItem(p);
+ }
+
+
+ }
+}
View
19 bigbluebutton-client/src/org/bigbluebutton/modules/present/models/Presentations.as
@@ -0,0 +1,19 @@
+package org.bigbluebutton.modules.present.models
+{
+ import flash.events.IEventDispatcher;
+ import flash.utils.Dictionary;
+
+ public class Presentations
+ {
+ private var _presentations:Dictionary = new Dictionary();
+ private var _currentPresentation:Presentation;
+
+ private var _dispatcher:IEventDispatcher;
+
+ public function Presentations(dispatcher:IEventDispatcher)
+ {
+ _dispatcher = dispatcher;
+ }
+
+ }
+}
View
34 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as
@@ -0,0 +1,34 @@
+package org.bigbluebutton.modules.present.services
+{
+ import flash.events.Event;
+ import flash.net.URLLoader;
+ import flash.net.URLLoaderDataFormat;
+ import flash.net.URLRequest;
+
+ import org.bigbluebutton.modules.present.models.Page;
+
+ public class PageLoaderService
+ {
+ private var _loader:URLLoader = new URLLoader();
+ private var _loaded:Boolean = false;
+ private var _page:Page;
+
+ public function PageLoaderService(page:Page)
+ {
+ _page = page;
+ }
+
+ public function load(uri:String):void {
+ if (!_loaded) {
+ _loader.addEventListener(Event.COMPLETE, handleComplete);
+ _loader.dataFormat = URLLoaderDataFormat.BINARY;
+ _loader.load(new URLRequest(uri));
+ }
+ }
+
+ private function handleComplete(e:Event):void{
+ _loaded = true;
+ _page.page = _loader.data;
+ }
+ }
+}
View
111 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationLoaderService.as
@@ -0,0 +1,111 @@
+package org.bigbluebutton.modules.present.services
+{
+ import flash.events.Event;
+ import flash.events.IEventDispatcher;
+ import flash.events.IOErrorEvent;
+ import flash.net.URLLoader;
+ import flash.net.URLRequest;
+
+ import mx.rpc.http.HTTPService;
+
+ import org.bigbluebutton.common.LogUtil;
+ import org.bigbluebutton.modules.present.models.Presentation;
+ import org.bigbluebutton.modules.present.models.PresentationConfigModel;
+
+ public class PresentationLoaderService
+ {
+ private var _service:HTTPService = new HTTPService();
+ private var _urlLoader:URLLoader;
+ private var _slideUri:String;
+ private var _dispatcher:IEventDispatcher;
+
+ private var _presentation:Presentation;
+
+ public function PresentationLoaderService(_presentation:Presentation)
+ {
+ _presentation = _presentation;
+ }
+
+ /**
+ * Load slides from an HTTP service. Response is received in the Responder class' onResult method
+ * @param url
+ *
+ */
+ public function load(url:String):void
+ {
+ _service.url = url;
+ _urlLoader = new URLLoader();
+ _urlLoader.addEventListener(Event.COMPLETE, handleComplete);
+ _urlLoader.addEventListener(IOErrorEvent.IO_ERROR, handleIOErrorEvent);
+ _urlLoader.load(new URLRequest(url));
+
+ }
+
+ private function handleComplete(e:Event):void{
+ LogUtil.debug("Presentation loading complete");
+ parse(new XML(e.target.data));
+ }
+
+ private function handleIOErrorEvent(e:IOErrorEvent):void{
+ LogUtil.error(e.toString());
+ }
+
+ public function parse(xml:XML):void{
+ var list:XMLList = xml.presentation.slides.slide;
+ var item:XML;
+ LogUtil.debug("Slides: " + xml);
+
+ var presentationName:String = xml.presentation[0].@name;
+ LogUtil.debug("PresentationService::parse()... presentationName=" + presentationName);
+
+ for each (item in list){
+ LogUtil.debug("Available slide: [number=" + item.@number + ", page=" + item.@name + ", thumb=" + item.@thumb);
+ _presentation.addPage(item.@number, item.@name, item.@thumb);
+
+ }
+ }
+
+ /**
+ * This is the response event. It is called when the PresentationService class sends a request to
+ * the server. This class then responds with this event
+ * @param event
+ *
+ */
+ public function result(event:Object):void
+ {
+ var xml:XML = new XML(event.result);
+ var list:XMLList = xml.presentations;
+ var item:XML;
+
+ for each(item in list){
+ LogUtil.debug("Available Modules: " + item.toXMLString() + " at " + item.text());
+
+ }
+ }
+
+ /**
+ * Event is called in case the call the to server wasn't successful. This method then gets called
+ * instead of the result() method above
+ * @param event
+ *
+ */
+ public function fault(event : Object):void
+ {
+ LogUtil.debug("Got fault [" + event.fault.toString() + "]");
+ }
+/*
+ public function loadPresentationListener(loaded:Boolean, presentationName:String):void {
+ if (loaded) {
+ LogUtil.debug('presentation has been loaded presentationName=' + presentationName);
+ var e:PresentationEvent = new PresentationEvent(PresentationEvent.PRESENTATION_LOADED);
+ e.presentationName = presentationName;
+ e.slides = _slides;
+ dispatcher.dispatchEvent(e);
+ } else {
+ dispatcher.dispatchEvent(new PresentationEvent(PresentationEvent.PRESENTATION_NOT_LOADED));
+ LogUtil.debug('failed to load presentation');
+ }
+ }
+*/
+ }
+}
View
615 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationSOService.as
@@ -0,0 +1,615 @@
+package org.bigbluebutton.modules.present.services
+{
+ import flash.events.AsyncErrorEvent;
+ import flash.events.IEventDispatcher;
+ import flash.events.NetStatusEvent;
+ import flash.events.SyncEvent;
+ import flash.net.Responder;
+ import flash.net.SharedObject;
+
+ import org.bigbluebutton.common.LogUtil;
+ import org.bigbluebutton.core.model.MeetingModel;
+ import org.bigbluebutton.core.services.Red5BBBAppConnectionService;
+ import org.bigbluebutton.main.events.BBBEvent;
+ import org.bigbluebutton.main.events.MadePresenterEvent;
+ import org.bigbluebutton.modules.present.events.CursorEvent;
+ import org.bigbluebutton.modules.present.events.MoveEvent;
+ import org.bigbluebutton.modules.present.events.NavigationEvent;
+ import org.bigbluebutton.modules.present.events.RemovePresentationEvent;
+ import org.bigbluebutton.modules.present.events.UploadEvent;
+ import org.bigbluebutton.modules.present.events.ZoomEvent;
+
+ public class PresentationSOService
+ {
+ private static const SHAREDOBJECT:String = "presentationSO";
+ private static const PRESENTER:String = "presenter";
+ private static const SHARING:String = "sharing";
+ private static const UPDATE_MESSAGE:String = "updateMessage";
+ private static const CURRENT_PAGE:String = "currentPage";
+
+ public var red5Conn:Red5BBBAppConnectionService;
+ public var meetingModel:MeetingModel;
+
+ private var url:String;
+ private var userid:Number;
+
+ private var _presentationSO:SharedObject;
+ private var _dispatcher:IEventDispatcher;
+ private var _connectionListener:Function;
+ private var _messageSender:Function;
+ private var _soErrors:Array;
+
+ private var currentSlide:Number = -1;
+
+ public function PresentationSOService(dispatcher:IEventDispatcher){
+ _dispatcher = dispatcher;
+ }
+
+ public function connect():void {
+ _presentationSO = SharedObject.getRemote(SHAREDOBJECT, red5Conn.connectionUri, false);
+ _presentationSO.client = this;
+ _presentationSO.addEventListener(SyncEvent.SYNC, syncHandler);
+ _presentationSO.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
+ _presentationSO.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
+ _presentationSO.connect(red5Conn.connection);
+ }
+
+ public function disconnect():void {
+ leave();
+ notifyConnectionStatusListener(false, ["Disconnected from presentation application"]);
+ }
+
+ private function connectionListener(connected:Boolean, errors:Array=null):void {
+ if (connected) {
+ join();
+ notifyConnectionStatusListener(true);
+ } else {
+ leave();
+ notifyConnectionStatusListener(false, errors);
+ }
+ }
+
+ private function join() : void {
+
+ }
+
+ private function leave():void {
+ if (_presentationSO != null) _presentationSO.close();
+ }
+
+ public function addConnectionStatusListener(connectionListener:Function):void {
+ _connectionListener = connectionListener;
+ }
+
+ public function addMessageSender(msgSender:Function):void {
+ _messageSender = msgSender;
+ }
+
+ private function sendMessage(msg:String, body:Object=null):void {
+ if (_messageSender != null) _messageSender(msg, body);
+ }
+
+ /**
+ * Send an event to the server to resize the clients view of the slide in percentage increments
+ * @param slideHeight
+ * @param slideWidth
+ *
+ */
+ public function zoom(xOffset:Number, yOffset:Number, widthRatio:Number, heightRatio:Number):void{
+ move(xOffset, yOffset, widthRatio, heightRatio);
+ }
+
+ /**
+ * A callback method for zooming in a slide. Called when preseter zooms the slide
+ * @param slideHeight
+ * @param slideWidth
+ *
+ */
+ public function zoomCallback(xOffset:Number, yOffset:Number, widthRatio:Number, heightRatio:Number):void{
+ var e:ZoomEvent = new ZoomEvent(ZoomEvent.ZOOM);
+ e.xOffset = xOffset;
+ e.yOffset = yOffset;
+ e.slideToCanvasWidthRatio = widthRatio;
+ e.slideToCanvasHeightRatio = heightRatio;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ /**
+ * Send an event to the server to update the presenter's cursor view on the client
+ * @param xPercent
+ * @param yPercent
+ *
+ */
+ public function sendCursorUpdate(xPercent:Number, yPercent:Number):void{
+ _presentationSO.send("updateCursorCallback", xPercent, yPercent);
+ }
+
+ /**
+ * A callback method for the cursor update. Called whenever the presenter moves the mouse within the present window
+ * @param xPercent
+ * @param yPercent
+ *
+ */
+ public function updateCursorCallback(xPercent:Number, yPercent:Number):void{
+ var e:CursorEvent = new CursorEvent(CursorEvent.UPDATE_CURSOR);
+ e.xPercent = xPercent;
+ e.yPercent = yPercent;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ /**
+ * Send an event to the server to update the size of the slide shows, as a percentage of the default value
+ * @param newSizeInPercent
+ *
+ */
+ public function resizeSlide(newSizeInPercent:Number):void{
+ _presentationSO.send("resizeSlideCallback", newSizeInPercent);
+ }
+
+ public function resizeSlideCallback(newSizeInPercent:Number):void{
+ var e:ZoomEvent = new ZoomEvent(ZoomEvent.RESIZE);
+ e.zoomPercentage = newSizeInPercent;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ /**
+ * Sends an event to the server to update the clients with the new slide position
+ * @param slideXPosition
+ * @param slideYPosition
+ *
+ */
+ public function move(xOffset:Number, yOffset:Number, widthRatio:Number, heightRatio:Number):void{
+ //_presentationSO.send("moveCallback", xOffset, yOffset, widthRatio, heightRatio);
+ red5Conn.connection.call("presentation.resizeAndMoveSlide",// Remote function name
+ new Responder(
+ // participants - On successful result
+ function(result:Boolean):void {
+
+ if (result) {
+ LogUtil.debug("Successfully sent resizeAndMoveSlide");
+ }
+ },
+ // status - On error occurred
+ function(status:Object):void {
+ LogUtil.error("Error occurred:");
+ for (var x:Object in status) {
+ LogUtil.error(x + " : " + status[x]);
+ }
+ }
+ ), //new Responder
+ xOffset,
+ yOffset,
+ widthRatio,
+ heightRatio
+ ); //_netConnection.call
+
+ presenterViewedRegionX = xOffset;
+ presenterViewedRegionY = yOffset;
+ presenterViewedRegionW = widthRatio;
+ presenterViewedRegionH = heightRatio;
+ }
+
+ /**
+ * A callback method from the server to update the slide position
+ * @param slideXPosition
+ * @param slideYPosition
+ *
+ */
+ public function moveCallback(xOffset:Number, yOffset:Number, widthRatio:Number, heightRatio:Number):void{
+ var e:MoveEvent = new MoveEvent(MoveEvent.MOVE);
+ e.xOffset = xOffset;
+ e.yOffset = yOffset;
+ e.slideToCanvasWidthRatio = widthRatio;
+ e.slideToCanvasHeightRatio = heightRatio;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ /***
+ * A hack for the viewer to sync with the presenter. Have the viewer query the presenter for it's x,y,width and height info.
+ */
+ private var presenterViewedRegionX:Number = 0;
+ private var presenterViewedRegionY:Number = 0;
+ private var presenterViewedRegionW:Number = 100;
+ private var presenterViewedRegionH:Number = 100;
+
+ private function queryPresenterForSlideInfo():void {
+ LogUtil.debug("Query for slide info");
+ _presentationSO.send("whatIsTheSlideInfo", meetingModel.getMyUserId());
+ }
+
+ public function whatIsTheSlideInfo(userid:Number):void {
+ LogUtil.debug("Rx Query for slide info");
+ if (meetingModel.amIPresenter()) {
+ LogUtil.debug("User Query for slide info");
+ _presentationSO.send("whatIsTheSlideInfoReply", userid, presenterViewedRegionX, presenterViewedRegionY, presenterViewedRegionW, presenterViewedRegionH);
+ }
+ }
+
+ public function whatIsTheSlideInfoReply(userId:Number, xOffset:Number, yOffset:Number, widthRatio:Number, heightRatio:Number):void{
+ LogUtil.debug("Rx whatIsTheSlideInfoReply");
+ if (meetingModel.amIThisUser(userId.toString())) {
+ LogUtil.debug("Got reply for Query for slide info");
+ var e:MoveEvent = new MoveEvent(MoveEvent.CUR_SLIDE_SETTING);
+ e.xOffset = xOffset;
+ e.yOffset = yOffset;
+ e.slideToCanvasWidthRatio = widthRatio;
+ e.slideToCanvasHeightRatio = heightRatio;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ }
+
+
+ /**
+ * Sends an event out for the clients to maximize the presentation module
+ *
+ */
+ public function maximize():void{
+ _presentationSO.send("maximizeCallback");
+ }
+
+ /**
+ * A callback method from the server to maximize the presentation
+ *
+ */
+ public function maximizeCallback():void{
+ _dispatcher.dispatchEvent(new ZoomEvent(ZoomEvent.MAXIMIZE));
+ }
+
+ public function restore():void{
+ _presentationSO.send("restoreCallback");
+ }
+
+ public function restoreCallback():void{
+ _dispatcher.dispatchEvent(new ZoomEvent(ZoomEvent.RESTORE));
+ }
+
+ /**
+ * Send an event to the server to clear the presentation
+ *
+ */
+ public function clearPresentation() : void {
+ _presentationSO.send("clearCallback");
+ }
+
+ public function removePresentation(name:String):void {
+ red5Conn.connection.call("presentation.removePresentation",// Remote function name
+ new Responder(
+ function(result:Boolean):void {
+ if (result) {
+ LogUtil.debug("Successfully assigned presenter to: " + userid);
+ }
+ },
+ // status - On error occurred
+ function(status:Object):void {
+ LogUtil.error("Error occurred:");
+ for (var x:Object in status) {
+ LogUtil.error(x + " : " + status[x]);
+ }
+ }
+ ), //new Responder
+ name
+ ); //_netConnection.call
+ }
+
+ /**
+ * A call-back method for the clear method. This method is called when the clear method has
+ * successfuly called the server.
+ *
+ */
+ public function clearCallback() : void {
+ _presentationSO.setProperty(SHARING, false);
+ _dispatcher.dispatchEvent(new UploadEvent(UploadEvent.CLEAR_PRESENTATION));
+ }
+
+ public function setPresenterName(presenterName:String):void {
+ _presentationSO.setProperty(PRESENTER, presenterName);
+ }
+
+ public function getPresentationInfo():void {
+ red5Conn.connection.call( "presentation.getPresentationInfo",// Remote function name
+ new Responder(
+ // participants - On successful result
+ function(result:Object):void {
+ LogUtil.debug("Successfully querried for presentation information.");
+ if (result.presenter.hasPresenter) {
+ _dispatcher.dispatchEvent(new MadePresenterEvent(MadePresenterEvent.SWITCH_TO_VIEWER_MODE));
+ }
+
+ if (result.presentation.xOffset) {
+ LogUtil.debug("Sending presenters slide settings");
+ var e:MoveEvent = new MoveEvent(MoveEvent.CUR_SLIDE_SETTING);
+ e.xOffset = Number(result.presentation.xOffset);
+ e.yOffset = Number(result.presentation.yOffset);
+ e.slideToCanvasWidthRatio = Number(result.presentation.widthRatio);
+ e.slideToCanvasHeightRatio = Number(result.presentation.heightRatio);
+ LogUtil.debug("****presenter settings [" + e.xOffset + "," + e.yOffset + "," + e.slideToCanvasWidthRatio + "," + e.slideToCanvasHeightRatio + "]");
+ _dispatcher.dispatchEvent(e);
+ }
+ if (result.presentations) {
+ for(var p:Object in result.presentations) {
+ var u:Object = result.presentations[p]
+ LogUtil.debug("Presentation name " + u as String);
+ sendPresentationName(u as String);
+ }
+ }
+
+ // Force switching the presenter.
+ triggerSwitchPresenter();
+
+ if (result.presentation.sharing) {
+ currentSlide = Number(result.presentation.slide);
+ LogUtil.debug("The presenter has shared slides and showing slide " + currentSlide);
+ var shareEvent:UploadEvent = new UploadEvent(UploadEvent.PRESENTATION_READY);
+ shareEvent.presentationName = String(result.presentation.currentPresentation);
+ _dispatcher.dispatchEvent(shareEvent);
+ }
+ },
+ // status - On error occurred
+ function(status:Object):void {
+ LogUtil.error("Error occurred:");
+ for (var x:Object in status) {
+ LogUtil.error(x + " : " + status[x]);
+ }
+ }
+ ) //new Responder
+ ); //_netConnection.call
+ }
+
+ /***
+ * NOTE:
+ * This is a workaround to trigger the UI to switch to presenter or viewer.
+ * The reason is that when the user joins, the MadePresenterEvent in UserServiceSO
+ * doesn't get received by the modules as the modules hasn't started yet.
+ * Need to redo the proper sequence of events but will take a lot of changes.
+ * (ralam dec 8, 2011).
+ */
+ public function triggerSwitchPresenter():void {
+ if (meetingModel.amIPresenter()) {
+ LogUtil.debug("trigger Switch to Presenter mode ");
+// var e:MadePresenterEvent = new MadePresenterEvent(MadePresenterEvent.SWITCH_TO_PRESENTER_MODE);
+// e.userid = meetingModel.getMyUserId();
+ // e.presenterName = meetingModel.getMyName();
+ // e.assignerBy = meetingModel.getMyUserId();
+
+ // _dispatcher.dispatchEvent(e);
+ } else {
+/*
+ var p:BBBUser = meeting.getPresenter();
+ if (p != null) {
+ LogUtil.debug("trigger Switch to Viewer mode ");
+ var viewerEvent:MadePresenterEvent = new MadePresenterEvent(MadePresenterEvent.SWITCH_TO_VIEWER_MODE);
+ viewerEvent.userid = p.userid;
+ viewerEvent.presenterName = p.name;
+ viewerEvent.assignerBy = p.userid;
+
+ dispatcher.dispatchEvent(viewerEvent);
+ }
+*/ }
+ }
+
+ private function sendPresentationName(presentationName:String):void {
+ var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.CONVERT_SUCCESS);
+ uploadEvent.presentationName = presentationName;
+ _dispatcher.dispatchEvent(uploadEvent)
+ }
+
+ /**
+ * Send an event out to the server to go to a new page in the SlidesDeck
+ * @param page
+ *
+ */
+ public function gotoSlide(num:int) : void {
+ red5Conn.connection.call("presentation.gotoSlide",// Remote function name
+ new Responder(
+ // On successful result
+ function(result:Boolean):void {
+
+ if (result) {
+ LogUtil.debug("Successfully moved page to: " + num);
+ }
+ },
+ // status - On error occurred
+ function(status:Object):void {
+ LogUtil.error("Error occurred:");
+ for (var x:Object in status) {
+ LogUtil.error(x + " : " + status[x]);
+ }
+ }
+ ), //new Responder
+ num
+ ); //_netConnection.call
+ }
+
+ /**
+ * A callback method. It is called after the gotoPage method has successfully executed on the server
+ * The method sets the clients view to the page number received
+ * @param page
+ *
+ */
+ public function gotoSlideCallback(page : Number) : void {
+ var e:NavigationEvent = new NavigationEvent(NavigationEvent.GOTO_PAGE)
+ e.pageNumber = page;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ public function getCurrentSlideNumber():void {
+ if (currentSlide >= 0) {
+ var e:NavigationEvent = new NavigationEvent(NavigationEvent.GOTO_PAGE)
+ e.pageNumber = currentSlide;
+ _dispatcher.dispatchEvent(e);
+ }
+ }
+
+ public function sharePresentation(share:Boolean, presentationName:String):void {
+ LogUtil.debug("PresentationSOService::sharePresentation()... presentationName=" + presentationName);
+ red5Conn.connection.call("presentation.sharePresentation",// Remote function name
+ new Responder(
+ // On successful result
+ function(result:Boolean):void {
+
+ if (result) {
+ LogUtil.debug("Successfully shared presentation");
+ }
+ },
+ // status - On error occurred
+ function(status:Object):void {
+ LogUtil.error("Error occurred:");
+ for (var x:Object in status) {
+ LogUtil.error(x + " : " + status[x]);
+ }
+ }
+ ), //new Responder
+ presentationName,
+ share
+ ); //_netConnection.call
+ }
+
+ public function sharePresentationCallback(presentationName:String, share:Boolean):void {
+ LogUtil.debug("sharePresentationCallback " + presentationName + "," + share);
+ if (share) {
+ var e:UploadEvent = new UploadEvent(UploadEvent.PRESENTATION_READY);
+ e.presentationName = presentationName;
+ _dispatcher.dispatchEvent(e);
+ } else {
+ _dispatcher.dispatchEvent(new UploadEvent(UploadEvent.CLEAR_PRESENTATION));
+ }
+ }
+
+ public function removePresentationCallback(presentationName:String):void {
+ LogUtil.debug("removePresentationCallback " + presentationName);
+ var e:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.PRESENTATION_REMOVED_EVENT);
+ e.presentationName = presentationName;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ public function pageCountExceededUpdateMessageCallback(conference:String, room:String,
+ code:String, presentationName:String, messageKey:String, numberOfPages:Number,
+ maxNumberOfPages:Number) : void {
+ LogUtil.debug("pageCountExceededUpdateMessageCallback:Received update message " + messageKey);
+ var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.PAGE_COUNT_EXCEEDED);
+ uploadEvent.maximumSupportedNumberOfSlides = maxNumberOfPages;
+ _dispatcher.dispatchEvent(uploadEvent);
+ }
+
+ public function generatedSlideUpdateMessageCallback(conference:String, room:String,
+ code:String, presentationName:String, messageKey:String, numberOfPages:Number,
+ pagesCompleted:Number) : void {
+ LogUtil.debug( "CONVERTING = [" + pagesCompleted + " of " + numberOfPages + "]");
+ var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.CONVERT_UPDATE);
+ uploadEvent.totalSlides = numberOfPages;
+ uploadEvent.completedSlides = pagesCompleted;
+ _dispatcher.dispatchEvent(uploadEvent);
+ }
+
+ public function conversionCompletedUpdateMessageCallback(conference:String, room:String,
+ code:String, presentationName:String, messageKey:String, slidesInfo:String) : void {
+ LogUtil.debug("conversionCompletedUpdateMessageCallback:Received update message " + messageKey);
+ var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.CONVERT_SUCCESS);
+ uploadEvent.data = messageKey;
+ uploadEvent.presentationName = presentationName;
+ _dispatcher.dispatchEvent(uploadEvent);
+ _dispatcher.dispatchEvent(new BBBEvent(BBBEvent.PRESENTATION_CONVERTED));
+ var readyEvent:UploadEvent = new UploadEvent(UploadEvent.PRESENTATION_READY);
+ readyEvent.presentationName = presentationName;
+ _dispatcher.dispatchEvent(readyEvent);
+ }
+
+ public function conversionUpdateMessageCallback(conference:String, room:String,
+ code:String, presentationName:String, messageKey:String) : void {
+ LogUtil.debug("conversionUpdateMessageCallback:Received update message " + messageKey);
+ var totalSlides : Number;
+ var completedSlides : Number;
+ var message : String;
+ var uploadEvent:UploadEvent;
+
+ switch (messageKey) {
+ case "OFFICE_DOC_CONVERSION_SUCCESS":
+ uploadEvent = new UploadEvent(UploadEvent.OFFICE_DOC_CONVERSION_SUCCESS);
+ _dispatcher.dispatchEvent(uploadEvent);
+ break;
+ case "OFFICE_DOC_CONVERSION_FAILED":
+ uploadEvent = new UploadEvent(UploadEvent.OFFICE_DOC_CONVERSION_FAILED);
+ _dispatcher.dispatchEvent(uploadEvent);
+ break;
+ case "SUPPORTED_DOCUMENT":
+ uploadEvent = new UploadEvent(UploadEvent.SUPPORTED_DOCUMENT);
+ _dispatcher.dispatchEvent(uploadEvent);
+ break;
+ case "UNSUPPORTED_DOCUMENT":
+ uploadEvent = new UploadEvent(UploadEvent.UNSUPPORTED_DOCUMENT);
+ _dispatcher.dispatchEvent(uploadEvent);
+ break;
+ case "GENERATING_THUMBNAIL":
+ _dispatcher.dispatchEvent(new UploadEvent(UploadEvent.THUMBNAILS_UPDATE));
+ break;
+ case "PAGE_COUNT_FAILED":
+ uploadEvent = new UploadEvent(UploadEvent.PAGE_COUNT_FAILED);
+ _dispatcher.dispatchEvent(uploadEvent);
+ break;
+ case "GENERATED_THUMBNAIL":
+ LogUtil.warn("conversionUpdateMessageCallback:GENERATED_THUMBNAIL_KEY " + messageKey);
+ break;
+ default:
+ LogUtil.warn("conversionUpdateMessageCallback:Unknown message " + messageKey);
+ break;
+ }
+ }
+
+ private function notifyConnectionStatusListener(connected:Boolean, errors:Array=null):void {
+ if (_connectionListener != null) {
+ _connectionListener(connected, errors);
+ }
+ }
+
+ private function syncHandler(event:SyncEvent):void {
+ // var statusCode:String = event.info.code;
+ LogUtil.debug("!!!!! Presentation sync handler - " + event.changeList.length );
+ notifyConnectionStatusListener(true);
+ getPresentationInfo();
+ queryPresenterForSlideInfo();
+ }
+
+ private function netStatusHandler (event:NetStatusEvent):void {
+ var statusCode:String = event.info.code;
+ LogUtil.debug("!!!!! Presentation status handler - " + event.info.code );
+ switch (statusCode) {
+ case "NetConnection.Connect.Success":
+ LogUtil.debug(":Connection Success");
+ notifyConnectionStatusListener(true);
+ getPresentationInfo();
+ break;
+ case "NetConnection.Connect.Failed":
+ addError("PresentSO connection failed");
+ break;
+ case "NetConnection.Connect.Closed":
+ addError("Connection to PresentSO was closed.");
+ notifyConnectionStatusListener(false, _soErrors);
+ break;
+ case "NetConnection.Connect.InvalidApp":
+ addError("PresentSO not found in server");
+ break;
+ case "NetConnection.Connect.AppShutDown":
+ addError("PresentSO is shutting down");
+ break;
+ case "NetConnection.Connect.Rejected":
+ addError("No permissions to connect to the PresentSO");
+ break;
+ default :
+ LogUtil.debug(":default - " + event.info.code );
+ break;
+ }
+ }
+
+ private function asyncErrorHandler (event:AsyncErrorEvent):void {
+ addError("PresentSO asynchronous error.");
+ }
+
+ private function addError(error:String):void {
+ if (_soErrors == null) {
+ _soErrors = new Array();
+ }
+ _soErrors.push(error);
+ }
+ }
+}
View
116 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationUploadService.as
@@ -0,0 +1,116 @@
+package org.bigbluebutton.modules.present.services
+{
+ import flash.events.Event;
+ import flash.events.HTTPStatusEvent;
+ import flash.events.IEventDispatcher;
+ import flash.events.IOErrorEvent;
+ import flash.events.ProgressEvent;
+ import flash.events.SecurityErrorEvent;
+ import flash.net.FileReference;
+ import flash.net.URLRequest;
+ import flash.net.URLRequestMethod;
+ import flash.net.URLVariables;
+
+ import org.bigbluebutton.common.LogUtil;
+ import org.bigbluebutton.core.model.UsersModel;
+ import org.bigbluebutton.modules.present.events.UploadEvent;
+ import org.bigbluebutton.modules.present.models.PresentationConfigModel;
+
+ public class PresentationUploadService
+ {
+ public static const UPLOAD_PROGRESS:String = "UPLOAD_PROGRESS";
+ public static const UPLOAD_COMPLETED:String = "UPLOAD_COMPLETED";
+ public static const UPLOAD_IO_ERROR:String = "UPLOAD_IO_ERROR";
+ public static const UPLOAD_SECURITY_ERROR:String = "UPLOAD_SECURITY_ERROR";
+
+ private var request:URLRequest = new URLRequest();
+ private var sendVars:URLVariables = new URLVariables();
+
+ private var _dispatcher:IEventDispatcher;
+
+ public var usersModel:UsersModel;
+ public var configModel:PresentationConfigModel;
+
+ public function PresentationUploadService(dispatcher:IEventDispatcher):void {
+ _dispatcher = dispatcher;
+ }
+
+ /**
+ * Uploads local files to a server
+ * @param file - The FileReference class of the file we wish to send
+ *
+ */
+ public function upload(presentationName:String, file:FileReference):void {
+ sendVars.presentation_name = presentationName;
+ var fileToUpload:FileReference = new FileReference();
+ fileToUpload = file;
+ fileToUpload.addEventListener(ProgressEvent.PROGRESS, onUploadProgress);
+ fileToUpload.addEventListener(Event.COMPLETE, onUploadComplete);
+ fileToUpload.addEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
+ fileToUpload.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
+ fileToUpload.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
+ fileToUpload.addEventListener(Event.OPEN, openHandler);
+
+ sendVars.conference = usersModel.loggedInUser.conference;
+ sendVars.room = usersModel.loggedInUser.conference;
+ request.url = configModel.presentationService + "/upload";
+ request.data = sendVars;
+ request.method = URLRequestMethod.POST;
+
+ // "fileUpload" is the variable name of the uploaded file in the server
+ fileToUpload.upload(request, "fileUpload", true);
+ }
+
+ private function httpStatusHandler(event:HTTPStatusEvent):void {
+ // TO CLEANUP
+ //_progressListener(PresentModuleConstants.UPLOAD_IO_ERROR_EVENT, "HTTP STATUS EVENT");
+ }
+
+ private function openHandler(event:Event):void {
+ // TO CLEANUP
+ //_progressListener(PresentModuleConstants.UPLOAD_IO_ERROR_EVENT, "OPEN HANDLER");
+ }
+
+
+ /**
+ * Receives an ProgressEvent which then updated the progress bar on the view
+ * @param event - a ProgressEvent
+ *
+ */
+ private function onUploadProgress(event:ProgressEvent) : void {
+ var percentage:Number = Math.round((event.bytesLoaded / event.bytesTotal) * 100);
+ var e:UploadEvent = new UploadEvent(UploadEvent.UPLOAD_PROGRESS_UPDATE);
+ e.percentageComplete = percentage;
+ _dispatcher.dispatchEvent(e);
+ }
+
+ /**
+ * Method is called when the upload has completed successfuly
+ * @param event
+ *
+ */
+ private function onUploadComplete(event:Event):void {
+ _dispatcher.dispatchEvent(new UploadEvent(UploadEvent.UPLOAD_COMPLETE));
+ }
+
+ /**
+ * Receives an ErrorEvent when an error occured during the upload
+ * @param event
+ *
+ */
+ private function onUploadIoError(event:IOErrorEvent):void {
+ _dispatcher.dispatchEvent(new UploadEvent(UploadEvent.UPLOAD_IO_ERROR));
+ LogUtil.error("An error occured while uploading the file. " + event.toString());
+ }
+
+ /**
+ * Method is called when a SecurityError is received
+ * @param event
+ *
+ */
+ private function onUploadSecurityError(event:SecurityErrorEvent) : void {
+ _dispatcher.dispatchEvent(new UploadEvent(UploadEvent.UPLOAD_SECURITY_ERROR));
+ LogUtil.error("A security error occured while trying to upload the presentation. " + event.toString());
+ }
+ }
+}
View
34 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/ThumbnailLoaderService.as
@@ -0,0 +1,34 @@
+package org.bigbluebutton.modules.present.services
+{
+ import flash.events.Event;
+ import flash.net.URLLoader;
+ import flash.net.URLLoaderDataFormat;
+ import flash.net.URLRequest;
+
+ import org.bigbluebutton.modules.present.models.Page;
+
+ public class ThumbnailLoaderService
+ {
+ private var _loader:URLLoader = new URLLoader();
+ private var _loaded:Boolean = false;
+ private var _page:Page;
+
+ public function ThumbnailLoaderService(page:Page)
+ {
+ _page = page;
+ }
+
+ public function load(uri:String):void {
+ if (!_loaded) {
+ _loader.addEventListener(Event.COMPLETE, handleComplete);
+ _loader.dataFormat = URLLoaderDataFormat.BINARY;
+ _loader.load(new URLRequest(uri));
+ }
+ }
+
+ private function handleComplete(e:Event):void{
+ _loaded = true;
+ _page.thumbnail = _loader.data;
+ }
+ }
+}
View
125 bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindowEventMap.mxml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ BigBlueButton open source conferencing system - http://www.bigbluebutton.org
+
+ Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below).
+
+ BigBlueButton is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later
+ version.
+
+ 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/>.
+
+ $Id: $
+-->
+<EventMap xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="http://mate.asfusion.com/">
+
+ <mx:Script>
+ <![CDATA[
+ import mx.events.FlexEvent;
+
+ import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
+ import org.bigbluebutton.modules.present.api.PresentationAPI;
+ import org.bigbluebutton.modules.present.business.PresentProxy;
+ import org.bigbluebutton.modules.present.events.AddOverlayCanvasEvent;
+ import org.bigbluebutton.modules.present.events.PresentModuleEvent;
+ import org.bigbluebutton.modules.present.events.PresentationEvent;
+ import org.bigbluebutton.modules.present.events.PresenterCommands;
+ import org.bigbluebutton.modules.present.events.RemovePresentationEvent;
+ import org.bigbluebutton.modules.present.events.SlideEvent;
+ import org.bigbluebutton.modules.present.events.UploadEvent;
+ import org.bigbluebutton.modules.present.managers.PresentManager;
+ import org.bigbluebutton.modules.present.ui.views.PresentationWindow;
+
+ private var apiInstance:PresentationAPI;
+
+ private function createAPI():void{
+ apiInstance = PresentationAPI.getInstance();
+ }
+ ]]>
+ </mx:Script>
+
+ <EventHandlers type="{FlexEvent.PREINITIALIZE}">
+ <ObjectBuilder generator="{PresentManager}" cache="global" />
+ <ObjectBuilder generator="{PresentProxy}" cache="global" />
+ <InlineInvoker method="createAPI" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresentModuleEvent.START_MODULE}" >
+ <MethodInvoker generator="{PresentManager}" method="handleStartModuleEvent" arguments="{event}"/>
+ <MethodInvoker generator="{PresentProxy}" method="connect" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresentModuleEvent.STOP_MODULE}" >
+ <MethodInvoker generator="{PresentManager}" method="handleStopModuleEvent" />
+ </EventHandlers>
+
+ <EventHandlers type="{UploadEvent.OPEN_UPLOAD_WINDOW}" >
+ <MethodInvoker generator="{PresentManager}" method="handleOpenUploadWindow" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{UploadEvent.CLOSE_UPLOAD_WINDOW}" >
+ <MethodInvoker generator="{PresentManager}" method="handleCloseUploadWindow" />
+ </EventHandlers>
+
+ <EventHandlers type="{UploadEvent.START_UPLOAD}">
+ <MethodInvoker generator="{PresentProxy}" method="startUpload" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresenterCommands.GOTO_SLIDE}" >
+ <MethodInvoker generator="{PresentProxy}" method="gotoSlide" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresenterCommands.RESET_ZOOM}" >
+ <MethodInvoker generator="{PresentProxy}" method="resetZoom" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresenterCommands.SHARE_PRESENTATION_COMMAND}">
+ <MethodInvoker generator="{PresentProxy}" method="sharePresentation" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresenterCommands.MOVE}" >
+ <MethodInvoker generator="{PresentProxy}" method="moveSlide" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresenterCommands.ZOOM}" >
+ <MethodInvoker generator="{PresentProxy}" method="zoomSlide" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresenterCommands.SEND_CURSOR_UPDATE}" >
+ <MethodInvoker generator="{PresentProxy}" method="sendCursorUpdate" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{PresenterCommands.RESIZE}" >
+ <MethodInvoker generator="{PresentProxy}" method="resizeSlide" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{UploadEvent.PRESENTATION_READY}" >
+ <MethodInvoker generator="{PresentProxy}" method="loadPresentation" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{RemovePresentationEvent.REMOVE_PRESENTATION_EVENT}">
+ <MethodInvoker generator="{PresentProxy}" method="removePresentation" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{RemovePresentationEvent.PRESENTATION_REMOVED_EVENT}">
+ <MethodInvoker generator="{PresentManager}" method="removePresentation" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{UploadEvent.CONVERT_SUCCESS}">
+ <MethodInvoker generator="{PresentManager}" method="updatePresentationNames" arguments="{event}" />
+ </EventHandlers>
+
+ <EventHandlers type="{SlideEvent.LOAD_CURRENT_SLIDE}" >
+ <MethodInvoker generator="{PresentProxy}" method="loadCurrentSlideLocally" arguments="{event}" />
+ </EventHandlers>
+
+
+
+</EventMap>
View
9 bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindowEventMapDelegate.as
@@ -0,0 +1,9 @@
+package org.bigbluebutton.modules.present.ui.views
+{
+ public class PresentationWindowEventMapDelegate
+ {
+ public function PresentationWindowEventMapDelegate()
+ {
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.