From 9c92780ddb1154783b8222b9b8960e9f47692398 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Wed, 20 Sep 2017 16:58:04 -0400 Subject: [PATCH 01/12] added presentation pod models --- .../core/apps/PresentationModel.scala | 16 +++--- .../PresentationUploadTokenReqMsgHdlr.scala | 2 +- .../presentationpod/PresentationPodsApp.scala | 21 ++++++++ .../core/domain/MeetingState2x.scala | 11 ++-- .../core/models/PresentationPods.scala | 52 +++++++++++++++++++ .../core/running/MeetingActor.scala | 15 +++++- 6 files changed, 103 insertions(+), 14 deletions(-) create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationModel.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationModel.scala index eb0a29eaad..1418929706 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationModel.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PresentationModel.scala @@ -9,17 +9,17 @@ case class Presentation(id: String, name: String, current: Boolean = false, pages: scala.collection.immutable.Map[String, PageVO], downloadable: Boolean) class PresentationModel { - private var presentations = new scala.collection.immutable.HashMap[String, Presentation] + private var presentations = new scala.collection.immutable.HashMap[String, Presentation] // todo remove - def addPresentation(pres: Presentation) { + def addPresentation(pres: Presentation) { // todo remove savePresentation(pres) } - def getPresentations(): Vector[Presentation] = { + def getPresentations(): Vector[Presentation] = { // todo remove presentations.values.toVector } - def getCurrentPresentation(): Option[Presentation] = { + def getCurrentPresentation(): Option[Presentation] = { // todo remove presentations.values find (p => p.current) } @@ -34,7 +34,7 @@ class PresentationModel { } yield curPage } - def removePresentation(presId: String): Option[Presentation] = { + def removePresentation(presId: String): Option[Presentation] = { // todo remove for { pres <- presentations.get(presId) } yield { @@ -43,7 +43,7 @@ class PresentationModel { } } - def setCurrentPresentation(presId: String): Option[Presentation] = { + def setCurrentPresentation(presId: String): Option[Presentation] = { // todo remove getPresentations foreach (curPres => { if (curPres.id != presId) { val newPres = curPres.copy(current = false) @@ -60,7 +60,7 @@ class PresentationModel { } } - private def savePresentation(pres: Presentation) { + private def savePresentation(pres: Presentation) { // todo remove presentations += pres.id -> pres } @@ -105,7 +105,7 @@ class PresentationModel { } def changeCurrentPage(presentationId: String, pageId: String): Boolean = { - var foundPage: Boolean = false; + var foundPage: Boolean = false for { pres <- presentations.get(presentationId) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala index 09623b533c..8db1ad9ad4 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala @@ -2,7 +2,7 @@ package org.bigbluebutton.core.apps.presentation import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.{ LiveMeeting } +import org.bigbluebutton.core.running.LiveMeeting trait PresentationUploadTokenReqMsgHdlr { this: PresentationApp2x => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala new file mode 100644 index 0000000000..26a6ff813f --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala @@ -0,0 +1,21 @@ +package org.bigbluebutton.core.apps.presentationpod + +import org.bigbluebutton.core.apps.Presentation +import org.bigbluebutton.core.domain.{ BbbSystemConst, MeetingState2x } +import org.bigbluebutton.core.models._ +import org.bigbluebutton.core.running.LiveMeeting + +object PresentationPodsApp { + + def createPresentationPod(id: String, ownerId: String, currentPresenter: String, authorizedPresenters: Vector[String], + presentations: collection.immutable.Map[String, Presentation]): PresentationPod = { + PresentationPodFactory.create(ownerId) + } + + def createDefaultPresentationPod(state: MeetingState2x): MeetingState2x = { + val defaultPresPod = PresentationPodFactory.create("the-owner-id") + val podManager = state.presentationPodManager.addPod(defaultPresPod) + state.update(podManager) + } + +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala index 857210d284..3128be69a3 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala @@ -2,19 +2,22 @@ package org.bigbluebutton.core.domain import org.bigbluebutton.core.apps.BreakoutModel import org.bigbluebutton.core.models.GroupChats +import org.bigbluebutton.core.models.PresentationPodManager object MeetingState2x { } case class MeetingState2x( - groupChats: GroupChats, - breakout: Option[BreakoutModel], - inactivityTracker: MeetingInactivityTracker, - expiryTracker: MeetingExpiryTracker + groupChats: GroupChats, + presentationPodManager: PresentationPodManager, + breakout: Option[BreakoutModel], + inactivityTracker: MeetingInactivityTracker, + expiryTracker: MeetingExpiryTracker ) { def update(groupChats: GroupChats): MeetingState2x = copy(groupChats = groupChats) + def update(presPodManager: PresentationPodManager): MeetingState2x = copy(presentationPodManager = presPodManager) def update(breakout: Option[BreakoutModel]): MeetingState2x = copy(breakout = breakout) def update(expiry: MeetingExpiryTracker): MeetingState2x = copy(expiryTracker = expiry) def update(inactivityTracker: MeetingInactivityTracker): MeetingState2x = copy(inactivityTracker = inactivityTracker) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala new file mode 100644 index 0000000000..e31fc2d61a --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala @@ -0,0 +1,52 @@ +package org.bigbluebutton.core.models + +import org.bigbluebutton.core.apps.Presentation +import org.bigbluebutton.core.util.RandomStringGenerator + +object PresentationPodFactory { + private def genId(): String = System.currentTimeMillis() + "-" + RandomStringGenerator.randomAlphanumericString(8) + def create(ownerId: String): PresentationPod = { + val currentPresenter = ownerId // default + new PresentationPod(genId(), ownerId, currentPresenter, Vector.empty, Map.empty) + } +} + +case class PresentationPod(id: String, ownerId: String, currentPresenter: String, authorizedPresenters: Vector[String], + presentations: collection.immutable.Map[String, Presentation]) { + def addPresentation(presentation: Presentation): PresentationPod = copy(presentations = + presentations + (presentation.id -> presentation)) + def removePresentation(id: String): PresentationPod = copy(presentations = presentations - id) + + def addAuthorizedPresenter(userId: String): PresentationPod = copy(authorizedPresenters = authorizedPresenters :+ userId) + def removeAuthorizedPresenter(userId: String): PresentationPod = copy(authorizedPresenters = + authorizedPresenters.filterNot(u => u == userId)) + + def setCurrentPresenter(userId: String): PresentationPod = copy(currentPresenter = userId) + // def getCurrentPresenter(): String = currentPresenter + + def getCurrentPresentation(): Option[Presentation] = presentations.values find (p => p.current) + def setCurrentPresentation(presId: String): Option[Presentation] = { // copy(currentPresenter = userId) // **** + presentations.values foreach (curPres => { // unset previous current presentation + if (curPres.id != presId) { + val newPres = curPres.copy(current = false) + addPresentation(newPres) + } + }) + + presentations.get(presId) match { + case Some(pres) => + val cp = pres.copy(current = true) + addPresentation(cp) + Some(cp) + case None => None + } + + } +} + +case class PresentationPodManager(presentationPods: collection.immutable.Map[String, PresentationPod]) { + + def addPod(presPod: PresentationPod): PresentationPodManager = copy(presentationPods + (presPod.id -> presPod)) + def removePod(id: String): PresentationPodManager = copy(presentationPods = presentationPods - id) + def getNumberOfPods(): Int = presentationPods.size +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index f8fa17128c..8f45099b49 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -3,6 +3,7 @@ package org.bigbluebutton.core.running import java.io.{ PrintWriter, StringWriter } import org.bigbluebutton.core.apps.groupchats.{ GroupChatApp, GroupChatHdlrs } +import org.bigbluebutton.core.apps.presentationpod._ import org.bigbluebutton.core.apps.users._ import org.bigbluebutton.core.apps.whiteboard.ClientToServerLatencyTracerMsgHdlr import org.bigbluebutton.core.domain.{ BbbSystemConst, MeetingExpiryTracker, MeetingInactivityTracker, MeetingState2x } @@ -131,7 +132,13 @@ class MeetingActor( meetingExpireWhenLastUserLeftInMs = TimeUtil.minutesToMillis(props.durationProps.meetingExpireWhenLastUserLeftInMinutes) ) - var state = new MeetingState2x(new GroupChats(Map.empty), None, inactivityTracker, expiryTracker) + var state = new MeetingState2x( + new GroupChats(Map.empty), + new PresentationPodManager(Map.empty), + None, + inactivityTracker, + expiryTracker + ) var lastRttTestSentOn = System.currentTimeMillis() @@ -141,6 +148,11 @@ class MeetingActor( log.debug("NUM GROUP CHATS = " + state.groupChats.findAllPublicChats().length) + // Create a default Presentation Pod + state = PresentationPodsApp.createDefaultPresentationPod(state) + log.debug("\n\n____NUM Presentation Pods = " + state.presentationPodManager.getNumberOfPods()) + + /*******************************************************************/ //object FakeTestData extends FakeTestData //FakeTestData.createFakeUsers(liveMeeting) @@ -268,6 +280,7 @@ class MeetingActor( case m: GetLockSettingsReqMsg => handleGetLockSettingsReqMsg(m) // Presentation + // case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus, state) case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: GetPresentationInfoReqMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: SetCurrentPagePubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) From 9283c342b7ac1c5f476d8cec4e09b039b9eb5112 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Thu, 21 Sep 2017 15:30:39 -0400 Subject: [PATCH 02/12] add a default presentation pod on present module load --- .../CreateNewPresentationPodPubMsgHdlr.scala | 36 +++++++++++++++++++ .../PresentationPodHdlrs.scala | 11 ++++++ .../presentationpod/PresentationPodsApp.scala | 8 +++-- .../core/models/PresentationPods.scala | 2 +- .../senders/ReceivedJsonMsgHandlerActor.scala | 4 +++ .../core/running/MeetingActor.scala | 5 ++- .../common2/msgs/PresentationPodsMsgs.scala | 35 ++++++++++++++++++ .../events/NewPresentationPodCreated.as | 17 +++++++++ .../present/managers/PresentManager.as | 14 ++++++++ .../modules/present/maps/PresentEventMap.mxml | 6 ++++ .../services/messaging/MessageReceiver.as | 17 +++++++++ .../services/messaging/MessageSender.as | 18 +++++++++- .../present/ui/views/PresentationWindow.mxml | 23 ++++++++++-- 13 files changed, 189 insertions(+), 7 deletions(-) create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala create mode 100644 bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/NewPresentationPodCreated.as diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala new file mode 100644 index 0000000000..b76da1053b --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala @@ -0,0 +1,36 @@ +package org.bigbluebutton.core.apps.presentationpod + +import org.bigbluebutton.common2.msgs._ +import org.bigbluebutton.core.bus.MessageBus +import org.bigbluebutton.core.domain.MeetingState2x +import org.bigbluebutton.core.running.LiveMeeting + +trait CreateNewPresentationPodPubMsgHdlr { + + def handle(msg: CreateNewPresentationPodPubMsg, state: MeetingState2x, + liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = { + + def buildCreateNewPresentationPodEvtMsg(meetingId: String, ownerId: String, podId: String): BbbCommonEnvCoreMsg = { + val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, ownerId) + val envelope = BbbCoreEnvelope(CreateNewPresentationPodEvtMsg.NAME, routing) + val header = BbbClientMsgHeader(CreateNewPresentationPodEvtMsg.NAME, meetingId, ownerId) + + val body = CreateNewPresentationPodEvtMsgBody(ownerId, podId) + val event = CreateNewPresentationPodEvtMsg(header, body) + + BbbCommonEnvCoreMsg(envelope, event) + } + + val ownerId = msg.body.ownerId + val pod = PresentationPodsApp.createPresentationPod(ownerId) + val respMsg = buildCreateNewPresentationPodEvtMsg( + liveMeeting.props.meetingProp.intId, + ownerId, pod.id + ) + bus.outGW.send(respMsg) + + val pods = state.presentationPodManager.addPod(pod) + state.update(pods) + + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala new file mode 100644 index 0000000000..d87dd15874 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala @@ -0,0 +1,11 @@ +package org.bigbluebutton.core.apps.presentationpod + +import org.bigbluebutton.core.apps.presentationpod._ +import akka.actor.ActorContext +import akka.event.Logging + +class PresentationPodHdlrs(implicit val context: ActorContext) + extends CreateNewPresentationPodPubMsgHdlr { + + val log = Logging(context.system, getClass) +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala index 26a6ff813f..63f4501360 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala @@ -7,11 +7,15 @@ import org.bigbluebutton.core.running.LiveMeeting object PresentationPodsApp { - def createPresentationPod(id: String, ownerId: String, currentPresenter: String, authorizedPresenters: Vector[String], - presentations: collection.immutable.Map[String, Presentation]): PresentationPod = { + def createPresentationPod(ownerId: String): PresentationPod = { PresentationPodFactory.create(ownerId) } + // def createPresentationPod(id: String, ownerId: String, currentPresenter: String, authorizedPresenters: Vector[String], + // presentations: collection.immutable.Map[String, Presentation]): PresentationPod = { + // PresentationPodFactory.create(ownerId) + // } + def createDefaultPresentationPod(state: MeetingState2x): MeetingState2x = { val defaultPresPod = PresentationPodFactory.create("the-owner-id") val podManager = state.presentationPodManager.addPod(defaultPresPod) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala index e31fc2d61a..d6c36f60d1 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala @@ -33,7 +33,7 @@ case class PresentationPod(id: String, ownerId: String, currentPresenter: String } }) - presentations.get(presId) match { + presentations.get(presId) match { // set new current presenter case Some(pres) => val cp = pres.copy(current = true) addPresentation(cp) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index 45790e252a..4d5a9ffa23 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -200,6 +200,10 @@ class ReceivedJsonMsgHandlerActor( case AssignPresenterReqMsg.NAME => routeGenericMsg[AssignPresenterReqMsg](envelope, jsonNode) + // Presentation Pods + case CreateNewPresentationPodPubMsg.NAME => + routeGenericMsg[CreateNewPresentationPodPubMsg](envelope, jsonNode) + // Caption case EditCaptionHistoryPubMsg.NAME => routeGenericMsg[EditCaptionHistoryPubMsg](envelope, jsonNode) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index 8f45099b49..8da9f126f9 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -110,6 +110,7 @@ class MeetingActor( val chatApp2x = new ChatApp2x val usersApp = new UsersApp(liveMeeting, outGW, eventBus) val groupChatApp = new GroupChatHdlrs + val presentationPodsApp = new PresentationPodHdlrs val pollApp = new PollApp2x val wbApp = new WhiteboardApp2x @@ -152,7 +153,6 @@ class MeetingActor( state = PresentationPodsApp.createDefaultPresentationPod(state) log.debug("\n\n____NUM Presentation Pods = " + state.presentationPodManager.getNumberOfPods()) - /*******************************************************************/ //object FakeTestData extends FakeTestData //FakeTestData.createFakeUsers(liveMeeting) @@ -294,6 +294,9 @@ class MeetingActor( case m: PresentationConversionCompletedSysPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: AssignPresenterReqMsg => handlePresenterChange(m) + // Presentation Pods + case m: CreateNewPresentationPodPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) + // Caption case m: EditCaptionHistoryPubMsg => captionApp2x.handle(m, liveMeeting, msgBus) case m: UpdateCaptionOwnerPubMsg => captionApp2x.handle(m, liveMeeting, msgBus) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala new file mode 100644 index 0000000000..c6c0498094 --- /dev/null +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala @@ -0,0 +1,35 @@ +package org.bigbluebutton.common2.msgs + + +// ------------ client to akka-apps ------------ +object CreateNewPresentationPodPubMsg { val NAME = "CreateNewPresentationPodPubMsg"} +case class CreateNewPresentationPodPubMsg(header: BbbClientMsgHeader, body: CreateNewPresentationPodPubMsgBody) extends StandardMsg +case class CreateNewPresentationPodPubMsgBody(ownerId: String) + +object RemovePresentationPodPubMsg { val NAME = "RemovePresentationPodPubMsg"} +case class RemovePresentationPodPubMsg(header: BbbClientMsgHeader, body: RemovePresentationPodPubMsgBody) extends StandardMsg +case class RemovePresentationPodPubMsgBody(podId: String) + +// ------------ client to akka-apps ------------ + + +// ------------ bbb-common-web to akka-apps ------------ + +// ------------ bbb-common-web to akka-apps ------------ + + +// ------------ akka-apps to client ------------ +object CreateNewPresentationPodEvtMsg { val NAME = "CreateNewPresentationPodEvtMsg"} +case class CreateNewPresentationPodEvtMsg(header: BbbClientMsgHeader, body: CreateNewPresentationPodEvtMsgBody) extends StandardMsg +case class CreateNewPresentationPodEvtMsgBody(ownerId: String, podId: String) + +object RemovePresentationPodEvtMsg { val NAME = "RemovePresentationPodEvtMsg"} +case class RemovePresentationPodEvtMsg(header: BbbClientMsgHeader, body: RemovePresentationPodEvtMsgBody) extends StandardMsg +case class RemovePresentationPodEvtMsgBody(podId: String) + + +// ------------ akka-apps to client ------------ + + +// ------------ akka-apps to bbb-common-web ------------ +// ------------ akka-apps to bbb-common-web ------------ diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/NewPresentationPodCreated.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/NewPresentationPodCreated.as new file mode 100644 index 0000000000..f9dc38f0c4 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/NewPresentationPodCreated.as @@ -0,0 +1,17 @@ +package org.bigbluebutton.modules.present.events { + + import flash.events.Event; + + public class NewPresentationPodCreated extends Event { + public static const PRESENTATION_NEW_POD_CREATED:String = "NewPresentationPodCreated"; + + public var podId:String; + public var ownerId:String; + + public function NewPresentationPodCreated(_podId:String, _ownerId:String) { + super(PRESENTATION_NEW_POD_CREATED, true, false); + this.podId = _podId; + this.ownerId = _ownerId; + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as index 6a79c5cce9..1d764f513e 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as @@ -31,26 +31,40 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.core.PopUpUtil; import org.bigbluebutton.modules.present.events.PresentModuleEvent; import org.bigbluebutton.modules.present.events.UploadEvent; + import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; import org.bigbluebutton.modules.present.model.PresentOptions; import org.bigbluebutton.modules.present.ui.views.FileDownloadWindow; import org.bigbluebutton.modules.present.ui.views.FileUploadWindow; import org.bigbluebutton.modules.present.ui.views.PresentationWindow; + import org.bigbluebutton.modules.present.services.messaging.MessageSender; public class PresentManager { private var globalDispatcher:Dispatcher; private var presentWindow:PresentationWindow; + private var sender:MessageSender; public function PresentManager() { globalDispatcher = new Dispatcher(); + sender = new MessageSender(); } public function handleStartModuleEvent(e:PresentModuleEvent):void{ if (presentWindow != null){ return; } + sender.createNewPresentationPod(); + } + + public function handleAddPresentationPod(e: NewPresentationPodCreated): void { + if (presentWindow != null){ + return; + } + var presentOptions:PresentOptions = Options.getOptions(PresentOptions) as PresentOptions; presentWindow = new PresentationWindow(); + presentWindow.setPodId(e.podId); + presentWindow.setOwnerId(e.ownerId); presentWindow.visible = presentOptions.showPresentWindow; presentWindow.showControls = presentOptions.showWindowControls; openWindow(presentWindow); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml index 53fd4bd225..0525f2f6e4 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml @@ -40,6 +40,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.events.UploadEvent; import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass; import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail; + import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; import org.bigbluebutton.modules.present.managers.PresentManager; import org.bigbluebutton.modules.present.services.PageLoaderService; ]]> @@ -141,5 +142,10 @@ with BigBlueButton; if not, see . + + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as index 49c9c4784e..8f9b7c8170 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as @@ -38,10 +38,13 @@ package org.bigbluebutton.modules.present.services.messaging import org.bigbluebutton.modules.present.events.OfficeDocConvertSuccessEvent; import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass; import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail; + import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; import org.bigbluebutton.modules.present.services.Constants; import org.bigbluebutton.modules.present.services.PresentationService; import org.bigbluebutton.modules.present.services.messages.PageVO; import org.bigbluebutton.modules.present.services.messages.PresentationVO; + import org.bigbluebutton.main.api.JSLog; + public class MessageReceiver implements IMessageListener { private static const LOGGER:ILogger = getClassLogger(MessageReceiver); @@ -57,6 +60,7 @@ package org.bigbluebutton.modules.present.services.messaging public function onMessage(messageName:String, message:Object):void { //LOGGER.info("Presentation: received message " + messageName); + JSLog.warn("____Presentation received: " + messageName, message); switch (messageName) { case "SetCurrentPageEvtMsg": @@ -92,6 +96,9 @@ package org.bigbluebutton.modules.present.services.messaging case "PresentationUploadTokenFailRespMsg": handlePresentationUploadTokenFailRespMsg(message); break; + case "CreateNewPresentationPodEvtMsg": + handleCreateNewPresentationPodEvtMsg(message); + break; } } @@ -248,5 +255,15 @@ package org.bigbluebutton.modules.present.services.messaging var filename: String = msg.body.filename; dispatcher.dispatchEvent(new PresentationUploadTokenFail(podId, filename)); } + + private function handleCreateNewPresentationPodEvtMsg(msg:Object): void { + var ownerId: String = msg.body.ownerId; + var podId: String = msg.body.podId; + dispatcher.dispatchEvent(new NewPresentationPodCreated(podId, ownerId)); + + JSLog.warn("+++ receiver handleCreateNewPresentationPodEvtMsg received ownerId=" + ownerId + " podId=" + podId, {}); + } + + } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as index 3c55dbe3a9..b8fdc1f71c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as @@ -23,6 +23,7 @@ package org.bigbluebutton.modules.present.services.messaging import org.bigbluebutton.core.BBB; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.managers.ConnectionManager; + import org.bigbluebutton.main.api.JSLog; public class MessageSender { @@ -115,5 +116,20 @@ package org.bigbluebutton.modules.present.services.messaging JSON.stringify(message) ); } + + public function createNewPresentationPod():void { + var message:Object = { + header: {name: "CreateNewPresentationPodPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, + body: {ownerId: UsersUtil.getMyUserID()} + }; + JSLog.warn("sender: creating a new presentation pod ", null); + + var _nc:ConnectionManager = BBB.initConnectionManager(); + _nc.sendMessage2x( + function(result:String):void { }, + function(status:String):void { LOGGER.error("Error while creating a new presentation pod." + status); }, + JSON.stringify(message) + ); + } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index e698f608a4..d4b59660a3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -146,7 +146,10 @@ with BigBlueButton; if not, see . private var pollMenuData:Array; private var pollMenu:Menu; - + + private var podId: String = ""; + private var ownerId: String = ""; + [Embed(source="../../../polling/sounds/Poll.mp3")] private var noticeSoundClass:Class; private var noticeSound:Sound = new noticeSoundClass() as Sound; @@ -156,7 +159,23 @@ with BigBlueButton; if not, see . private function init():void{ presentOptions = Options.getOptions(PresentOptions) as PresentOptions; } - + + public function setPodId(_podId: String):void { + this.podId = _podId; + } + + public function getPodId(): String { + return this.podId; + } + + public function setOwnerId(_ownerId: String):void { + this.ownerId = _ownerId; + } + + public function getOwnerId(): String { + return this.ownerId; + } + private function onCreationComplete():void{ //check for the polling module in config.xml var vxml:XML = BBB.getConfigForModule("PollingModule"); From 6d4fa587c8a2ae26344ca5c62ff89366fd2f93e3 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Mon, 25 Sep 2017 14:58:11 -0400 Subject: [PATCH 03/12] work on add and remove presentation pods --- .../CreateNewPresentationPodPubMsgHdlr.scala | 7 ++ .../PresentationPodHdlrs.scala | 5 +- .../presentationpod/PresentationPodsApp.scala | 12 ++++ .../RemovePresentationPodPubMsgHdlr.scala | 69 +++++++++++++++++++ .../core/models/PresentationPods.scala | 3 +- .../senders/ReceivedJsonMsgHandlerActor.scala | 2 + .../core/running/MeetingActor.scala | 1 + .../common2/msgs/PresentationPodsMsgs.scala | 4 +- .../locale/en_US/bbbResources.properties | 2 + .../modules/present/business/PresentProxy.as | 22 +++++- .../RequestClosePresentationPodEvent.as | 37 ++++++++++ .../events/RequestNewPresentationPodEvent.as | 36 ++++++++++ .../present/managers/PresentManager.as | 13 ++-- .../modules/present/maps/PresentEventMap.mxml | 11 +++ .../services/messaging/MessageSender.as | 23 +++++-- .../present/ui/views/PresentationWindow.mxml | 54 ++++++++++++--- 16 files changed, 275 insertions(+), 26 deletions(-) create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/RemovePresentationPodPubMsgHdlr.scala create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestClosePresentationPodEvent.as create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestNewPresentationPodEvent.as diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala index b76da1053b..5c5ce6da4b 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala @@ -6,6 +6,7 @@ import org.bigbluebutton.core.domain.MeetingState2x import org.bigbluebutton.core.running.LiveMeeting trait CreateNewPresentationPodPubMsgHdlr { + this: PresentationPodHdlrs => def handle(msg: CreateNewPresentationPodPubMsg, state: MeetingState2x, liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = { @@ -29,7 +30,13 @@ trait CreateNewPresentationPodPubMsgHdlr { ) bus.outGW.send(respMsg) + log.warning("CreateNewPresentationPodPubMsgHdlr new podId=" + pod.id) + + log.warning("_____ pres pod add, before:" + state.presentationPodManager.getNumberOfPods()) val pods = state.presentationPodManager.addPod(pod) + + log.warning("_____ pres pod add, afterB:" + pods.getNumberOfPods()) + state.update(pods) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala index d87dd15874..da9f811cf5 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala @@ -1,11 +1,12 @@ package org.bigbluebutton.core.apps.presentationpod -import org.bigbluebutton.core.apps.presentationpod._ +//import org.bigbluebutton.core.apps.presentationpod._ import akka.actor.ActorContext import akka.event.Logging class PresentationPodHdlrs(implicit val context: ActorContext) - extends CreateNewPresentationPodPubMsgHdlr { + extends CreateNewPresentationPodPubMsgHdlr + with RemovePresentationPodPubMsgHdlr { val log = Logging(context.system, getClass) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala index 63f4501360..9b19b24864 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala @@ -22,4 +22,16 @@ object PresentationPodsApp { state.update(podManager) } + def removePresentationPod(state: MeetingState2x, podId: String): MeetingState2x = { + val podManager = state.presentationPodManager.removePod(podId) + state.update(podManager) + } + + def getPresentationPod(state: MeetingState2x, podId: String): Option[PresentationPod] = { + state.presentationPodManager.getPod(podId) + } + + def getNumberOfPresentationPods(state: MeetingState2x): Int = state.presentationPodManager.getNumberOfPods() + } + diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/RemovePresentationPodPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/RemovePresentationPodPubMsgHdlr.scala new file mode 100644 index 0000000000..1799771447 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/RemovePresentationPodPubMsgHdlr.scala @@ -0,0 +1,69 @@ +package org.bigbluebutton.core.apps.presentationpod + +import org.bigbluebutton.common2.msgs._ +import org.bigbluebutton.core.bus.MessageBus +import org.bigbluebutton.core.domain.MeetingState2x +import org.bigbluebutton.core.running.LiveMeeting + +trait RemovePresentationPodPubMsgHdlr { + this: PresentationPodHdlrs => + + def handle(msg: RemovePresentationPodPubMsg, state: MeetingState2x, + liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = { + + def buildRemovePresentationPodEvtMsg(meetingId: String, ownerId: String, podId: String): BbbCommonEnvCoreMsg = { + val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, ownerId) + val envelope = BbbCoreEnvelope(RemovePresentationPodEvtMsg.NAME, routing) + val header = BbbClientMsgHeader(RemovePresentationPodEvtMsg.NAME, meetingId, ownerId) + + val body = RemovePresentationPodEvtMsgBody(ownerId, podId) + val event = RemovePresentationPodEvtMsg(header, body) + + BbbCommonEnvCoreMsg(envelope, event) + } + + val requesterId = msg.body.requesterId // TODO -- use it + + log.warning(s"_____ attempt for pres pod removal by $requesterId, num before:${state.presentationPodManager.getNumberOfPods()}") + + val newState = for { + pod <- PresentationPodsApp.getPresentationPod(state, msg.body.podId) + } yield { + + val ownerId = pod.ownerId + + val event = buildRemovePresentationPodEvtMsg( + liveMeeting.props.meetingProp.intId, + ownerId, pod.id + ) + + bus.outGW.send(event) + + log.warning("_____ pres pod removal, before:" + state.presentationPodManager.getNumberOfPods()) + val pods = state.presentationPodManager.removePod(pod.id) + // PresentationPodsApp.removePresentationPod(state, pod.id) + log.warning("_____ pres pod removal, afterB:" + pods.getNumberOfPods()) + state.update(pods) + } + + newState match { + case Some(ns) => ns + case None => state + } + + // TODO check if requesterId == ownerId + // TODO check about notifying only the list of authorized? + + // val respMsg = buildRemovePresentationPodEvtMsg( + // liveMeeting.props.meetingProp.intId, + // ownerId, pod.id + // ) + // bus.outGW.send(respMsg) + // + // log.warning("RemovePresentationPodPubMsgHdlr new podId=" + pod.id) + // + // val pods = state.presentationPodManager.removePod(pod) + // state.update(pods) + + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala index d6c36f60d1..dfbbadadf4 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala @@ -47,6 +47,7 @@ case class PresentationPod(id: String, ownerId: String, currentPresenter: String case class PresentationPodManager(presentationPods: collection.immutable.Map[String, PresentationPod]) { def addPod(presPod: PresentationPod): PresentationPodManager = copy(presentationPods + (presPod.id -> presPod)) - def removePod(id: String): PresentationPodManager = copy(presentationPods = presentationPods - id) + def removePod(podId: String): PresentationPodManager = copy(presentationPods = presentationPods - podId) def getNumberOfPods(): Int = presentationPods.size + def getPod(podId: String): Option[PresentationPod] = presentationPods.get(podId) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index 4d5a9ffa23..ced4decab7 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -203,6 +203,8 @@ class ReceivedJsonMsgHandlerActor( // Presentation Pods case CreateNewPresentationPodPubMsg.NAME => routeGenericMsg[CreateNewPresentationPodPubMsg](envelope, jsonNode) + case RemovePresentationPodPubMsg.NAME => + routeGenericMsg[RemovePresentationPodPubMsg](envelope, jsonNode) // Caption case EditCaptionHistoryPubMsg.NAME => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index 8da9f126f9..15ecb3e3ed 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -296,6 +296,7 @@ class MeetingActor( // Presentation Pods case m: CreateNewPresentationPodPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) + case m: RemovePresentationPodPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) // Caption case m: EditCaptionHistoryPubMsg => captionApp2x.handle(m, liveMeeting, msgBus) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala index c6c0498094..22198df2e9 100644 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala @@ -8,7 +8,7 @@ case class CreateNewPresentationPodPubMsgBody(ownerId: String) object RemovePresentationPodPubMsg { val NAME = "RemovePresentationPodPubMsg"} case class RemovePresentationPodPubMsg(header: BbbClientMsgHeader, body: RemovePresentationPodPubMsgBody) extends StandardMsg -case class RemovePresentationPodPubMsgBody(podId: String) +case class RemovePresentationPodPubMsgBody(requesterId: String, podId: String) // ------------ client to akka-apps ------------ @@ -25,7 +25,7 @@ case class CreateNewPresentationPodEvtMsgBody(ownerId: String, podId: String) object RemovePresentationPodEvtMsg { val NAME = "RemovePresentationPodEvtMsg"} case class RemovePresentationPodEvtMsg(header: BbbClientMsgHeader, body: RemovePresentationPodEvtMsgBody) extends StandardMsg -case class RemovePresentationPodEvtMsgBody(podId: String) +case class RemovePresentationPodEvtMsgBody( ownerId: String, podId: String) // ------------ akka-apps to client ------------ diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index 28d71818b5..76fd97aaec 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -264,6 +264,8 @@ bbb.presentation.uploadwindow.image = IMAGE bbb.presentation.minimizeBtn.accessibilityName = Minimize the Presentation Window bbb.presentation.maximizeRestoreBtn.accessibilityName = Maximize the Presentation Window bbb.presentation.closeBtn.accessibilityName = Close the Presentation Window +bbb.presentation.multipod.controls.newPresentationWindowOpen = New Presentation Window +bbb.presentation.multipod.controls.closePresentationWindowOpen = Close Presentation Window bbb.fileupload.title = Add Files to Your Presentation bbb.fileupload.lblFileName.defaultText = No file selected bbb.fileupload.selectBtn.label = Select File diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as index 8040379b02..d8c892428a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as @@ -40,6 +40,8 @@ package org.bigbluebutton.modules.present.business import org.bigbluebutton.modules.present.events.UploadEvent; import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass; import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail; + import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent; + import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; import org.bigbluebutton.modules.present.managers.PresentationSlides; import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.Presentation; @@ -242,5 +244,23 @@ package org.bigbluebutton.modules.present.business sender.move(currentPresentation.id, currentPage.id, e.xOffset, e.yOffset, e.slideToCanvasWidthRatio, e.slideToCanvasHeightRatio); } + + /** + * Request the creation of a new presentation pod + * @param e + * + */ + public function handleRequestNewPresentationPod(e: RequestNewPresentationPodEvent): void { + sender.requestNewPresentationPod(e.requesterId); + } + + /** + * Request the removal of a specific presentation pod + * @param e + * + */ + public function handleRequestClosePresentationPod(e: RequestClosePresentationPodEvent): void { + sender.requestClosePresentationPod(e.requesterId, e.podId); + } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestClosePresentationPodEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestClosePresentationPodEvent.as new file mode 100644 index 0000000000..5f5281f3c1 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestClosePresentationPodEvent.as @@ -0,0 +1,37 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +package org.bigbluebutton.modules.present.events +{ + + import flash.events.Event; + import flash.net.FileReference; + + public class RequestClosePresentationPodEvent extends Event { + public static const REQUEST_CLOSE_PRES_POD:String = "REQUEST_CLOSE_PRES_POD"; + + public var requesterId: String; + public var podId: String; + + public function RequestClosePresentationPodEvent(type:String) { + super(type, true, false); + } + + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestNewPresentationPodEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestNewPresentationPodEvent.as new file mode 100644 index 0000000000..1f19fe4e32 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestNewPresentationPodEvent.as @@ -0,0 +1,36 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +package org.bigbluebutton.modules.present.events +{ + +import flash.events.Event; +import flash.net.FileReference; + + public class RequestNewPresentationPodEvent extends Event { + public static const REQUEST_NEW_PRES_POD:String = "REQUEST_NEW_PRES_POD"; + + public var requesterId: String; + + public function RequestNewPresentationPodEvent(type:String) { + super(type, true, false); + } + + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as index 1d764f513e..171814b87d 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as @@ -29,31 +29,33 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.common.events.OpenWindowEvent; import org.bigbluebutton.core.Options; import org.bigbluebutton.core.PopUpUtil; + import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.modules.present.events.PresentModuleEvent; import org.bigbluebutton.modules.present.events.UploadEvent; import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; + import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; import org.bigbluebutton.modules.present.model.PresentOptions; import org.bigbluebutton.modules.present.ui.views.FileDownloadWindow; import org.bigbluebutton.modules.present.ui.views.FileUploadWindow; import org.bigbluebutton.modules.present.ui.views.PresentationWindow; - import org.bigbluebutton.modules.present.services.messaging.MessageSender; public class PresentManager { private var globalDispatcher:Dispatcher; private var presentWindow:PresentationWindow; - private var sender:MessageSender; public function PresentManager() { globalDispatcher = new Dispatcher(); - sender = new MessageSender(); } public function handleStartModuleEvent(e:PresentModuleEvent):void{ if (presentWindow != null){ return; } - sender.createNewPresentationPod(); + + var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD); + event.requesterId = UsersUtil.getMyUserID(); + globalDispatcher.dispatchEvent(event); } public function handleAddPresentationPod(e: NewPresentationPodCreated): void { @@ -63,8 +65,7 @@ package org.bigbluebutton.modules.present.managers var presentOptions:PresentOptions = Options.getOptions(PresentOptions) as PresentOptions; presentWindow = new PresentationWindow(); - presentWindow.setPodId(e.podId); - presentWindow.setOwnerId(e.ownerId); + presentWindow.onPodCreated(e.podId, e.ownerId); presentWindow.visible = presentOptions.showPresentWindow; presentWindow.showControls = presentOptions.showWindowControls; openWindow(presentWindow); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml index 0525f2f6e4..0bf43aac58 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml @@ -41,6 +41,8 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass; import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail; import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; + import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; + import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent; import org.bigbluebutton.modules.present.managers.PresentManager; import org.bigbluebutton.modules.present.services.PageLoaderService; ]]> @@ -147,5 +149,14 @@ with BigBlueButton; if not, see . + + + + + + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as index b8fdc1f71c..7c8817457c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as @@ -117,17 +117,32 @@ package org.bigbluebutton.modules.present.services.messaging ); } - public function createNewPresentationPod():void { + public function requestNewPresentationPod(requesterId: String):void { var message:Object = { header: {name: "CreateNewPresentationPodPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, - body: {ownerId: UsersUtil.getMyUserID()} + body: {ownerId: requesterId} }; - JSLog.warn("sender: creating a new presentation pod ", null); + JSLog.warn("sender: request the creation of a new presentation pod ", null); var _nc:ConnectionManager = BBB.initConnectionManager(); _nc.sendMessage2x( function(result:String):void { }, - function(status:String):void { LOGGER.error("Error while creating a new presentation pod." + status); }, + function(status:String):void { LOGGER.error("Error while requesting a new presentation pod." + status); }, + JSON.stringify(message) + ); + } + + public function requestClosePresentationPod(requesterId: String, podId: String):void { + var message:Object = { + header: {name: "RemovePresentationPodPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, + body: {requesterId: requesterId, podId: podId} + }; + JSLog.warn("sender: closing a presentation pod ", null); + + var _nc:ConnectionManager = BBB.initConnectionManager(); + _nc.sendMessage2x( + function(result:String):void { }, + function(status:String):void { LOGGER.error("Error while closing a presentation pod." + status); }, JSON.stringify(message) ); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index d4b59660a3..95a3934aef 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -68,6 +68,7 @@ with BigBlueButton; if not, see . import flash.geom.Point; import mx.collections.ArrayCollection; + import mx.collections.ArrayList; import mx.controls.Menu; import mx.events.MenuEvent; @@ -102,6 +103,8 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.events.PresenterCommands; import org.bigbluebutton.modules.present.events.RemovePresentationEvent; import org.bigbluebutton.modules.present.events.UploadEvent; + import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; + import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent; import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.PresentOptions; import org.bigbluebutton.modules.present.model.PresentationModel; @@ -110,6 +113,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.whiteboard.views.WhiteboardTextToolbar; import org.bigbluebutton.modules.whiteboard.views.WhiteboardToolbar; import org.bigbluebutton.util.i18n.ResourceUtil; + import org.bigbluebutton.main.api.JSLog; private static const LOGGER:ILogger = getClassLogger(PresentationWindow); @@ -149,6 +153,7 @@ with BigBlueButton; if not, see . private var podId: String = ""; private var ownerId: String = ""; + private var listOfPodControls:Array = []; [Embed(source="../../../polling/sounds/Poll.mp3")] private var noticeSoundClass:Class; @@ -160,20 +165,44 @@ with BigBlueButton; if not, see . presentOptions = Options.getOptions(PresentOptions) as PresentOptions; } - public function setPodId(_podId: String):void { + public function onPodCreated(_podId: String, _ownerId: String):void { this.podId = _podId; - } - - public function getPodId(): String { - return this.podId; - } - - public function setOwnerId(_ownerId: String):void { this.ownerId = _ownerId; + + listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.newPresentationWindowOpen'), + icon: getStyle('iconClearStatus'), handler: newPresentationWindowHandler}); + + listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.closePresentationWindowOpen'), + icon: getStyle('iconClearStatus'), handler: closePresentationWindowHandler}); + + + } - public function getOwnerId(): String { - return this.ownerId; + public function getPodId(): String { return this.podId; } + + public function getOwnerId(): String { return this.ownerId; } + + private function onPresentationPodControlsClicked():void { + JSLog.warn("+++ onPresentationPodControlsClicked: ", {}); + presentationPodControls.selectedItem.handler(); + } + + private function newPresentationWindowHandler(): void { + JSLog.warn("+++ newPresentationWindowHandler: ", {}); + + var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD); + event.requesterId = UsersUtil.getMyUserID(); + localDispatcher.dispatchEvent(event); + } + + private function closePresentationWindowHandler(): void { + JSLog.warn("+++ closePresentationWindowHandler: ", {}); + + var event:RequestClosePresentationPodEvent = new RequestClosePresentationPodEvent(RequestClosePresentationPodEvent.REQUEST_CLOSE_PRES_POD); + event.requesterId = UsersUtil.getMyUserID(); + event.podId = this.podId; + localDispatcher.dispatchEvent(event); } private function onCreationComplete():void{ @@ -858,6 +887,11 @@ with BigBlueButton; if not, see . + + Date: Tue, 26 Sep 2017 16:43:57 -0400 Subject: [PATCH 04/12] avoid run error when buttons are unll if presentation is null --- .../modules/present/ui/views/PresentationWindow.mxml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index 95a3934aef..3e5c1dcb8a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -444,6 +444,11 @@ with BigBlueButton; if not, see . styleNameExt = "RTL"; } + // Base case when there is no presentation file in the presentation window + if (backButton == null || forwardButton == null) { + return; + } + // We use mouseEnabled here instead of enabled because the tab position gets lost when going through //the pages. Please don't change this if you don't know why this is. if (pageNumber != 1) { From 0f22b3b0b6a9ef16b852a965346640bd97e656a8 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Tue, 26 Sep 2017 17:22:36 -0400 Subject: [PATCH 05/12] add and remove pres pod client side code --- .../present/events/PresentationPodRemoved.as | 17 ++++++ .../present/managers/PresentManager.as | 60 +++++++++++++------ .../modules/present/maps/PresentEventMap.mxml | 5 +- .../services/messaging/MessageReceiver.as | 12 +++- 4 files changed, 71 insertions(+), 23 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationPodRemoved.as diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationPodRemoved.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationPodRemoved.as new file mode 100644 index 0000000000..f04ca843a4 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationPodRemoved.as @@ -0,0 +1,17 @@ +package org.bigbluebutton.modules.present.events { + + import flash.events.Event; + + public class PresentationPodRemoved extends Event { + public static const PRESENTATION_POD_REMOVED:String = "PresentationPodRemoved"; + + public var podId:String; + public var ownerId:String; + + public function PresentationPodRemoved(_podId:String, _ownerId:String) { + super(PRESENTATION_POD_REMOVED, true, false); + this.podId = _podId; + this.ownerId = _ownerId; + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as index 171814b87d..0a317586bd 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as @@ -27,6 +27,7 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.common.IBbbModuleWindow; import org.bigbluebutton.common.events.OpenWindowEvent; + import org.bigbluebutton.common.events.CloseWindowEvent; import org.bigbluebutton.core.Options; import org.bigbluebutton.core.PopUpUtil; import org.bigbluebutton.core.UsersUtil; @@ -34,22 +35,25 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.modules.present.events.UploadEvent; import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; + import org.bigbluebutton.modules.present.events.PresentationPodRemoved; import org.bigbluebutton.modules.present.model.PresentOptions; import org.bigbluebutton.modules.present.ui.views.FileDownloadWindow; import org.bigbluebutton.modules.present.ui.views.FileUploadWindow; import org.bigbluebutton.modules.present.ui.views.PresentationWindow; + import org.bigbluebutton.main.api.JSLog; + public class PresentManager { private var globalDispatcher:Dispatcher; - private var presentWindow:PresentationWindow; + private var windows: Array = []; public function PresentManager() { globalDispatcher = new Dispatcher(); } public function handleStartModuleEvent(e:PresentModuleEvent):void{ - if (presentWindow != null){ + if (windows.length >= 1) { return; } @@ -59,26 +63,44 @@ package org.bigbluebutton.modules.present.managers } public function handleAddPresentationPod(e: NewPresentationPodCreated): void { - if (presentWindow != null){ - return; - } +// JSLog.warn("+++ PresentManager::handleAddPresentationPod " + e.podId, {}); - var presentOptions:PresentOptions = Options.getOptions(PresentOptions) as PresentOptions; - presentWindow = new PresentationWindow(); - presentWindow.onPodCreated(e.podId, e.ownerId); - presentWindow.visible = presentOptions.showPresentWindow; - presentWindow.showControls = presentOptions.showWindowControls; - openWindow(presentWindow); + var podId: String = e.podId; + var ownerId: String = e.ownerId; + if(!windows.hasOwnProperty(podId)) { + var newWindow:PresentationWindow = new PresentationWindow(); + newWindow.onPodCreated(podId, ownerId); + + var presentOptions:PresentOptions = Options.getOptions(PresentOptions) as PresentOptions; + newWindow.visible = true; // TODO + // newWindow.visible = presentOptions.showPresentWindow; + newWindow.showControls = presentOptions.showWindowControls; + + windows[podId] = newWindow; + + var openEvent:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT); + openEvent.window = newWindow; + globalDispatcher.dispatchEvent(openEvent); + } + } + + public function handlePresentationPodRemoved(e: PresentationPodRemoved): void { + var podId: String = e.podId; + var ownerId: String = e.ownerId; + + var destroyWindow:PresentationWindow = windows[podId]; + if (destroyWindow != null) { + var closeEvent:CloseWindowEvent = new CloseWindowEvent(CloseWindowEvent.CLOSE_WINDOW_EVENT); + closeEvent.window = destroyWindow; + globalDispatcher.dispatchEvent(closeEvent); + + delete windows[podId]; + } } - public function handleStopModuleEvent():void{ - presentWindow.close(); - } - - private function openWindow(window:IBbbModuleWindow):void{ - var event:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT); - event.window = window; - globalDispatcher.dispatchEvent(event); + for (var key: String in windows) { + windows[key].close(); + } } public function handleOpenUploadWindow(e:UploadEvent):void{ diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml index 0bf43aac58..df88592ca1 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml @@ -43,6 +43,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent; + import org.bigbluebutton.modules.present.events.PresentationPodRemoved; import org.bigbluebutton.modules.present.managers.PresentManager; import org.bigbluebutton.modules.present.services.PageLoaderService; ]]> @@ -157,6 +158,8 @@ with BigBlueButton; if not, see . - + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as index 8f9b7c8170..03328d90e6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as @@ -39,6 +39,7 @@ package org.bigbluebutton.modules.present.services.messaging import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass; import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail; import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; + import org.bigbluebutton.modules.present.events.PresentationPodRemoved; import org.bigbluebutton.modules.present.services.Constants; import org.bigbluebutton.modules.present.services.PresentationService; import org.bigbluebutton.modules.present.services.messages.PageVO; @@ -99,6 +100,9 @@ package org.bigbluebutton.modules.present.services.messaging case "CreateNewPresentationPodEvtMsg": handleCreateNewPresentationPodEvtMsg(message); break; + case "RemovePresentationPodEvtMsg": + handleRemovePresentationPodEvtMsg(message); + break; } } @@ -260,10 +264,12 @@ package org.bigbluebutton.modules.present.services.messaging var ownerId: String = msg.body.ownerId; var podId: String = msg.body.podId; dispatcher.dispatchEvent(new NewPresentationPodCreated(podId, ownerId)); - - JSLog.warn("+++ receiver handleCreateNewPresentationPodEvtMsg received ownerId=" + ownerId + " podId=" + podId, {}); } - + private function handleRemovePresentationPodEvtMsg(msg:Object): void { + var ownerId: String = msg.body.ownerId; + var podId: String = msg.body.podId; + dispatcher.dispatchEvent(new PresentationPodRemoved(podId, ownerId)); + } } } From 23dadc54772d4133f83452c239da47f395da08ae Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Fri, 29 Sep 2017 18:20:33 -0400 Subject: [PATCH 06/12] work on separating pods - client/conversion/apps --- .../GetPresentationInfoReqMsgHdlr.scala | 70 ++++----- .../apps/presentation/PresentationApp2x.scala | 2 +- ...ntationConversionCompletedPubMsgHdlr.scala | 2 +- ...esentationConversionUpdatePubMsgHdlr.scala | 2 +- ...PresentationPageCountErrorPubMsgHdlr.scala | 2 +- .../PresentationPageGeneratedPubMsgHdlr.scala | 2 +- .../GetAllPresentationPodsReqMsgHdlr.scala | 44 ++++++ .../GetPresentationInfoReqMsgHdlr.scala | 48 +++++++ .../PresentationPodHdlrs.scala | 2 + .../presentationpod/PresentationPodsApp.scala | 15 +- .../core/models/PresentationPods.scala | 1 + .../senders/ReceivedJsonMsgHandlerActor.scala | 2 + .../core/running/MeetingActor.scala | 6 +- .../common2/domain/Presentation.scala | 4 + .../common2/msgs/PresentationMsgs.scala | 66 --------- .../common2/msgs/PresentationPodsMsgs.scala | 71 +++++++++ .../DocumentConversionServiceImp.java | 2 + .../OfficeToPdfConversionSuccessFilter.java | 5 +- .../PresentationUrlDownloadService.java | 7 +- .../presentation/SupportedDocumentFilter.java | 2 +- .../presentation/UploadedPresentation.java | 8 +- .../imp/PdfToSwfSlidesGenerationService.java | 12 +- .../SwfSlidesGenerationProgressNotifier.java | 10 +- .../messages/DocPageCompletedProgress.java | 4 +- .../messages/DocPageCountExceeded.java | 4 +- .../messages/DocPageCountFailed.java | 4 +- .../messages/DocPageGeneratedProgress.java | 4 +- .../messages/OfficeDocConversionInvalid.java | 4 +- .../messages/OfficeDocConversionProgress.java | 4 +- .../messages/OfficeDocConversionSuccess.java | 4 +- .../OfficeDocConversionSupported.java | 4 +- .../OfficeDocConversionUnsupported.java | 4 +- .../bigbluebutton/api2/BbbWebApiGWApp.scala | 2 +- .../org/bigbluebutton/api2/MsgBuilder.scala | 12 +- .../modules/polling/service/PollingService.as | 18 +-- .../modules/polling/views/QuickPollButton.as | 4 +- .../present/business/FileUploadService.as | 3 +- .../modules/present/business/PresentProxy.as | 124 +++++++++------- .../present/commands/UploadFileCommand.as | 1 + .../present/events/PresenterCommands.as | 1 + .../present/events/RequestAllPodsEvent.as | 34 +++++ .../events/RequestPresentationInfoPodEvent.as | 36 +++++ .../modules/present/events/UploadEvent.as | 1 + .../present/managers/PresentManager.as | 25 +++- .../modules/present/maps/PresentEventMap.mxml | 16 ++- .../modules/present/model/Presentation.as | 2 +- .../present/model/PresentationModel.as | 40 +++--- .../present/model/PresentationPodManager.as | 133 +++++++++++++++++ .../present/services/PageLoaderService.as | 44 +++--- .../present/services/PresentationService.as | 77 +++++----- .../services/messaging/MessageReceiver.as | 25 +++- .../services/messaging/MessageSender.as | 24 +++- .../present/ui/views/FileDownloadWindow.mxml | 2 +- .../present/ui/views/FileUploadWindow.mxml | 20 ++- .../present/ui/views/PresentationWindow.mxml | 136 ++++++++++-------- .../modules/present/ui/views/SlideView.mxml | 102 ++++++------- .../web/controllers/ApiController.groovy | 13 +- .../controllers/PresentationController.groovy | 4 +- .../web/services/PresentationService.groovy | 3 +- 59 files changed, 902 insertions(+), 421 deletions(-) create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestAllPodsEvent.as create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestPresentationInfoPodEvent.as create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/GetPresentationInfoReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/GetPresentationInfoReqMsgHdlr.scala index 2c80ebedbf..d92e6eabc6 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/GetPresentationInfoReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/GetPresentationInfoReqMsgHdlr.scala @@ -1,35 +1,35 @@ -package org.bigbluebutton.core.apps.presentation - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.common2.domain.PresentationVO -import org.bigbluebutton.core.apps.Presentation -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } - -trait GetPresentationInfoReqMsgHdlr { - this: PresentationApp2x => - - def handle( - msg: GetPresentationInfoReqMsg, - liveMeeting: LiveMeeting, bus: MessageBus - ): Unit = { - log.debug("Received GetPresentationInfoReqMsg") - - def broadcastEvent(msg: GetPresentationInfoReqMsg, presentations: Vector[Presentation]): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(GetPresentationInfoRespMsg.NAME, routing) - val header = BbbClientMsgHeader(GetPresentationInfoRespMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - - val presVOs = presentations.map { p => - PresentationVO(p.id, p.name, p.current, p.pages.values.toVector, p.downloadable) - } - - val body = GetPresentationInfoRespMsgBody(presVOs) - val event = GetPresentationInfoRespMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - broadcastEvent(msg, getPresentationInfo(liveMeeting)) - } -} +//package org.bigbluebutton.core.apps.presentation +// +//import org.bigbluebutton.common2.msgs._ +//import org.bigbluebutton.common2.domain.PresentationVO +//import org.bigbluebutton.core.apps.Presentation +//import org.bigbluebutton.core.bus.MessageBus +//import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } +// +//trait GetPresentationInfoReqMsgHdlr { +// this: PresentationApp2x => +// +// def handle( +// msg: GetPresentationInfoReqMsg, +// liveMeeting: LiveMeeting, bus: MessageBus +// ): Unit = { +// log.debug("Received GetPresentationInfoReqMsg") +// +// def broadcastEvent(msg: GetPresentationInfoReqMsg, presentations: Vector[Presentation]): Unit = { +// val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, msg.header.userId) +// val envelope = BbbCoreEnvelope(GetPresentationInfoRespMsg.NAME, routing) +// val header = BbbClientMsgHeader(GetPresentationInfoRespMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) +// +// val presVOs = presentations.map { p => +// PresentationVO(p.id, p.name, p.current, p.pages.values.toVector, p.downloadable) +// } +// +// val body = GetPresentationInfoRespMsgBody(presVOs) +// val event = GetPresentationInfoRespMsg(header, body) +// val msgEvent = BbbCommonEnvCoreMsg(envelope, event) +// bus.outGW.send(msgEvent) +// } +// +// broadcastEvent(msg, getPresentationInfo(liveMeeting)) // +// } +//} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala index 01ff1e020f..10ae1d0493 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala @@ -9,7 +9,7 @@ import org.bigbluebutton.core.running.LiveMeeting class PresentationApp2x(implicit val context: ActorContext) extends NewPresentationMsgHdlr with SetCurrentPresentationPubMsgHdlr - with GetPresentationInfoReqMsgHdlr + // with GetPresentationInfoReqMsgHdlr with SetCurrentPagePubMsgHdlr with ResizeAndMovePagePubMsgHdlr with RemovePresentationPubMsgHdlr diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionCompletedPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionCompletedPubMsgHdlr.scala index 5daab8b1c9..daf91e3ef4 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionCompletedPubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionCompletedPubMsgHdlr.scala @@ -24,7 +24,7 @@ trait PresentationConversionCompletedPubMsgHdlr { liveMeeting.props.meetingProp.intId, msg.header.userId ) - val body = PresentationConversionCompletedEvtMsgBody(msg.body.messageKey, msg.body.code, msg.body.presentation) + val body = PresentationConversionCompletedEvtMsgBody(msg.body.podId, msg.body.messageKey, msg.body.code, msg.body.presentation) val event = PresentationConversionCompletedEvtMsg(header, body) val msgEvent = BbbCommonEnvCoreMsg(envelope, event) bus.outGW.send(msgEvent) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionUpdatePubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionUpdatePubMsgHdlr.scala index 033e3a16a2..0fce706a0e 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionUpdatePubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationConversionUpdatePubMsgHdlr.scala @@ -17,7 +17,7 @@ trait PresentationConversionUpdatePubMsgHdlr { val envelope = BbbCoreEnvelope(PresentationConversionUpdateEvtMsg.NAME, routing) val header = BbbClientMsgHeader(PresentationConversionUpdateEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - val body = PresentationConversionUpdateEvtMsgBody(msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.presName) + val body = PresentationConversionUpdateEvtMsgBody(msg.body.podId, msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.presName) val event = PresentationConversionUpdateEvtMsg(header, body) val msgEvent = BbbCommonEnvCoreMsg(envelope, event) bus.outGW.send(msgEvent) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageCountErrorPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageCountErrorPubMsgHdlr.scala index 07be3ecaa8..6d88789005 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageCountErrorPubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageCountErrorPubMsgHdlr.scala @@ -23,7 +23,7 @@ trait PresentationPageCountErrorPubMsgHdlr { liveMeeting.props.meetingProp.intId, msg.header.userId ) - val body = PresentationPageCountErrorEvtMsgBody(msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.numberOfPages, msg.body.maxNumberPages, msg.body.presName) + val body = PresentationPageCountErrorEvtMsgBody(msg.body.podId, msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.numberOfPages, msg.body.maxNumberPages, msg.body.presName) val event = PresentationPageCountErrorEvtMsg(header, body) val msgEvent = BbbCommonEnvCoreMsg(envelope, event) bus.outGW.send(msgEvent) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageGeneratedPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageGeneratedPubMsgHdlr.scala index a416c7ee49..b15b7dd601 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageGeneratedPubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationPageGeneratedPubMsgHdlr.scala @@ -23,7 +23,7 @@ trait PresentationPageGeneratedPubMsgHdlr { liveMeeting.props.meetingProp.intId, msg.header.userId ) - val body = PresentationPageGeneratedEvtMsgBody(msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.numberOfPages, msg.body.pagesCompleted, msg.body.presName) + val body = PresentationPageGeneratedEvtMsgBody(msg.body.podId, msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.numberOfPages, msg.body.pagesCompleted, msg.body.presName) val event = PresentationPageGeneratedEvtMsg(header, body) val msgEvent = BbbCommonEnvCoreMsg(envelope, event) bus.outGW.send(msgEvent) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala new file mode 100644 index 0000000000..109f3d6b19 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala @@ -0,0 +1,44 @@ + + +package org.bigbluebutton.core.apps.presentationpod + +import org.bigbluebutton.common2.domain.{ PresentationPodVO, PresentationVO } +import org.bigbluebutton.common2.msgs._ +import org.bigbluebutton.core.bus.MessageBus +import org.bigbluebutton.core.domain.MeetingState2x +import org.bigbluebutton.core.models.PresentationPod +import org.bigbluebutton.core.running.LiveMeeting + +trait GetAllPresentationPodsReqMsgHdlr { + this: PresentationPodHdlrs => + + def handle(msg: GetAllPresentationPodsReqMsg, state: MeetingState2x, + liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = { + + def buildGetAllPresentationPodsRespMsg(pods: Vector[PresentationPodVO], requesterId: String): BbbCommonEnvCoreMsg = { + val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, requesterId) + val envelope = BbbCoreEnvelope(GetAllPresentationPodsRespMsg.NAME, routing) + val header = BbbClientMsgHeader(GetAllPresentationPodsRespMsg.NAME, liveMeeting.props.meetingProp.intId, requesterId) + + val body = GetAllPresentationPodsRespMsgBody(pods) + val event = GetAllPresentationPodsRespMsg(header, body) + + BbbCommonEnvCoreMsg(envelope, event) + } + + log.debug("___________C_____________________") + + val requesterId = msg.body.requesterId + + val pods = PresentationPodsApp.getAllPresentationPodsInMeeting(state) + + log.debug("___________D_____________________" + requesterId) + + val podsVO = pods.map(pod => PresentationPodsApp.translatePresentationPodToVO(pod)) + val event = buildGetAllPresentationPodsRespMsg(podsVO, requesterId) + + bus.outGW.send(event) + + state + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala new file mode 100644 index 0000000000..1c087958ee --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala @@ -0,0 +1,48 @@ +package org.bigbluebutton.core.apps.presentationpod + +import org.bigbluebutton.common2.domain.PresentationVO +import org.bigbluebutton.common2.msgs._ +import org.bigbluebutton.core.bus.MessageBus +import org.bigbluebutton.core.domain.MeetingState2x +import org.bigbluebutton.core.running.LiveMeeting + +trait GetPresentationInfoReqMsgHdlr { + this: PresentationPodHdlrs => + + def handle(msg: GetPresentationInfoReqMsg, state: MeetingState2x, + liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = { + + def buildGetPresentationInfoRespMsg(presentations: Vector[PresentationVO], podId: String, + requesterId: String): BbbCommonEnvCoreMsg = { + val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, requesterId) + val envelope = BbbCoreEnvelope(GetPresentationInfoRespMsg.NAME, routing) + val header = BbbClientMsgHeader(GetPresentationInfoRespMsg.NAME, liveMeeting.props.meetingProp.intId, requesterId) + + val body = GetPresentationInfoRespMsgBody(podId, presentations) + val event = GetPresentationInfoRespMsg(header, body) + + BbbCommonEnvCoreMsg(envelope, event) + } + + log.debug("___________A_____________________") + + val requesterId = msg.body.userId + val podId = msg.body.podId + + for { + pod <- PresentationPodsApp.getPresentationPod(state, podId) + } yield { + log.debug("___________b_____________________" + podId) + val presInPod = pod.presentations + + val presVOs = presInPod.values.map { p => + PresentationVO(p.id, p.name, p.current, p.pages.values.toVector, p.downloadable) + }.toVector + val event = buildGetPresentationInfoRespMsg(presVOs, podId, requesterId) + + bus.outGW.send(event) + + } + state + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala index da9f811cf5..19c6672920 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala @@ -6,6 +6,8 @@ import akka.event.Logging class PresentationPodHdlrs(implicit val context: ActorContext) extends CreateNewPresentationPodPubMsgHdlr + with GetPresentationInfoReqMsgHdlr + with GetAllPresentationPodsReqMsgHdlr with RemovePresentationPodPubMsgHdlr { val log = Logging(context.system, getClass) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala index 9b19b24864..9433bd0629 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala @@ -1,7 +1,8 @@ package org.bigbluebutton.core.apps.presentationpod +import org.bigbluebutton.common2.domain._ import org.bigbluebutton.core.apps.Presentation -import org.bigbluebutton.core.domain.{ BbbSystemConst, MeetingState2x } +import org.bigbluebutton.core.domain._ import org.bigbluebutton.core.models._ import org.bigbluebutton.core.running.LiveMeeting @@ -31,7 +32,19 @@ object PresentationPodsApp { state.presentationPodManager.getPod(podId) } + def getAllPresentationPodsInMeeting(state: MeetingState2x): Vector[PresentationPod] = { + state.presentationPodManager.getAllPresentationPodsInMeeting() + } + def getNumberOfPresentationPods(state: MeetingState2x): Int = state.presentationPodManager.getNumberOfPods() + def translatePresentationPodToVO(pod: PresentationPod): PresentationPodVO = { + val presentationObjects = pod.presentations + val presentationVOs = presentationObjects.values.map(p => PresentationVO(p.id, p.name, p.current, + p.pages.values.toVector, p.downloadable)).toVector + + PresentationPodVO(pod.id, pod.ownerId, pod.currentPresenter, + pod.authorizedPresenters, presentationVOs) + } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala index dfbbadadf4..c4a4c563c1 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala @@ -50,4 +50,5 @@ case class PresentationPodManager(presentationPods: collection.immutable.Map[Str def removePod(podId: String): PresentationPodManager = copy(presentationPods = presentationPods - podId) def getNumberOfPods(): Int = presentationPods.size def getPod(podId: String): Option[PresentationPod] = presentationPods.get(podId) + def getAllPresentationPodsInMeeting(): Vector[PresentationPod] = presentationPods.values.toVector } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index ced4decab7..e1daf87cf4 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -187,6 +187,8 @@ class ReceivedJsonMsgHandlerActor( routeGenericMsg[RemovePresentationPubMsg](envelope, jsonNode) case PresentationUploadTokenReqMsg.NAME => routeGenericMsg[PresentationUploadTokenReqMsg](envelope, jsonNode) + case GetAllPresentationPodsReqMsg.NAME => + routeGenericMsg[GetAllPresentationPodsReqMsg](envelope, jsonNode) case PreuploadedPresentationsSysPubMsg.NAME => routeGenericMsg[PreuploadedPresentationsSysPubMsg](envelope, jsonNode) case PresentationConversionUpdateSysPubMsg.NAME => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index 15ecb3e3ed..1f314f5cfb 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -150,7 +150,7 @@ class MeetingActor( log.debug("NUM GROUP CHATS = " + state.groupChats.findAllPublicChats().length) // Create a default Presentation Pod - state = PresentationPodsApp.createDefaultPresentationPod(state) + // state = PresentationPodsApp.createDefaultPresentationPod(state) log.debug("\n\n____NUM Presentation Pods = " + state.presentationPodManager.getNumberOfPods()) /*******************************************************************/ @@ -282,7 +282,7 @@ class MeetingActor( // Presentation // case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus, state) case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) - case m: GetPresentationInfoReqMsg => presentationApp2x.handle(m, liveMeeting, msgBus) + // case m: GetPresentationInfoReqMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: SetCurrentPagePubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: ResizeAndMovePagePubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: RemovePresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) @@ -297,6 +297,8 @@ class MeetingActor( // Presentation Pods case m: CreateNewPresentationPodPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) case m: RemovePresentationPodPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) + case m: GetPresentationInfoReqMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) + case m: GetAllPresentationPodsReqMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) // Caption case m: EditCaptionHistoryPubMsg => captionApp2x.handle(m, liveMeeting, msgBus) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Presentation.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Presentation.scala index 8a38c2bfbe..5713c4a5de 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Presentation.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Presentation.scala @@ -6,3 +6,7 @@ case class PresentationVO(id: String, name: String, current: Boolean = false, case class PageVO(id: String, num: Int, thumbUri: String = "", swfUri: String, txtUri: String, svgUri: String, current: Boolean = false, xOffset: Double = 0, yOffset: Double = 0, widthRatio: Double = 100D, heightRatio: Double = 100D) + +case class PresentationPodVO(id: String, ownerId: String, currentPresenter: String, + authorizedPresenters: Vector[String], + presentations: Vector[PresentationVO]) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala index 441290247c..76b77c5364 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala @@ -8,10 +8,6 @@ object SetCurrentPresentationPubMsg { val NAME = "SetCurrentPresentationPubMsg"} case class SetCurrentPresentationPubMsg(header: BbbClientMsgHeader, body: SetCurrentPresentationPubMsgBody) extends StandardMsg case class SetCurrentPresentationPubMsgBody(presentationId: String) -object GetPresentationInfoReqMsg { val NAME = "GetPresentationInfoReqMsg"} -case class GetPresentationInfoReqMsg(header: BbbClientMsgHeader, body: GetPresentationInfoReqMsgBody) extends StandardMsg -case class GetPresentationInfoReqMsgBody(userId: String) - object SetCurrentPagePubMsg { val NAME = "SetCurrentPagePubMsg"} case class SetCurrentPagePubMsg(header: BbbClientMsgHeader, body: SetCurrentPagePubMsgBody) extends StandardMsg case class SetCurrentPagePubMsgBody(presentationId: String, pageId: String) @@ -23,40 +19,10 @@ case class ResizeAndMovePagePubMsgBody(presentationId: String, pageId: String, x object RemovePresentationPubMsg { val NAME = "RemovePresentationPubMsg"} case class RemovePresentationPubMsg(header: BbbClientMsgHeader, body: RemovePresentationPubMsgBody) extends StandardMsg case class RemovePresentationPubMsgBody(presentationId: String) - -object PresentationUploadTokenReqMsg { val NAME = "PresentationUploadTokenReqMsg"} -case class PresentationUploadTokenReqMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenReqMsgBody) extends StandardMsg -case class PresentationUploadTokenReqMsgBody(podId: String, filename: String) // ------------ client to akka-apps ------------ // ------------ bbb-common-web to akka-apps ------------ -object PresentationConversionUpdateSysPubMsg { val NAME = "PresentationConversionUpdateSysPubMsg"} -case class PresentationConversionUpdateSysPubMsg(header: BbbClientMsgHeader, - body: PresentationConversionUpdateSysPubMsgBody) extends StandardMsg -case class PresentationConversionUpdateSysPubMsgBody(messageKey: String, - code: String, - presentationId: String, - presName: String) - -object PresentationPageCountErrorSysPubMsg { val NAME = "PresentationPageCountErrorSysPubMsg"} -case class PresentationPageCountErrorSysPubMsg(header: BbbClientMsgHeader, - body: PresentationPageCountErrorSysPubMsgBody) extends StandardMsg -case class PresentationPageCountErrorSysPubMsgBody(messageKey: String, code: String, presentationId: String, - numberOfPages: Int, maxNumberPages: Int, presName: String) - -object PresentationPageGeneratedSysPubMsg { val NAME = "PresentationPageGeneratedSysPubMsg"} -case class PresentationPageGeneratedSysPubMsg(header: BbbClientMsgHeader, - body: PresentationPageGeneratedSysPubMsgBody) extends StandardMsg -case class PresentationPageGeneratedSysPubMsgBody(messageKey: String, code: String, presentationId: String, - numberOfPages: Int, pagesCompleted: Int, presName: String) - -object PresentationConversionCompletedSysPubMsg { val NAME = "PresentationConversionCompletedSysPubMsg"} -case class PresentationConversionCompletedSysPubMsg(header: BbbClientMsgHeader, - body: PresentationConversionCompletedSysPubMsgBody) extends StandardMsg -case class PresentationConversionCompletedSysPubMsgBody(messageKey: String, code: String, - presentation: PresentationVO) - object PreuploadedPresentationsSysPubMsg { val NAME = "PreuploadedPresentationsSysPubMsg"} case class PreuploadedPresentationsSysPubMsg(header: BbbClientMsgHeader, body: PreuploadedPresentationsSysPubMsgBody) extends StandardMsg case class PreuploadedPresentationsSysPubMsgBody(presentations: Vector[PresentationVO]) @@ -80,10 +46,6 @@ object SetCurrentPresentationEvtMsg { val NAME = "SetCurrentPresentationEvtMsg"} case class SetCurrentPresentationEvtMsg(header: BbbClientMsgHeader, body: SetCurrentPresentationEvtMsgBody) extends BbbCoreMsg case class SetCurrentPresentationEvtMsgBody(presentationId: String) -object GetPresentationInfoRespMsg { val NAME = "GetPresentationInfoRespMsg"} -case class GetPresentationInfoRespMsg(header: BbbClientMsgHeader, body: GetPresentationInfoRespMsgBody) extends BbbCoreMsg -case class GetPresentationInfoRespMsgBody(presentations: Vector[PresentationVO]) - object SetCurrentPageEvtMsg { val NAME = "SetCurrentPageEvtMsg"} case class SetCurrentPageEvtMsg(header: BbbClientMsgHeader, body: SetCurrentPageEvtMsgBody) extends BbbCoreMsg case class SetCurrentPageEvtMsgBody(presentationId: String, pageId: String) @@ -96,29 +58,6 @@ object RemovePresentationEvtMsg { val NAME = "RemovePresentationEvtMsg"} case class RemovePresentationEvtMsg(header: BbbClientMsgHeader, body: RemovePresentationEvtMsgBody) extends BbbCoreMsg case class RemovePresentationEvtMsgBody(presentationId: String) -object PresentationConversionUpdateEvtMsg { val NAME = "PresentationConversionUpdateEvtMsg"} -case class PresentationConversionUpdateEvtMsg(header: BbbClientMsgHeader, body: PresentationConversionUpdateEvtMsgBody) extends BbbCoreMsg -case class PresentationConversionUpdateEvtMsgBody(messageKey: String, code: String, presentationId: String, presName: String) - -object PresentationPageCountErrorEvtMsg { val NAME = "PresentationPageCountErrorEvtMsg"} -case class PresentationPageCountErrorEvtMsg(header: BbbClientMsgHeader, body: PresentationPageCountErrorEvtMsgBody) extends BbbCoreMsg -case class PresentationPageCountErrorEvtMsgBody(messageKey: String, code: String, presentationId: String, numberOfPages: Int, maxNumberPages: Int, presName: String) - -object PresentationPageGeneratedEvtMsg { val NAME = "PresentationPageGeneratedEvtMsg"} -case class PresentationPageGeneratedEvtMsg(header: BbbClientMsgHeader, body: PresentationPageGeneratedEvtMsgBody) extends BbbCoreMsg -case class PresentationPageGeneratedEvtMsgBody(messageKey: String, code: String, presentationId: String, numberOfPages: Int, pagesCompleted: Int, presName: String) - -object PresentationConversionCompletedEvtMsg { val NAME = "PresentationConversionCompletedEvtMsg"} -case class PresentationConversionCompletedEvtMsg(header: BbbClientMsgHeader, body: PresentationConversionCompletedEvtMsgBody) extends BbbCoreMsg -case class PresentationConversionCompletedEvtMsgBody(messageKey: String, code: String, presentation: PresentationVO) - -object PresentationUploadTokenPassRespMsg { val NAME = "PresentationUploadTokenPassRespMsg"} -case class PresentationUploadTokenPassRespMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenPassRespMsgBody) extends StandardMsg -case class PresentationUploadTokenPassRespMsgBody(podId: String, authzToken: String, filename: String) - -object PresentationUploadTokenFailRespMsg { val NAME = "PresentationUploadTokenFailRespMsg"} -case class PresentationUploadTokenFailRespMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenFailRespMsgBody) extends StandardMsg -case class PresentationUploadTokenFailRespMsgBody(podId: String, filename: String) // html5 client only object SyncGetPresentationInfoRespMsg { val NAME = "SyncGetPresentationInfoRespMsg"} @@ -127,8 +66,3 @@ case class SyncGetPresentationInfoRespMsgBody(presentations: Vector[Presentation // ------------ akka-apps to client ------------ -// ------------ akka-apps to bbb-common-web ------------ -object PresentationUploadTokenSysPubMsg { val NAME = "PresentationUploadTokenSysPubMsg"} -case class PresentationUploadTokenSysPubMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenSysPubMsgBody) extends BbbCoreMsg -case class PresentationUploadTokenSysPubMsgBody(podId: String, authzToken: String, filename: String) -// ------------ akka-apps to bbb-common-web ------------ diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala index 22198df2e9..dcea3f5674 100644 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationPodsMsgs.scala @@ -1,5 +1,7 @@ package org.bigbluebutton.common2.msgs +import org.bigbluebutton.common2.domain.{PresentationPodVO, PresentationVO} + // ------------ client to akka-apps ------------ object CreateNewPresentationPodPubMsg { val NAME = "CreateNewPresentationPodPubMsg"} @@ -10,11 +12,47 @@ object RemovePresentationPodPubMsg { val NAME = "RemovePresentationPodPubMsg"} case class RemovePresentationPodPubMsg(header: BbbClientMsgHeader, body: RemovePresentationPodPubMsgBody) extends StandardMsg case class RemovePresentationPodPubMsgBody(requesterId: String, podId: String) +object GetPresentationInfoReqMsg { val NAME = "GetPresentationInfoReqMsg"} +case class GetPresentationInfoReqMsg(header: BbbClientMsgHeader, body: GetPresentationInfoReqMsgBody) extends StandardMsg +case class GetPresentationInfoReqMsgBody(userId: String, podId: String) + +object PresentationUploadTokenReqMsg { val NAME = "PresentationUploadTokenReqMsg"} +case class PresentationUploadTokenReqMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenReqMsgBody) extends StandardMsg +case class PresentationUploadTokenReqMsgBody(podId: String, filename: String) + +object GetAllPresentationPodsReqMsg { val NAME = "GetAllPresentationPodsReqMsg"} +case class GetAllPresentationPodsReqMsg(header: BbbClientMsgHeader, body: GetAllPresentationPodsReqMsgBody) extends StandardMsg +case class GetAllPresentationPodsReqMsgBody(requesterId: String) // ------------ client to akka-apps ------------ // ------------ bbb-common-web to akka-apps ------------ +object PresentationConversionUpdateSysPubMsg { val NAME = "PresentationConversionUpdateSysPubMsg"} +case class PresentationConversionUpdateSysPubMsg(header: BbbClientMsgHeader, + body: PresentationConversionUpdateSysPubMsgBody) extends StandardMsg +case class PresentationConversionUpdateSysPubMsgBody(podId: String, + messageKey: String, + code: String, + presentationId: String, + presName: String) +object PresentationPageCountErrorSysPubMsg { val NAME = "PresentationPageCountErrorSysPubMsg"} +case class PresentationPageCountErrorSysPubMsg(header: BbbClientMsgHeader, + body: PresentationPageCountErrorSysPubMsgBody) extends StandardMsg +case class PresentationPageCountErrorSysPubMsgBody(podId: String, messageKey: String, code: String, presentationId: String, + numberOfPages: Int, maxNumberPages: Int, presName: String) + +object PresentationPageGeneratedSysPubMsg { val NAME = "PresentationPageGeneratedSysPubMsg"} +case class PresentationPageGeneratedSysPubMsg(header: BbbClientMsgHeader, + body: PresentationPageGeneratedSysPubMsgBody) extends StandardMsg +case class PresentationPageGeneratedSysPubMsgBody(podId: String, messageKey: String, code: String, presentationId: String, + numberOfPages: Int, pagesCompleted: Int, presName: String) + +object PresentationConversionCompletedSysPubMsg { val NAME = "PresentationConversionCompletedSysPubMsg"} +case class PresentationConversionCompletedSysPubMsg(header: BbbClientMsgHeader, + body: PresentationConversionCompletedSysPubMsgBody) extends StandardMsg +case class PresentationConversionCompletedSysPubMsgBody(podId: String, messageKey: String, code: String, + presentation: PresentationVO) // ------------ bbb-common-web to akka-apps ------------ @@ -27,9 +65,42 @@ object RemovePresentationPodEvtMsg { val NAME = "RemovePresentationPodEvtMsg"} case class RemovePresentationPodEvtMsg(header: BbbClientMsgHeader, body: RemovePresentationPodEvtMsgBody) extends StandardMsg case class RemovePresentationPodEvtMsgBody( ownerId: String, podId: String) +object GetPresentationInfoRespMsg { val NAME = "GetPresentationInfoRespMsg"} +case class GetPresentationInfoRespMsg(header: BbbClientMsgHeader, body: GetPresentationInfoRespMsgBody) extends BbbCoreMsg +case class GetPresentationInfoRespMsgBody(podId: String, presentations: Vector[PresentationVO]) +object PresentationUploadTokenPassRespMsg { val NAME = "PresentationUploadTokenPassRespMsg"} +case class PresentationUploadTokenPassRespMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenPassRespMsgBody) extends StandardMsg +case class PresentationUploadTokenPassRespMsgBody(podId: String, authzToken: String, filename: String) + +object PresentationUploadTokenFailRespMsg { val NAME = "PresentationUploadTokenFailRespMsg"} +case class PresentationUploadTokenFailRespMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenFailRespMsgBody) extends StandardMsg +case class PresentationUploadTokenFailRespMsgBody(podId: String, filename: String) + +object PresentationConversionUpdateEvtMsg { val NAME = "PresentationConversionUpdateEvtMsg"} +case class PresentationConversionUpdateEvtMsg(header: BbbClientMsgHeader, body: PresentationConversionUpdateEvtMsgBody) extends BbbCoreMsg +case class PresentationConversionUpdateEvtMsgBody(podId: String, messageKey: String, code: String, presentationId: String, presName: String) + +object PresentationPageCountErrorEvtMsg { val NAME = "PresentationPageCountErrorEvtMsg"} +case class PresentationPageCountErrorEvtMsg(header: BbbClientMsgHeader, body: PresentationPageCountErrorEvtMsgBody) extends BbbCoreMsg +case class PresentationPageCountErrorEvtMsgBody(podId: String, messageKey: String, code: String, presentationId: String, numberOfPages: Int, maxNumberPages: Int, presName: String) + +object PresentationPageGeneratedEvtMsg { val NAME = "PresentationPageGeneratedEvtMsg"} +case class PresentationPageGeneratedEvtMsg(header: BbbClientMsgHeader, body: PresentationPageGeneratedEvtMsgBody) extends BbbCoreMsg +case class PresentationPageGeneratedEvtMsgBody(podId: String, messageKey: String, code: String, presentationId: String, numberOfPages: Int, pagesCompleted: Int, presName: String) + +object PresentationConversionCompletedEvtMsg { val NAME = "PresentationConversionCompletedEvtMsg"} +case class PresentationConversionCompletedEvtMsg(header: BbbClientMsgHeader, body: PresentationConversionCompletedEvtMsgBody) extends BbbCoreMsg +case class PresentationConversionCompletedEvtMsgBody(podId: String, messageKey: String, code: String, presentation: PresentationVO) + +object GetAllPresentationPodsRespMsg { val NAME = "GetAllPresentationPodsRespMsg"} +case class GetAllPresentationPodsRespMsg(header: BbbClientMsgHeader, body: GetAllPresentationPodsRespMsgBody) extends StandardMsg +case class GetAllPresentationPodsRespMsgBody(pods: Vector[PresentationPodVO]) // ------------ akka-apps to client ------------ // ------------ akka-apps to bbb-common-web ------------ +object PresentationUploadTokenSysPubMsg { val NAME = "PresentationUploadTokenSysPubMsg"} +case class PresentationUploadTokenSysPubMsg(header: BbbClientMsgHeader, body: PresentationUploadTokenSysPubMsgBody) extends BbbCoreMsg +case class PresentationUploadTokenSysPubMsgBody(podId: String, authzToken: String, filename: String) // ------------ akka-apps to bbb-common-web ------------ diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/DocumentConversionServiceImp.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/DocumentConversionServiceImp.java index f58e9c54b2..8d8c8cd102 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/DocumentConversionServiceImp.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/DocumentConversionServiceImp.java @@ -44,6 +44,7 @@ public class DocumentConversionServiceImp implements DocumentConversionService { SupportedDocumentFilter sdf = new SupportedDocumentFilter(gw); Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -79,6 +80,7 @@ public class DocumentConversionServiceImp implements DocumentConversionService { } logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/OfficeToPdfConversionSuccessFilter.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/OfficeToPdfConversionSuccessFilter.java index 047cfd8688..d9522fd511 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/OfficeToPdfConversionSuccessFilter.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/OfficeToPdfConversionSuccessFilter.java @@ -60,6 +60,7 @@ public class OfficeToPdfConversionSuccessFilter { msg.put("room", pres.getMeetingId()); msg.put("returnCode", "CONVERT"); msg.put("presentationId", pres.getId()); + msg.put("podId", pres.getPodId()); msg.put("presentationName", pres.getId()); msg.put("filename", pres.getName()); msg.put("message", conversionMessagesMap.get(pres.getConversionStatus())); @@ -72,8 +73,8 @@ public class OfficeToPdfConversionSuccessFilter { public void sendProgress(UploadedPresentation pres) { - OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getMeetingId(), - pres.getId(), pres.getId(), + OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getPodId(), + pres.getMeetingId(),pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), pres.getConversionStatus()); gw.sendDocConversionMsg(progress); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java index d4a8065d47..f59b595fb0 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java @@ -58,9 +58,10 @@ public class PresentationUrlDownloadService { } - public void processUploadedFile(String meetingId, String presId, + public void processUploadedFile(String podId, String meetingId, String presId, String filename, File presFile, Boolean current) { - UploadedPresentation uploadedPres = new UploadedPresentation(meetingId, + // TODO add podId + UploadedPresentation uploadedPres = new UploadedPresentation(podId, meetingId, presId, filename, presentationBaseURL, current); uploadedPres.setUploadedFile(presFile); processUploadedPresentation(uploadedPres); @@ -143,7 +144,7 @@ public class PresentationUrlDownloadService { } } - processUploadedFile(destinationMeetingId, presId, "default-" + processUploadedFile("THREE", destinationMeetingId, presId, "default-" + presentationSlide.toString() + "." + filenameExt, newPresentation, true); } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java index 4d1256f435..9980649442 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedDocumentFilter.java @@ -64,7 +64,7 @@ public class SupportedDocumentFilter { } if (gw != null) { - OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getMeetingId(), + OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), msgKey); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/UploadedPresentation.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/UploadedPresentation.java index 4105b00d91..867982abe8 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/UploadedPresentation.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/UploadedPresentation.java @@ -22,6 +22,7 @@ package org.bigbluebutton.presentation; import java.io.File; public final class UploadedPresentation { + private final String podId; private final String meetingId; private final String id; private final String name; @@ -33,7 +34,8 @@ public final class UploadedPresentation { private boolean isDownloadable = false; private boolean current = false; - public UploadedPresentation(String meetingId, String id, String name, String baseUrl, Boolean current) { + public UploadedPresentation(String podId, String meetingId, String id, String name, String baseUrl, Boolean current) { + this.podId = podId; this.meetingId = meetingId; this.id = id; this.name = name; @@ -54,6 +56,10 @@ public final class UploadedPresentation { return meetingId; } + public String getPodId() { + return podId; + } + public String getId() { return id; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/PdfToSwfSlidesGenerationService.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/PdfToSwfSlidesGenerationService.java index d6e94e015c..e645015a53 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/PdfToSwfSlidesGenerationService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/PdfToSwfSlidesGenerationService.java @@ -102,6 +102,7 @@ public class PdfToSwfSlidesGenerationService { builder.messageKey(ConversionMessageConstants.PAGE_COUNT_FAILED_KEY); Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -110,7 +111,7 @@ public class PdfToSwfSlidesGenerationService { String logStr = gson.toJson(logData); log.warn("-- analytics -- " + logStr); - DocPageCountFailed progress = new DocPageCountFailed(pres.getMeetingId(), + DocPageCountFailed progress = new DocPageCountFailed(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), ConversionMessageConstants.PAGE_COUNT_FAILED_KEY); @@ -123,6 +124,7 @@ public class PdfToSwfSlidesGenerationService { builder.messageKey(ConversionMessageConstants.PAGE_COUNT_EXCEEDED_KEY); Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -133,7 +135,7 @@ public class PdfToSwfSlidesGenerationService { String logStr = gson.toJson(logData); log.warn("-- analytics -- " + logStr); - DocPageCountExceeded progress = new DocPageCountExceeded(pres.getMeetingId(), + DocPageCountExceeded progress = new DocPageCountExceeded(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), ConversionMessageConstants.PAGE_COUNT_EXCEEDED_KEY, @@ -196,6 +198,7 @@ public class PdfToSwfSlidesGenerationService { notifier.sendConversionUpdateMessage(slidesCompleted, pres); } catch (ExecutionException e) { Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -208,6 +211,7 @@ public class PdfToSwfSlidesGenerationService { log.error(e.getMessage()); } catch (InterruptedException e) { Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -220,6 +224,7 @@ public class PdfToSwfSlidesGenerationService { Thread.currentThread().interrupt(); } catch (TimeoutException e) { Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -234,6 +239,7 @@ public class PdfToSwfSlidesGenerationService { long pageConvEnd = System.currentTimeMillis(); Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -252,6 +258,7 @@ public class PdfToSwfSlidesGenerationService { slide.generateBlankSlide(); Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); @@ -267,6 +274,7 @@ public class PdfToSwfSlidesGenerationService { long presConvEnd = System.currentTimeMillis(); Map logData = new HashMap(); + logData.put("podId", pres.getPodId()); logData.put("meetingId", pres.getMeetingId()); logData.put("presId", pres.getId()); logData.put("filename", pres.getName()); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SwfSlidesGenerationProgressNotifier.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SwfSlidesGenerationProgressNotifier.java index 55513b90c8..3039d37e0a 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SwfSlidesGenerationProgressNotifier.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/SwfSlidesGenerationProgressNotifier.java @@ -43,7 +43,7 @@ public class SwfSlidesGenerationProgressNotifier { public void sendConversionUpdateMessage(int slidesCompleted, UploadedPresentation pres) { - DocPageGeneratedProgress progress = new DocPageGeneratedProgress(pres.getMeetingId(), + DocPageGeneratedProgress progress = new DocPageGeneratedProgress(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), ConversionMessageConstants.GENERATED_SLIDE_KEY, @@ -52,7 +52,7 @@ public class SwfSlidesGenerationProgressNotifier { } public void sendCreatingThumbnailsUpdateMessage(UploadedPresentation pres) { - OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getMeetingId(), + OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), ConversionMessageConstants.GENERATING_THUMBNAIL_KEY); @@ -65,7 +65,7 @@ public class SwfSlidesGenerationProgressNotifier { return; } - DocPageCompletedProgress progress = new DocPageCompletedProgress(pres.getMeetingId(), + DocPageCompletedProgress progress = new DocPageCompletedProgress(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), ConversionMessageConstants.CONVERSION_COMPLETED_KEY, @@ -86,7 +86,7 @@ public class SwfSlidesGenerationProgressNotifier { } public void sendCreatingTextFilesUpdateMessage(UploadedPresentation pres) { - OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getMeetingId(), + OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), ConversionMessageConstants.GENERATING_TEXTFILES_KEY); @@ -94,7 +94,7 @@ public class SwfSlidesGenerationProgressNotifier { } public void sendCreatingSvgImagesUpdateMessage(UploadedPresentation pres) { - OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getMeetingId(), + OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getPodId(), pres.getMeetingId(), pres.getId(), pres.getId(), pres.getName(), "notUsedYet", "notUsedYet", pres.isDownloadable(), ConversionMessageConstants.GENERATING_SVGIMAGES_KEY); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCompletedProgress.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCompletedProgress.java index b885016521..2fca85dce7 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCompletedProgress.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCompletedProgress.java @@ -1,6 +1,7 @@ package org.bigbluebutton.presentation.messages; public class DocPageCompletedProgress implements IDocConversionMsg { + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -13,10 +14,11 @@ public class DocPageCompletedProgress implements IDocConversionMsg { public final String presBaseUrl; public final Boolean current; - public DocPageCompletedProgress(String meetingId, String presId, String presInstance, + public DocPageCompletedProgress(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable, String key, Integer numPages, String presBaseUrl, Boolean current) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountExceeded.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountExceeded.java index a36ef9cda0..b70e4adaf4 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountExceeded.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountExceeded.java @@ -1,6 +1,7 @@ package org.bigbluebutton.presentation.messages; public class DocPageCountExceeded implements IDocConversionMsg { + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -12,10 +13,11 @@ public class DocPageCountExceeded implements IDocConversionMsg { public final Integer numPages; public final Integer maxNumPages; - public DocPageCountExceeded(String meetingId, String presId, String presInstance, + public DocPageCountExceeded(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable, String key, Integer numPages, Integer maxNumPages) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountFailed.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountFailed.java index fcc8806087..2ecc282da4 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountFailed.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageCountFailed.java @@ -1,6 +1,7 @@ package org.bigbluebutton.presentation.messages; public class DocPageCountFailed implements IDocConversionMsg { + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -10,9 +11,10 @@ public class DocPageCountFailed implements IDocConversionMsg { public final Boolean downloadable; public final String key; - public DocPageCountFailed(String meetingId, String presId, String presInstance, + public DocPageCountFailed(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable, String key) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageGeneratedProgress.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageGeneratedProgress.java index e9ef860549..a67249da85 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageGeneratedProgress.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/DocPageGeneratedProgress.java @@ -1,6 +1,7 @@ package org.bigbluebutton.presentation.messages; public class DocPageGeneratedProgress implements IDocConversionMsg { + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -12,10 +13,11 @@ public class DocPageGeneratedProgress implements IDocConversionMsg { public final Integer numPages; public final Integer pagesCompleted; - public DocPageGeneratedProgress(String meetingId, String presId, String presInstance, + public DocPageGeneratedProgress(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable, String key, Integer numPages, Integer pagesCompleted) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionInvalid.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionInvalid.java index 826af2c8d0..92f94d0e4b 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionInvalid.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionInvalid.java @@ -4,6 +4,7 @@ package org.bigbluebutton.presentation.messages; import org.bigbluebutton.api.messaging.messages.IMessage; public class OfficeDocConversionInvalid implements IMessage{ + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -12,9 +13,10 @@ public class OfficeDocConversionInvalid implements IMessage{ public final String authzToken; public final Boolean downloadable; - public OfficeDocConversionInvalid(String meetingId, String presId, String presInstance, + public OfficeDocConversionInvalid(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionProgress.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionProgress.java index a42a5b4816..9d4df6b901 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionProgress.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionProgress.java @@ -4,6 +4,7 @@ package org.bigbluebutton.presentation.messages; import org.bigbluebutton.api.messaging.messages.IMessage; public class OfficeDocConversionProgress implements IDocConversionMsg { + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -13,9 +14,10 @@ public class OfficeDocConversionProgress implements IDocConversionMsg { public final Boolean downloadable; public final String key; - public OfficeDocConversionProgress(String meetingId, String presId, String presInstance, + public OfficeDocConversionProgress(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable, String key) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSuccess.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSuccess.java index f79bab478c..8c239b150d 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSuccess.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSuccess.java @@ -4,6 +4,7 @@ package org.bigbluebutton.presentation.messages; import org.bigbluebutton.api.messaging.messages.IMessage; public class OfficeDocConversionSuccess implements IMessage{ + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -12,9 +13,10 @@ public class OfficeDocConversionSuccess implements IMessage{ public final String authzToken; public final Boolean downloadable; - public OfficeDocConversionSuccess(String meetingId, String presId, String presInstance, + public OfficeDocConversionSuccess(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSupported.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSupported.java index ef9718ab3e..a8b9ea5461 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSupported.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionSupported.java @@ -4,6 +4,7 @@ package org.bigbluebutton.presentation.messages; import org.bigbluebutton.api.messaging.messages.IMessage; public class OfficeDocConversionSupported implements IMessage{ + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -12,9 +13,10 @@ public class OfficeDocConversionSupported implements IMessage{ public final String authzToken; public final Boolean downloadable; - public OfficeDocConversionSupported(String meetingId, String presId, String presInstance, + public OfficeDocConversionSupported(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionUnsupported.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionUnsupported.java index 70599a0247..b579a8e288 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionUnsupported.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/messages/OfficeDocConversionUnsupported.java @@ -4,6 +4,7 @@ package org.bigbluebutton.presentation.messages; import org.bigbluebutton.api.messaging.messages.IMessage; public class OfficeDocConversionUnsupported implements IMessage{ + public final String podId; public final String meetingId; public final String presId; public final String presInstance; @@ -12,9 +13,10 @@ public class OfficeDocConversionUnsupported implements IMessage{ public final String authzToken; public final Boolean downloadable; - public OfficeDocConversionUnsupported(String meetingId, String presId, String presInstance, + public OfficeDocConversionUnsupported(String podId, String meetingId, String presId, String presInstance, String filename, String uploaderId, String authzToken, Boolean downloadable) { + this.podId = podId; this.meetingId = meetingId; this.presId = presId; this.presInstance = presInstance; diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala index 231b511c3d..8210924004 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala @@ -181,7 +181,7 @@ class BbbWebApiGWApp(val oldMessageReceivedGW: OldMessageReceivedGW, val event = MsgBuilder.buildPresentationConversionCompletedSysPubMsg(msg.asInstanceOf[DocPageCompletedProgress]) msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event)) } else if (msg.isInstanceOf[DocPageCountFailed]) { - val event = MsgBuilder.buildbuildPresentationPageCountFailedSysPubMsg(msg.asInstanceOf[DocPageCountFailed]) + val event = MsgBuilder.buildPresentationPageCountFailedSysPubMsg(msg.asInstanceOf[DocPageCountFailed]) msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event)) } else if (msg.isInstanceOf[DocPageCountExceeded]) { val event = MsgBuilder.buildPresentationPageCountExceededSysPubMsg(msg.asInstanceOf[DocPageCountExceeded]) diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala index 0bd081b274..c9625b7e90 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/MsgBuilder.scala @@ -59,7 +59,7 @@ object MsgBuilder { val routing = collection.immutable.HashMap("sender" -> "bbb-web") val envelope = BbbCoreEnvelope(PresentationPageGeneratedSysPubMsg.NAME, routing) val header = BbbClientMsgHeader(PresentationPageGeneratedSysPubMsg.NAME, msg.meetingId, msg.authzToken) - val body = PresentationPageGeneratedSysPubMsgBody(messageKey = msg.key, + val body = PresentationPageGeneratedSysPubMsgBody(podId = msg.podId, messageKey = msg.key, code = msg.key, presentationId = msg.presId, numberOfPages = msg.numPages.intValue(), pagesCompleted = msg.pagesCompleted.intValue(), presName = msg.filename) val req = PresentationPageGeneratedSysPubMsg(header, body) @@ -70,7 +70,7 @@ object MsgBuilder { val routing = collection.immutable.HashMap("sender" -> "bbb-web") val envelope = BbbCoreEnvelope(PresentationConversionUpdateSysPubMsg.NAME, routing) val header = BbbClientMsgHeader(PresentationConversionUpdateSysPubMsg.NAME, msg.meetingId, msg.authzToken) - val body = PresentationConversionUpdateSysPubMsgBody(messageKey = msg.key, + val body = PresentationConversionUpdateSysPubMsgBody(podId = msg.podId, messageKey = msg.key, code = msg.key, presentationId = msg.presId, presName = msg.filename) val req = PresentationConversionUpdateSysPubMsg(header, body) BbbCommonEnvCoreMsg(envelope, req) @@ -85,7 +85,7 @@ object MsgBuilder { val presentation = PresentationVO(msg.presId, msg.filename, current=msg.current.booleanValue(), pages.values.toVector, msg.downloadable.booleanValue()) - val body = PresentationConversionCompletedSysPubMsgBody(messageKey = msg.key, + val body = PresentationConversionCompletedSysPubMsgBody(podId = msg.podId, messageKey = msg.key, code = msg.key, presentation) val req = PresentationConversionCompletedSysPubMsg(header, body) BbbCommonEnvCoreMsg(envelope, req) @@ -112,12 +112,12 @@ object MsgBuilder { pages.toMap } - def buildbuildPresentationPageCountFailedSysPubMsg(msg: DocPageCountFailed): BbbCommonEnvCoreMsg = { + def buildPresentationPageCountFailedSysPubMsg(msg: DocPageCountFailed): BbbCommonEnvCoreMsg = { val routing = collection.immutable.HashMap("sender" -> "bbb-web") val envelope = BbbCoreEnvelope(PresentationPageCountErrorSysPubMsg.NAME, routing) val header = BbbClientMsgHeader(PresentationPageCountErrorSysPubMsg.NAME, msg.meetingId, msg.authzToken) - val body = PresentationPageCountErrorSysPubMsgBody(messageKey = msg.key, + val body = PresentationPageCountErrorSysPubMsgBody(podId = msg.podId, messageKey = msg.key, code = msg.key, msg.presId, 0, 0, msg.filename) val req = PresentationPageCountErrorSysPubMsg(header, body) BbbCommonEnvCoreMsg(envelope, req) @@ -128,7 +128,7 @@ object MsgBuilder { val envelope = BbbCoreEnvelope(PresentationPageCountErrorSysPubMsg.NAME, routing) val header = BbbClientMsgHeader(PresentationPageCountErrorSysPubMsg.NAME, msg.meetingId, msg.authzToken) - val body = PresentationPageCountErrorSysPubMsgBody(messageKey = msg.key, + val body = PresentationPageCountErrorSysPubMsgBody(podId = msg.podId, messageKey = msg.key, code = msg.key, msg.presId, msg.numPages.intValue(), msg.maxNumPages.intValue(), msg.filename) val req = PresentationPageCountErrorSysPubMsg(header, body) BbbCommonEnvCoreMsg(envelope, req) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollingService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollingService.as index 222545f335..2b5806f4b9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollingService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/service/PollingService.as @@ -54,15 +54,15 @@ package org.bigbluebutton.modules.polling.service private function generatePollId():String { - var curPres:Presentation = PresentationModel.getInstance().getCurrentPresentation(); - if (curPres != null) { - var date:Date = new Date(); - - var pollId:String; - pollId = curPres.id + "/" + curPres.getCurrentPage().num + "/" + date.time; - - return pollId; - } +// var curPres:Presentation = PresentationModel.getInstance().getCurrentPresentation(); +// if (curPres != null) { +// var date:Date = new Date(); +// +// var pollId:String; +// pollId = curPres.id + "/" + curPres.getCurrentPage().num + "/" + date.time; +// +// return pollId; +// } return null; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/QuickPollButton.as b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/QuickPollButton.as index 8c3515408d..a608823bd2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/QuickPollButton.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/QuickPollButton.as @@ -17,8 +17,8 @@ package org.bigbluebutton.modules.polling.views { override public function set visible(vsb:Boolean):void { if (vsb) { // This button should only be visible when there is a polling at the current slide's text - var page:Page = PresentationModel.getInstance().getCurrentPage(); - super.visible = page != null ? parseSlideText(page.txtData) : false; +// var page:Page = PresentationModel.getInstance().getCurrentPage(); +// super.visible = page != null ? parseSlideText(page.txtData) : false; } else { super.visible = false; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/FileUploadService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/FileUploadService.as index 8d2e7dd897..08a3e606b0 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/FileUploadService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/FileUploadService.as @@ -71,9 +71,10 @@ package org.bigbluebutton.modules.present.business * @param file - The FileReference class of the file we wish to send * */ - public function upload(presentationName:String, file:FileReference, downloadable:Boolean):void { + public function upload(podId: String, presentationName:String, file:FileReference, downloadable:Boolean):void { sendVars.presentation_name = presentationName; sendVars.is_downloadable = downloadable; + sendVars.pod_id = podId; var fileToUpload : FileReference = new FileReference(); fileToUpload = file; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as index d8c892428a..a5b12ca9e8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as @@ -42,18 +42,22 @@ package org.bigbluebutton.modules.present.business import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail; import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent; import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; + import org.bigbluebutton.modules.present.events.RequestPresentationInfoPodEvent; + import org.bigbluebutton.modules.present.events.RequestAllPodsEvent; import org.bigbluebutton.modules.present.managers.PresentationSlides; import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.Presentation; + import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.modules.present.model.PresentationModel; import org.bigbluebutton.modules.present.services.PresentationService; import org.bigbluebutton.modules.present.services.messages.PageChangeVO; import org.bigbluebutton.modules.present.services.messaging.MessageReceiver; import org.bigbluebutton.modules.present.services.messaging.MessageSender; + import org.bigbluebutton.main.api.JSLog; public class PresentProxy { private static const LOGGER:ILogger = getClassLogger(PresentProxy); - + private var host:String; private var conference:String; private var room:String; @@ -61,29 +65,36 @@ package org.bigbluebutton.modules.present.business private var uploadService:FileUploadService; private var slides:PresentationSlides; private var sender:MessageSender; - private var _messageReceiver:MessageReceiver; - - private var presentationModel:PresentationModel; - private var service: PresentationService; - private var currentUploadCommand: UploadFileCommand; + private var _messageReceiver:MessageReceiver; + private var podManager: PresentationPodManager; + private var service: PresentationService; + private var currentUploadCommand: UploadFileCommand; + public function PresentProxy() { - presentationModel = PresentationModel.getInstance(); - + JSLog.warn("+++ PresentProxy:: constructor: ", {}); + + podManager = PresentationPodManager.getInstance(); + slides = new PresentationSlides(); - sender = new MessageSender(); - service = new PresentationService(); + sender = new MessageSender(); + service = new PresentationService(); } - - public function getCurrentPresentationInfo():void { - sender.getPresentationInfo(); - } - - public function connect(e:PresentModuleEvent):void{ - extractAttributes(e.data); - sender.getPresentationInfo(); + + public function getCurrentPresentationInfo():void { + podManager.requestAllPodsPresentationInfo(); } - + + public function handleRequestAllPodsEvent(e: RequestAllPodsEvent):void { + sender.requestAllPodsEvent(); + } + + public function connect(e:PresentModuleEvent):void { + extractAttributes(e.data); + + podManager.requestAllPodsPresentationInfo(); // Instead of sender.getPresentationInfo(); + } + private function extractAttributes(a:Object):void{ host = a.host as String; conference = a.conference as String; @@ -105,42 +116,49 @@ package org.bigbluebutton.modules.present.business var dispatcher:Dispatcher = new Dispatcher(); dispatcher.dispatchEvent(new GetListOfPresentationsReply(idAndName)); } + + private function handleRequestPresentationInfoPodEvent(e: RequestPresentationInfoPodEvent): void { + sender.getPresentationInfo(e.podId); + } public function handleChangePresentationCommand(cmd:ChangePresentationCommand):void { - var pres:Presentation = PresentationModel.getInstance().getPresentation(cmd.presId); - if (pres != null) { - sender.sharePresentation(pres.id); - } +// var pres:Presentation = PresentationModel.getInstance().getPresentation(cmd.presId); +// JSLog.warn("+++ PresentProxy:: sharePresentation2: " + pres.id, {}); +// +// +// if (pres != null) { +// sender.sharePresentation(pres.id); +// } } public function handleGoToPageCommand(cmd:GoToPageCommand):void { - var pageChangeVO:PageChangeVO = PresentationModel.getInstance().getSpecificPageIds(cmd.pageId); - if (pageChangeVO != null) { - LOGGER.debug("Going to page[{0}] from presentation[{1}]", [pageChangeVO.pageId, pageChangeVO.presentationId]); - sender.goToPage(pageChangeVO.presentationId, pageChangeVO.pageId); - } else { - LOGGER.debug("Could not go to selected page. Might not exist or is already current"); - } +// var pageChangeVO:PageChangeVO = PresentationModel.getInstance().getSpecificPageIds(cmd.pageId); +// if (pageChangeVO != null) { +// LOGGER.debug("Going to page[{0}] from presentation[{1}]", [pageChangeVO.pageId, pageChangeVO.presentationId]); +// sender.goToPage(pageChangeVO.presentationId, pageChangeVO.pageId); +// } else { +// LOGGER.debug("Could not go to selected page. Might not exist or is already current"); +// } } public function handleGoToPreviousPageCommand(cmd:GoToPrevPageCommand):void { - var pageChangeVO:PageChangeVO = PresentationModel.getInstance().getPrevPageIds(); - if (pageChangeVO != null) { - LOGGER.debug("Going to prev page[{0}] from presentation[{1}]", [pageChangeVO.pageId, pageChangeVO.presentationId]); - sender.goToPage(pageChangeVO.presentationId, pageChangeVO.pageId); - } else { - LOGGER.debug("Could not find previous page to change to"); - } +// var pageChangeVO:PageChangeVO = PresentationModel.getInstance().getPrevPageIds(); +// if (pageChangeVO != null) { +// LOGGER.debug("Going to prev page[{0}] from presentation[{1}]", [pageChangeVO.pageId, pageChangeVO.presentationId]); +// sender.goToPage(pageChangeVO.presentationId, pageChangeVO.pageId); +// } else { +// LOGGER.debug("Could not find previous page to change to"); +// } } public function handleGoToNextPageCommand(cmd:GoToNextPageCommand):void { - var pageChangeVO:PageChangeVO = PresentationModel.getInstance().getNextPageIds(); - if (pageChangeVO != null) { - LOGGER.debug("Going to prev page[{0}] from presentation[{1}]", [pageChangeVO.pageId, pageChangeVO.presentationId]); - sender.goToPage(pageChangeVO.presentationId, pageChangeVO.pageId); - } else { - LOGGER.debug("Could not find previous page to change to"); - } +// var pageChangeVO:PageChangeVO = PresentationModel.getInstance().getNextPageIds(); +// if (pageChangeVO != null) { +// LOGGER.debug("Going to prev page[{0}] from presentation[{1}]", [pageChangeVO.pageId, pageChangeVO.presentationId]); +// sender.goToPage(pageChangeVO.presentationId, pageChangeVO.pageId); +// } else { +// LOGGER.debug("Could not find previous page to change to"); +// } } /** @@ -156,7 +174,7 @@ package org.bigbluebutton.modules.present.business } if (currentUploadCommand != null && currentUploadCommand.filename == e.filename) { - uploadService.upload(currentUploadCommand.filename, currentUploadCommand.file, currentUploadCommand.isDownloadable); + uploadService.upload(currentUploadCommand.podId, currentUploadCommand.filename, currentUploadCommand.file, currentUploadCommand.isDownloadable); currentUploadCommand = null; } else { @@ -184,7 +202,7 @@ package org.bigbluebutton.modules.present.business */ public function requestUploadToken(e:UploadFileCommand):void{ currentUploadCommand = e; - sender.requestPresentationUploadPermission("todo-podId", e.filename); + sender.requestPresentationUploadPermission(e.podId, e.filename); } /** @@ -224,6 +242,8 @@ package org.bigbluebutton.modules.present.business * */ public function sharePresentation(e:PresenterCommands):void{ + JSLog.warn("+++ PresentProxy:: sharePresentation1: " + e.presentationName, {}); + JSLog.warn("+++ PresentProxy:: sharePresentation2: " + e.podId, {}); sender.sharePresentation(e.presentationName); } @@ -237,12 +257,12 @@ package org.bigbluebutton.modules.present.business * */ public function zoomSlide(e:PresenterCommands):void{ - var currentPresentation:Presentation = PresentationModel.getInstance().getCurrentPresentation(); - if (currentPresentation == null) return; - - var currentPage:Page = PresentationModel.getInstance().getCurrentPage(); - - sender.move(currentPresentation.id, currentPage.id, e.xOffset, e.yOffset, e.slideToCanvasWidthRatio, e.slideToCanvasHeightRatio); +// var currentPresentation:Presentation = PresentationModel.getInstance().getCurrentPresentation(); +// if (currentPresentation == null) return; +// +// var currentPage:Page = PresentationModel.getInstance().getCurrentPage(); +// +// sender.move(currentPresentation.id, currentPage.id, e.xOffset, e.yOffset, e.slideToCanvasWidthRatio, e.slideToCanvasHeightRatio); } /** diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/UploadFileCommand.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/UploadFileCommand.as index 55b3771f71..a81cbbe404 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/UploadFileCommand.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/UploadFileCommand.as @@ -10,6 +10,7 @@ package org.bigbluebutton.modules.present.commands public var filename:String; public var file:FileReference; public var isDownloadable:Boolean; + public var podId: String; public function UploadFileCommand() { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresenterCommands.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresenterCommands.as index 695ecd98de..928a0c2e9c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresenterCommands.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresenterCommands.as @@ -45,6 +45,7 @@ package org.bigbluebutton.modules.present.events //Parameters for the share event public var presentationName:String; + public var podId: String; public function PresenterCommands(type:String, slideNumber:Number = 0) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestAllPodsEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestAllPodsEvent.as new file mode 100644 index 0000000000..c4c1d6bec6 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestAllPodsEvent.as @@ -0,0 +1,34 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +package org.bigbluebutton.modules.present.events +{ + + import flash.events.Event; + import flash.net.FileReference; + + public class RequestAllPodsEvent extends Event { + public static const REQUEST_ALL_PODS:String = "REQUEST_ALL_PODS"; + + public function RequestAllPodsEvent(type:String) { + super(type, true, false); + } + + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestPresentationInfoPodEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestPresentationInfoPodEvent.as new file mode 100644 index 0000000000..97f5c4a85f --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestPresentationInfoPodEvent.as @@ -0,0 +1,36 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +package org.bigbluebutton.modules.present.events +{ + + import flash.events.Event; + import flash.net.FileReference; + + public class RequestPresentationInfoPodEvent extends Event { + public static const REQUEST_PRES_INFO:String = "REQUEST_PRES_INFO"; + + public var podId: String; + + public function RequestPresentationInfoPodEvent(type:String) { + super(type, true, false); + } + + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/UploadEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/UploadEvent.as index c14fc9d2ef..7f993fa8c0 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/UploadEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/UploadEvent.as @@ -36,6 +36,7 @@ package org.bigbluebutton.modules.present.events public var percentageComplete:Number; public var maximumSupportedNumberOfSlides:int; public var maxFileSize:Number; + public var podId:String; public function UploadEvent(type:String) { super(type, true, false); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as index 0a317586bd..da02cb828d 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as @@ -36,7 +36,9 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; import org.bigbluebutton.modules.present.events.PresentationPodRemoved; + import org.bigbluebutton.modules.present.events.RequestAllPodsEvent; import org.bigbluebutton.modules.present.model.PresentOptions; + import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.modules.present.ui.views.FileDownloadWindow; import org.bigbluebutton.modules.present.ui.views.FileUploadWindow; import org.bigbluebutton.modules.present.ui.views.PresentationWindow; @@ -57,16 +59,14 @@ package org.bigbluebutton.modules.present.managers return; } - var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD); - event.requesterId = UsersUtil.getMyUserID(); + var event:RequestAllPodsEvent = new RequestAllPodsEvent(RequestAllPodsEvent.REQUEST_ALL_PODS); globalDispatcher.dispatchEvent(event); } public function handleAddPresentationPod(e: NewPresentationPodCreated): void { -// JSLog.warn("+++ PresentManager::handleAddPresentationPod " + e.podId, {}); - var podId: String = e.podId; var ownerId: String = e.ownerId; + if(!windows.hasOwnProperty(podId)) { var newWindow:PresentationWindow = new PresentationWindow(); newWindow.onPodCreated(podId, ownerId); @@ -80,15 +80,20 @@ package org.bigbluebutton.modules.present.managers var openEvent:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT); openEvent.window = newWindow; + JSLog.warn("+++ PresentManager::handleAddPresentationPod openWindow req: " + podId, {}); globalDispatcher.dispatchEvent(openEvent); + + PresentationPodManager.getInstance().handleAddPresentationPod(podId, ownerId); // GOOD } } public function handlePresentationPodRemoved(e: PresentationPodRemoved): void { var podId: String = e.podId; var ownerId: String = e.ownerId; - - var destroyWindow:PresentationWindow = windows[podId]; + + PresentationPodManager.getInstance().handlePresentationPodRemoved(podId, ownerId); // GOOD + + var destroyWindow:PresentationWindow = windows[podId]; if (destroyWindow != null) { var closeEvent:CloseWindowEvent = new CloseWindowEvent(CloseWindowEvent.CLOSE_WINDOW_EVENT); closeEvent.window = destroyWindow; @@ -97,16 +102,22 @@ package org.bigbluebutton.modules.present.managers delete windows[podId]; } } + public function handleStopModuleEvent():void{ for (var key: String in windows) { windows[key].close(); } } - public function handleOpenUploadWindow(e:UploadEvent):void{ + + + public function handleOpenUploadWindow(e:UploadEvent):void { var uploadWindow : FileUploadWindow = PopUpUtil.createModalPopUp(FlexGlobals.topLevelApplication as DisplayObject, FileUploadWindow, false) as FileUploadWindow; if (uploadWindow) { + import org.bigbluebutton.main.api.JSLog; + JSLog.warn("+++ PresentManager:: handleOpenUploadWindow: " + e.podId, {}); uploadWindow.maxFileSize = e.maxFileSize; + uploadWindow.podId = e.podId; var point1:Point = new Point(); point1.x = FlexGlobals.topLevelApplication.width / 2; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml index df88592ca1..a7df59a3f2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml @@ -44,7 +44,10 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent; import org.bigbluebutton.modules.present.events.PresentationPodRemoved; + import org.bigbluebutton.modules.present.events.RequestPresentationInfoPodEvent; + import org.bigbluebutton.modules.present.events.RequestAllPodsEvent; import org.bigbluebutton.modules.present.managers.PresentManager; + import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.modules.present.services.PageLoaderService; ]]> @@ -57,8 +60,8 @@ with BigBlueButton; if not, see . - - + + @@ -161,5 +164,14 @@ with BigBlueButton; if not, see . + + + + + + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Presentation.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Presentation.as index 9b61b25679..bbe1889089 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Presentation.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Presentation.as @@ -19,7 +19,7 @@ package org.bigbluebutton.modules.present.model _id = id; _name = name; _current = current; - _pages = pages + _pages = pages; _downloadable = downloadable; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as index 6edcf85ab8..895c02f21f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as @@ -5,40 +5,48 @@ package org.bigbluebutton.modules.present.model import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.modules.present.services.messages.PageChangeVO; + import org.bigbluebutton.main.api.JSLog; public class PresentationModel { private static const LOGGER:ILogger = getClassLogger(PresentationModel); - private static var instance:PresentationModel = null; +// private static var instance:PresentationModel = null; private var _presentations:ArrayCollection = new ArrayCollection(); + private var _podId: String = ""; // TODO make this private + private var _ownerId: String = ""; /** * This class is a singleton. Please initialize it using the getInstance() method. * */ - public function PresentationModel(enforcer:SingletonEnforcer) { - if (enforcer == null){ - throw new Error("There can only be 1 PresentationModel instance"); - } - initialize(); - } - - private function initialize():void { + public function PresentationModel(podId: String, ownerId: String) { + initialize(podId, ownerId); } - /** - * Return the single instance of the PresentationModel class - */ + private function initialize(podId: String, ownerId: String):void { + _podId = podId; + _ownerId = ownerId; + JSLog.warn("+++ PresentationModel:: initialize2: " + _podId + " " + _ownerId, {}); + } + +// /** +// * Return the single instance of the PresentationModel class +// */ public static function getInstance():PresentationModel{ - if (instance == null){ - instance = new PresentationModel(new SingletonEnforcer()); - } - return instance; +// if (instance == null){ +// instance = new PresentationModel(); +// } +// return instance; + return null; } + public function getPodId(): String { + return _podId; + } + public function addPresentation(p: Presentation):void { _presentations.addItem(p); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as new file mode 100644 index 0000000000..0939ce900b --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as @@ -0,0 +1,133 @@ +package org.bigbluebutton.modules.present.model { + import mx.collections.ArrayCollection; + + import org.as3commons.logging.api.ILogger; + import org.as3commons.logging.api.getClassLogger; + import org.bigbluebutton.modules.present.services.messages.PageChangeVO; + import org.bigbluebutton.modules.present.model.PresentationModel; + import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; + import com.asfusion.mate.events.Dispatcher; + import org.bigbluebutton.core.UsersUtil; + + + import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; + import org.bigbluebutton.modules.present.events.PresentationPodRemoved; + import org.bigbluebutton.modules.present.events.RequestPresentationInfoPodEvent; + + import org.bigbluebutton.main.api.JSLog; + + public class PresentationPodManager { + private static const LOGGER:ILogger = getClassLogger(PresentationPodManager); + + private static var instance:PresentationPodManager = null; + + private var _presentationPods: ArrayCollection = new ArrayCollection(); + private var globalDispatcher:Dispatcher; + + + /** + * This class is a singleton. Please initialize it using the getInstance() method. + * + */ + public function PresentationPodManager(enforcer:SingletonEnforcer) { + if (enforcer == null) { + throw new Error("There can only be 1 PresentationPodManager instance"); + } + globalDispatcher = new Dispatcher(); + + initialize(); + } + + private function initialize():void { + JSLog.warn("+++ PresentationPodManager:: initialize: ", {}); + } + + /** + * Return the single instance of the PresentationPodManager class + */ + public static function getInstance():PresentationPodManager { + if (instance == null) { + instance = new PresentationPodManager(new SingletonEnforcer()); + instance.requestDefaultPresentationPod(); + } + + return instance; + } + + public function requestDefaultPresentationPod(): void { + JSLog.warn("+++ PresentationPodManager::requestDefaultPresentationPod ", {}); + + var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD); + event.requesterId = UsersUtil.getMyUserID(); + globalDispatcher.dispatchEvent(event); + } + + public function getPod(podId: String): PresentationModel { +// return _presentationPods[podId]; + + var resultingPod: PresentationModel = getFirstPod(); // TODO + for (var i:int = 0; i < _presentationPods.length; i++) { + var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; + JSLog.warn("+++ PresentationPodManager:: getPod for podId=" + podId + " " + pod.getPodId(), {}); + + if (pod.getPodId() == podId) { + JSLog.warn("+++ PresentationPodManager:: getPod SUCCESS for podId=" + podId , {}); + return pod; + } + } + JSLog.warn("+++ PresentationPodManager:: getPod FAIL for podId=" + podId , {}); + return resultingPod; + } + + + public function getFirstPod(): PresentationModel { + JSLog.warn("+++ PresentationPodManager:: getFirstPod size=" + _presentationPods.length, {}); + return _presentationPods.getItemAt(0) as PresentationModel; + } + + public function handleAddPresentationPod(podId: String, ownerId: String): void { + for (var i:int = 0; i < _presentationPods.length; i++) { + var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; + if (pod.getPodId() == podId) { + JSLog.warn("+++ (DUPLICATE FOUND) PresentationPodManager::handleAddPresentationPod " + podId, {}); + return; + } + } + + var newPod: PresentationModel = new PresentationModel(podId, ownerId); + _presentationPods.addItem(newPod); + JSLog.warn("+++ after (SUCCESS) PresentationPodManager::handleAddPresentationPod " + podId + " size=" + _presentationPods.length, {}); + } + + public function handlePresentationPodRemoved(podId: String, ownerId: String): void { + JSLog.warn("+++ PresentationPodManager::handlePresentationPodRemoved " + podId, {}); + + for (var i:int = 0; i < _presentationPods.length; i++) { + var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; + JSLog.warn("+++ PresentationPodManager:: remove for podId=" + podId + " final size= " + _presentationPods.length, {}); + + if (pod.getPodId() == podId) { + _presentationPods.removeItemAt(i); + JSLog.warn("+++ (SUCCESS) PresentationPodManager:: remove for podId=" + podId + " final size= " + _presentationPods.length, {}); + return; + } + } + JSLog.warn("+++ (FAIL) PresentationPodManager:: remove for podId=" + podId + " final size= " + _presentationPods.length, {}); + + } + + public function requestAllPodsPresentationInfo(): void { + JSLog.warn("+++ PresentationPodManager:: requestAllPodsPresentationInfo" + _presentationPods.length, {}); + for (var i:int = 0; i < _presentationPods.length; i++) { + var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; + + var event:RequestPresentationInfoPodEvent = new RequestPresentationInfoPodEvent(RequestPresentationInfoPodEvent.REQUEST_PRES_INFO); + event.podId = pod.getPodId(); + globalDispatcher.dispatchEvent(event); + } + } + + } +} + +class SingletonEnforcer{} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as index e0d6536f7f..b6f9148fff 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as @@ -15,32 +15,32 @@ package org.bigbluebutton.modules.present.services private var dispatcher:Dispatcher = new Dispatcher(); public function loadPage(cmd: ChangePageCommand):void { - var page:Page = PresentationModel.getInstance().getPage(cmd.pageId); - if (page != null) { - LOGGER.debug("Loading page [{0}]", [cmd.pageId]); - page.loadPage(pageLoadedListener, cmd.preloadCount); - } +// var page:Page = PresentationModel.getInstance().getPage(cmd.pageId); +// if (page != null) { +// LOGGER.debug("Loading page [{0}]", [cmd.pageId]); +// page.loadPage(pageLoadedListener, cmd.preloadCount); +// } } public function pageLoadedListener(pageId:String, preloadCount:uint):void { - var page: Page = PresentationModel.getInstance().getPage(pageId); - if (page != null) { - if (page.current) { - // The page has been loaded and still the current displayed page. - LOGGER.debug("Loaded page [{0}]. Dispatching event to display it.", [pageId]); - var event: PageLoadedEvent = new PageLoadedEvent(page.id); - dispatcher.dispatchEvent(event); - } - - if (preloadCount > 0) { - var pageIdParts:Array = pageId.split("/"); - LOGGER.debug("after split: {0}", [pageIdParts]); - LOGGER.debug("trying to preload next page with id: {0}", [(parseInt(pageIdParts[1],10) + 1).toString()]); - var changePageCommand: ChangePageCommand = new ChangePageCommand(pageIdParts[0]+"/"+(parseInt(pageIdParts[1], 10) + 1), preloadCount-1); - dispatcher.dispatchEvent(changePageCommand); - } - } +// var page: Page = PresentationModel.getInstance().getPage(pageId); +// if (page != null) { +// if (page.current) { +// // The page has been loaded and still the current displayed page. +// LOGGER.debug("Loaded page [{0}]. Dispatching event to display it.", [pageId]); +// var event: PageLoadedEvent = new PageLoadedEvent(page.id); +// dispatcher.dispatchEvent(event); +// } +// +// if (preloadCount > 0) { +// var pageIdParts:Array = pageId.split("/"); +// LOGGER.debug("after split: {0}", [pageIdParts]); +// LOGGER.debug("trying to preload next page with id: {0}", [(parseInt(pageIdParts[1],10) + 1).toString()]); +// var changePageCommand: ChangePageCommand = new ChangePageCommand(pageIdParts[0]+"/"+(parseInt(pageIdParts[1], 10) + 1), preloadCount-1); +// dispatcher.dispatchEvent(changePageCommand); +// } +// } } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as index 3ff41d7ecd..4d6b69baef 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as @@ -14,6 +14,7 @@ package org.bigbluebutton.modules.present.services import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.Presentation; import org.bigbluebutton.modules.present.model.PresentationModel; + import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.modules.present.services.messages.PageVO; import org.bigbluebutton.modules.present.services.messages.PresentationVO; import org.bigbluebutton.modules.present.services.messaging.MessageReceiver; @@ -24,27 +25,29 @@ package org.bigbluebutton.modules.present.services private static const LOGGER:ILogger = getClassLogger(PresentationService); private static const NUM_PRELOAD:uint = 3; private var model:PresentationModel; + private var podManager: PresentationPodManager; private var sender:MessageSender; private var receiver:MessageReceiver; private var dispatcher:Dispatcher; public function PresentationService() { model = PresentationModel.getInstance(); + podManager = PresentationPodManager.getInstance(); receiver = new MessageReceiver(this); dispatcher = new Dispatcher(); } public function pageChanged(pageId:String):void { - var np: Page = model.getPage(pageId); - if (np != null) { - var oldPage: Page = PresentationModel.getInstance().getCurrentPage(); - if (oldPage != null) oldPage.current = false; - - np.current = true -// trace(LOG + "Sending page changed event. page [" + np.id + "] oldpage current=[" + oldPage.current + "] newPage current=[" + np.current + "]"); - var changePageCommand: ChangePageCommand = new ChangePageCommand(np.id, NUM_PRELOAD); - dispatcher.dispatchEvent(changePageCommand); - } +// var np: Page = model.getPage(pageId); +// if (np != null) { +// var oldPage: Page = PresentationModel.getInstance().getCurrentPage(); +// if (oldPage != null) oldPage.current = false; +// +// np.current = true +//// trace(LOG + "Sending page changed event. page [" + np.id + "] oldpage current=[" + oldPage.current + "] newPage current=[" + np.current + "]"); +// var changePageCommand: ChangePageCommand = new ChangePageCommand(np.id, NUM_PRELOAD); +// dispatcher.dispatchEvent(changePageCommand); +// } } public function pageMoved(pageId:String, xOffset:Number, yOffset:Number, widthRatio:Number, heightRatio:Number):void { @@ -68,16 +71,16 @@ package org.bigbluebutton.modules.present.services return page; } - public function addPresentations(presos:ArrayCollection):void { + public function addPresentations(podId: String, presos:ArrayCollection):void { for (var i:int = 0; i < presos.length; i++) { var pres:PresentationVO = presos.getItemAt(i) as PresentationVO; - addPresentation(pres); + addPresentation(podId, pres); } } - public function addPresentation(pres:PresentationVO):void { + public function addPresentation(podId: String, pres:PresentationVO):void { var presentation:Presentation = presentationVOToPresentation(pres); - model.addPresentation(presentation); + podManager.getPod(podId).addPresentation(presentation); LOGGER.debug("Added new presentation [{0}]", [presentation.id]); if (presentation.current) { @@ -112,29 +115,29 @@ package org.bigbluebutton.modules.present.services public function changeCurrentPresentation(presentationId:String):void { // We've switched presentations. Mark the old presentation as not current. - var curPres:Presentation = PresentationModel.getInstance().getCurrentPresentation(); - if (curPres != null) { - curPres.current = false; - } else { - LOGGER.debug("No previous active presentation."); - } - - var newPres:Presentation = PresentationModel.getInstance().getPresentation(presentationId); - if (newPres != null) { - LOGGER.debug("Making presentation [{0}] the active presentation.", [presentationId]); - newPres.current = true; - - var event: PresentationChangedEvent = new PresentationChangedEvent(presentationId); - dispatcher.dispatchEvent(event); - - var curPage:Page = PresentationModel.getInstance().getCurrentPage(); - if (curPage != null) { - var changePageCommand: ChangePageCommand = new ChangePageCommand(curPage.id, NUM_PRELOAD); - dispatcher.dispatchEvent(changePageCommand); - } - } else { - LOGGER.debug("Could not find presentation to make current. id="+presentationId); - } +// var curPres:Presentation = PresentationModel.getInstance().getCurrentPresentation(); +// if (curPres != null) { +// curPres.current = false; +// } else { +// LOGGER.debug("No previous active presentation."); +// } +// +// var newPres:Presentation = PresentationModel.getInstance().getPresentation(presentationId); +// if (newPres != null) { +// LOGGER.debug("Making presentation [{0}] the active presentation.", [presentationId]); +// newPres.current = true; +// +// var event: PresentationChangedEvent = new PresentationChangedEvent(presentationId); +// dispatcher.dispatchEvent(event); +// +// var curPage:Page = PresentationModel.getInstance().getCurrentPage(); +// if (curPage != null) { +// var changePageCommand: ChangePageCommand = new ChangePageCommand(curPage.id, NUM_PRELOAD); +// dispatcher.dispatchEvent(changePageCommand); +// } +// } else { +// LOGGER.debug("Could not find presentation to make current. id="+presentationId); +// } } public function removeAllPresentations():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as index 03328d90e6..4824551c38 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as @@ -61,7 +61,19 @@ package org.bigbluebutton.modules.present.services.messaging public function onMessage(messageName:String, message:Object):void { //LOGGER.info("Presentation: received message " + messageName); - JSLog.warn("____Presentation received: " + messageName, message); + if (messageName == "ResizeAndMovePageEvtMsg" || + messageName == "SendCursorPositionEvtMsg" || + messageName == "GetWhiteboardAccessRespMsg" || + messageName == "GetSharedNotesEvtMsg" || + messageName == "SendCaptionHistoryRespMsg" || + messageName == "GetGroupChatMsgsRespMsg" || + messageName == "DoLatencyTracerMsg" || + messageName == "ServerToClientLatencyTracerMsg") { + + } else { + JSLog.warn("____Presentation received: " + messageName, message); + } + switch (messageName) { case "SetCurrentPageEvtMsg": @@ -164,6 +176,12 @@ package org.bigbluebutton.modules.present.services.messaging } private function handleSetCurrentPresentationEvtMsg(msg:Object):void { + + + + + + service.changeCurrentPresentation(msg.body.presentationId); } @@ -173,8 +191,9 @@ package org.bigbluebutton.modules.present.services.messaging private function handlePresentationConversionCompletedEvtMsg(msg:Object):void { var presVO: PresentationVO = processUploadedPresentation(msg.body.presentation); + var podId: String = msg.body.podId as String; - service.addPresentation(presVO); + service.addPresentation(podId, presVO); var uploadEvent:ConversionCompletedEvent = new ConversionCompletedEvent(presVO.id, presVO.name); dispatcher.dispatchEvent(uploadEvent); @@ -243,7 +262,7 @@ package org.bigbluebutton.modules.present.services.messaging } service.removeAllPresentations(); - service.addPresentations(presos); +// service.addPresentations(presos, podId); // TODO -- are they all on the same pod? } private function handlePresentationUploadTokenPassRespMsg(msg:Object):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as index 7c8817457c..d183f99dc8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as @@ -75,10 +75,12 @@ package org.bigbluebutton.modules.present.services.messaging ); } - public function getPresentationInfo():void { + public function getPresentationInfo(podId: String):void { + JSLog.warn("sender: getPresentationInfo " + podId, {}); + var message:Object = { header: {name: "GetPresentationInfoReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, - body: {userId: UsersUtil.getMyUserID()} + body: {userId: UsersUtil.getMyUserID(), podId: podId} }; var _nc:ConnectionManager = BBB.initConnectionManager(); @@ -88,7 +90,23 @@ package org.bigbluebutton.modules.present.services.messaging JSON.stringify(message) ); } - + + public function requestAllPodsEvent():void { + JSLog.warn("sender: requestAllPodsEvent ", {}); + + var message:Object = { + header: {name: "GetAllPresentationPodsReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, + body: {requesterId: UsersUtil.getMyUserID()} + }; + + var _nc:ConnectionManager = BBB.initConnectionManager(); + _nc.sendMessage2x( + function(result:String):void { }, + function(status:String):void { LOGGER.error(status); }, + JSON.stringify(message) + ); + } + public function removePresentation(presentationId:String):void { var message:Object = { header: {name: "RemovePresentationPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileDownloadWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileDownloadWindow.mxml index 4544f32ad8..4eb3924045 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileDownloadWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileDownloadWindow.mxml @@ -50,7 +50,7 @@ with BigBlueButton; if not, see . } private function initData():void { - downloadablePresentations = PresentationModel.getInstance().getDownloadablePresentations(); +// downloadablePresentations = PresentationModel.getInstance().getDownloadablePresentations(); } private function onCancelClicked():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml index eb4bc263ea..6b65f9adaf 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml @@ -91,15 +91,17 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.model.PresentOptions; import org.bigbluebutton.modules.present.model.Presentation; import org.bigbluebutton.modules.present.model.PresentationModel; + import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.util.i18n.ResourceUtil; use namespace mx_internal; private static const LOGGER:ILogger = getClassLogger(FileUploadWindow); - - [Bindable] private var presentationNamesAC:ArrayCollection; - [BIndable] public var maxFileSize:Number; - + + [Bindable] private var presentationNamesAC:ArrayCollection; + [Bindable] public var maxFileSize:Number; + [Bindable] public var podId:String; + private var dispatcher:Dispatcher; private var thumbnailTimer:Timer = new Timer(5000); @@ -130,7 +132,8 @@ with BigBlueButton; if not, see . private function initData():void { presentOptions = Options.getOptions(PresentOptions) as PresentOptions; - presentationNamesAC = PresentationModel.getInstance().getPresentations(); + + presentationNamesAC = PresentationPodManager.getInstance().getPod(podId).getPresentations(); // GOOD if (presentationNamesAC.length <= 0) { selectFile(); } @@ -218,6 +221,11 @@ with BigBlueButton; if not, see . uploadCmd.filename = presentationName; uploadCmd.file = fileToUpload; uploadCmd.isDownloadable = isDownloadable; + uploadCmd.podId = podId; + + import org.bigbluebutton.main.api.JSLog; + JSLog.warn("+++ FileUploadWindow:: startUpload: " + podId, {}); + globalDispatch.dispatchEvent(uploadCmd); letUserDownload.visible = false; } @@ -368,7 +376,7 @@ with BigBlueButton; if not, see . - + . import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.PresentOptions; import org.bigbluebutton.modules.present.model.PresentationModel; + import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.modules.whiteboard.events.RequestNewCanvasEvent; import org.bigbluebutton.modules.whiteboard.views.WhiteboardCanvas; import org.bigbluebutton.modules.whiteboard.views.WhiteboardTextToolbar; @@ -169,6 +170,9 @@ with BigBlueButton; if not, see . this.podId = _podId; this.ownerId = _ownerId; + listOfPodControls.push({label: _podId, + icon: getStyle('iconClearStatus'), handler: setPresenterInPodHandler}); + listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.newPresentationWindowOpen'), icon: getStyle('iconClearStatus'), handler: newPresentationWindowHandler}); @@ -205,6 +209,10 @@ with BigBlueButton; if not, see . localDispatcher.dispatchEvent(event); } + private function setPresenterInPodHandler(): void { + JSLog.warn("+++ setPresenterInPodHandler: ", {}); + } + private function onCreationComplete():void{ //check for the polling module in config.xml var vxml:XML = BBB.getConfigForModule("PollingModule"); @@ -330,14 +338,15 @@ with BigBlueButton; if not, see . slideView.onParentResized(parentWidth, parentHeight); } - private function handleDisplaySlideEvent(event:DisplaySlideEvent):void { - var curPage:Page = PresentationModel.getInstance().getCurrentPage(); - if (curPage != null) { - displaySlideNumber(curPage.num); - currentSlideWidth = event.slideWidth; - currentSlideHeight = event.slideHeight; - fitSlideToWindowMaintainingAspectRatio(); - } + private function handleDisplaySlideEvent(event:DisplaySlideEvent):void { + var presentationModel: PresentationModel = PresentationPodManager.getInstance().getPod(podId); // GOOD + var curPage:Page = presentationModel.getCurrentPage(); + if (curPage != null) { + displaySlideNumber(curPage.num); + currentSlideWidth = event.slideWidth; + currentSlideHeight = event.slideHeight; + fitSlideToWindowMaintainingAspectRatio(); + } } public function getPrefferedPosition():String{ @@ -377,33 +386,33 @@ with BigBlueButton; if not, see . uploadPres.visible = isPresenter; downloadPres.visible = !isPresenter; - var page:Page = PresentationModel.getInstance().getCurrentPage(); - if (page != null) { - displaySlideNumber(page.num); - } - displaySlideNavigationControls(isPresenter, !!page); - - setControlBarState("presenter"); +// var page:Page = PresentationModel.getInstance().getCurrentPage(); +// if (page != null) { +// displaySlideNumber(page.num); +// } +// displaySlideNavigationControls(isPresenter, !!page); +// +// setControlBarState("presenter"); } private function handlePresentationChangedEvent(e:PresentationChangedEvent) : void { - currentPresentation = PresentationModel.getInstance().getCurrentPresentationName(); - - slideView.setSlides(); - slideView.visible = true; - var page : Page = PresentationModel.getInstance().getCurrentPage(); - if (page != null) { - displaySlideNumber(page.num); - } - - if (UsersUtil.amIPresenter()) { - displaySlideNavigationControls(true, !!page); - } - else { - displaySlideNavigationControls(false, !!page) - } - onResetZoom(); - updateDownloadBtn(); +// currentPresentation = PresentationModel.getInstance().getCurrentPresentationName(); +// +// slideView.setSlides(); +// slideView.visible = true; +// var page : Page = PresentationModel.getInstance().getCurrentPage(); +// if (page != null) { +// displaySlideNumber(page.num); +// } +// +// if (UsersUtil.amIPresenter()) { +// displaySlideNavigationControls(true, !!page); +// } +// else { +// displaySlideNavigationControls(false, !!page) +// } +// onResetZoom(); +// updateDownloadBtn(); } @@ -433,8 +442,12 @@ with BigBlueButton; if not, see . } private function notifyOthersOfSharingPresentation(presentationName:String):void { + JSLog.warn("+++ notifyOthersOfSharingPresentation1: " + presentationName, {}); + + var shareEvent:PresenterCommands = new PresenterCommands(PresenterCommands.SHARE_PRESENTATION_COMMAND); shareEvent.presentationName = presentationName; + shareEvent.podId = podId; dispatchEvent(shareEvent); } @@ -459,19 +472,19 @@ with BigBlueButton; if not, see . backButton.styleName = "presentationBackButtonDisabledStyle" + styleNameExt; } - if (pageNumber < PresentationModel.getInstance().getNumberOfPages()) { - forwardButton.mouseEnabled = true; - forwardButton.styleName = "presentationForwardButtonStyle" + styleNameExt; - } else { - forwardButton.mouseEnabled = false; - forwardButton.styleName = "presentationForwardButtonDisabledStyle" + styleNameExt; - } +// if (pageNumber < PresentationModel.getInstance().getNumberOfPages()) { +// forwardButton.mouseEnabled = true; +// forwardButton.styleName = "presentationForwardButtonStyle" + styleNameExt; +// } else { +// forwardButton.mouseEnabled = false; +// forwardButton.styleName = "presentationForwardButtonDisabledStyle" + styleNameExt; +// } } private function displaySlideNumber(currentSlide:int):void { disableSlideNavigationButtons(currentSlide); - btnSlideNum.label = "" + currentSlide + '/' + PresentationModel.getInstance().getNumberOfPages(); - btnSlideNum.accessibilityName = ResourceUtil.getInstance().getString('bbb.presentation.btnSlideNum.accessibilityName', [currentSlide, PresentationModel.getInstance().getNumberOfPages()]) +// btnSlideNum.label = "" + currentSlide + '/' + PresentationModel.getInstance().getNumberOfPages(); +// btnSlideNum.accessibilityName = ResourceUtil.getInstance().getString('bbb.presentation.btnSlideNum.accessibilityName', [currentSlide, PresentationModel.getInstance().getNumberOfPages()]) } @@ -492,15 +505,15 @@ with BigBlueButton; if not, see . } private function goToPreviousSlide():void { - if (PresentationModel.getInstance().getCurrentPage().num > 1) { - dispatchEvent(new GoToPrevPageCommand()); - } +// if (PresentationModel.getInstance().getCurrentPage().num > 1) { +// dispatchEvent(new GoToPrevPageCommand()); +// } } private function goToNextSlide():void { - if (PresentationModel.getInstance().getCurrentPage().num < PresentationModel.getInstance().getNumberOfPages()) { - dispatchEvent(new GoToNextPageCommand()); - } +// if (PresentationModel.getInstance().getCurrentPage().num < PresentationModel.getInstance().getNumberOfPages()) { +// dispatchEvent(new GoToNextPageCommand()); +// } } private function showPercentageInDataTip(val:String):String { @@ -567,7 +580,7 @@ with BigBlueButton; if not, see . private function remoteUpload(e:ShortcutEvent):void{ if (uploadPres.visible){ uploadPres.setFocus(); - openUploadWindow(); + openUploadWindow(podId); } } @@ -616,10 +629,10 @@ with BigBlueButton; if not, see . } private function onUploadButtonClicked():void { - openUploadWindow(); + openUploadWindow(podId); } - private function openUploadWindow():void { + private function openUploadWindow(_podId: String):void { if (presentOptions.openExternalFileUploadDialog) { var fileEvent:UploadEvent = new UploadEvent(UploadEvent.OPEN_EXTERNAL_UPLOAD_WINDOW); fileEvent.maxFileSize = presentOptions.maxFileSize; @@ -628,6 +641,7 @@ with BigBlueButton; if not, see . } else { var event:UploadEvent = new UploadEvent(UploadEvent.OPEN_UPLOAD_WINDOW); event.maxFileSize = presentOptions.maxFileSize; + event.podId = _podId; dispatchEvent(event); } } @@ -650,9 +664,9 @@ with BigBlueButton; if not, see . } private function updateStyles():void { - if (PresentationModel.getInstance().getCurrentPage()) { - disableSlideNavigationButtons(PresentationModel.getInstance().getCurrentPage().num); - } +// if (PresentationModel.getInstance().getCurrentPage()) { +// disableSlideNavigationButtons(PresentationModel.getInstance().getCurrentPage().num); +// } } private function onPollStartButtonClicked():void { @@ -836,14 +850,14 @@ with BigBlueButton; if not, see . return; } - var downloadablePresentations:ArrayCollection = PresentationModel.getInstance().getDownloadablePresentations(); - if (presentOptions.enableDownload && downloadablePresentations.length > 0 && !UsersUtil.amIPresenter()) { - LOGGER.debug("Enabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); - downloadPres.visible = true; - } else { - LOGGER.debug("Disabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); - downloadPres.visible = false; - } +// var downloadablePresentations:ArrayCollection = PresentationModel.getInstance().getDownloadablePresentations(); +// if (presentOptions.enableDownload && downloadablePresentations.length > 0 && !UsersUtil.amIPresenter()) { +// LOGGER.debug("Enabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); +// downloadPres.visible = true; +// } else { +// LOGGER.debug("Disabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); +// downloadPres.visible = false; +// } } public function receiveToolbars(wt:WhiteboardToolbar, wtt:WhiteboardTextToolbar):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml index f3ae9a923d..1d4735f23c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml @@ -113,23 +113,23 @@ with BigBlueButton; if not, see . } public function setSlides():void { - var pres: Presentation = PresentationModel.getInstance().getCurrentPresentation(); - if (pres != null) { - pageCache = pres.getPages(); - /* Create the SortField object for the "num" field in the ArrayCollection object, and make sure we do a numeric sort. */ - var dataSortField:SortField = new SortField(); - dataSortField.name = "num"; - dataSortField.numeric = true; - - /* Create the Sort object and add the SortField object created earlier to the array of fields to sort on. */ - var numericDataSort:Sort = new Sort(); - numericDataSort.fields = [dataSortField]; - - /* Set the ArrayCollection object's sort property to our custom sort, and refresh the ArrayCollection. */ - pageCache.sort = numericDataSort; - pageCache.refresh(); - thumbnailView.dataProvider = pageCache; - } +// var pres: Presentation = PresentationModel.getInstance().getCurrentPresentation(); +// if (pres != null) { +// pageCache = pres.getPages(); +// /* Create the SortField object for the "num" field in the ArrayCollection object, and make sure we do a numeric sort. */ +// var dataSortField:SortField = new SortField(); +// dataSortField.name = "num"; +// dataSortField.numeric = true; +// +// /* Create the Sort object and add the SortField object created earlier to the array of fields to sort on. */ +// var numericDataSort:Sort = new Sort(); +// numericDataSort.fields = [dataSortField]; +// +// /* Set the ArrayCollection object's sort property to our custom sort, and refresh the ArrayCollection. */ +// pageCache.sort = numericDataSort; +// pageCache.refresh(); +// thumbnailView.dataProvider = pageCache; +// } } public function setSelectedSlide(slideNum:int):void { @@ -206,11 +206,11 @@ with BigBlueButton; if not, see . fitSlideToLoader(); notifyOthersOfZoomEvent(); } else { - var page:Page = PresentationModel.getInstance().getCurrentPage(); - if (page != null) { - LOGGER.debug("Parent window has resized. Reposition page [{0}]", [page.id]); - positionPage(page); - } +// var page:Page = PresentationModel.getInstance().getCurrentPage(); +// if (page != null) { +// LOGGER.debug("Parent window has resized. Reposition page [{0}]", [page.id]); +// positionPage(page); +// } } } @@ -288,13 +288,13 @@ with BigBlueButton; if not, see . */ private function handlePageChangedEvent(e:PageChangedEvent):void { LOGGER.debug("Got a page changed event for page [{0}]", [e.pageId]); - var page:Page = PresentationModel.getInstance().getPage(e.pageId); - if (page != null) { - if (! UsersUtil.amIPresenter()) { - // if we are presenter, we don't need to reposition our view of the page - positionPage(page); - } - } +// var page:Page = PresentationModel.getInstance().getPage(e.pageId); +// if (page != null) { +// if (! UsersUtil.amIPresenter()) { +// // if we are presenter, we don't need to reposition our view of the page +// positionPage(page); +// } +// } } private function positionPage(page:Page):void { @@ -315,22 +315,22 @@ with BigBlueButton; if not, see . private function handlePageLoadedEvent(e:PageLoadedEvent):void { LOGGER.debug("Got a page loaded event for page [{0}]", [e.pageId]); - var page:Page = PresentationModel.getInstance().getPage(e.pageId); - if (page != null) { - setSelectedSlide(page.num); - slideLoader.source = page.swfData; - LOGGER.debug("Displaying page [{0}]", [e.pageId]); -// positionPage(page); - if (whiteboardCanvas != null) { - whiteboardCanvas.displayWhiteboardById(page.id); - } - - //slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end"; - slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + - page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); - slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + - page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); - } +// var page:Page = PresentationModel.getInstance().getPage(e.pageId); +// if (page != null) { +// setSelectedSlide(page.num); +// slideLoader.source = page.swfData; +// LOGGER.debug("Displaying page [{0}]", [e.pageId]); +//// positionPage(page); +// if (whiteboardCanvas != null) { +// whiteboardCanvas.displayWhiteboardById(page.id); +// } +// +// //slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end"; +// slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + +// page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); +// slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + +// page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); +// } } private function becomeViewer():void { @@ -392,11 +392,11 @@ with BigBlueButton; if not, see . public function acceptOverlayCanvas(overlay:WhiteboardCanvas):void{ whiteboardCanvas = overlay; - var currPage:Page = PresentationModel.getInstance().getCurrentPage(); - if (currPage != null) { - whiteboardCanvas.displayWhiteboardById(currPage.id); - } - +// var currPage:Page = PresentationModel.getInstance().getCurrentPage(); +// if (currPage != null) { +// whiteboardCanvas.displayWhiteboardById(currPage.id); +// } +// this.addChildAt(whiteboardCanvas, this.getChildIndex(thumbnailView)); fitSlideToLoader(); whiteboardCanvas.addEventListener(MouseEvent.MOUSE_DOWN, handleWhiteboardCanvasClick); @@ -431,7 +431,7 @@ with BigBlueButton; if not, see . } ]]> - + Date: Sat, 30 Sep 2017 08:27:16 -0400 Subject: [PATCH 07/12] add existing pods on join --- .../present/events/GetAllPodsRespEvent.as | 38 +++++++++++++ .../present/managers/PresentManager.as | 23 +++++--- .../modules/present/maps/PresentEventMap.mxml | 5 ++ .../present/model/PresentationModel.as | 4 ++ .../present/model/PresentationPodManager.as | 17 ++++++ .../services/messages/PresentationPodVO.as | 53 +++++++++++++++++++ .../services/messages/PresentationVO.as | 2 +- .../services/messaging/MessageReceiver.as | 42 ++++++++++++++- 8 files changed, 174 insertions(+), 10 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/events/GetAllPodsRespEvent.as create mode 100644 bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationPodVO.as diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/GetAllPodsRespEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/GetAllPodsRespEvent.as new file mode 100644 index 0000000000..655a7680a8 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/GetAllPodsRespEvent.as @@ -0,0 +1,38 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +package org.bigbluebutton.modules.present.events +{ + + import flash.events.Event; + import flash.net.FileReference; + import mx.collections.ArrayCollection; + + + public class GetAllPodsRespEvent extends Event { + public static const GET_ALL_PODS_RESP:String = "GET_ALL_PODS_RESP"; + + public var pods: ArrayCollection; + + public function GetAllPodsRespEvent(type:String) { + super(type, true, false); + } + + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as index da02cb828d..f709889ce4 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as @@ -24,7 +24,8 @@ package org.bigbluebutton.modules.present.managers import flash.geom.Point; import mx.core.FlexGlobals; - + import mx.collections.ArrayCollection; + import org.bigbluebutton.common.IBbbModuleWindow; import org.bigbluebutton.common.events.OpenWindowEvent; import org.bigbluebutton.common.events.CloseWindowEvent; @@ -37,6 +38,7 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; import org.bigbluebutton.modules.present.events.PresentationPodRemoved; import org.bigbluebutton.modules.present.events.RequestAllPodsEvent; + import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent; import org.bigbluebutton.modules.present.model.PresentOptions; import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.modules.present.ui.views.FileDownloadWindow; @@ -49,9 +51,11 @@ package org.bigbluebutton.modules.present.managers { private var globalDispatcher:Dispatcher; private var windows: Array = []; + private var podsManager: PresentationPodManager; public function PresentManager() { globalDispatcher = new Dispatcher(); + podsManager = PresentationPodManager.getInstance(); } public function handleStartModuleEvent(e:PresentModuleEvent):void{ @@ -80,10 +84,10 @@ package org.bigbluebutton.modules.present.managers var openEvent:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT); openEvent.window = newWindow; - JSLog.warn("+++ PresentManager::handleAddPresentationPod openWindow req: " + podId, {}); + JSLog.warn("+++ PresentManager::handleAddPresentationPod openWindow req: " + podId, {}); globalDispatcher.dispatchEvent(openEvent); - PresentationPodManager.getInstance().handleAddPresentationPod(podId, ownerId); // GOOD + podsManager.handleAddPresentationPod(podId, ownerId); // GOOD } } @@ -91,7 +95,7 @@ package org.bigbluebutton.modules.present.managers var podId: String = e.podId; var ownerId: String = e.ownerId; - PresentationPodManager.getInstance().handlePresentationPodRemoved(podId, ownerId); // GOOD + podsManager.handlePresentationPodRemoved(podId, ownerId); // GOOD var destroyWindow:PresentationWindow = windows[podId]; if (destroyWindow != null) { @@ -103,6 +107,11 @@ package org.bigbluebutton.modules.present.managers } } + public function handleGetAllPodsRespEvent(e: GetAllPodsRespEvent): void { + var podsAC:ArrayCollection = e.pods as ArrayCollection; + podsManager.handleGetAllPodsResp(podsAC); + } + public function handleStopModuleEvent():void{ for (var key: String in windows) { windows[key].close(); @@ -114,14 +123,14 @@ package org.bigbluebutton.modules.present.managers public function handleOpenUploadWindow(e:UploadEvent):void { var uploadWindow : FileUploadWindow = PopUpUtil.createModalPopUp(FlexGlobals.topLevelApplication as DisplayObject, FileUploadWindow, false) as FileUploadWindow; if (uploadWindow) { - import org.bigbluebutton.main.api.JSLog; - JSLog.warn("+++ PresentManager:: handleOpenUploadWindow: " + e.podId, {}); + import org.bigbluebutton.main.api.JSLog; + JSLog.warn("+++ PresentManager:: handleOpenUploadWindow: " + e.podId, {}); uploadWindow.maxFileSize = e.maxFileSize; uploadWindow.podId = e.podId; var point1:Point = new Point(); point1.x = FlexGlobals.topLevelApplication.width / 2; - point1.y = FlexGlobals.topLevelApplication.height / 2; + point1.y = FlexGlobals.topLevelApplication.height / 2; uploadWindow.x = point1.x - (uploadWindow.width/2); uploadWindow.y = point1.y - (uploadWindow.height/2); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml index a7df59a3f2..2aeac5bd96 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/maps/PresentEventMap.mxml @@ -45,6 +45,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent; import org.bigbluebutton.modules.present.events.PresentationPodRemoved; import org.bigbluebutton.modules.present.events.RequestPresentationInfoPodEvent; + import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent; import org.bigbluebutton.modules.present.events.RequestAllPodsEvent; import org.bigbluebutton.modules.present.managers.PresentManager; import org.bigbluebutton.modules.present.model.PresentationPodManager; @@ -173,5 +174,9 @@ with BigBlueButton; if not, see . + + + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as index 895c02f21f..72ba7f419d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as @@ -47,6 +47,10 @@ package org.bigbluebutton.modules.present.model return _podId; } + public function getOwnerId(): String { + return _ownerId; + } + public function addPresentation(p: Presentation):void { _presentations.addItem(p); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as index 0939ce900b..753b79101e 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as @@ -4,6 +4,7 @@ package org.bigbluebutton.modules.present.model { import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.modules.present.services.messages.PageChangeVO; + import org.bigbluebutton.modules.present.services.messages.PresentationPodVO; import org.bigbluebutton.modules.present.model.PresentationModel; import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent; import com.asfusion.mate.events.Dispatcher; @@ -126,6 +127,22 @@ package org.bigbluebutton.modules.present.model { globalDispatcher.dispatchEvent(event); } } + + public function handleGetAllPodsResp(podsAC: ArrayCollection): void { + // flush pod manager and add these pods instead + + for (var i:int = 0; i < _presentationPods.length; i++) { + var oldPod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; + globalDispatcher.dispatchEvent(new PresentationPodRemoved(oldPod.getPodId(), oldPod.getOwnerId())); + } + + for (var j:int = 0; j < podsAC.length; j++) { + var podVO: PresentationPodVO = podsAC.getItemAt(j) as PresentationPodVO; + var newPod: PresentationModel = new PresentationModel(podVO.id, podVO.ownerId); + + globalDispatcher.dispatchEvent(new NewPresentationPodCreated(newPod.getPodId(), newPod.getOwnerId())); + } + } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationPodVO.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationPodVO.as new file mode 100644 index 0000000000..3a6349f318 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationPodVO.as @@ -0,0 +1,53 @@ +package org.bigbluebutton.modules.present.services.messages +{ +import mx.collections.ArrayCollection; + + public class PresentationPodVO { + private var _id:String; + private var _ownerId:String; + private var _currentPresenter:String; + private var _authorizedPresenters:ArrayCollection; + private var _presentations:ArrayCollection; + + public function PresentationPodVO(id: String, ownerId: String, currentPresenter: String, + authorizedPresenters: ArrayCollection, presentations: ArrayCollection) { + _id = id; + _ownerId = ownerId; + _currentPresenter = currentPresenter; + _authorizedPresenters = authorizedPresenters; + _presentations = presentations; + } + + public function get id():String { + return _id; + } + + public function get ownerId():String { + return _ownerId; + } + + public function currentPresenter():String { + return _currentPresenter; + } + + public function getAuthorizedPresenters():ArrayCollection { + var authorizedPresenters:ArrayCollection = new ArrayCollection(); + + for (var i: int = 0; i < _authorizedPresenters.length; i++) { + authorizedPresenters.addItem(_authorizedPresenters.getItemAt(i) as String); + } + + return authorizedPresenters; + } + + public function getPresentations():ArrayCollection { + var presentations:ArrayCollection = new ArrayCollection(); + + for (var i: int = 0; i < _presentations.length; i++) { + presentations.addItem(_presentations.getItemAt(i) as PresentationVO); + } + + return presentations; + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationVO.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationVO.as index d1dfd86665..db26d8bbd7 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationVO.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messages/PresentationVO.as @@ -13,7 +13,7 @@ package org.bigbluebutton.modules.present.services.messages _id = id; _name = name; _current = current; - _pages = pages + _pages = pages; _downloadable = downloadable; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as index 4824551c38..8c0e0628ba 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as @@ -40,10 +40,12 @@ package org.bigbluebutton.modules.present.services.messaging import org.bigbluebutton.modules.present.events.PresentationUploadTokenFail; import org.bigbluebutton.modules.present.events.NewPresentationPodCreated; import org.bigbluebutton.modules.present.events.PresentationPodRemoved; + import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent; import org.bigbluebutton.modules.present.services.Constants; import org.bigbluebutton.modules.present.services.PresentationService; import org.bigbluebutton.modules.present.services.messages.PageVO; import org.bigbluebutton.modules.present.services.messages.PresentationVO; + import org.bigbluebutton.modules.present.services.messages.PresentationPodVO; import org.bigbluebutton.main.api.JSLog; @@ -115,6 +117,9 @@ package org.bigbluebutton.modules.present.services.messaging case "RemovePresentationPodEvtMsg": handleRemovePresentationPodEvtMsg(message); break; + case "GetAllPresentationPodsRespMsg": + handleGetAllPresentationPodsRespMsg(message); + break; } } @@ -204,7 +209,7 @@ package org.bigbluebutton.modules.present.services.messaging var pages:Array = presentation.pages as Array; for (var k:int = 0; k < pages.length; k++) { var page:Object = pages[k] as Object; - var pg:PageVO = extractPage(page) + var pg:PageVO = extractPage(page); presoPages.addItem(pg); } @@ -212,6 +217,25 @@ package org.bigbluebutton.modules.present.services.messaging presentation.current, presoPages, presentation.downloadable); return preso; } + + private function processPresentationPod(presentationPod:Object):PresentationPodVO { + var presentationVOs:ArrayCollection = new ArrayCollection(); + var presentations:Array = presentationPod.presentations as Array; + for (var k:int = 0; k < presentations.length; k++) { + var aPres:PresentationVO = processUploadedPresentation(presentations[k] as Object); + presentationVOs.addItem(aPres); + } + + var authorizedPresenters:ArrayCollection = new ArrayCollection(); + var authPresArray:Array = presentationPod.authorizedPresenters as Array; + for (var m:int = 0; m < authorizedPresenters.length; m++) { + presentationVOs.addItem(authPresArray[m] as String); + } + + var podVO:PresentationPodVO = new PresentationPodVO(presentationPod.id, presentationPod.ownerId, + presentationPod.currentPresenter, authorizedPresenters, presentationVOs); + return podVO; + } private function handlePresentationPageGeneratedEvtMsg(msg:Object):void { dispatcher.dispatchEvent(new ConversionUpdateEvent(msg.body.numberOfPages, msg.body.pagesCompleted)); @@ -257,7 +281,7 @@ package org.bigbluebutton.modules.present.services.messaging var presentations:Array = msg.body.presentations as Array; for (var j:int = 0; j < presentations.length; j++) { var presentation:Object = presentations[j] as Object; - var presVO: PresentationVO = processUploadedPresentation(presentation) + var presVO: PresentationVO = processUploadedPresentation(presentation); presos.addItem(presVO); } @@ -290,5 +314,19 @@ package org.bigbluebutton.modules.present.services.messaging var podId: String = msg.body.podId; dispatcher.dispatchEvent(new PresentationPodRemoved(podId, ownerId)); } + + private function handleGetAllPresentationPodsRespMsg(msg: Object): void { + var podsAC:ArrayCollection = new ArrayCollection(); + var podsArr:Array = msg.body.pods as Array; + for (var j:int = 0; j < podsArr.length; j++) { + var podObj:Object = podsArr[j] as Object; + var podVO: PresentationPodVO = processPresentationPod(podObj); + podsAC.addItem(podVO); + } + + var event: GetAllPodsRespEvent = new GetAllPodsRespEvent(GetAllPodsRespEvent.GET_ALL_PODS_RESP); + event.pods = podsAC; + dispatcher.dispatchEvent(event); + } } } From 670f2b2564b1c1258293b32ee4458d743dd88c6d Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Sun, 1 Oct 2017 07:36:01 -0400 Subject: [PATCH 08/12] add default pod if no pods in meeting --- .../modules/present/model/PresentationPodManager.as | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as index 753b79101e..1f06eef304 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as @@ -49,15 +49,12 @@ package org.bigbluebutton.modules.present.model { public static function getInstance():PresentationPodManager { if (instance == null) { instance = new PresentationPodManager(new SingletonEnforcer()); - instance.requestDefaultPresentationPod(); } return instance; } public function requestDefaultPresentationPod(): void { - JSLog.warn("+++ PresentationPodManager::requestDefaultPresentationPod ", {}); - var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD); event.requesterId = UsersUtil.getMyUserID(); globalDispatcher.dispatchEvent(event); @@ -142,6 +139,10 @@ package org.bigbluebutton.modules.present.model { globalDispatcher.dispatchEvent(new NewPresentationPodCreated(newPod.getPodId(), newPod.getOwnerId())); } + + if (podsAC.length == 0) { // If there are no pods, request the creation of a default one + requestDefaultPresentationPod(); + } } } From 60904989b3afdda834d700b4bedaca38455a8bf1 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Sun, 1 Oct 2017 09:50:12 -0400 Subject: [PATCH 09/12] work on set presentation (client + akka apps) --- .../apps/presentation/PresentationApp2x.scala | 2 +- .../SetCurrentPresentationPubMsgHdlr.scala | 65 ++++++++++--------- .../PresentationPodHdlrs.scala | 1 + .../presentationpod/PresentationPodsApp.scala | 6 ++ .../SetCurrentPresentationPubMsgHdlr.scala | 48 ++++++++++++++ .../core/models/PresentationPods.scala | 1 + .../core/running/MeetingActor.scala | 3 +- .../common2/msgs/PresentationMsgs.scala | 4 +- .../main/api/ExternalApiCalls.as | 3 +- .../modules/present/business/PresentProxy.as | 18 ++--- .../commands/ChangePresentationCommand.as | 4 +- .../events/ConversionCompletedEvent.as | 6 +- .../present/managers/PresentManager.as | 3 +- .../present/model/PresentationPodManager.as | 15 +---- .../present/services/PresentationService.as | 52 ++++++++------- .../services/messaging/MessageReceiver.as | 15 ++--- .../services/messaging/MessageSender.as | 4 +- .../present/ui/views/FileUploadWindow.mxml | 23 +++++-- .../present/ui/views/PresentationWindow.mxml | 2 +- .../views/UploadedPresentationRenderer.mxml | 5 +- 20 files changed, 175 insertions(+), 105 deletions(-) create mode 100644 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/SetCurrentPresentationPubMsgHdlr.scala diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala index 10ae1d0493..bd2d71e6ef 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationApp2x.scala @@ -8,7 +8,7 @@ import org.bigbluebutton.core.running.LiveMeeting class PresentationApp2x(implicit val context: ActorContext) extends NewPresentationMsgHdlr - with SetCurrentPresentationPubMsgHdlr + // with SetCurrentPresentationPubMsgHdlr // with GetPresentationInfoReqMsgHdlr with SetCurrentPagePubMsgHdlr with ResizeAndMovePagePubMsgHdlr diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPresentationPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPresentationPubMsgHdlr.scala index cac0fa9fa5..15b34cb79a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPresentationPubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/SetCurrentPresentationPubMsgHdlr.scala @@ -1,32 +1,33 @@ -package org.bigbluebutton.core.apps.presentation - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.{ LiveMeeting } - -trait SetCurrentPresentationPubMsgHdlr { - this: PresentationApp2x => - - def handle( - msg: SetCurrentPresentationPubMsg, - liveMeeting: LiveMeeting, bus: MessageBus - ): Unit = { - - def broadcastEvent(msg: SetCurrentPresentationPubMsg): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(SetCurrentPresentationEvtMsg.NAME, routing) - val header = BbbClientMsgHeader(SetCurrentPresentationEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - - val body = SetCurrentPresentationEvtMsgBody(msg.body.presentationId) - val event = SetCurrentPresentationEvtMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - for { - presentation <- setCurrentPresentation(liveMeeting, msg.body.presentationId) - } yield { - broadcastEvent(msg) - } - } -} +//package org.bigbluebutton.core.apps.presentation +// +//import org.bigbluebutton.common2.msgs._ +//import org.bigbluebutton.core.bus.MessageBus +//import org.bigbluebutton.core.running.LiveMeeting +// +//trait SetCurrentPresentationPubMsgHdlr { +// this: PresentationApp2x => +// +// def handle( +// msg: SetCurrentPresentationPubMsg, +// liveMeeting: LiveMeeting, bus: MessageBus +// ): Unit = { +// +// def broadcastEvent(msg: SetCurrentPresentationPubMsg): Unit = { +// val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId) +// val envelope = BbbCoreEnvelope(SetCurrentPresentationEvtMsg.NAME, routing) +// val header = BbbClientMsgHeader(SetCurrentPresentationEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) +// +// val body = SetCurrentPresentationEvtMsgBody(msg.body.podId, msg.body.presentationId) +// val event = SetCurrentPresentationEvtMsg(header, body) +// val msgEvent = BbbCommonEnvCoreMsg(envelope, event) +// bus.outGW.send(msgEvent) +// } +// +// for { +//// pod <- getPr +// presentation <- setCurrentPresentation(liveMeeting, msg.body.presentationId) +// } yield { +// broadcastEvent(msg) +// } +// } +//} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala index 19c6672920..946a4f4935 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodHdlrs.scala @@ -8,6 +8,7 @@ class PresentationPodHdlrs(implicit val context: ActorContext) extends CreateNewPresentationPodPubMsgHdlr with GetPresentationInfoReqMsgHdlr with GetAllPresentationPodsReqMsgHdlr + with SetCurrentPresentationPubMsgHdlr with RemovePresentationPodPubMsgHdlr { val log = Logging(context.system, getClass) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala index 9433bd0629..461f2df8c7 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationPodsApp.scala @@ -46,5 +46,11 @@ object PresentationPodsApp { PresentationPodVO(pod.id, pod.ownerId, pod.currentPresenter, pod.authorizedPresenters, presentationVOs) } + + def updatePresentationPod(state: MeetingState2x, pod: PresentationPod): MeetingState2x = { + val podManager = state.presentationPodManager.addPod(pod) + state.update(podManager) + } + } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/SetCurrentPresentationPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/SetCurrentPresentationPubMsgHdlr.scala new file mode 100644 index 0000000000..ee6a4a7365 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/SetCurrentPresentationPubMsgHdlr.scala @@ -0,0 +1,48 @@ +package org.bigbluebutton.core.apps.presentationpod + +import org.bigbluebutton.common2.domain.PresentationPodVO +import org.bigbluebutton.common2.msgs._ +import org.bigbluebutton.core.bus.MessageBus +import org.bigbluebutton.core.domain.MeetingState2x +import org.bigbluebutton.core.running.LiveMeeting + +trait SetCurrentPresentationPubMsgHdlr { + this: PresentationPodHdlrs => + + def handle( + msg: SetCurrentPresentationPubMsg, state: MeetingState2x, + liveMeeting: LiveMeeting, bus: MessageBus + ): MeetingState2x = { + + def broadcastSetCurrentPresentationEvent(podId: String, userId: String, presentationId: String): Unit = { + val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, userId) + val envelope = BbbCoreEnvelope(SetCurrentPresentationEvtMsg.NAME, routing) + val header = BbbClientMsgHeader(SetCurrentPresentationEvtMsg.NAME, liveMeeting.props.meetingProp.intId, userId) + + val body = SetCurrentPresentationEvtMsgBody(podId, presentationId) + val event = SetCurrentPresentationEvtMsg(header, body) + val msgEvent = BbbCommonEnvCoreMsg(envelope, event) + bus.outGW.send(msgEvent) + } + + val podId = msg.body.podId + val presId = msg.body.presentationId + + val newState = for { + pod <- PresentationPodsApp.getPresentationPod(state, podId) + // presentation <- setCurrentPresentation(liveMeeting, pod.id, presId) + } yield { + + // unset old current + PresentationPodsApp.getPresentationPod(state, podId) + // TODO + + // set new current + // TODO + + broadcastSetCurrentPresentationEvent(podId, msg.header.userId, presId) + } + state + + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala index c4a4c563c1..47effc0f06 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/PresentationPods.scala @@ -51,4 +51,5 @@ case class PresentationPodManager(presentationPods: collection.immutable.Map[Str def getNumberOfPods(): Int = presentationPods.size def getPod(podId: String): Option[PresentationPod] = presentationPods.get(podId) def getAllPresentationPodsInMeeting(): Vector[PresentationPod] = presentationPods.values.toVector + def updatePresentationPod(presPod: PresentationPod): PresentationPodManager = addPod(presPod) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index 1f314f5cfb..2abf24c11c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -281,7 +281,7 @@ class MeetingActor( // Presentation // case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus, state) - case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) + // case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) // case m: GetPresentationInfoReqMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: SetCurrentPagePubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) case m: ResizeAndMovePagePubMsg => presentationApp2x.handle(m, liveMeeting, msgBus) @@ -299,6 +299,7 @@ class MeetingActor( case m: RemovePresentationPodPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) case m: GetPresentationInfoReqMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) case m: GetAllPresentationPodsReqMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) + case m: SetCurrentPresentationPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus) // Caption case m: EditCaptionHistoryPubMsg => captionApp2x.handle(m, liveMeeting, msgBus) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala index 76b77c5364..8cdbdfdb7a 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala @@ -6,7 +6,7 @@ import org.bigbluebutton.common2.domain.PresentationVO // ------------ client to akka-apps ------------ object SetCurrentPresentationPubMsg { val NAME = "SetCurrentPresentationPubMsg"} case class SetCurrentPresentationPubMsg(header: BbbClientMsgHeader, body: SetCurrentPresentationPubMsgBody) extends StandardMsg -case class SetCurrentPresentationPubMsgBody(presentationId: String) +case class SetCurrentPresentationPubMsgBody(podId: String, presentationId: String) object SetCurrentPagePubMsg { val NAME = "SetCurrentPagePubMsg"} case class SetCurrentPagePubMsg(header: BbbClientMsgHeader, body: SetCurrentPagePubMsgBody) extends StandardMsg @@ -44,7 +44,7 @@ case class NewPresentationEvtMsgBody(presentation: PresentationVO) object SetCurrentPresentationEvtMsg { val NAME = "SetCurrentPresentationEvtMsg"} case class SetCurrentPresentationEvtMsg(header: BbbClientMsgHeader, body: SetCurrentPresentationEvtMsgBody) extends BbbCoreMsg -case class SetCurrentPresentationEvtMsgBody(presentationId: String) +case class SetCurrentPresentationEvtMsgBody(podId: String, presentationId: String) object SetCurrentPageEvtMsg { val NAME = "SetCurrentPageEvtMsg"} case class SetCurrentPageEvtMsg(header: BbbClientMsgHeader, body: SetCurrentPageEvtMsgBody) extends BbbCoreMsg diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCalls.as b/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCalls.as index 3a4ae4e93f..370083c5d8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCalls.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCalls.as @@ -57,7 +57,7 @@ package org.bigbluebutton.main.api import org.bigbluebutton.modules.present.events.OfficeDocConvertInvalidEvent; import org.bigbluebutton.modules.present.events.OfficeDocConvertSuccessEvent; import org.bigbluebutton.modules.present.events.UploadEvent; - import org.bigbluebutton.modules.videoconf.model.VideoConfOptions; + import org.bigbluebutton.modules.videoconf.model.VideoConfOptions; public class ExternalApiCalls { private static const LOGGER:ILogger = getClassLogger(ExternalApiCalls); @@ -377,6 +377,7 @@ package org.bigbluebutton.main.api payload.eventName = EventConstants.CONVERT_SUCCESS; payload.presentationName = event.presName; payload.presentationId = event.presId; + payload.podId = event.podId; broadcastEvent(payload); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as index a5b12ca9e8..69cc51aa54 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as @@ -122,13 +122,15 @@ package org.bigbluebutton.modules.present.business } public function handleChangePresentationCommand(cmd:ChangePresentationCommand):void { -// var pres:Presentation = PresentationModel.getInstance().getPresentation(cmd.presId); -// JSLog.warn("+++ PresentProxy:: sharePresentation2: " + pres.id, {}); -// -// -// if (pres != null) { -// sender.sharePresentation(pres.id); -// } + var presModel: PresentationModel = podManager.getPod(cmd.podId); + var pres:Presentation = presModel.getPresentation(cmd.presId); + JSLog.warn("+++ PresentProxy:: sharePresentation1: " + pres.id + " " + cmd.podId, {}); + JSLog.warn("+++ PresentProxy:: sharePresentation2: " + pres.id, {}); + JSLog.warn("+++ PresentProxy:: sharePresentation: ", pres != null); + + if (pres != null) { + sender.sharePresentation(cmd.podId, pres.id); + } } public function handleGoToPageCommand(cmd:GoToPageCommand):void { @@ -244,7 +246,7 @@ package org.bigbluebutton.modules.present.business public function sharePresentation(e:PresenterCommands):void{ JSLog.warn("+++ PresentProxy:: sharePresentation1: " + e.presentationName, {}); JSLog.warn("+++ PresentProxy:: sharePresentation2: " + e.podId, {}); - sender.sharePresentation(e.presentationName); + sender.sharePresentation(e.podId, e.presentationName); } public function removePresentation(e:RemovePresentationEvent):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePresentationCommand.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePresentationCommand.as index 3de53904c3..b1512f094f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePresentationCommand.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePresentationCommand.as @@ -6,11 +6,13 @@ package org.bigbluebutton.modules.present.commands { public static const CHANGE_PRESENTATION:String = "presentation change presentation command"; + public var podId:String; public var presId:String; - public function ChangePresentationCommand(presentationId:String) + public function ChangePresentationCommand(destPodId: String, presentationId:String) { super(CHANGE_PRESENTATION, true, false); + podId = destPodId; presId = presentationId; } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/ConversionCompletedEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/ConversionCompletedEvent.as index 32a0df0934..1371bdf361 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/ConversionCompletedEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/ConversionCompletedEvent.as @@ -8,12 +8,14 @@ package org.bigbluebutton.modules.present.events public var presId:String; public var presName:String; + public var podId:String; - public function ConversionCompletedEvent(presentationId:String, presentationName:String) + public function ConversionCompletedEvent(destPodId: String, presentationId:String, presentationName:String) { super(CONVERSION_COMPLETED, true, false); + podId = destPodId; presId = presentationId; presName = presentationName; } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as index f709889ce4..f9a87b6e1e 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as @@ -126,7 +126,8 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.main.api.JSLog; JSLog.warn("+++ PresentManager:: handleOpenUploadWindow: " + e.podId, {}); uploadWindow.maxFileSize = e.maxFileSize; - uploadWindow.podId = e.podId; +// uploadWindow.podId = e.podId; + uploadWindow.setPodId(e.podId); var point1:Point = new Point(); point1.x = FlexGlobals.topLevelApplication.width / 2; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as index 1f06eef304..f272867b42 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as @@ -61,28 +61,19 @@ package org.bigbluebutton.modules.present.model { } public function getPod(podId: String): PresentationModel { -// return _presentationPods[podId]; - - var resultingPod: PresentationModel = getFirstPod(); // TODO + var resultingPod: PresentationModel = null; for (var i:int = 0; i < _presentationPods.length; i++) { var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; - JSLog.warn("+++ PresentationPodManager:: getPod for podId=" + podId + " " + pod.getPodId(), {}); + JSLog.warn("+++ PresentationPodManager:: getPod podId=" + podId + " getPodId=" + pod.getPodId(), {}); if (pod.getPodId() == podId) { - JSLog.warn("+++ PresentationPodManager:: getPod SUCCESS for podId=" + podId , {}); return pod; } } - JSLog.warn("+++ PresentationPodManager:: getPod FAIL for podId=" + podId , {}); + JSLog.warn("+++ PresentationPodManager:: getPod FAIL for podId=" + podId + " size=" + _presentationPods.length, {}); return resultingPod; } - - public function getFirstPod(): PresentationModel { - JSLog.warn("+++ PresentationPodManager:: getFirstPod size=" + _presentationPods.length, {}); - return _presentationPods.getItemAt(0) as PresentationModel; - } - public function handleAddPresentationPod(podId: String, ownerId: String): void { for (var i:int = 0; i < _presentationPods.length; i++) { var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as index 4d6b69baef..14aea80d73 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as @@ -19,6 +19,7 @@ package org.bigbluebutton.modules.present.services import org.bigbluebutton.modules.present.services.messages.PresentationVO; import org.bigbluebutton.modules.present.services.messaging.MessageReceiver; import org.bigbluebutton.modules.present.services.messaging.MessageSender; + import org.bigbluebutton.main.api.JSLog; public class PresentationService { @@ -72,6 +73,8 @@ package org.bigbluebutton.modules.present.services } public function addPresentations(podId: String, presos:ArrayCollection):void { + JSLog.warn("+++ PresentationService:: addPresentations1: " + podId, {}); + JSLog.warn("+++ PresentationService:: addPresentations2: " + presos.length, {}); for (var i:int = 0; i < presos.length; i++) { var pres:PresentationVO = presos.getItemAt(i) as PresentationVO; addPresentation(podId, pres); @@ -80,6 +83,7 @@ package org.bigbluebutton.modules.present.services public function addPresentation(podId: String, pres:PresentationVO):void { var presentation:Presentation = presentationVOToPresentation(pres); + JSLog.warn("+++ PresentationService:: addPresentatioN: " + podId, {}); podManager.getPod(podId).addPresentation(presentation); LOGGER.debug("Added new presentation [{0}]", [presentation.id]); @@ -113,31 +117,31 @@ package org.bigbluebutton.modules.present.services return presentation; } - public function changeCurrentPresentation(presentationId:String):void { + public function changeCurrentPresentation(podId: String, presentationId:String):void { // We've switched presentations. Mark the old presentation as not current. -// var curPres:Presentation = PresentationModel.getInstance().getCurrentPresentation(); -// if (curPres != null) { -// curPres.current = false; -// } else { -// LOGGER.debug("No previous active presentation."); -// } -// -// var newPres:Presentation = PresentationModel.getInstance().getPresentation(presentationId); -// if (newPres != null) { -// LOGGER.debug("Making presentation [{0}] the active presentation.", [presentationId]); -// newPres.current = true; -// -// var event: PresentationChangedEvent = new PresentationChangedEvent(presentationId); -// dispatcher.dispatchEvent(event); -// -// var curPage:Page = PresentationModel.getInstance().getCurrentPage(); -// if (curPage != null) { -// var changePageCommand: ChangePageCommand = new ChangePageCommand(curPage.id, NUM_PRELOAD); -// dispatcher.dispatchEvent(changePageCommand); -// } -// } else { -// LOGGER.debug("Could not find presentation to make current. id="+presentationId); -// } + var curPres:Presentation = podManager.getPod(podId).getCurrentPresentation(); + if (curPres != null) { + curPres.current = false; + } else { + LOGGER.debug("No previous active presentation."); + } + + var newPres:Presentation = podManager.getPod(podId).getPresentation(presentationId); + if (newPres != null) { + LOGGER.debug("Making presentation [{0}] the active presentation.", [presentationId]); + newPres.current = true; + + var event: PresentationChangedEvent = new PresentationChangedEvent(presentationId); + dispatcher.dispatchEvent(event); + + var curPage:Page = podManager.getPod(podId).getCurrentPage(); + if (curPage != null) { + var changePageCommand: ChangePageCommand = new ChangePageCommand(curPage.id, NUM_PRELOAD); + dispatcher.dispatchEvent(changePageCommand); + } + } else { + LOGGER.debug("Could not find presentation to make current. id="+presentationId); + } } public function removeAllPresentations():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as index 8c0e0628ba..a45c3db043 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as @@ -181,13 +181,7 @@ package org.bigbluebutton.modules.present.services.messaging } private function handleSetCurrentPresentationEvtMsg(msg:Object):void { - - - - - - - service.changeCurrentPresentation(msg.body.presentationId); + service.changeCurrentPresentation(msg.body.podId, msg.body.presentationId); } private function handleRemovePresentationEvtMsg(msg:Object):void { @@ -197,10 +191,13 @@ package org.bigbluebutton.modules.present.services.messaging private function handlePresentationConversionCompletedEvtMsg(msg:Object):void { var presVO: PresentationVO = processUploadedPresentation(msg.body.presentation); var podId: String = msg.body.podId as String; - + + JSLog.warn("+++ Receiver:: handlePresentationConversionCompletedEvtMsg1: " + podId, {}); + JSLog.warn("+++ Receiver:: handlePresentationConversionCompletedEvtMsg2: " + presVO.id, {}); + JSLog.warn("+++ Receiver:: handlePresentationConversionCompletedEvtMsg3: " + presVO.name, {}); service.addPresentation(podId, presVO); - var uploadEvent:ConversionCompletedEvent = new ConversionCompletedEvent(presVO.id, presVO.name); + var uploadEvent:ConversionCompletedEvent = new ConversionCompletedEvent(podId, presVO.id, presVO.name); dispatcher.dispatchEvent(uploadEvent); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as index d183f99dc8..0f78373de5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as @@ -47,10 +47,10 @@ package org.bigbluebutton.modules.present.services.messaging ); } - public function sharePresentation(presentationId:String):void { + public function sharePresentation(podId: String, presentationId:String):void { var message:Object = { header: {name: "SetCurrentPresentationPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, - body: {presentationId: presentationId} + body: {podId: podId, presentationId: presentationId} }; var _nc:ConnectionManager = BBB.initConnectionManager(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml index 6b65f9adaf..9b35f115d2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml @@ -93,6 +93,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.model.PresentationModel; import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.util.i18n.ResourceUtil; + import org.bigbluebutton.main.api.JSLog; use namespace mx_internal; @@ -120,7 +121,15 @@ with BigBlueButton; if not, see . dispatcher = new Dispatcher(); updateStyles(); } - + + public function setPodId(_podId: String): void { + podId = _podId; + presentationNamesAC = PresentationPodManager.getInstance().getPod(podId).getPresentations(); // GOOD + if (presentationNamesAC.length <= 0) { + selectFile(); + } + } + private function updateStyles() : void { var styleNameExt : String = ""; if (ResourceUtil.getInstance().isRTLEnabled() && ResourceUtil.getInstance().getCurrentLanguageDirection() == Direction.RTL) { @@ -133,10 +142,8 @@ with BigBlueButton; if not, see . private function initData():void { presentOptions = Options.getOptions(PresentOptions) as PresentOptions; - presentationNamesAC = PresentationPodManager.getInstance().getPod(podId).getPresentations(); // GOOD - if (presentationNamesAC.length <= 0) { - selectFile(); - } + JSLog.warn("+++ FileUploadWindow:: initData: " + podId, {}); + } private function handleThumbnailsProgressEvent(event:CreatingThumbnailsEvent):void { @@ -223,7 +230,7 @@ with BigBlueButton; if not, see . uploadCmd.isDownloadable = isDownloadable; uploadCmd.podId = podId; - import org.bigbluebutton.main.api.JSLog; + JSLog.warn("+++ FileUploadWindow:: startUpload: " + podId, {}); globalDispatch.dispatchEvent(uploadCmd); @@ -319,8 +326,10 @@ with BigBlueButton; if not, see . } private function handleConversionCompleted(e:ConversionCompletedEvent):void{ + JSLog.warn("+++ FileUploadWindow:: handleConversionCompleted1: " + e.presId, {}); + JSLog.warn("+++ FileUploadWindow:: handleConversionCompleted2: " + e.podId, {}); enableClosing(); - globalDispatch.dispatchEvent(new ChangePresentationCommand(e.presId)); + globalDispatch.dispatchEvent(new ChangePresentationCommand(e.podId, e.presId)); globalDispatch.dispatchEvent(new UploadEvent(UploadEvent.CLOSE_UPLOAD_WINDOW)); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index bac0dcb83d..2ac13ef02d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -122,7 +122,7 @@ with BigBlueButton; if not, see . [Bindable] private var thumbY:Number; - public var uploadWindow:FileUploadWindow = null; +// public var uploadWindow:FileUploadWindow = null; [Bindable] private var DEFAULT_X_POSITION:Number = 237; [Bindable] private var DEFAULT_Y_POSITION:Number = 0; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml index 01f8f5685a..ac49d75115 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml @@ -39,7 +39,10 @@ private var rolledOver:Boolean = false; private function showPresentation():void { - var changePresCommand:ChangePresentationCommand = new ChangePresentationCommand(data.id); + import org.bigbluebutton.main.api.JSLog; + JSLog.warn("+++ UploadedPresentationRenderer::showPresentation " , data); + + var changePresCommand:ChangePresentationCommand = new ChangePresentationCommand('AAAAAUploadedPresentationRendererAAAA', data.id); globalDispatch.dispatchEvent(changePresCommand); globalDispatch.dispatchEvent(new UploadEvent(UploadEvent.CLOSE_UPLOAD_WINDOW)); From 0866bc01ce1183fd3332aa83b9f7b5b73dd2ec06 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Tue, 3 Oct 2017 11:06:54 -0400 Subject: [PATCH 10/12] independent pods, visible slide on presenter side --- .../PresentationUploadTokenReqMsgHdlr.scala | 3 +- .../modules/present/business/PresentProxy.as | 15 +- .../present/commands/ChangePageCommand.as | 8 +- .../present/events/PageChangedEvent.as | 6 +- .../modules/present/events/PageLoadedEvent.as | 6 +- .../events/PresentationChangedEvent.as | 8 +- .../modules/present/model/Page.as | 12 +- .../present/model/PresentationModel.as | 1 + .../present/model/PresentationPodManager.as | 2 +- .../present/services/PageLoaderService.as | 51 +++--- .../present/services/PresentationService.as | 92 ++++++----- .../services/messaging/MessageReceiver.as | 9 +- .../present/ui/views/FileUploadWindow.mxml | 8 - .../present/ui/views/PresentationWindow.mxml | 148 ++++++++++-------- .../modules/present/ui/views/SlideView.mxml | 109 +++++++------ 15 files changed, 261 insertions(+), 217 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala index 8db1ad9ad4..4dda9418cd 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentation/PresentationUploadTokenReqMsgHdlr.scala @@ -3,6 +3,7 @@ package org.bigbluebutton.core.apps.presentation import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.bus.MessageBus import org.bigbluebutton.core.running.LiveMeeting +import org.bigbluebutton.core.util.RandomStringGenerator trait PresentationUploadTokenReqMsgHdlr { this: PresentationApp2x => @@ -14,7 +15,7 @@ trait PresentationUploadTokenReqMsgHdlr { // TODO move these in Pods def generateToken(podId: String, userId: String): String = { - "LALA-" + podId + "-" + userId + "LALA-" + RandomStringGenerator.randomAlphanumericString(8) + podId + "-" + userId } def userIsAllowedToUploadInPod(podId: String, userId: String): Boolean = { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as index 69cc51aa54..eaa7f286c6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as @@ -178,6 +178,9 @@ package org.bigbluebutton.modules.present.business if (currentUploadCommand != null && currentUploadCommand.filename == e.filename) { uploadService.upload(currentUploadCommand.podId, currentUploadCommand.filename, currentUploadCommand.file, currentUploadCommand.isDownloadable); currentUploadCommand = null; + + // TODO + uploadService = null; // reset upload service so we can use new token for consecutive upload } else { } @@ -236,19 +239,17 @@ package org.bigbluebutton.modules.present.business // service.load(fullUri, slides, slideUri); LOGGER.debug('number of slides={0}', [slides.size()]); } - + /** * It may take a few seconds for the process to complete on the server, so we allow for some time * before notifying viewers the presentation has been loaded * @param e * - */ - public function sharePresentation(e:PresenterCommands):void{ - JSLog.warn("+++ PresentProxy:: sharePresentation1: " + e.presentationName, {}); - JSLog.warn("+++ PresentProxy:: sharePresentation2: " + e.podId, {}); - sender.sharePresentation(e.podId, e.presentationName); + */ + public function sharePresentation(e:PresenterCommands):void { + sender.sharePresentation(e.podId, e.presentationName); } - + public function removePresentation(e:RemovePresentationEvent):void { sender.removePresentation(e.presentationName); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePageCommand.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePageCommand.as index ce87041d5a..c4f8a65e50 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePageCommand.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/commands/ChangePageCommand.as @@ -6,14 +6,16 @@ package org.bigbluebutton.modules.present.commands { public static const CHANGE_PAGE_COMMAND:String = "presentation change page command"; + public var podId:String; public var pageId:String; - public var preloadCount:uint + public var preloadCount:uint; - public function ChangePageCommand(pageId: String, preloadCount:uint) + public function ChangePageCommand(podId: String, pageId: String, preloadCount:uint) { super(CHANGE_PAGE_COMMAND, true, false); + this.podId = podId; this.pageId = pageId; this.preloadCount = preloadCount; } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageChangedEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageChangedEvent.as index c928d24fc3..5bc95798d3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageChangedEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageChangedEvent.as @@ -6,12 +6,14 @@ package org.bigbluebutton.modules.present.events { public static const PRESENTATION_PAGE_CHANGED_EVENT:String = "presentation page changed event"; + public var podId: String; public var pageId: String; - public function PageChangedEvent(pageId: String) + public function PageChangedEvent(podId: String, pageId: String) { super(PRESENTATION_PAGE_CHANGED_EVENT, true, false); this.pageId = pageId; + this.podId = podId; } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageLoadedEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageLoadedEvent.as index 59b8a951d6..48898fb021 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageLoadedEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PageLoadedEvent.as @@ -7,11 +7,13 @@ package org.bigbluebutton.modules.present.events public static const PAGE_LOADED_EVENT:String = "presentation page loaded event"; public var pageId: String; + public var podId: String; - public function PageLoadedEvent(pageId: String) + public function PageLoadedEvent(podId: String, pageId: String) { super(PAGE_LOADED_EVENT, true, false); this.pageId = pageId; + this.podId = podId; } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationChangedEvent.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationChangedEvent.as index b86606b933..60921861d3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationChangedEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/events/PresentationChangedEvent.as @@ -6,12 +6,14 @@ package org.bigbluebutton.modules.present.events { public static const PRESENTATION_CHANGED_EVENT: String = "presentation changed event"; + public var podId: String; public var presentationId: String; - public function PresentationChangedEvent(id: String) + public function PresentationChangedEvent(_podId: String, _presid: String) { super(PRESENTATION_CHANGED_EVENT, true, false); - presentationId = id; + podId = _podId; + presentationId = _presid; } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Page.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Page.as index 24e4ea9744..e27678cb05 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Page.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/Page.as @@ -18,9 +18,10 @@ package org.bigbluebutton.modules.present.model public var xOffset: Number; public var yOffset: Number; public var widthRatio: Number; - public var heightRatio: Number + public var heightRatio: Number; private var _pageLoadedListener:Function; + private var _parentPodId: String; private var _swfLoader:URLLoader; private var _swfLoaded:Boolean = false; private var _txtLoader:URLLoader; @@ -73,13 +74,14 @@ package org.bigbluebutton.modules.present.model return _txtUri; } - public function loadPage(pageLoadedListener:Function, preloadCount:uint):void { + public function loadPage(pageLoadedListener:Function, podId: String, preloadCount:uint):void { if (_swfLoaded && _txtLoaded) { - pageLoadedListener(_id, preloadCount); + pageLoadedListener(podId, _id, preloadCount); return; } _pageLoadedListener = pageLoadedListener; + _parentPodId = podId; _preloadCount = preloadCount; if (!_swfLoaded) loadSwf(); @@ -101,7 +103,7 @@ package org.bigbluebutton.modules.present.model _swfLoaded = true; if (_txtLoaded) { if (_pageLoadedListener != null) { - _pageLoadedListener(_id, _preloadCount); + _pageLoadedListener(_parentPodId, _id, _preloadCount); } _preloadCount = 0; } @@ -122,7 +124,7 @@ package org.bigbluebutton.modules.present.model _txtLoaded = true; if (_swfLoaded) { if (_pageLoadedListener != null) { - _pageLoadedListener(_id, _preloadCount); + _pageLoadedListener(_parentPodId, _id, _preloadCount); } _preloadCount = 0; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as index 72ba7f419d..a2a4d1b516 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as @@ -52,6 +52,7 @@ package org.bigbluebutton.modules.present.model } public function addPresentation(p: Presentation):void { + JSLog.warn("+++ PresentationModel:: addPresentation: ", {}); _presentations.addItem(p); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as index f272867b42..db050c69f2 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as @@ -65,7 +65,7 @@ package org.bigbluebutton.modules.present.model { for (var i:int = 0; i < _presentationPods.length; i++) { var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; - JSLog.warn("+++ PresentationPodManager:: getPod podId=" + podId + " getPodId=" + pod.getPodId(), {}); + // JSLog.warn("+++ PresentationPodManager:: getPod podId=" + podId + " getPodId=" + pod.getPodId(), {}); if (pod.getPodId() == podId) { return pod; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as index b6f9148fff..d603eb1e6c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as @@ -8,6 +8,8 @@ package org.bigbluebutton.modules.present.services import org.bigbluebutton.modules.present.events.PageLoadedEvent; import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.PresentationModel; + import org.bigbluebutton.modules.present.model.PresentationPodManager; + import org.bigbluebutton.main.api.JSLog; public class PageLoaderService { @@ -15,32 +17,35 @@ package org.bigbluebutton.modules.present.services private var dispatcher:Dispatcher = new Dispatcher(); public function loadPage(cmd: ChangePageCommand):void { -// var page:Page = PresentationModel.getInstance().getPage(cmd.pageId); -// if (page != null) { -// LOGGER.debug("Loading page [{0}]", [cmd.pageId]); -// page.loadPage(pageLoadedListener, cmd.preloadCount); -// } + var page:Page = PresentationPodManager.getInstance().getPod(cmd.podId).getPage(cmd.pageId); + JSLog.warn("+++ PageLoaderService:: loadPage1: " + cmd.podId + "_____" + cmd.pageId, page != null); + if (page != null) { + LOGGER.debug("Loading page [{0}]", [cmd.pageId]); + page.loadPage(pageLoadedListener, cmd.podId, cmd.preloadCount); + } } - public function pageLoadedListener(pageId:String, preloadCount:uint):void { -// var page: Page = PresentationModel.getInstance().getPage(pageId); -// if (page != null) { -// if (page.current) { -// // The page has been loaded and still the current displayed page. -// LOGGER.debug("Loaded page [{0}]. Dispatching event to display it.", [pageId]); -// var event: PageLoadedEvent = new PageLoadedEvent(page.id); -// dispatcher.dispatchEvent(event); -// } -// -// if (preloadCount > 0) { -// var pageIdParts:Array = pageId.split("/"); -// LOGGER.debug("after split: {0}", [pageIdParts]); -// LOGGER.debug("trying to preload next page with id: {0}", [(parseInt(pageIdParts[1],10) + 1).toString()]); -// var changePageCommand: ChangePageCommand = new ChangePageCommand(pageIdParts[0]+"/"+(parseInt(pageIdParts[1], 10) + 1), preloadCount-1); -// dispatcher.dispatchEvent(changePageCommand); -// } -// } + public function pageLoadedListener(podId: String, pageId:String, preloadCount:uint):void { + var page: Page = PresentationPodManager.getInstance().getPod(podId).getPage(pageId); + + JSLog.warn("+++ PageLoaderService:: pageLoadedListener1: " + podId + "_____" + pageId, {}); + if (page != null) { + if (page.current) { + // The page has been loaded and still the current displayed page. + LOGGER.debug("Loaded page [{0}]. Dispatching event to display it.", [pageId]); + var event: PageLoadedEvent = new PageLoadedEvent(podId, page.id); + dispatcher.dispatchEvent(event); + } + + if (preloadCount > 0) { + var pageIdParts:Array = pageId.split("/"); + LOGGER.debug("after split: {0}", [pageIdParts]); + LOGGER.debug("trying to preload next page with id: {0}", [(parseInt(pageIdParts[1],10) + 1).toString()]); + var changePageCommand: ChangePageCommand = new ChangePageCommand(podId, pageIdParts[0]+"/"+(parseInt(pageIdParts[1], 10) + 1), preloadCount-1); + dispatcher.dispatchEvent(changePageCommand); + } + } } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as index 14aea80d73..30ec198c28 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as @@ -25,43 +25,41 @@ package org.bigbluebutton.modules.present.services { private static const LOGGER:ILogger = getClassLogger(PresentationService); private static const NUM_PRELOAD:uint = 3; - private var model:PresentationModel; private var podManager: PresentationPodManager; private var sender:MessageSender; private var receiver:MessageReceiver; private var dispatcher:Dispatcher; public function PresentationService() { - model = PresentationModel.getInstance(); podManager = PresentationPodManager.getInstance(); receiver = new MessageReceiver(this); dispatcher = new Dispatcher(); } - public function pageChanged(pageId:String):void { -// var np: Page = model.getPage(pageId); -// if (np != null) { -// var oldPage: Page = PresentationModel.getInstance().getCurrentPage(); -// if (oldPage != null) oldPage.current = false; -// -// np.current = true -//// trace(LOG + "Sending page changed event. page [" + np.id + "] oldpage current=[" + oldPage.current + "] newPage current=[" + np.current + "]"); -// var changePageCommand: ChangePageCommand = new ChangePageCommand(np.id, NUM_PRELOAD); -// dispatcher.dispatchEvent(changePageCommand); -// } + public function pageChanged(podId: String, pageId:String):void { + var np: Page = podManager.getPod(podId).getPage(pageId); + if (np != null) { + var oldPage: Page = podManager.getPod(podId).getCurrentPage(); + if (oldPage != null) oldPage.current = false; + + np.current = true; +// trace(LOG + "Sending page changed event. page [" + np.id + "] oldpage current=[" + oldPage.current + "] newPage current=[" + np.current + "]"); + var changePageCommand: ChangePageCommand = new ChangePageCommand(podId, np.id, NUM_PRELOAD); + dispatcher.dispatchEvent(changePageCommand); + } } public function pageMoved(pageId:String, xOffset:Number, yOffset:Number, widthRatio:Number, heightRatio:Number):void { - var np: Page = model.getPage(pageId); - if (np != null) { - np.xOffset = xOffset; - np.yOffset = yOffset; - np.widthRatio = widthRatio; - np.heightRatio = heightRatio; -// trace(LOG + "Sending page moved event. page [" + np.id + "] current=[" + np.current + "]"); - var event: PageChangedEvent = new PageChangedEvent(np.id); - dispatcher.dispatchEvent(event); - } +// var np: Page = model.getPage(pageId); +// if (np != null) { +// np.xOffset = xOffset; +// np.yOffset = yOffset; +// np.widthRatio = widthRatio; +// np.heightRatio = heightRatio; +//// trace(LOG + "Sending page moved event. page [" + np.id + "] current=[" + np.current + "]"); +// var event: PageChangedEvent = new PageChangedEvent(np.id); +// dispatcher.dispatchEvent(event); +// } } private function copyPageVOToPage(p: PageVO):Page { @@ -73,8 +71,6 @@ package org.bigbluebutton.modules.present.services } public function addPresentations(podId: String, presos:ArrayCollection):void { - JSLog.warn("+++ PresentationService:: addPresentations1: " + podId, {}); - JSLog.warn("+++ PresentationService:: addPresentations2: " + presos.length, {}); for (var i:int = 0; i < presos.length; i++) { var pres:PresentationVO = presos.getItemAt(i) as PresentationVO; addPresentation(podId, pres); @@ -83,22 +79,22 @@ package org.bigbluebutton.modules.present.services public function addPresentation(podId: String, pres:PresentationVO):void { var presentation:Presentation = presentationVOToPresentation(pres); - JSLog.warn("+++ PresentationService:: addPresentatioN: " + podId, {}); + JSLog.warn("+++ PresentationService:: addPresentatioN: " + podId, {}); podManager.getPod(podId).addPresentation(presentation); LOGGER.debug("Added new presentation [{0}]", [presentation.id]); if (presentation.current) { LOGGER.debug("Making presentation [{0}] current [{1}]", [presentation.id, presentation.current]); - var event: PresentationChangedEvent = new PresentationChangedEvent(pres.id); + var event: PresentationChangedEvent = new PresentationChangedEvent(podId, pres.id); dispatcher.dispatchEvent(event); var curPage:Page = presentation.getCurrentPage(); if (curPage != null) { - var changePageCommand: ChangePageCommand = new ChangePageCommand(curPage.id, NUM_PRELOAD); + var changePageCommand: ChangePageCommand = new ChangePageCommand(podId, curPage.id, NUM_PRELOAD); dispatcher.dispatchEvent(changePageCommand); LOGGER.debug("Sending page moved event to position page [{0}] current=[{1}]", [curPage.id, curPage.current]); - var pageChangedEvent: PageChangedEvent = new PageChangedEvent(curPage.id); + var pageChangedEvent: PageChangedEvent = new PageChangedEvent(podId, curPage.id); dispatcher.dispatchEvent(pageChangedEvent); } } @@ -109,7 +105,7 @@ package org.bigbluebutton.modules.present.services var pages:ArrayCollection = presVO.getPages() as ArrayCollection; for (var k:int = 0; k < pages.length; k++) { var page:PageVO = pages[k] as PageVO; - var pg:Page = copyPageVOToPage(page) + var pg:Page = copyPageVOToPage(page); presoPages.addItem(pg); } @@ -131,12 +127,14 @@ package org.bigbluebutton.modules.present.services LOGGER.debug("Making presentation [{0}] the active presentation.", [presentationId]); newPres.current = true; - var event: PresentationChangedEvent = new PresentationChangedEvent(presentationId); + + var event: PresentationChangedEvent = new PresentationChangedEvent(podId, presentationId); dispatcher.dispatchEvent(event); var curPage:Page = podManager.getPod(podId).getCurrentPage(); + JSLog.warn("+++ PresentationService:: changeCurrentPresentation3: " + curPage.id, curPage != null); if (curPage != null) { - var changePageCommand: ChangePageCommand = new ChangePageCommand(curPage.id, NUM_PRELOAD); + var changePageCommand: ChangePageCommand = new ChangePageCommand(podId, curPage.id, NUM_PRELOAD); dispatcher.dispatchEvent(changePageCommand); } } else { @@ -145,24 +143,24 @@ package org.bigbluebutton.modules.present.services } public function removeAllPresentations():void { - model.removeAllPresentations(); +// model.removeAllPresentations(); } public function removePresentation(presentationID:String):void { - var removedEvent:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.PRESENTATION_REMOVED_EVENT); - removedEvent.presentationName = presentationID; - dispatcher.dispatchEvent(removedEvent); - - var currPresentation:Presentation = model.getCurrentPresentation(); - - if(currPresentation && presentationID == currPresentation.id) { - var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.CLEAR_PRESENTATION); - dispatcher.dispatchEvent(uploadEvent); - } - - model.removePresentation(presentationID); - var updateEvent:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.UPDATE_DOWNLOADABLE_FILES_EVENT); - dispatcher.dispatchEvent(updateEvent); // this event will trigger the disabling of the download button. +// var removedEvent:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.PRESENTATION_REMOVED_EVENT); +// removedEvent.presentationName = presentationID; +// dispatcher.dispatchEvent(removedEvent); +// +// var currPresentation:Presentation = model.getCurrentPresentation(); +// +// if(currPresentation && presentationID == currPresentation.id) { +// var uploadEvent:UploadEvent = new UploadEvent(UploadEvent.CLEAR_PRESENTATION); +// dispatcher.dispatchEvent(uploadEvent); +// } +// +// model.removePresentation(presentationID); +// var updateEvent:RemovePresentationEvent = new RemovePresentationEvent(RemovePresentationEvent.UPDATE_DOWNLOADABLE_FILES_EVENT); +// dispatcher.dispatchEvent(updateEvent); // this event will trigger the disabling of the download button. } } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as index a45c3db043..21c94cc0eb 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as @@ -70,6 +70,7 @@ package org.bigbluebutton.modules.present.services.messaging messageName == "SendCaptionHistoryRespMsg" || messageName == "GetGroupChatMsgsRespMsg" || messageName == "DoLatencyTracerMsg" || + messageName == "PresentationConversionUpdateEvtMsg" || messageName == "ServerToClientLatencyTracerMsg") { } else { @@ -124,7 +125,10 @@ package org.bigbluebutton.modules.present.services.messaging } private function handleSetCurrentPageEvtMsg(msg:Object):void { - service.pageChanged(msg.body.pageId); + JSLog.warn("__--__Presentation received: handleSetCurrentPageEvtMsg" + msg.body.podId, {}); + JSLog.warn("__--__Presentation received: handleSetCurrentPageEvtMsg" + msg.body.pageId, {}); + + service.pageChanged(msg.body.podId, msg.body.pageId); } private function validatePage(map:Object):Boolean { @@ -192,9 +196,6 @@ package org.bigbluebutton.modules.present.services.messaging var presVO: PresentationVO = processUploadedPresentation(msg.body.presentation); var podId: String = msg.body.podId as String; - JSLog.warn("+++ Receiver:: handlePresentationConversionCompletedEvtMsg1: " + podId, {}); - JSLog.warn("+++ Receiver:: handlePresentationConversionCompletedEvtMsg2: " + presVO.id, {}); - JSLog.warn("+++ Receiver:: handlePresentationConversionCompletedEvtMsg3: " + presVO.name, {}); service.addPresentation(podId, presVO); var uploadEvent:ConversionCompletedEvent = new ConversionCompletedEvent(podId, presVO.id, presVO.name); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml index 9b35f115d2..ca7b4c0088 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml @@ -141,9 +141,6 @@ with BigBlueButton; if not, see . private function initData():void { presentOptions = Options.getOptions(PresentOptions) as PresentOptions; - - JSLog.warn("+++ FileUploadWindow:: initData: " + podId, {}); - } private function handleThumbnailsProgressEvent(event:CreatingThumbnailsEvent):void { @@ -230,9 +227,6 @@ with BigBlueButton; if not, see . uploadCmd.isDownloadable = isDownloadable; uploadCmd.podId = podId; - - JSLog.warn("+++ FileUploadWindow:: startUpload: " + podId, {}); - globalDispatch.dispatchEvent(uploadCmd); letUserDownload.visible = false; } @@ -326,8 +320,6 @@ with BigBlueButton; if not, see . } private function handleConversionCompleted(e:ConversionCompletedEvent):void{ - JSLog.warn("+++ FileUploadWindow:: handleConversionCompleted1: " + e.presId, {}); - JSLog.warn("+++ FileUploadWindow:: handleConversionCompleted2: " + e.podId, {}); enableClosing(); globalDispatch.dispatchEvent(new ChangePresentationCommand(e.podId, e.presId)); globalDispatch.dispatchEvent(new UploadEvent(UploadEvent.CLOSE_UPLOAD_WINDOW)); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index 2ac13ef02d..99a541bd78 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -339,13 +339,15 @@ with BigBlueButton; if not, see . } private function handleDisplaySlideEvent(event:DisplaySlideEvent):void { - var presentationModel: PresentationModel = PresentationPodManager.getInstance().getPod(podId); // GOOD - var curPage:Page = presentationModel.getCurrentPage(); - if (curPage != null) { - displaySlideNumber(curPage.num); - currentSlideWidth = event.slideWidth; - currentSlideHeight = event.slideHeight; - fitSlideToWindowMaintainingAspectRatio(); + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null) { + var curPage:Page = presentationModel.getCurrentPage(); + if (curPage != null) { + displaySlideNumber(curPage.num); + currentSlideWidth = event.slideWidth; + currentSlideHeight = event.slideHeight; + fitSlideToWindowMaintainingAspectRatio(); + } } } @@ -386,34 +388,44 @@ with BigBlueButton; if not, see . uploadPres.visible = isPresenter; downloadPres.visible = !isPresenter; -// var page:Page = PresentationModel.getInstance().getCurrentPage(); -// if (page != null) { -// displaySlideNumber(page.num); -// } -// displaySlideNavigationControls(isPresenter, !!page); -// -// setControlBarState("presenter"); + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null) { + var page:Page = presentationModel.getCurrentPage(); + if (page != null) { + displaySlideNumber(page.num); + } + displaySlideNavigationControls(isPresenter, !!page); + + setControlBarState("presenter"); + } + } + + private function handlePresentationChangedEvent(e:PresentationChangedEvent) : void { + if (podId != e.podId) { + return; + } + + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null) { + currentPresentation = presentationModel.getCurrentPresentationName(); + + slideView.setSlides(podId); + slideView.visible = true; + var page : Page = presentationModel.getCurrentPage(); + if (page != null) { + displaySlideNumber(page.num); + } + + if (UsersUtil.amIPresenter()) { + displaySlideNavigationControls(true, !!page); + } + else { + displaySlideNavigationControls(false, !!page) + } + onResetZoom(); + updateDownloadBtn(); + } } - - private function handlePresentationChangedEvent(e:PresentationChangedEvent) : void { -// currentPresentation = PresentationModel.getInstance().getCurrentPresentationName(); -// -// slideView.setSlides(); -// slideView.visible = true; -// var page : Page = PresentationModel.getInstance().getCurrentPage(); -// if (page != null) { -// displaySlideNumber(page.num); -// } -// -// if (UsersUtil.amIPresenter()) { -// displaySlideNavigationControls(true, !!page); -// } -// else { -// displaySlideNavigationControls(false, !!page) -// } -// onResetZoom(); -// updateDownloadBtn(); - } private function displaySlideNavigationControls(isPresenter:Boolean, activePresentation:Boolean):void { @@ -471,22 +483,28 @@ with BigBlueButton; if not, see . backButton.mouseEnabled = false; backButton.styleName = "presentationBackButtonDisabledStyle" + styleNameExt; } - -// if (pageNumber < PresentationModel.getInstance().getNumberOfPages()) { -// forwardButton.mouseEnabled = true; -// forwardButton.styleName = "presentationForwardButtonStyle" + styleNameExt; -// } else { -// forwardButton.mouseEnabled = false; -// forwardButton.styleName = "presentationForwardButtonDisabledStyle" + styleNameExt; -// } + + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null) { + if (pageNumber < presentationModel.getNumberOfPages()) { + forwardButton.mouseEnabled = true; + forwardButton.styleName = "presentationForwardButtonStyle" + styleNameExt; + } else { + forwardButton.mouseEnabled = false; + forwardButton.styleName = "presentationForwardButtonDisabledStyle" + styleNameExt; + } + } } private function displaySlideNumber(currentSlide:int):void { disableSlideNavigationButtons(currentSlide); -// btnSlideNum.label = "" + currentSlide + '/' + PresentationModel.getInstance().getNumberOfPages(); -// btnSlideNum.accessibilityName = ResourceUtil.getInstance().getString('bbb.presentation.btnSlideNum.accessibilityName', [currentSlide, PresentationModel.getInstance().getNumberOfPages()]) + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null) { + btnSlideNum.label = "" + currentSlide + '/' + presentationModel.getNumberOfPages(); + btnSlideNum.accessibilityName = ResourceUtil.getInstance().getString('bbb.presentation.btnSlideNum.accessibilityName', + [currentSlide, presentationModel.getNumberOfPages()]) + } } - private function clearPresentation(e:UploadEvent):void{ slideView.visible = false; @@ -505,15 +523,17 @@ with BigBlueButton; if not, see . } private function goToPreviousSlide():void { -// if (PresentationModel.getInstance().getCurrentPage().num > 1) { -// dispatchEvent(new GoToPrevPageCommand()); -// } + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null && presentationModel.getCurrentPage().num > 1) { + dispatchEvent(new GoToPrevPageCommand()); + } } private function goToNextSlide():void { -// if (PresentationModel.getInstance().getCurrentPage().num < PresentationModel.getInstance().getNumberOfPages()) { -// dispatchEvent(new GoToNextPageCommand()); -// } + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null && presentationModel.getCurrentPage().num < presentationModel.getNumberOfPages()) { + dispatchEvent(new GoToNextPageCommand()); + } } private function showPercentageInDataTip(val:String):String { @@ -664,9 +684,10 @@ with BigBlueButton; if not, see . } private function updateStyles():void { -// if (PresentationModel.getInstance().getCurrentPage()) { -// disableSlideNavigationButtons(PresentationModel.getInstance().getCurrentPage().num); -// } + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null && presentationModel.getCurrentPage()) { + disableSlideNavigationButtons(presentationModel.getCurrentPage().num); + } } private function onPollStartButtonClicked():void { @@ -850,14 +871,17 @@ with BigBlueButton; if not, see . return; } -// var downloadablePresentations:ArrayCollection = PresentationModel.getInstance().getDownloadablePresentations(); -// if (presentOptions.enableDownload && downloadablePresentations.length > 0 && !UsersUtil.amIPresenter()) { -// LOGGER.debug("Enabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); -// downloadPres.visible = true; -// } else { -// LOGGER.debug("Disabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); -// downloadPres.visible = false; -// } + var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId); + if (presentationModel != null) { + var downloadablePresentations:ArrayCollection = presentationModel.getDownloadablePresentations(); + if (presentOptions.enableDownload && downloadablePresentations.length > 0 && !UsersUtil.amIPresenter()) { + LOGGER.debug("Enabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); + downloadPres.visible = true; + } else { + LOGGER.debug("Disabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]); + downloadPres.visible = false; + } + } } public function receiveToolbars(wt:WhiteboardToolbar, wtt:WhiteboardTextToolbar):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml index 1d4735f23c..e2b1168ac0 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml @@ -64,11 +64,13 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.Presentation; import org.bigbluebutton.modules.present.model.PresentationModel; + import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.modules.present.ui.views.models.SlideCalcUtil; import org.bigbluebutton.modules.present.ui.views.models.SlideViewModel; import org.bigbluebutton.modules.whiteboard.views.WhiteboardCanvas; import org.bigbluebutton.util.i18n.ResourceUtil; - + import org.bigbluebutton.main.api.JSLog; + private static const LOGGER:ILogger = getClassLogger(SlideView); [Bindable] public var zoomPercentage:Number = 100; @@ -112,26 +114,26 @@ with BigBlueButton; if not, see . } } - public function setSlides():void { -// var pres: Presentation = PresentationModel.getInstance().getCurrentPresentation(); -// if (pres != null) { -// pageCache = pres.getPages(); -// /* Create the SortField object for the "num" field in the ArrayCollection object, and make sure we do a numeric sort. */ -// var dataSortField:SortField = new SortField(); -// dataSortField.name = "num"; -// dataSortField.numeric = true; -// -// /* Create the Sort object and add the SortField object created earlier to the array of fields to sort on. */ -// var numericDataSort:Sort = new Sort(); -// numericDataSort.fields = [dataSortField]; -// -// /* Set the ArrayCollection object's sort property to our custom sort, and refresh the ArrayCollection. */ -// pageCache.sort = numericDataSort; -// pageCache.refresh(); -// thumbnailView.dataProvider = pageCache; -// } + public function setSlides(podId: String):void { + var pres: Presentation = PresentationPodManager.getInstance().getPod(podId).getCurrentPresentation(); + if (pres != null) { + pageCache = pres.getPages(); + /* Create the SortField object for the "num" field in the ArrayCollection object, and make sure we do a numeric sort. */ + var dataSortField:SortField = new SortField(); + dataSortField.name = "num"; + dataSortField.numeric = true; + + /* Create the Sort object and add the SortField object created earlier to the array of fields to sort on. */ + var numericDataSort:Sort = new Sort(); + numericDataSort.fields = [dataSortField]; + + /* Set the ArrayCollection object's sort property to our custom sort, and refresh the ArrayCollection. */ + pageCache.sort = numericDataSort; + pageCache.refresh(); + thumbnailView.dataProvider = pageCache; + } } - + public function setSelectedSlide(slideNum:int):void { if (slideNum > pageCache.length) { LOGGER.debug("Page num [{0}] > numPages[{1}]", [slideNum, pageCache.length]); @@ -282,21 +284,22 @@ with BigBlueButton; if not, see . // If delta is negative, the presenter is zooming-out of the presentation. return delta < 0; } - + /** * Handles notification from presenter that the slide has moved. */ private function handlePageChangedEvent(e:PageChangedEvent):void { - LOGGER.debug("Got a page changed event for page [{0}]", [e.pageId]); -// var page:Page = PresentationModel.getInstance().getPage(e.pageId); -// if (page != null) { -// if (! UsersUtil.amIPresenter()) { -// // if we are presenter, we don't need to reposition our view of the page -// positionPage(page); -// } -// } + JSLog.warn("+++--- SlideView:: handlePageChangedEvent: " + e.podId, {}); + LOGGER.debug("Got a page changed event for page [{0}]", [e.pageId]); + var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId); + if (page != null) { + if (! UsersUtil.amIPresenter()) { + // if we are presenter, we don't need to reposition our view of the page + positionPage(page); + } + } } - + private function positionPage(page:Page):void { if (page != null && page.swfData != null) { LOGGER.debug("Positioning page [{0}]", [page.id]); @@ -315,22 +318,24 @@ with BigBlueButton; if not, see . private function handlePageLoadedEvent(e:PageLoadedEvent):void { LOGGER.debug("Got a page loaded event for page [{0}]", [e.pageId]); -// var page:Page = PresentationModel.getInstance().getPage(e.pageId); -// if (page != null) { -// setSelectedSlide(page.num); -// slideLoader.source = page.swfData; -// LOGGER.debug("Displaying page [{0}]", [e.pageId]); -//// positionPage(page); -// if (whiteboardCanvas != null) { -// whiteboardCanvas.displayWhiteboardById(page.id); -// } -// -// //slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end"; -// slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + -// page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); -// slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + -// page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); -// } + + JSLog.warn("+++--- SlideView:: handlePageLoadedEvent: " + e.pageId + " " + e.podId, {}); + var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId); + if (page != null) { + setSelectedSlide(page.num); + slideLoader.source = page.swfData; + LOGGER.debug("Displaying page [{0}]", [e.pageId]); +// positionPage(page); + if (whiteboardCanvas != null) { + whiteboardCanvas.displayWhiteboardById(page.id); + } + + //slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end"; + slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + + page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); + slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") + + page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext"); + } } private function becomeViewer():void { @@ -377,12 +382,18 @@ with BigBlueButton; if not, see . } private function handleSlideLoadedCompleteEvent(event:Event):void { + + JSLog.warn("+++--- SlideView:: handleSlideLoadedCompleteEvent: ", {}); LOGGER.debug("Page has been loaded by swfLoader."); - slideModel.resetForNewSlide(slideLoader.contentWidth, slideLoader.contentHeight); - dispatchNewSlideDisplayedEvent(slideModel.pageOrigW, slideModel.pageOrigH); + slideModel.resetForNewSlide(slideLoader.contentWidth, slideLoader.contentHeight); + dispatchNewSlideDisplayedEvent(slideModel.pageOrigW, slideModel.pageOrigH); } - + private function dispatchNewSlideDisplayedEvent(slideRealWidth:int, slideRealHeight:int):void { + + + JSLog.warn("+++--- SlideView:: dispatchNewSlideDisplayedEvent: ", {}); + var dispEvent:DisplaySlideEvent = new DisplaySlideEvent(DisplaySlideEvent.DISPLAY_SLIDE_EVENT); dispEvent.slideWidth = slideRealWidth; dispEvent.slideHeight = slideRealHeight; From 301003bc2d9531a6c2c7ec5384721ad99a00d0f0 Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Tue, 3 Oct 2017 11:43:16 -0400 Subject: [PATCH 11/12] cleanup --- .../CreateNewPresentationPodPubMsgHdlr.scala | 5 +---- .../GetAllPresentationPodsReqMsgHdlr.scala | 4 ---- .../GetPresentationInfoReqMsgHdlr.scala | 3 --- .../core/running/MeetingActor.scala | 2 +- .../modules/present/business/PresentProxy.as | 5 ----- .../present/managers/PresentManager.as | 6 +----- .../present/model/PresentationModel.as | 3 --- .../present/model/PresentationPodManager.as | 11 ---------- .../present/services/PageLoaderService.as | 6 ++---- .../present/services/PresentationService.as | 4 +--- .../services/messaging/MessageReceiver.as | 20 +------------------ .../services/messaging/MessageSender.as | 7 ------- .../present/ui/views/FileUploadWindow.mxml | 1 - .../present/ui/views/PresentationWindow.mxml | 12 ++--------- .../modules/present/ui/views/SlideView.mxml | 9 --------- .../views/UploadedPresentationRenderer.mxml | 3 --- 16 files changed, 9 insertions(+), 92 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala index 5c5ce6da4b..f4a772e889 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/CreateNewPresentationPodPubMsgHdlr.scala @@ -30,12 +30,9 @@ trait CreateNewPresentationPodPubMsgHdlr { ) bus.outGW.send(respMsg) - log.warning("CreateNewPresentationPodPubMsgHdlr new podId=" + pod.id) - - log.warning("_____ pres pod add, before:" + state.presentationPodManager.getNumberOfPods()) val pods = state.presentationPodManager.addPod(pod) - log.warning("_____ pres pod add, afterB:" + pods.getNumberOfPods()) + log.warning("_____ pres pod add, after:" + pods.getNumberOfPods()) state.update(pods) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala index 109f3d6b19..3dd38c687e 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetAllPresentationPodsReqMsgHdlr.scala @@ -26,14 +26,10 @@ trait GetAllPresentationPodsReqMsgHdlr { BbbCommonEnvCoreMsg(envelope, event) } - log.debug("___________C_____________________") - val requesterId = msg.body.requesterId val pods = PresentationPodsApp.getAllPresentationPodsInMeeting(state) - log.debug("___________D_____________________" + requesterId) - val podsVO = pods.map(pod => PresentationPodsApp.translatePresentationPodToVO(pod)) val event = buildGetAllPresentationPodsRespMsg(podsVO, requesterId) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala index 1c087958ee..98da14b504 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/GetPresentationInfoReqMsgHdlr.scala @@ -24,15 +24,12 @@ trait GetPresentationInfoReqMsgHdlr { BbbCommonEnvCoreMsg(envelope, event) } - log.debug("___________A_____________________") - val requesterId = msg.body.userId val podId = msg.body.podId for { pod <- PresentationPodsApp.getPresentationPod(state, podId) } yield { - log.debug("___________b_____________________" + podId) val presInPod = pod.presentations val presVOs = presInPod.values.map { p => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index c8f3320d75..57e151702c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -155,7 +155,7 @@ class MeetingActor( // Create a default Presentation Pod // state = PresentationPodsApp.createDefaultPresentationPod(state) - log.debug("\n\n____NUM Presentation Pods = " + state.presentationPodManager.getNumberOfPods()) + log.debug("NUM Presentation Pods = " + state.presentationPodManager.getNumberOfPods()) /*******************************************************************/ //object FakeTestData extends FakeTestData diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as index eaa7f286c6..fd37d3fa27 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentProxy.as @@ -53,7 +53,6 @@ package org.bigbluebutton.modules.present.business import org.bigbluebutton.modules.present.services.messages.PageChangeVO; import org.bigbluebutton.modules.present.services.messaging.MessageReceiver; import org.bigbluebutton.modules.present.services.messaging.MessageSender; - import org.bigbluebutton.main.api.JSLog; public class PresentProxy { private static const LOGGER:ILogger = getClassLogger(PresentProxy); @@ -72,7 +71,6 @@ package org.bigbluebutton.modules.present.business private var currentUploadCommand: UploadFileCommand; public function PresentProxy() { - JSLog.warn("+++ PresentProxy:: constructor: ", {}); podManager = PresentationPodManager.getInstance(); @@ -124,9 +122,6 @@ package org.bigbluebutton.modules.present.business public function handleChangePresentationCommand(cmd:ChangePresentationCommand):void { var presModel: PresentationModel = podManager.getPod(cmd.podId); var pres:Presentation = presModel.getPresentation(cmd.presId); - JSLog.warn("+++ PresentProxy:: sharePresentation1: " + pres.id + " " + cmd.podId, {}); - JSLog.warn("+++ PresentProxy:: sharePresentation2: " + pres.id, {}); - JSLog.warn("+++ PresentProxy:: sharePresentation: ", pres != null); if (pres != null) { sender.sharePresentation(cmd.podId, pres.id); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as index 277ac54d5b..49f1177622 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/managers/PresentManager.as @@ -45,7 +45,6 @@ package org.bigbluebutton.modules.present.managers import org.bigbluebutton.modules.present.ui.views.FileDownloadWindow; import org.bigbluebutton.modules.present.ui.views.FileUploadWindow; import org.bigbluebutton.modules.present.ui.views.PresentationWindow; - import org.bigbluebutton.main.api.JSLog; public class PresentManager @@ -85,10 +84,9 @@ package org.bigbluebutton.modules.present.managers var openEvent:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT); openEvent.window = newWindow; - JSLog.warn("+++ PresentManager::handleAddPresentationPod openWindow req: " + podId, {}); globalDispatcher.dispatchEvent(openEvent); - podsManager.handleAddPresentationPod(podId, ownerId); // GOOD + podsManager.handleAddPresentationPod(podId, ownerId); } } @@ -128,8 +126,6 @@ package org.bigbluebutton.modules.present.managers public function handleOpenUploadWindow(e:UploadEvent):void { var uploadWindow : FileUploadWindow = PopUpUtil.createModalPopUp(FlexGlobals.topLevelApplication as DisplayObject, FileUploadWindow, false) as FileUploadWindow; if (uploadWindow) { - import org.bigbluebutton.main.api.JSLog; - JSLog.warn("+++ PresentManager:: handleOpenUploadWindow: " + e.podId, {}); uploadWindow.maxFileSize = e.maxFileSize; // uploadWindow.podId = e.podId; uploadWindow.setPodId(e.podId); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as index a2a4d1b516..8df1e14a83 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationModel.as @@ -5,7 +5,6 @@ package org.bigbluebutton.modules.present.model import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.modules.present.services.messages.PageChangeVO; - import org.bigbluebutton.main.api.JSLog; public class PresentationModel { @@ -29,7 +28,6 @@ package org.bigbluebutton.modules.present.model private function initialize(podId: String, ownerId: String):void { _podId = podId; _ownerId = ownerId; - JSLog.warn("+++ PresentationModel:: initialize2: " + _podId + " " + _ownerId, {}); } // /** @@ -52,7 +50,6 @@ package org.bigbluebutton.modules.present.model } public function addPresentation(p: Presentation):void { - JSLog.warn("+++ PresentationModel:: addPresentation: ", {}); _presentations.addItem(p); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as index db050c69f2..25893c660a 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/model/PresentationPodManager.as @@ -15,7 +15,6 @@ package org.bigbluebutton.modules.present.model { import org.bigbluebutton.modules.present.events.PresentationPodRemoved; import org.bigbluebutton.modules.present.events.RequestPresentationInfoPodEvent; - import org.bigbluebutton.main.api.JSLog; public class PresentationPodManager { private static const LOGGER:ILogger = getClassLogger(PresentationPodManager); @@ -40,7 +39,6 @@ package org.bigbluebutton.modules.present.model { } private function initialize():void { - JSLog.warn("+++ PresentationPodManager:: initialize: ", {}); } /** @@ -65,12 +63,10 @@ package org.bigbluebutton.modules.present.model { for (var i:int = 0; i < _presentationPods.length; i++) { var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; - // JSLog.warn("+++ PresentationPodManager:: getPod podId=" + podId + " getPodId=" + pod.getPodId(), {}); if (pod.getPodId() == podId) { return pod; } } - JSLog.warn("+++ PresentationPodManager:: getPod FAIL for podId=" + podId + " size=" + _presentationPods.length, {}); return resultingPod; } @@ -78,35 +74,28 @@ package org.bigbluebutton.modules.present.model { for (var i:int = 0; i < _presentationPods.length; i++) { var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; if (pod.getPodId() == podId) { - JSLog.warn("+++ (DUPLICATE FOUND) PresentationPodManager::handleAddPresentationPod " + podId, {}); return; } } var newPod: PresentationModel = new PresentationModel(podId, ownerId); _presentationPods.addItem(newPod); - JSLog.warn("+++ after (SUCCESS) PresentationPodManager::handleAddPresentationPod " + podId + " size=" + _presentationPods.length, {}); } public function handlePresentationPodRemoved(podId: String, ownerId: String): void { - JSLog.warn("+++ PresentationPodManager::handlePresentationPodRemoved " + podId, {}); for (var i:int = 0; i < _presentationPods.length; i++) { var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; - JSLog.warn("+++ PresentationPodManager:: remove for podId=" + podId + " final size= " + _presentationPods.length, {}); if (pod.getPodId() == podId) { _presentationPods.removeItemAt(i); - JSLog.warn("+++ (SUCCESS) PresentationPodManager:: remove for podId=" + podId + " final size= " + _presentationPods.length, {}); return; } } - JSLog.warn("+++ (FAIL) PresentationPodManager:: remove for podId=" + podId + " final size= " + _presentationPods.length, {}); } public function requestAllPodsPresentationInfo(): void { - JSLog.warn("+++ PresentationPodManager:: requestAllPodsPresentationInfo" + _presentationPods.length, {}); for (var i:int = 0; i < _presentationPods.length; i++) { var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as index d603eb1e6c..2b50696830 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PageLoaderService.as @@ -9,7 +9,6 @@ package org.bigbluebutton.modules.present.services import org.bigbluebutton.modules.present.model.Page; import org.bigbluebutton.modules.present.model.PresentationModel; import org.bigbluebutton.modules.present.model.PresentationPodManager; - import org.bigbluebutton.main.api.JSLog; public class PageLoaderService { @@ -18,7 +17,7 @@ package org.bigbluebutton.modules.present.services public function loadPage(cmd: ChangePageCommand):void { var page:Page = PresentationPodManager.getInstance().getPod(cmd.podId).getPage(cmd.pageId); - JSLog.warn("+++ PageLoaderService:: loadPage1: " + cmd.podId + "_____" + cmd.pageId, page != null); + if (page != null) { LOGGER.debug("Loading page [{0}]", [cmd.pageId]); page.loadPage(pageLoadedListener, cmd.podId, cmd.preloadCount); @@ -28,8 +27,7 @@ package org.bigbluebutton.modules.present.services public function pageLoadedListener(podId: String, pageId:String, preloadCount:uint):void { var page: Page = PresentationPodManager.getInstance().getPod(podId).getPage(pageId); - - JSLog.warn("+++ PageLoaderService:: pageLoadedListener1: " + podId + "_____" + pageId, {}); + if (page != null) { if (page.current) { // The page has been loaded and still the current displayed page. diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as index 30ec198c28..7800da2c45 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/PresentationService.as @@ -19,7 +19,6 @@ package org.bigbluebutton.modules.present.services import org.bigbluebutton.modules.present.services.messages.PresentationVO; import org.bigbluebutton.modules.present.services.messaging.MessageReceiver; import org.bigbluebutton.modules.present.services.messaging.MessageSender; - import org.bigbluebutton.main.api.JSLog; public class PresentationService { @@ -79,7 +78,7 @@ package org.bigbluebutton.modules.present.services public function addPresentation(podId: String, pres:PresentationVO):void { var presentation:Presentation = presentationVOToPresentation(pres); - JSLog.warn("+++ PresentationService:: addPresentatioN: " + podId, {}); + podManager.getPod(podId).addPresentation(presentation); LOGGER.debug("Added new presentation [{0}]", [presentation.id]); @@ -132,7 +131,6 @@ package org.bigbluebutton.modules.present.services dispatcher.dispatchEvent(event); var curPage:Page = podManager.getPod(podId).getCurrentPage(); - JSLog.warn("+++ PresentationService:: changeCurrentPresentation3: " + curPage.id, curPage != null); if (curPage != null) { var changePageCommand: ChangePageCommand = new ChangePageCommand(podId, curPage.id, NUM_PRELOAD); dispatcher.dispatchEvent(changePageCommand); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as index 21c94cc0eb..b9fcfca5ca 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageReceiver.as @@ -46,7 +46,6 @@ package org.bigbluebutton.modules.present.services.messaging import org.bigbluebutton.modules.present.services.messages.PageVO; import org.bigbluebutton.modules.present.services.messages.PresentationVO; import org.bigbluebutton.modules.present.services.messages.PresentationPodVO; - import org.bigbluebutton.main.api.JSLog; public class MessageReceiver implements IMessageListener { @@ -63,21 +62,7 @@ package org.bigbluebutton.modules.present.services.messaging public function onMessage(messageName:String, message:Object):void { //LOGGER.info("Presentation: received message " + messageName); - if (messageName == "ResizeAndMovePageEvtMsg" || - messageName == "SendCursorPositionEvtMsg" || - messageName == "GetWhiteboardAccessRespMsg" || - messageName == "GetSharedNotesEvtMsg" || - messageName == "SendCaptionHistoryRespMsg" || - messageName == "GetGroupChatMsgsRespMsg" || - messageName == "DoLatencyTracerMsg" || - messageName == "PresentationConversionUpdateEvtMsg" || - messageName == "ServerToClientLatencyTracerMsg") { - - } else { - JSLog.warn("____Presentation received: " + messageName, message); - } - - + switch (messageName) { case "SetCurrentPageEvtMsg": handleSetCurrentPageEvtMsg(message); @@ -125,9 +110,6 @@ package org.bigbluebutton.modules.present.services.messaging } private function handleSetCurrentPageEvtMsg(msg:Object):void { - JSLog.warn("__--__Presentation received: handleSetCurrentPageEvtMsg" + msg.body.podId, {}); - JSLog.warn("__--__Presentation received: handleSetCurrentPageEvtMsg" + msg.body.pageId, {}); - service.pageChanged(msg.body.podId, msg.body.pageId); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as index 0f78373de5..6df48b4d29 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/messaging/MessageSender.as @@ -23,7 +23,6 @@ package org.bigbluebutton.modules.present.services.messaging import org.bigbluebutton.core.BBB; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.managers.ConnectionManager; - import org.bigbluebutton.main.api.JSLog; public class MessageSender { @@ -76,8 +75,6 @@ package org.bigbluebutton.modules.present.services.messaging } public function getPresentationInfo(podId: String):void { - JSLog.warn("sender: getPresentationInfo " + podId, {}); - var message:Object = { header: {name: "GetPresentationInfoReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, body: {userId: UsersUtil.getMyUserID(), podId: podId} @@ -92,8 +89,6 @@ package org.bigbluebutton.modules.present.services.messaging } public function requestAllPodsEvent():void { - JSLog.warn("sender: requestAllPodsEvent ", {}); - var message:Object = { header: {name: "GetAllPresentationPodsReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, body: {requesterId: UsersUtil.getMyUserID()} @@ -140,7 +135,6 @@ package org.bigbluebutton.modules.present.services.messaging header: {name: "CreateNewPresentationPodPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, body: {ownerId: requesterId} }; - JSLog.warn("sender: request the creation of a new presentation pod ", null); var _nc:ConnectionManager = BBB.initConnectionManager(); _nc.sendMessage2x( @@ -155,7 +149,6 @@ package org.bigbluebutton.modules.present.services.messaging header: {name: "RemovePresentationPodPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()}, body: {requesterId: requesterId, podId: podId} }; - JSLog.warn("sender: closing a presentation pod ", null); var _nc:ConnectionManager = BBB.initConnectionManager(); _nc.sendMessage2x( diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml index f62ac24324..16c2ad8a8a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/FileUploadWindow.mxml @@ -93,7 +93,6 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.model.PresentationModel; import org.bigbluebutton.modules.present.model.PresentationPodManager; import org.bigbluebutton.util.i18n.ResourceUtil; - import org.bigbluebutton.main.api.JSLog; use namespace mx_internal; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index 99a541bd78..00d610f47d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -114,7 +114,6 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.whiteboard.views.WhiteboardTextToolbar; import org.bigbluebutton.modules.whiteboard.views.WhiteboardToolbar; import org.bigbluebutton.util.i18n.ResourceUtil; - import org.bigbluebutton.main.api.JSLog; private static const LOGGER:ILogger = getClassLogger(PresentationWindow); @@ -188,21 +187,16 @@ with BigBlueButton; if not, see . public function getOwnerId(): String { return this.ownerId; } private function onPresentationPodControlsClicked():void { - JSLog.warn("+++ onPresentationPodControlsClicked: ", {}); presentationPodControls.selectedItem.handler(); } private function newPresentationWindowHandler(): void { - JSLog.warn("+++ newPresentationWindowHandler: ", {}); - var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD); event.requesterId = UsersUtil.getMyUserID(); localDispatcher.dispatchEvent(event); } private function closePresentationWindowHandler(): void { - JSLog.warn("+++ closePresentationWindowHandler: ", {}); - var event:RequestClosePresentationPodEvent = new RequestClosePresentationPodEvent(RequestClosePresentationPodEvent.REQUEST_CLOSE_PRES_POD); event.requesterId = UsersUtil.getMyUserID(); event.podId = this.podId; @@ -210,7 +204,7 @@ with BigBlueButton; if not, see . } private function setPresenterInPodHandler(): void { - JSLog.warn("+++ setPresenterInPodHandler: ", {}); + // TODO } private function onCreationComplete():void{ @@ -454,9 +448,7 @@ with BigBlueButton; if not, see . } private function notifyOthersOfSharingPresentation(presentationName:String):void { - JSLog.warn("+++ notifyOthersOfSharingPresentation1: " + presentationName, {}); - - + // TODO var shareEvent:PresenterCommands = new PresenterCommands(PresenterCommands.SHARE_PRESENTATION_COMMAND); shareEvent.presentationName = presentationName; shareEvent.podId = podId; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml index e2b1168ac0..8d4ee3e55f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml @@ -69,7 +69,6 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.present.ui.views.models.SlideViewModel; import org.bigbluebutton.modules.whiteboard.views.WhiteboardCanvas; import org.bigbluebutton.util.i18n.ResourceUtil; - import org.bigbluebutton.main.api.JSLog; private static const LOGGER:ILogger = getClassLogger(SlideView); @@ -289,7 +288,6 @@ with BigBlueButton; if not, see . * Handles notification from presenter that the slide has moved. */ private function handlePageChangedEvent(e:PageChangedEvent):void { - JSLog.warn("+++--- SlideView:: handlePageChangedEvent: " + e.podId, {}); LOGGER.debug("Got a page changed event for page [{0}]", [e.pageId]); var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId); if (page != null) { @@ -318,8 +316,6 @@ with BigBlueButton; if not, see . private function handlePageLoadedEvent(e:PageLoadedEvent):void { LOGGER.debug("Got a page loaded event for page [{0}]", [e.pageId]); - - JSLog.warn("+++--- SlideView:: handlePageLoadedEvent: " + e.pageId + " " + e.podId, {}); var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId); if (page != null) { setSelectedSlide(page.num); @@ -383,17 +379,12 @@ with BigBlueButton; if not, see . private function handleSlideLoadedCompleteEvent(event:Event):void { - JSLog.warn("+++--- SlideView:: handleSlideLoadedCompleteEvent: ", {}); LOGGER.debug("Page has been loaded by swfLoader."); slideModel.resetForNewSlide(slideLoader.contentWidth, slideLoader.contentHeight); dispatchNewSlideDisplayedEvent(slideModel.pageOrigW, slideModel.pageOrigH); } private function dispatchNewSlideDisplayedEvent(slideRealWidth:int, slideRealHeight:int):void { - - - JSLog.warn("+++--- SlideView:: dispatchNewSlideDisplayedEvent: ", {}); - var dispEvent:DisplaySlideEvent = new DisplaySlideEvent(DisplaySlideEvent.DISPLAY_SLIDE_EVENT); dispEvent.slideWidth = slideRealWidth; dispEvent.slideHeight = slideRealHeight; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml index ac49d75115..8fae90477d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/UploadedPresentationRenderer.mxml @@ -39,9 +39,6 @@ private var rolledOver:Boolean = false; private function showPresentation():void { - import org.bigbluebutton.main.api.JSLog; - JSLog.warn("+++ UploadedPresentationRenderer::showPresentation " , data); - var changePresCommand:ChangePresentationCommand = new ChangePresentationCommand('AAAAAUploadedPresentationRendererAAAA', data.id); globalDispatch.dispatchEvent(changePresCommand); From 04ae60f6aaf198172ea8061c90c81cc9ce9c4cd3 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Tue, 3 Oct 2017 11:01:48 -0700 Subject: [PATCH 12/12] - fix determining of guest status --- .../bigbluebutton/core/api/ValueObjects.scala | 2 +- .../apps/users/RegisterUserReqMsgHdlr.scala | 7 +++++- .../core/models/GuestsWaiting.scala | 22 +++++++++++++++---- .../bigbluebutton/core2/AnalyticsActor.scala | 1 + 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala index 3d5984726a..26b18b5d2c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala @@ -92,7 +92,7 @@ case class MeetingConfig( duration: MeetingDuration, defaultAvatarURL: String, defaultConfigToken: String, - guestPolicy: String = GuestPolicyType.ASK_MODERATOR + guestPolicy: String = GuestPolicyType.ALWAYS_ACCEPT ) case class MeetingName(name: String) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala index 668a9bf708..2ee89a5630 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/RegisterUserReqMsgHdlr.scala @@ -22,12 +22,15 @@ trait RegisterUserReqMsgHdlr { BbbCommonEnvCoreMsg(envelope, event) } + val guestPolicy = liveMeeting.guestsWaiting.getGuestPolicy().policy val guestStatus = GuestStatus.determineGuestStatus( msg.body.guest, - liveMeeting.guestsWaiting.getGuestPolicy().policy, + guestPolicy, msg.body.authed ) + println("********* GUEST MANAGEMENT guestStatus=" + guestStatus + " policy=" + guestPolicy) + val regUser = RegisteredUsers.create(msg.body.intUserId, msg.body.extUserId, msg.body.name, msg.body.role, msg.body.authToken, msg.body.avatarURL, msg.body.guest, msg.body.authed, guestStatus) @@ -53,6 +56,8 @@ trait RegisterUserReqMsgHdlr { } guestStatus match { + case GuestStatus.ALLOW => + // do nothing. Let the user go through. case GuestStatus.WAIT => val guest = GuestWaiting(regUser.id, regUser.name, regUser.role) addGuestToWaitingForApproval(guest, liveMeeting.guestsWaiting) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/GuestsWaiting.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/GuestsWaiting.scala index f613ab109b..26ac604320 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/GuestsWaiting.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/GuestsWaiting.scala @@ -29,7 +29,7 @@ object GuestsWaiting { class GuestsWaiting { private var guests: collection.immutable.HashMap[String, GuestWaiting] = new collection.immutable.HashMap[String, GuestWaiting] - private var guestPolicy = GuestPolicy(GuestPolicyType.ASK_MODERATOR, "SYSTEM") + private var guestPolicy = GuestPolicy(GuestPolicyType.ALWAYS_ACCEPT, "SYSTEM") private def toVector: Vector[GuestWaiting] = guests.values.toVector @@ -60,7 +60,7 @@ object GuestPolicyType { val ASK_MODERATOR = "ASK_MODERATOR" val ALWAYS_ACCEPT_AUTH = "ALWAYS_ACCEPT_AUTH" - val policyTypes = Set(ALWAYS_ACCEPT, ALWAYS_ACCEPT, ASK_MODERATOR, ALWAYS_ACCEPT_AUTH) + val policyTypes = Set(ALWAYS_ACCEPT, ALWAYS_DENY, ASK_MODERATOR, ALWAYS_ACCEPT_AUTH) } object GuestStatus { @@ -68,14 +68,28 @@ object GuestStatus { val DENY = "DENY" val WAIT = "WAIT" + def defaultGuestStatus(guestPolicy: String): String = { + guestPolicy match { + case GuestPolicyType.ASK_MODERATOR => + GuestStatus.WAIT + case GuestPolicyType.ALWAYS_ACCEPT => + GuestStatus.ALLOW + case GuestPolicyType.ALWAYS_DENY => + GuestStatus.DENY + case _ => + //Handle No case found + GuestStatus.DENY + } + } + def determineGuestStatus(guest: Boolean, guestPolicy: String, authenticated: Boolean): String = { - var guestStatus = GuestStatus.WAIT + var guestStatus = defaultGuestStatus(guestPolicy) + if (guest) { guestPolicy match { case GuestPolicyType.ASK_MODERATOR => guestStatus = GuestStatus.WAIT case GuestPolicyType.ALWAYS_ACCEPT => - // Do not ask to join guestStatus = GuestStatus.ALLOW case GuestPolicyType.ALWAYS_ACCEPT_AUTH => if (authenticated) { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala index 7056532443..6497cdb94c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala @@ -96,6 +96,7 @@ class AnalyticsActor extends Actor with ActorLogging { // Guest Management case m: GuestsWaitingApprovedMsg => logMessage(msg) case m: GuestsWaitingApprovedEvtMsg => logMessage(msg) + case m: GuestsWaitingForApprovalEvtMsg => logMessage(msg) case m: ClientToServerLatencyTracerMsg => traceMessage(msg) case m: ServerToClientLatencyTracerMsg => traceMessage(msg)