- continue cleaning up presentation

This commit is contained in:
Richard Alam 2014-02-27 21:41:25 +00:00
parent feb49951a5
commit d15e8c3a5b
24 changed files with 380 additions and 214 deletions

View File

@ -47,9 +47,10 @@ public class ConversionUpdatesProcessor {
}
public void sendConversionCompleted(String messageKey, String conference,
String code, String presId, Integer numberOfPages, String presName) {
String code, String presId, Integer numberOfPages, String presName,
String presBaseUrl) {
presentationApplication.sendConversionCompleted(messageKey, conference,
code, presId, numberOfPages, presName);
code, presId, numberOfPages, presName, presBaseUrl);
}
public void setPresentationApplication(PresentationApplication a) {

View File

@ -56,9 +56,10 @@ public class PresentationApplication {
}
public void sendConversionCompleted(String messageKey, String meetingId,
String code, String presentation, int numberOfPages, String presName) {
String code, String presentation, int numberOfPages,
String presName, String presBaseUrl) {
bbbInGW.sendConversionCompleted(messageKey, meetingId,
code, presentation, numberOfPages, presName);
code, presentation, numberOfPages, presName, presBaseUrl);
}
public void removePresentation(String meetingID, String presentationID){

View File

@ -50,10 +50,10 @@ public class PresentationMessageListener implements MessageHandler {
private void sendConversionCompleted(String messageKey, String conference,
String code, String presId, Integer numberOfPages,
String filename) {
String filename, String presBaseUrl) {
conversionUpdatesProcessor.sendConversionCompleted(messageKey, conference,
code, presId, numberOfPages, filename);
code, presId, numberOfPages, filename, presBaseUrl);
}
@ -96,8 +96,9 @@ public class PresentationMessageListener implements MessageHandler {
} else if(messageKey.equalsIgnoreCase(CONVERSION_COMPLETED_KEY)){
Integer numberOfPages = new Integer((String) map.get("numberOfPages"));
String presBaseUrl = (String) map.get("presentationBaseUrl");
sendConversionCompleted(messageKey, conference, code,
presId, numberOfPages, filename);
presId, numberOfPages, filename, presBaseUrl);
}
}
}

View File

@ -78,7 +78,7 @@ public interface IBigBlueButtonInGW {
int pagesCompleted, String presName);
void sendConversionCompleted(String messageKey, String meetingId,
String code, String presId, int numPages, String presName);
String code, String presId, int numPages, String presName, String presBaseUrl);
// Polling
void getPolls(String meetingID, String requesterID);

View File

@ -209,15 +209,20 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
code, presentationId, numberOfPages, pagesCompleted, presName))
}
def generatePresentationPages(numPages: Int):scala.collection.immutable.HashMap[String, Page] = {
def generatePresentationPages(numPages: Int, presBaseUrl: String):scala.collection.immutable.HashMap[String, Page] = {
var pages = new scala.collection.immutable.HashMap[String, Page]
val baseUrl =
for (i <- 1 to numPages) {
val id = "slide/" + i
val num = i;
val thumbnail = "thumbnail/" + i
val current = if (i == 1) true else false
val p = new Page(id=id, num=num, thumbnail=thumbnail, current=current)
val thumbnail = presBaseUrl + "/thumbnails/thumb-" + i + ".png"
val swfUri = presBaseUrl + "/slide-" + i + ".swf"
val txtUri = presBaseUrl + "/textfiles/slide-" + i + ".txt"
val p = new Page(id=id, num=num, thumbUri=thumbnail, swfUri=swfUri,
txtUri=txtUri, pngUri=thumbnail,
current=current)
pages += (p.id -> p)
}
@ -225,9 +230,10 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
}
def sendConversionCompleted(messageKey: String, meetingId: String,
code: String, presentationId: String, numPages: Int, presName: String) {
code: String, presentationId: String, numPages: Int,
presName: String, presBaseUrl: String) {
println("******************** PRESENTATION CONVERSION COMPLETED MESSAGE ***************************** ")
val pages = generatePresentationPages(numPages)
val pages = generatePresentationPages(numPages, presBaseUrl)
val presentation = new Presentation(id=presentationId, name=presName, pages=pages)
bbbGW.accept(new PresentationConversionCompleted(meetingId, messageKey,

View File

@ -3,8 +3,12 @@ package org.bigbluebutton.core.apps.presentation
case class Presentation(id: String, name: String, current: Boolean = false,
pages: scala.collection.immutable.HashMap[String, Page])
case class Page(id: String, num: Int, current: Boolean = false,
thumbnail: String = "",
case class Page(id: String, num: Int,
thumbUri: String = "",
swfUri: String,
txtUri: String,
pngUri: String,
current: Boolean = false,
xOffset: Double = 0, yOffset: Double = 0,
widthRatio: Double = 0D, heightRatio: Double = 0D)

View File

@ -231,7 +231,10 @@ class PresentationClientMessageSender(service: ConnectionInvokerService) extends
args.put("id", msg.page.id)
args.put("num", msg.page.num:java.lang.Integer)
args.put("current", msg.page.current:java.lang.Boolean)
args.put("thumbnail", msg.page.thumbnail)
args.put("swfUri", msg.page.swfUri)
args.put("txtUri", msg.page.txtUri)
args.put("pngUri", msg.page.pngUri)
args.put("thumbUri", msg.page.thumbUri)
args.put("xOffset", msg.page.xOffset:java.lang.Double);
args.put("yOffset", msg.page.yOffset:java.lang.Double);
args.put("widthRatio", msg.page.widthRatio:java.lang.Double);
@ -252,7 +255,10 @@ class PresentationClientMessageSender(service: ConnectionInvokerService) extends
args.put("id", msg.page.id)
args.put("num", msg.page.num:java.lang.Integer)
args.put("current", msg.page.current:java.lang.Boolean)
args.put("thumbnail", msg.page.thumbnail)
args.put("swfUri", msg.page.swfUri)
args.put("txtUri", msg.page.txtUri)
args.put("pngUri", msg.page.pngUri)
args.put("thumbUri", msg.page.thumbUri)
args.put("xOffset", msg.page.xOffset:java.lang.Double);
args.put("yOffset", msg.page.yOffset:java.lang.Double);
args.put("widthRatio", msg.page.widthRatio:java.lang.Double);

View File

@ -23,9 +23,6 @@ package org.bigbluebutton.modules.present.business
import flash.events.TimerEvent;
import flash.net.NetConnection;
import flash.utils.Timer;
import mx.controls.Alert;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.MadePresenterEvent;
@ -44,13 +41,11 @@ package org.bigbluebutton.modules.present.business
import org.bigbluebutton.modules.present.services.MessageReceiver;
import org.bigbluebutton.modules.present.services.MessageSender;
public class PresentProxy
{
public class PresentProxy {
private var host:String;
private var conference:String;
private var room:String;
private var userid:Number;
private var soService:PresentSOService;
private var uploadService:FileUploadService;
private var slides:PresentationSlides;
private var sender:MessageSender;
@ -124,17 +119,7 @@ package org.bigbluebutton.modules.present.business
}
}
/**
* Reset the zoom level of the current slide to the default value
* @param e
*
*/
public function resetZoom(e:PresenterCommands):void{
if (soService == null) return;
// soService.restore();
}
/**
* Loads a presentation from the server. creates a new PresentationService class
*
@ -203,9 +188,5 @@ package org.bigbluebutton.modules.present.business
sender.sendCursorUpdate(e.xPercent, e.yPercent);
}
public function resizeSlide(e:PresenterCommands):void{
// soService.resizeSlide(e.newSizeInPercent);
}
}
}

View File

@ -18,13 +18,14 @@
*/
package org.bigbluebutton.modules.present.managers
{
import flash.display.DisplayObject;
import flash.geom.Point;
import com.asfusion.mate.events.Dispatcher;
import flash.display.DisplayObject;
import flash.geom.Point;
import mx.collections.ArrayCollection;
import mx.managers.PopUpManager;
import mx.core.*;
import mx.managers.PopUpManager;
import org.bigbluebutton.common.IBbbModuleWindow;
import org.bigbluebutton.common.LogUtil;
@ -37,6 +38,7 @@ package org.bigbluebutton.modules.present.managers
import org.bigbluebutton.modules.present.events.QueryListOfPresentationsReplyEvent;
import org.bigbluebutton.modules.present.events.RemovePresentationEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.modules.present.model.PresentationModel;
import org.bigbluebutton.modules.present.ui.views.FileUploadWindow;
import org.bigbluebutton.modules.present.ui.views.PresentationWindow;
@ -46,9 +48,6 @@ package org.bigbluebutton.modules.present.managers
private var uploadWindow:FileUploadWindow;
private var presentWindow:PresentationWindow;
//format: presentationNames = [{label:"00"}, {label:"11"}, {label:"22"} ];
[Bindable] public var presentationNames:ArrayCollection = new ArrayCollection();
public function PresentManager() {
globalDispatcher = new Dispatcher();
}
@ -78,7 +77,7 @@ package org.bigbluebutton.modules.present.managers
uploadWindow = FileUploadWindow(PopUpManager.createPopUp(FlexGlobals.topLevelApplication as DisplayObject, FileUploadWindow, true));
uploadWindow.presentationNamesAC = presentationNames;
uploadWindow.presentationNamesAC = PresentationModel.getInstance().getPresentationNames();
uploadWindow.maxFileSize = e.maxFileSize;
var point1:Point = new Point();
@ -93,34 +92,5 @@ package org.bigbluebutton.modules.present.managers
PopUpManager.removePopUp(uploadWindow);
uploadWindow = null;
}
public function updatePresentationNames(e:UploadEvent):void{
LogUtil.debug("Adding presentation " + e.presentationName);
for (var i:int = 0; i < presentationNames.length; i++) {
if (presentationNames[i] == e.presentationName) return;
}
presentationNames.addItem(e.presentationName);
}
public function removePresentation(e:RemovePresentationEvent):void {
LogUtil.debug("Removing presentation " + e.presentationName);
var p:String;
for (var i:int = 0; i < presentationNames.length; i++) {
p = presentationNames.getItemAt(i) as String;
if (p == e.presentationName) {
presentationNames.removeItemAt(i);
}
}
}
public function queryPresentations():void {
var pArray:Array = new Array();
pArray = presentationNames.toArray();
var qEvent:QueryListOfPresentationsReplyEvent = new QueryListOfPresentationsReplyEvent();
qEvent.presentations = pArray;
globalDispatcher.dispatchEvent(qEvent);
}
}
}

View File

@ -1,14 +1,148 @@
package org.bigbluebutton.modules.present.model
{
public class Page
{
public var id: String;
public var num: int;
public var current: Boolean;
public var thumb: String;
public var xOffset: Number;
public var yOffset: Number;
public var widthRatio: Number;
public var heightRatio: Number
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.utils.ByteArray;
public class Page {
private var _id: String;
private var _num: int;
private var _current: Boolean;
private var _swfUri: String;
private var _txtUri: String;
private var _pngUri: String;
private var _thumbUri: String;
private var _xOffset: Number;
private var _yOffset: Number;
private var _widthRatio: Number;
private var _heightRatio: Number
private var _swfLoader:URLLoader;
private var _swfLoaded:Boolean = false;
private var _swfLoadedListener:Function;
private var _txtLoader:URLLoader;
private var _txtLoaded:Boolean = false;
private var _txtLoadedListener:Function;
public function Page(id: String, num: int, current: Boolean,
swfUri: String, thumbUri: String, txtUri: String,
pngUri: String, x: Number, y: Number,
width: Number, height: Number) {
_id = id;
_num = num;
_current = current;
_swfUri = swfUri;
_thumbUri = thumbUri;
_txtUri = txtUri;
_pngUri = pngUri;
_xOffset = x;
_yOffset = y;
_widthRatio = width;
_heightRatio = height;
_swfLoader = new URLLoader();
_swfLoader.addEventListener(Event.COMPLETE, handleSwfLoadingComplete);
_swfLoader.dataFormat = URLLoaderDataFormat.BINARY;
_txtLoader = new URLLoader();
_txtLoader.addEventListener(Event.COMPLETE, handleTextLoadingComplete);
_txtLoader.dataFormat = URLLoaderDataFormat.TEXT;
}
public function get id():String {
return _id;
}
public function get num():int {
return _num;
}
public function get current():Boolean {
return _current;
}
public function get xOffset():Number {
return _xOffset;
}
public function set xOffset(x: Number):void {
_xOffset = x;
}
public function get yOffset():Number {
return _yOffset;
}
public function set yOffset(y: Number):void {
_yOffset = y;
}
public function get widthRatio():Number {
return _widthRatio;
}
public function set widthRatio(width:Number):void {
_widthRatio = width;
}
public function get swfUri():String {
return _swfUri;
}
public function get thumbUri():String {
return _thumbUri;
}
public function get txtUri():String {
return _txtUri;
}
public function get swfData():ByteArray {
if (_swfLoaded) return _swfLoader.data;
return null;
}
public function loadSwf(swfLoadedListener:Function):void {
if (_swfLoaded) {
swfLoadedListener(_id);
} else {
_swfLoadedListener = swfLoadedListener;
_swfLoader.load(new URLRequest(_swfUri));
}
}
private function handleSwfLoadingComplete(e:Event):void{
_swfLoaded = true;
if (_swfLoadedListener != null) {
_swfLoadedListener(_id);
}
}
public function get txtData():String {
if (_txtLoaded) {
return _txtLoader.data;
}
return null;
}
public function loadTxt(txtLoadedListener:Function):void {
if (_txtLoaded) {
txtLoadedListener(_id);
} else {
_txtLoadedListener = txtLoadedListener;
_txtLoader.load(new URLRequest(_txtUri));
}
}
private function handleTextLoadingComplete(e:Event):void{
_txtLoaded = true;
if (_txtLoadedListener != null) {
_txtLoadedListener(_id);
}
}
}
}

View File

@ -2,17 +2,17 @@ package org.bigbluebutton.modules.present.model
{
import mx.collections.ArrayCollection;
public class Presentation
{
public class Presentation {
private var _id:String;
private var _name:String;
private var _current:Boolean = false;
private var _pages:ArrayCollection = new ArrayCollection();
public function Presentation(id: String, name: String, current: Boolean) {
private var _pages:ArrayCollection;
public function Presentation(id: String, name: String, current: Boolean, pages: ArrayCollection) {
_id = id;
_name = name;
_current = current;
_pages = pages
}
public function get id():String {
@ -26,16 +26,12 @@ package org.bigbluebutton.modules.present.model
public function isCurrent():Boolean {
return _current;
}
public function addPage(p: Page):void {
_pages.addItem(p);
}
public function getPages():Array {
var pages:Array = new Array();
public function getPages():ArrayCollection {
var pages:ArrayCollection = new ArrayCollection();
for (var i: int = 0; i < _pages.length; i++) {
pages.push(_pages.getItemAt(i) as Page);
pages.addItem(_pages.getItemAt(i) as Page);
}
return pages;

View File

@ -6,6 +6,7 @@ package org.bigbluebutton.modules.present.model
{
private static var instance:PresentationModel = null;
private var _pages:ArrayCollection = new ArrayCollection();
private var _presentations:ArrayCollection = new ArrayCollection();
private var _presenter: Presenter;
@ -43,6 +44,10 @@ package org.bigbluebutton.modules.present.model
return _presenter;
}
public function addPage(page: Page):void {
_pages.addItem(page);
}
public function addPresentation(p: Presentation):void {
_presentations.addItem(p);
}
@ -56,12 +61,12 @@ package org.bigbluebutton.modules.present.model
return null;
}
public function getPresentationNames():Array {
var presos:Array = new Array();
public function getPresentationNames():ArrayCollection {
var presos:ArrayCollection = new ArrayCollection();
for (var i:int = 0; i < _presentations.length; i++) {
var pres: Presentation = _presentations.getItemAt(i) as Presentation;
presos.push(pres.name);
presos.addItem(pres.name);
}
return presos;
@ -80,7 +85,7 @@ package org.bigbluebutton.modules.present.model
var pres: Presentation = getCurrentPresentation();
if (pres != null) {
var pages:Array = pres.getPages();
var pages:ArrayCollection = pres.getPages();
for (var j:int = 0; j < pages.length; j++) {
var page:Page = pages[j] as Page;
if (page.current) return page;

View File

@ -20,6 +20,8 @@ package org.bigbluebutton.modules.present.services
{
import com.asfusion.mate.events.Dispatcher;
import mx.collections.ArrayCollection;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.UsersUtil;
@ -177,6 +179,8 @@ package org.bigbluebutton.modules.present.services
var map:Object = JSON.parse(msg.msg);
pocessUploadedPresentation(map);
var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.CONVERT_SUCCESS);
uploadEvent.data = CONVERSION_COMPLETED_KEY;
uploadEvent.presentationName = map.id;
@ -188,6 +192,25 @@ package org.bigbluebutton.modules.present.services
dispatcher.dispatchEvent(readyEvent);
}
private function pocessUploadedPresentation(presentation:Object):void {
var presoPages:ArrayCollection = new ArrayCollection();
var pages:ArrayCollection = presentation.pages as ArrayCollection;
for (var k:int = 0; k < pages.length; k++) {
var page:Object = pages[k];
var pg:Page = new Page(page.id, page.num, page.current,
page.swfUri, page.thumbUri, page.txtUri,
page.pngUri, page.xOffset, page.yOffset,
page.withRatio, page.heightRatio)
presoPages.addItem(pg);
}
var preso:Presentation = new Presentation(presentation.id, presentation.name,
presentation.current, pages);
PresentationModel.getInstance().addPresentation(preso);
}
private function handleGeneratedSlideUpdateMessageCallback(msg:Object) : void {
trace(LOG + "*** handleGeneratedSlideUpdateMessageCallback " + msg.msg + " **** \n");
@ -260,26 +283,8 @@ package org.bigbluebutton.modules.present.services
var presentations:Array = map.presentations as Array;
for (var j:int = 0; j < presentations.length; j++) {
var presentation:Object = presentations[j];
var preso:Presentation = new Presentation(presentation.id, presentation.name, presentation.current);
var pages:Array = presentation.pages as Array;
for (var k:int = 0; k < pages.length; k++) {
var page:Object = pages[k];
var pg:Page = new Page();
pg.id = page.id;
pg.num = page.num;
pg.current = page.current;
pg.thumb = page.thumbnail;
pg.xOffset = page.xOffset;
pg.yOffset = page.yOffset;
pg.widthRatio = page.withRatio;
pg.heightRatio = page.heightRatio;
preso.addPage(pg);
}
PresentationModel.getInstance().addPresentation(preso);
var presentation:Object = presentations[j];
pocessUploadedPresentation(presentation);
}
var myUserId: String = UsersUtil.getMyUserID();
@ -293,7 +298,7 @@ package org.bigbluebutton.modules.present.services
dispatcher.dispatchEvent(new MadePresenterEvent(MadePresenterEvent.SWITCH_TO_PRESENTER_MODE));
}
var presNames:Array = PresentationModel.getInstance().getPresentationNames();
var presNames:ArrayCollection = PresentationModel.getInstance().getPresentationNames();
if (presNames) {
trace(LOG + " ************ Getting list of presentations *************");

View File

@ -58,7 +58,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.util.i18n.ResourceUtil;
[Bindable] public var presentationNamesAC:ArrayCollection;
[BIndable] public var maxFileSize:Number;
[BIndable] public var maxFileSize:Number;
private var images:Images = new Images();
[Bindable] private var addIcon : Class = images.add;
@ -71,8 +71,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var fileToUpload:FileReference = new FileReference();
override public function move(x:Number, y:Number):void
{
override public function move(x:Number, y:Number):void{
return;
}
@ -132,7 +131,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
fileFormatHintLbl.visible = false;
fileFormatHintLbl.includeInLayout = false;
uploadedFilesList.enabled = false;
uploadedFilesList.enabled = false;
progressReportBox.visible = true;
progressBar.visible = true;
@ -147,13 +146,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
var presentationName:String = StringUtil.trim(fileToUpload.name);
trace("Uploading file : " + presentationName);
var filenamePattern:RegExp = /(.+)(\..+)/i;
// Get the first match which should be the filename without the extension.
presentationName = presentationName.replace(filenamePattern, "$1")
// Replace any character other than a word character (A-Z, a-z, 0-9, or _).
presentationName = presentationName.replace(/[^0-9a-zA-Z_\.]/g, "-");
trace("Uploadling presentation name: " + presentationName);
var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.START_UPLOAD);
uploadEvent.presentationName = presentationName;
uploadEvent.fileToUpload = fileToUpload;

View File

@ -68,44 +68,45 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import flash.geom.Point;
import flexlib.containers.DockableToolBar;
import flexlib.mdi.events.MDIWindowEvent;
import mx.binding.utils.BindingUtils;
import mx.collections.ArrayCollection;
import mx.containers.TitleWindow;
import mx.core.Application;
import mx.effects.Move;
import mx.events.ListEvent;
import mx.events.ResizeEvent;
import mx.managers.PopUpManager;
import mx.rpc.events.*;
import org.bigbluebutton.common.IBbbCanvas;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.present.events.AddOverlayCanvasEvent;
import org.bigbluebutton.modules.present.events.DisplaySlideEvent;
import org.bigbluebutton.modules.present.events.MoveEvent;
import org.bigbluebutton.modules.present.events.NavigationEvent;
import org.bigbluebutton.modules.present.events.PresentationEvent;
import org.bigbluebutton.modules.present.events.PresenterCommands;
import org.bigbluebutton.modules.present.events.SlideEvent;
import org.bigbluebutton.modules.present.events.SlideResizedEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.modules.present.events.WindowResizedEvent;
import org.bigbluebutton.modules.present.events.ZoomEvent;
import org.bigbluebutton.modules.present.managers.Slide;
import org.bigbluebutton.modules.present.managers.SlideManager;
import org.bigbluebutton.modules.present.ui.views.PresentOptions;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardButtonEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import flash.geom.Point;
import flexlib.containers.DockableToolBar;
import flexlib.mdi.events.MDIWindowEvent;
import mx.binding.utils.BindingUtils;
import mx.collections.ArrayCollection;
import mx.containers.TitleWindow;
import mx.core.Application;
import mx.effects.Move;
import mx.events.ListEvent;
import mx.events.ResizeEvent;
import mx.managers.PopUpManager;
import mx.rpc.events.*;
import org.bigbluebutton.common.IBbbCanvas;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.present.events.AddOverlayCanvasEvent;
import org.bigbluebutton.modules.present.events.DisplaySlideEvent;
import org.bigbluebutton.modules.present.events.MoveEvent;
import org.bigbluebutton.modules.present.events.NavigationEvent;
import org.bigbluebutton.modules.present.events.PresentationEvent;
import org.bigbluebutton.modules.present.events.PresenterCommands;
import org.bigbluebutton.modules.present.events.SlideEvent;
import org.bigbluebutton.modules.present.events.SlideResizedEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.modules.present.events.WindowResizedEvent;
import org.bigbluebutton.modules.present.events.ZoomEvent;
import org.bigbluebutton.modules.present.managers.Slide;
import org.bigbluebutton.modules.present.managers.SlideManager;
import org.bigbluebutton.modules.present.model.PresentationModel;
import org.bigbluebutton.modules.present.ui.views.PresentOptions;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardButtonEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
public static const TITLE:String = "Presentation";
private static const NEXT_BUTTON:String = "Next";
@ -167,10 +168,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
slideView.slideLoader.tabIndex = baseIndex+4;
hotkeyCapture();
//Necessary now because of module loading race conditions
var t:Timer = new Timer(2000, 1);
t.addEventListener(TimerEvent.TIMER, addWhiteboardToolbar);
t.start();
//Necessary now because of module loading race conditions
var t:Timer = new Timer(2000, 1);
t.addEventListener(TimerEvent.TIMER, addWhiteboardToolbar);
t.start();
}
private function addWhiteboardToolbar(event:TimerEvent):void {
@ -372,8 +373,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function handlePresentationLoadedEvent(e:PresentationEvent):void {
if (e.presentationName == currentPresentation) return;
currentPresentation = e.presentationName;
var newPresName = PresentationModel.getInstance().getCurrentPresentationName();
if (newPresName == currentPresentation) return;
presentationLoaded = true;
slideView.setSlides(e.slides.slides);
slideView.visible = true;
@ -382,7 +384,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
displaySlideNumber(slideView.getSelectedSlide() + 1);
if (isPresenter) {
displaySlideNavigationControls(true);
notifyOthersOfSharingPresentation(e.presentationName);
notifyOthersOfSharingPresentation(newPresName);
} else {
dispatchEvent(new SlideEvent(SlideEvent.LOAD_CURRENT_SLIDE));
}

View File

@ -43,17 +43,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import flash.events.Event;
import com.asfusion.mate.events.Dispatcher;
import flash.events.Event;
import mx.binding.utils.BindingUtils;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.controls.Button;
import mx.events.FlexEvent;
import mx.events.ListEvent;
import mx.events.ListEvent;
import org.bigbluebutton.common.IBbbCanvas;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.model.FocusableImage;
@ -323,9 +320,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function handleSlideLoadedEvent(e:SlideEvent):void{
slideLoader.source = e.slide;
//slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end";
slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + e.slideText + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + e.slideText + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
LogUtil.debug(e.slideText);
slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + e.slideText + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + e.slideText + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
LogUtil.debug(e.slideText);
}
/**
@ -499,10 +496,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
]]>
</mx:Script>
<fimage:FocusableImage id="slideLoader" width="{slideModel.loaderW}" height="{slideModel.loaderH}" x="{slideModel.loaderX}" y="{slideModel.loaderY}" useHandCursor="true" buttonMode="false"
creationComplete="listenForSlideLoadedCompleteEvent()" styleName="presentationSlideViewStyle" scaleContent="false" showBusyCursor="true" completeEffect="Fade" />
<fimage:FocusableImage id="slideLoader" width="{slideModel.loaderW}" height="{slideModel.loaderH}"
x="{slideModel.loaderX}" y="{slideModel.loaderY}" useHandCursor="true" buttonMode="false"
creationComplete="listenForSlideLoadedCompleteEvent()"
styleName="presentationSlideViewStyle"
scaleContent="false"
showBusyCursor="true"
completeEffect="Fade" />
<mx:HorizontalList id="thumbnailView" itemRenderer="org.bigbluebutton.modules.present.ui.views.Thumbnail" itemRollOver="changeIndex(event)"
visible="false" width="100%" height="100" y="{this.height - 100}" change="changeSlide()" />
<mx:HorizontalList id="thumbnailView" itemRenderer="org.bigbluebutton.modules.present.ui.views.Thumbnail"
itemRollOver="changeIndex(event)"
visible="false" width="100%" height="100"
y="{this.height - 100}" change="changeSlide()" />
</mx:Canvas>

View File

@ -111,6 +111,8 @@ disableRecordingDefault=false
# enters a name and password, she is redirected here to load the client.
bigbluebutton.web.serverURL=http://192.168.0.150
#----------------------------------------------------
# Assign URL where the logged-out participant will be redirected after sign-out.
# If "default", it returns to bigbluebutton.web.serverURL
@ -166,6 +168,11 @@ beans.presentationService.testUploadedPresentation=appkonference.txt
# Default Uploaded presentation file
beans.presentationService.defaultUploadedPresentation=${bigbluebutton.web.serverURL}/default.pdf
#----------------------------------------------------
# The URL where the presentations will be loaded from.
#----------------------------------------------------
beans.presentationService.presentationBaseUrl=${bigbluebutton.web.serverURL}/presentation
#----------------------------------------------------
# Inject values into grails service beans
beans.presentationService.presentationDir=${presentationDir}

View File

@ -1762,7 +1762,8 @@ class ApiController {
def processUploadedFile(meetingId, presId, filename, presFile) {
UploadedPresentation uploadedPres = new UploadedPresentation(meetingId, presId, filename);
def presentationBaseUrl = presentationService.presentationBaseUrl
UploadedPresentation uploadedPres = new UploadedPresentation(meetingId, presId, filename, presentationBaseUrl);
uploadedPres.setUploadedFile(presFile);
presentationService.processUploadedPresentation(uploadedPres);
}

View File

@ -79,8 +79,9 @@ class PresentationController {
def newFilename = Util.createNewFilename(presId, filenameExt)
def pres = new File(uploadDir.absolutePath + File.separatorChar + newFilename )
file.transferTo(pres)
UploadedPresentation uploadedPres = new UploadedPresentation(meetingId, presId, presFilename);
def presentationBaseUrl = presentationService.presentationBaseUrl
UploadedPresentation uploadedPres = new UploadedPresentation(meetingId, presId, presFilename, presentationBaseUrl);
uploadedPres.setUploadedFile(pres);
presentationService.processUploadedPresentation(uploadedPres)
}

View File

@ -33,8 +33,9 @@ class PresentationService {
def testPresentationName
def testUploadedPresentation
def defaultUploadedPresentation
def presentationBaseUrl
def deletePresentation = {conf, room, filename ->
def deletePresentation = {conf, room, filename ->
def directory = new File(roomDirectory(conf, room).absolutePath + File.separatorChar + filename)
deleteDirectory(directory)
}

View File

@ -19,6 +19,7 @@
package org.bigbluebutton.presentation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@ -40,9 +41,9 @@ public class ConversionUpdateMessage {
message.put("conference", pres.getMeetingId());
message.put("room", pres.getMeetingId());
message.put("returnCode", "CONVERT");
message.put("presentationName", pres.getPresentationId());
message.put("presentationId", pres.getPresentationId());
message.put("filename", pres.getPresentationName());
message.put("presentationName", pres.getId());
message.put("presentationId", pres.getId());
message.put("filename", pres.getName());
}
public MessageBuilder entry(String key, Object value) {
@ -74,9 +75,37 @@ public class ConversionUpdateMessage {
message.put("slidesInfo", slidesInfo);
return this;
}
public MessageBuilder presBaseUrl(UploadedPresentation pres) {
message.put("presentationBaseUrl", generateBasePresUrl(pres));
return this;
}
public ConversionUpdateMessage build() {
return new ConversionUpdateMessage(this);
}
public MessageBuilder generatePages(UploadedPresentation pres) {
String basePresUrl = generateBasePresUrl(pres);
ArrayList<Map<String, String>> pages = new ArrayList<Map<String, String>>();
for (int i = 1; i <= pres.getNumberOfPages(); i++) {
Map<String, String> page = new HashMap<String, String>();
page.put("num", new Integer(i).toString());
page.put("thumb", basePresUrl + "/thumbnails/thumb-" + i + ".png");
page.put("swf", basePresUrl + "/slide-" + i + ".swf");
page.put("text", basePresUrl + "/textfiles/slide-" + i + ".txt");
pages.add(page);
}
message.put("pages", pages);
return this;
}
private String generateBasePresUrl(UploadedPresentation pres) {
return pres.getBaseUrl() + "/" + pres.getMeetingId() + "/" + pres.getId();
}
}
}

View File

@ -0,0 +1,16 @@
package org.bigbluebutton.presentation;
public class Page {
private final int num;
public Page(int num) {
this.num = num;
}
public int getNum() {
return num;
}
}

View File

@ -23,17 +23,21 @@ import java.io.File;
public final class UploadedPresentation {
private final String meetingId;
private final String presentationId;
private final String presentationName;
private final String id;
private final String name;
private File uploadedFile;
private String fileType = "unknown";
private int numberOfPages = 0;
private boolean lastStepSuccessful = false;
private final String baseUrl;
public UploadedPresentation(String meetingId, String presentationId, String presentationName) {
public UploadedPresentation(String meetingId, String id,
String name,
String baseUrl) {
this.meetingId = meetingId;
this.presentationId = presentationId;
this.presentationName = presentationName;
this.id = id;
this.name = name;
this.baseUrl = baseUrl;
}
public File getUploadedFile() {
@ -48,12 +52,16 @@ public final class UploadedPresentation {
return meetingId;
}
public String getPresentationId() {
return presentationId;
public String getId() {
return id;
}
public String getPresentationName() {
return presentationName;
public String getName() {
return name;
}
public String getBaseUrl() {
return baseUrl;
}
public String getFileType() {

View File

@ -77,15 +77,10 @@ public class SwfSlidesGenerationProgressNotifier {
return;
}
String xml = generatedSlidesInfoHelper.generateUploadedPresentationInfo(pres);
String escape_xml = StringEscapeUtils.escapeXml(xml);
MessageBuilder builder = new ConversionUpdateMessage.MessageBuilder(pres);
builder.messageKey(ConversionMessageConstants.CONVERSION_COMPLETED_KEY);
builder.slidesInfo(escape_xml);
builder.numberOfPages(pres.getNumberOfPages());
builder.presBaseUrl(pres);
notifyProgressListener(builder.build().getMessage());
}