Merge branch 'antobinary-pods_vol3' into implement-multi-chat

This commit is contained in:
Richard Alam 2017-10-03 11:02:52 -07:00
commit 5b2cda0723
87 changed files with 1791 additions and 519 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)) //
// }
//}

View File

@ -8,8 +8,8 @@ import org.bigbluebutton.core.running.LiveMeeting
class PresentationApp2x(implicit val context: ActorContext)
extends NewPresentationMsgHdlr
with SetCurrentPresentationPubMsgHdlr
with GetPresentationInfoReqMsgHdlr
// with SetCurrentPresentationPubMsgHdlr
// with GetPresentationInfoReqMsgHdlr
with SetCurrentPagePubMsgHdlr
with ResizeAndMovePagePubMsgHdlr
with RemovePresentationPubMsgHdlr

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -2,7 +2,8 @@ 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
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 = {

View File

@ -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)
// }
// }
//}

View File

@ -0,0 +1,40 @@
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 {
this: PresentationPodHdlrs =>
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)
log.warning("_____ pres pod add, after:" + pods.getNumberOfPods())
state.update(pods)
}
}

View File

@ -0,0 +1,40 @@
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)
}
val requesterId = msg.body.requesterId
val pods = PresentationPodsApp.getAllPresentationPodsInMeeting(state)
val podsVO = pods.map(pod => PresentationPodsApp.translatePresentationPodToVO(pod))
val event = buildGetAllPresentationPodsRespMsg(podsVO, requesterId)
bus.outGW.send(event)
state
}
}

View File

@ -0,0 +1,45 @@
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)
}
val requesterId = msg.body.userId
val podId = msg.body.podId
for {
pod <- PresentationPodsApp.getPresentationPod(state, podId)
} yield {
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
}
}

View File

@ -0,0 +1,15 @@
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
with GetPresentationInfoReqMsgHdlr
with GetAllPresentationPodsReqMsgHdlr
with SetCurrentPresentationPubMsgHdlr
with RemovePresentationPodPubMsgHdlr {
val log = Logging(context.system, getClass)
}

View File

@ -0,0 +1,56 @@
package org.bigbluebutton.core.apps.presentationpod
import org.bigbluebutton.common2.domain._
import org.bigbluebutton.core.apps.Presentation
import org.bigbluebutton.core.domain._
import org.bigbluebutton.core.models._
import org.bigbluebutton.core.running.LiveMeeting
object PresentationPodsApp {
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)
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 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)
}
def updatePresentationPod(state: MeetingState2x, pod: PresentationPod): MeetingState2x = {
val podManager = state.presentationPodManager.addPod(pod)
state.update(podManager)
}
}

View File

@ -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)
}
}

View File

@ -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
}
}

View File

@ -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)

View File

@ -2,6 +2,7 @@ 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 {
@ -9,12 +10,14 @@ object MeetingState2x {
case class MeetingState2x(
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)

View File

@ -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) {

View File

@ -0,0 +1,55 @@
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 { // set new current presenter
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(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
def updatePresentationPod(presPod: PresentationPod): PresentationPodManager = addPod(presPod)
}

View File

@ -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 =>
@ -200,6 +202,12 @@ class ReceivedJsonMsgHandlerActor(
case AssignPresenterReqMsg.NAME =>
routeGenericMsg[AssignPresenterReqMsg](envelope, jsonNode)
// Presentation Pods
case CreateNewPresentationPodPubMsg.NAME =>
routeGenericMsg[CreateNewPresentationPodPubMsg](envelope, jsonNode)
case RemovePresentationPodPubMsg.NAME =>
routeGenericMsg[RemovePresentationPodPubMsg](envelope, jsonNode)
// Caption
case EditCaptionHistoryPubMsg.NAME =>
routeGenericMsg[EditCaptionHistoryPubMsg](envelope, jsonNode)

View File

@ -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 }
@ -109,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
@ -131,7 +133,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()
@ -145,6 +153,10 @@ class MeetingActor(
log.debug("NUM GROUP CHATS = " + state.groupChats.findAllPublicChats().length)
// Create a default Presentation Pod
// state = PresentationPodsApp.createDefaultPresentationPod(state)
log.debug("NUM Presentation Pods = " + state.presentationPodManager.getNumberOfPods())
/*******************************************************************/
//object FakeTestData extends FakeTestData
//FakeTestData.createFakeUsers(liveMeeting)
@ -272,8 +284,9 @@ class MeetingActor(
case m: GetLockSettingsReqMsg => handleGetLockSettingsReqMsg(m)
// Presentation
case m: SetCurrentPresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus)
case m: GetPresentationInfoReqMsg => presentationApp2x.handle(m, liveMeeting, msgBus)
// 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)
case m: ResizeAndMovePagePubMsg => presentationApp2x.handle(m, liveMeeting, msgBus)
case m: RemovePresentationPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus)
@ -285,6 +298,13 @@ 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)
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)
case m: UpdateCaptionOwnerPubMsg => captionApp2x.handle(m, liveMeeting, msgBus)

View File

@ -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)

View File

@ -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])

View File

@ -6,11 +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)
object GetPresentationInfoReqMsg { val NAME = "GetPresentationInfoReqMsg"}
case class GetPresentationInfoReqMsg(header: BbbClientMsgHeader, body: GetPresentationInfoReqMsgBody) extends StandardMsg
case class GetPresentationInfoReqMsgBody(userId: String)
case class SetCurrentPresentationPubMsgBody(podId: String, presentationId: String)
object SetCurrentPagePubMsg { val NAME = "SetCurrentPagePubMsg"}
case class SetCurrentPagePubMsg(header: BbbClientMsgHeader, body: SetCurrentPagePubMsgBody) extends StandardMsg
@ -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])
@ -78,11 +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)
object GetPresentationInfoRespMsg { val NAME = "GetPresentationInfoRespMsg"}
case class GetPresentationInfoRespMsg(header: BbbClientMsgHeader, body: GetPresentationInfoRespMsgBody) extends BbbCoreMsg
case class GetPresentationInfoRespMsgBody(presentations: Vector[PresentationVO])
case class SetCurrentPresentationEvtMsgBody(podId: String, presentationId: String)
object SetCurrentPageEvtMsg { val NAME = "SetCurrentPageEvtMsg"}
case class SetCurrentPageEvtMsg(header: BbbClientMsgHeader, body: SetCurrentPageEvtMsgBody) extends BbbCoreMsg
@ -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 ------------

View File

@ -0,0 +1,106 @@
package org.bigbluebutton.common2.msgs
import org.bigbluebutton.common2.domain.{PresentationPodVO, PresentationVO}
// ------------ 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(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 ------------
// ------------ 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( 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 ------------

View File

@ -44,6 +44,7 @@ public class DocumentConversionServiceImp implements DocumentConversionService {
SupportedDocumentFilter sdf = new SupportedDocumentFilter(gw);
Map<String, Object> logData = new HashMap<String, Object>();
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<String, Object>();
logData.put("podId", pres.getPodId());
logData.put("meetingId", pres.getMeetingId());
logData.put("presId", pres.getId());
logData.put("filename", pres.getName());

View File

@ -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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}

View File

@ -102,6 +102,7 @@ public class PdfToSwfSlidesGenerationService {
builder.messageKey(ConversionMessageConstants.PAGE_COUNT_FAILED_KEY);
Map<String, Object> logData = new HashMap<String, Object>();
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<String, Object> logData = new HashMap<String, Object>();
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<String, Object> logData = new HashMap<String, Object>();
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<String, Object> logData = new HashMap<String, Object>();
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<String, Object> logData = new HashMap<String, Object>();
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<String, Object> logData = new HashMap<String, Object>();
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<String, Object> logData = new HashMap<String, Object>();
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<String, Object> logData = new HashMap<String, Object>();
logData.put("podId", pres.getPodId());
logData.put("meetingId", pres.getMeetingId());
logData.put("presId", pres.getId());
logData.put("filename", pres.getName());

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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])

View File

@ -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)

View File

@ -275,6 +275,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

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -40,9 +40,14 @@ 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.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;
@ -61,12 +66,13 @@ package org.bigbluebutton.modules.present.business
private var sender:MessageSender;
private var _messageReceiver:MessageReceiver;
private var presentationModel:PresentationModel;
private var podManager: PresentationPodManager;
private var service: PresentationService;
private var currentUploadCommand: UploadFileCommand;
public function PresentProxy() {
presentationModel = PresentationModel.getInstance();
podManager = PresentationPodManager.getInstance();
slides = new PresentationSlides();
sender = new MessageSender();
@ -74,12 +80,17 @@ package org.bigbluebutton.modules.present.business
}
public function getCurrentPresentationInfo():void {
sender.getPresentationInfo();
podManager.requestAllPodsPresentationInfo();
}
public function connect(e:PresentModuleEvent):void{
public function handleRequestAllPodsEvent(e: RequestAllPodsEvent):void {
sender.requestAllPodsEvent();
}
public function connect(e:PresentModuleEvent):void {
extractAttributes(e.data);
sender.getPresentationInfo();
podManager.requestAllPodsPresentationInfo(); // Instead of sender.getPresentationInfo();
}
private function extractAttributes(a:Object):void{
@ -104,41 +115,47 @@ package org.bigbluebutton.modules.present.business
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);
var presModel: PresentationModel = podManager.getPod(cmd.podId);
var pres:Presentation = presModel.getPresentation(cmd.presId);
if (pres != null) {
sender.sharePresentation(pres.id);
sender.sharePresentation(cmd.podId, 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");
// }
}
/**
@ -154,8 +171,11 @@ 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;
// TODO
uploadService = null; // reset upload service so we can use new token for consecutive upload
} else {
}
@ -182,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);
}
/**
@ -221,8 +241,8 @@ package org.bigbluebutton.modules.present.business
* @param e
*
*/
public function sharePresentation(e:PresenterCommands):void{
sender.sharePresentation(e.presentationName);
public function sharePresentation(e:PresenterCommands):void {
sender.sharePresentation(e.podId, e.presentationName);
}
public function removePresentation(e:RemovePresentationEvent):void {
@ -235,12 +255,30 @@ package org.bigbluebutton.modules.present.business
*
*/
public function zoomSlide(e:PresenterCommands):void{
var currentPresentation:Presentation = PresentationModel.getInstance().getCurrentPresentation();
if (currentPresentation == null) return;
// 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 currentPage:Page = PresentationModel.getInstance().getCurrentPage();
/**
* Request the creation of a new presentation pod
* @param e
*
*/
public function handleRequestNewPresentationPod(e: RequestNewPresentationPodEvent): void {
sender.requestNewPresentationPod(e.requesterId);
}
sender.move(currentPresentation.id, currentPage.id, e.xOffset, e.yOffset, e.slideToCanvasWidthRatio, e.slideToCanvasHeightRatio);
/**
* Request the removal of a specific presentation pod
* @param e
*
*/
public function handleRequestClosePresentationPod(e: RequestClosePresentationPodEvent): void {
sender.requestClosePresentationPod(e.requesterId, e.podId);
}
}
}

View File

@ -6,12 +6,14 @@ 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;
}

View File

@ -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;
}
}

View File

@ -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()
{

View File

@ -8,10 +8,12 @@ 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;
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*
*/
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);
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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)
{

View File

@ -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 <http://www.gnu.org/licenses/>.
*
*/
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);
}
}
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*
*/
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);
}
}
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*
*/
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);
}
}
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*
*/
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);
}
}
}

View File

@ -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);

View File

@ -24,55 +24,111 @@ 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.CloseWindowEvent;
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;
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.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;
import org.bigbluebutton.modules.present.ui.views.FileUploadWindow;
import org.bigbluebutton.modules.present.ui.views.PresentationWindow;
public class PresentManager
{
private var globalDispatcher:Dispatcher;
private var presentWindow:PresentationWindow;
private var windows: Array = [];
private var podsManager: PresentationPodManager;
public function PresentManager() {
globalDispatcher = new Dispatcher();
podsManager = PresentationPodManager.getInstance();
}
public function handleStartModuleEvent(e:PresentModuleEvent):void{
if (presentWindow != null){
if (windows.length >= 1) {
return;
}
var event:RequestAllPodsEvent = new RequestAllPodsEvent(RequestAllPodsEvent.REQUEST_ALL_PODS);
globalDispatcher.dispatchEvent(event);
}
public function handleAddPresentationPod(e: NewPresentationPodCreated): void {
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;
presentWindow = new PresentationWindow();
presentWindow.visible = presentOptions.showPresentWindow;
presentWindow.showControls = presentOptions.showWindowControls;
openWindow(presentWindow);
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);
podsManager.handleAddPresentationPod(podId, ownerId);
}
}
public function handlePresentationPodRemoved(e: PresentationPodRemoved): void {
var podId: String = e.podId;
var ownerId: String = e.ownerId;
podsManager.handlePresentationPodRemoved(podId, ownerId); // GOOD
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 handleGetAllPodsRespEvent(e: GetAllPodsRespEvent): void {
var podsAC:ArrayCollection = e.pods as ArrayCollection;
podsManager.handleGetAllPodsResp(podsAC);
}
public function handleStopModuleEvent():void{
var event:CloseWindowEvent = new CloseWindowEvent(CloseWindowEvent.CLOSE_WINDOW_EVENT);
event.window = presentWindow;
globalDispatcher.dispatchEvent(event);
for (var key: String in windows) {
windows[key].close();
}
private function openWindow(window:IBbbModuleWindow):void{
var event:OpenWindowEvent = new OpenWindowEvent(OpenWindowEvent.OPEN_WINDOW_EVENT);
event.window = window;
globalDispatcher.dispatchEvent(event);
// var event:CloseWindowEvent = new CloseWindowEvent(CloseWindowEvent.CLOSE_WINDOW_EVENT);
// event.window = presentWindow;
// globalDispatcher.dispatchEvent(event);
}
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) {
uploadWindow.maxFileSize = e.maxFileSize;
// uploadWindow.podId = e.podId;
uploadWindow.setPodId(e.podId);
var point1:Point = new Point();
point1.x = FlexGlobals.topLevelApplication.width / 2;

View File

@ -40,7 +40,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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.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.GetAllPodsRespEvent;
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;
]]>
</fx:Script>
@ -141,5 +149,34 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<EventHandlers type="{GoToNextPageCommand.GO_TO_NEXT_PAGE}">
<MethodInvoker generator="{PresentProxy}" method="handleGoToNextPageCommand" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{NewPresentationPodCreated.PRESENTATION_NEW_POD_CREATED}" >
<MethodInvoker generator="{PresentManager}" method="handleAddPresentationPod" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD}" >
<MethodInvoker generator="{PresentProxy}" method="handleRequestNewPresentationPod" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{RequestClosePresentationPodEvent.REQUEST_CLOSE_PRES_POD}" >
<MethodInvoker generator="{PresentProxy}" method="handleRequestClosePresentationPod" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{PresentationPodRemoved.PRESENTATION_POD_REMOVED}" >
<MethodInvoker generator="{PresentManager}" method="handlePresentationPodRemoved" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{RequestPresentationInfoPodEvent.REQUEST_PRES_INFO}" >
<MethodInvoker generator="{PresentProxy}" method="handleRequestPresentationInfoPodEvent" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{RequestAllPodsEvent.REQUEST_ALL_PODS}" >
<MethodInvoker generator="{PresentProxy}" method="handleRequestAllPodsEvent" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{GetAllPodsRespEvent.GET_ALL_PODS_RESP}" >
<MethodInvoker generator="{PresentManager}" method="handleGetAllPodsRespEvent" arguments="{event}" />
</EventHandlers>
</fx:Declarations>
</EventMap>

View File

@ -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;
}

View File

@ -19,7 +19,7 @@ package org.bigbluebutton.modules.present.model
_id = id;
_name = name;
_current = current;
_pages = pages
_pages = pages;
_downloadable = downloadable;
}

View File

@ -10,33 +10,43 @@ package org.bigbluebutton.modules.present.model
{
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();
public function PresentationModel(podId: String, ownerId: String) {
initialize(podId, ownerId);
}
private function initialize():void {
private function initialize(podId: String, ownerId: String):void {
_podId = podId;
_ownerId = ownerId;
}
/**
* Return the single instance of the PresentationModel class
*/
// /**
// * Return the single instance of the PresentationModel class
// */
public static function getInstance():PresentationModel{
if (instance == null){
instance = new PresentationModel(new SingletonEnforcer());
// if (instance == null){
// instance = new PresentationModel();
// }
// return instance;
return null;
}
return instance;
public function getPodId(): String {
return _podId;
}
public function getOwnerId(): String {
return _ownerId;
}
public function addPresentation(p: Presentation):void {

View File

@ -0,0 +1,131 @@
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.services.messages.PresentationPodVO;
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;
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 {
}
/**
* Return the single instance of the PresentationPodManager class
*/
public static function getInstance():PresentationPodManager {
if (instance == null) {
instance = new PresentationPodManager(new SingletonEnforcer());
}
return instance;
}
public function requestDefaultPresentationPod(): void {
var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD);
event.requesterId = UsersUtil.getMyUserID();
globalDispatcher.dispatchEvent(event);
}
public function getPod(podId: String): PresentationModel {
var resultingPod: PresentationModel = null;
for (var i:int = 0; i < _presentationPods.length; i++) {
var pod: PresentationModel = _presentationPods.getItemAt(i) as PresentationModel;
if (pod.getPodId() == podId) {
return pod;
}
}
return resultingPod;
}
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) {
return;
}
}
var newPod: PresentationModel = new PresentationModel(podId, ownerId);
_presentationPods.addItem(newPod);
}
public function handlePresentationPodRemoved(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) {
_presentationPods.removeItemAt(i);
return;
}
}
}
public function requestAllPodsPresentationInfo(): void {
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);
}
}
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()));
}
if (podsAC.length == 0) { // If there are no pods, request the creation of a default one
requestDefaultPresentationPod();
}
}
}
}
class SingletonEnforcer{}

View File

@ -8,6 +8,7 @@ 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;
public class PageLoaderService
{
@ -15,21 +16,23 @@ 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);
var page:Page = PresentationPodManager.getInstance().getPod(cmd.podId).getPage(cmd.pageId);
if (page != null) {
LOGGER.debug("Loading page [{0}]", [cmd.pageId]);
page.loadPage(pageLoadedListener, cmd.preloadCount);
page.loadPage(pageLoadedListener, cmd.podId, cmd.preloadCount);
}
}
public function pageLoadedListener(pageId:String, preloadCount:uint):void {
var page: Page = PresentationModel.getInstance().getPage(pageId);
public function pageLoadedListener(podId: String, pageId:String, preloadCount:uint):void {
var page: Page = PresentationPodManager.getInstance().getPod(podId).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);
var event: PageLoadedEvent = new PageLoadedEvent(podId, page.id);
dispatcher.dispatchEvent(event);
}
@ -37,7 +40,7 @@ package org.bigbluebutton.modules.present.services
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);
var changePageCommand: ChangePageCommand = new ChangePageCommand(podId, pageIdParts[0]+"/"+(parseInt(pageIdParts[1], 10) + 1), preloadCount-1);
dispatcher.dispatchEvent(changePageCommand);
}
}

View File

@ -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;
@ -23,41 +24,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);
public function pageChanged(podId: String, pageId:String):void {
var np: Page = podManager.getPod(podId).getPage(pageId);
if (np != null) {
var oldPage: Page = PresentationModel.getInstance().getCurrentPage();
var oldPage: Page = podManager.getPod(podId).getCurrentPage();
if (oldPage != null) oldPage.current = false;
np.current = true
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);
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 {
@ -68,30 +69,31 @@ 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) {
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);
}
}
@ -102,7 +104,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);
}
@ -110,26 +112,27 @@ 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();
var curPres:Presentation = podManager.getPod(podId).getCurrentPresentation();
if (curPres != null) {
curPres.current = false;
} else {
LOGGER.debug("No previous active presentation.");
}
var newPres:Presentation = PresentationModel.getInstance().getPresentation(presentationId);
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);
var event: PresentationChangedEvent = new PresentationChangedEvent(podId, presentationId);
dispatcher.dispatchEvent(event);
var curPage:Page = PresentationModel.getInstance().getCurrentPage();
var curPage:Page = podManager.getPod(podId).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);
}
} else {
@ -138,24 +141,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.
}
}
}

View File

@ -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;
}
}
}

View File

@ -13,7 +13,7 @@ package org.bigbluebutton.modules.present.services.messages
_id = id;
_name = name;
_current = current;
_pages = pages
_pages = pages;
_downloadable = downloadable;
}

View File

@ -38,10 +38,15 @@ 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.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;
public class MessageReceiver implements IMessageListener {
private static const LOGGER:ILogger = getClassLogger(MessageReceiver);
@ -92,11 +97,20 @@ package org.bigbluebutton.modules.present.services.messaging
case "PresentationUploadTokenFailRespMsg":
handlePresentationUploadTokenFailRespMsg(message);
break;
case "CreateNewPresentationPodEvtMsg":
handleCreateNewPresentationPodEvtMsg(message);
break;
case "RemovePresentationPodEvtMsg":
handleRemovePresentationPodEvtMsg(message);
break;
case "GetAllPresentationPodsRespMsg":
handleGetAllPresentationPodsRespMsg(message);
break;
}
}
private function handleSetCurrentPageEvtMsg(msg:Object):void {
service.pageChanged(msg.body.pageId);
service.pageChanged(msg.body.podId, msg.body.pageId);
}
private function validatePage(map:Object):Boolean {
@ -153,7 +167,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 {
@ -162,10 +176,11 @@ 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);
var uploadEvent:ConversionCompletedEvent = new ConversionCompletedEvent(podId, presVO.id, presVO.name);
dispatcher.dispatchEvent(uploadEvent);
}
@ -174,7 +189,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);
}
@ -183,6 +198,25 @@ package org.bigbluebutton.modules.present.services.messaging
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));
}
@ -227,12 +261,12 @@ 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);
}
service.removeAllPresentations();
service.addPresentations(presos);
// service.addPresentations(presos, podId); // TODO -- are they all on the same pod?
}
private function handlePresentationUploadTokenPassRespMsg(msg:Object):void {
@ -248,5 +282,31 @@ 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));
}
private function handleRemovePresentationPodEvtMsg(msg:Object): void {
var ownerId: String = msg.body.ownerId;
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);
}
}
}

View File

@ -46,10 +46,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();
@ -74,10 +74,24 @@ package org.bigbluebutton.modules.present.services.messaging
);
}
public function getPresentationInfo():void {
public function getPresentationInfo(podId: String):void {
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();
_nc.sendMessage2x(
function(result:String):void { },
function(status:String):void { LOGGER.error(status); },
JSON.stringify(message)
);
}
public function requestAllPodsEvent():void {
var message:Object = {
header: {name: "GetAllPresentationPodsReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
body: {requesterId: UsersUtil.getMyUserID()}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
@ -115,5 +129,33 @@ package org.bigbluebutton.modules.present.services.messaging
JSON.stringify(message)
);
}
public function requestNewPresentationPod(requesterId: String):void {
var message:Object = {
header: {name: "CreateNewPresentationPodPubMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
body: {ownerId: requesterId}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage2x(
function(result:String):void { },
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}
};
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)
);
}
}
}

View File

@ -50,7 +50,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function initData():void {
downloadablePresentations = PresentationModel.getInstance().getDownloadablePresentations();
// downloadablePresentations = PresentationModel.getInstance().getDownloadablePresentations();
}
private function onCancelClicked():void {

View File

@ -91,6 +91,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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;
@ -98,7 +99,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private static const LOGGER:ILogger = getClassLogger(FileUploadWindow);
[Bindable] private var presentationNamesAC:ArrayCollection;
[BIndable] public var maxFileSize:Number;
[Bindable] public var maxFileSize:Number;
[Bindable] public var podId:String;
private var dispatcher:Dispatcher;
@ -119,6 +121,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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) {
@ -130,10 +140,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function initData():void {
presentOptions = Options.getOptions(PresentOptions) as PresentOptions;
presentationNamesAC = PresentationModel.getInstance().getPresentations();
if (presentationNamesAC.length <= 0) {
selectFile();
}
}
private function handleThumbnailsProgressEvent(event:CreatingThumbnailsEvent):void {
@ -218,6 +224,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
uploadCmd.filename = presentationName;
uploadCmd.file = fileToUpload;
uploadCmd.isDownloadable = isDownloadable;
uploadCmd.podId = podId;
globalDispatch.dispatchEvent(uploadCmd);
letUserDownload.visible = false;
}
@ -324,7 +332,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function handleConversionCompleted(e:ConversionCompletedEvent):void{
enableClosing();
globalDispatch.dispatchEvent(new ChangePresentationCommand(e.presId));
globalDispatch.dispatchEvent(new ChangePresentationCommand(e.podId, e.presId));
globalDispatch.dispatchEvent(new UploadEvent(UploadEvent.CLOSE_UPLOAD_WINDOW));
}

View File

@ -68,6 +68,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import flash.geom.Point;
import mx.collections.ArrayCollection;
import mx.collections.ArrayList;
import mx.controls.Menu;
import mx.events.MenuEvent;
@ -102,9 +103,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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;
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;
@ -117,7 +121,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[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;
@ -147,6 +151,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var pollMenuData:Array;
private var pollMenu:Menu;
private var podId: String = "";
private var ownerId: String = "";
private var listOfPodControls:Array = [];
[Embed(source="../../../polling/sounds/Poll.mp3")]
private var noticeSoundClass:Class;
private var noticeSound:Sound = new noticeSoundClass() as Sound;
@ -157,6 +165,48 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
presentOptions = Options.getOptions(PresentOptions) as PresentOptions;
}
public function onPodCreated(_podId: String, _ownerId: String):void {
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});
listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.closePresentationWindowOpen'),
icon: getStyle('iconClearStatus'), handler: closePresentationWindowHandler});
}
public function getPodId(): String { return this.podId; }
public function getOwnerId(): String { return this.ownerId; }
private function onPresentationPodControlsClicked():void {
presentationPodControls.selectedItem.handler();
}
private function newPresentationWindowHandler(): void {
var event:RequestNewPresentationPodEvent = new RequestNewPresentationPodEvent(RequestNewPresentationPodEvent.REQUEST_NEW_PRES_POD);
event.requesterId = UsersUtil.getMyUserID();
localDispatcher.dispatchEvent(event);
}
private function closePresentationWindowHandler(): void {
var event:RequestClosePresentationPodEvent = new RequestClosePresentationPodEvent(RequestClosePresentationPodEvent.REQUEST_CLOSE_PRES_POD);
event.requesterId = UsersUtil.getMyUserID();
event.podId = this.podId;
localDispatcher.dispatchEvent(event);
}
private function setPresenterInPodHandler(): void {
// TODO
}
private function onCreationComplete():void{
//check for the polling module in config.xml
var vxml:XML = BBB.getConfigForModule("PollingModule");
@ -283,7 +333,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function handleDisplaySlideEvent(event:DisplaySlideEvent):void {
var curPage:Page = PresentationModel.getInstance().getCurrentPage();
var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId);
if (presentationModel != null) {
var curPage:Page = presentationModel.getCurrentPage();
if (curPage != null) {
displaySlideNumber(curPage.num);
currentSlideWidth = event.slideWidth;
@ -291,6 +343,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
fitSlideToWindowMaintainingAspectRatio();
}
}
}
public function getPrefferedPosition():String{
return MainCanvas.MIDDLE;
@ -329,7 +382,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
uploadPres.visible = isPresenter;
downloadPres.visible = !isPresenter;
var page:Page = PresentationModel.getInstance().getCurrentPage();
var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId);
if (presentationModel != null) {
var page:Page = presentationModel.getCurrentPage();
if (page != null) {
displaySlideNumber(page.num);
}
@ -337,13 +392,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
setControlBarState("presenter");
}
}
private function handlePresentationChangedEvent(e:PresentationChangedEvent) : void {
currentPresentation = PresentationModel.getInstance().getCurrentPresentationName();
if (podId != e.podId) {
return;
}
slideView.setSlides();
var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId);
if (presentationModel != null) {
currentPresentation = presentationModel.getCurrentPresentationName();
slideView.setSlides(podId);
slideView.visible = true;
var page : Page = PresentationModel.getInstance().getCurrentPage();
var page : Page = presentationModel.getCurrentPage();
if (page != null) {
displaySlideNumber(page.num);
}
@ -357,6 +419,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
onResetZoom();
updateDownloadBtn();
}
}
private function displaySlideNavigationControls(isPresenter:Boolean, activePresentation:Boolean):void {
@ -385,8 +448,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function notifyOthersOfSharingPresentation(presentationName:String):void {
// TODO
var shareEvent:PresenterCommands = new PresenterCommands(PresenterCommands.SHARE_PRESENTATION_COMMAND);
shareEvent.presentationName = presentationName;
shareEvent.podId = podId;
dispatchEvent(shareEvent);
}
@ -396,6 +461,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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) {
@ -406,7 +476,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
backButton.styleName = "presentationBackButtonDisabledStyle" + styleNameExt;
}
if (pageNumber < PresentationModel.getInstance().getNumberOfPages()) {
var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId);
if (presentationModel != null) {
if (pageNumber < presentationModel.getNumberOfPages()) {
forwardButton.mouseEnabled = true;
forwardButton.styleName = "presentationForwardButtonStyle" + styleNameExt;
} else {
@ -414,13 +486,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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;
@ -439,13 +515,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function goToPreviousSlide():void {
if (PresentationModel.getInstance().getCurrentPage().num > 1) {
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()) {
var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId);
if (presentationModel != null && presentationModel.getCurrentPage().num < presentationModel.getNumberOfPages()) {
dispatchEvent(new GoToNextPageCommand());
}
}
@ -514,7 +592,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function remoteUpload(e:ShortcutEvent):void{
if (uploadPres.visible){
uploadPres.setFocus();
openUploadWindow();
openUploadWindow(podId);
}
}
@ -563,10 +641,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
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;
@ -575,6 +653,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} else {
var event:UploadEvent = new UploadEvent(UploadEvent.OPEN_UPLOAD_WINDOW);
event.maxFileSize = presentOptions.maxFileSize;
event.podId = _podId;
dispatchEvent(event);
}
}
@ -597,8 +676,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
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);
}
}
@ -783,7 +863,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return;
}
var downloadablePresentations:ArrayCollection = PresentationModel.getInstance().getDownloadablePresentations();
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;
@ -792,6 +874,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
downloadPres.visible = false;
}
}
}
public function receiveToolbars(wt:WhiteboardToolbar, wtt:WhiteboardTextToolbar):void {
var addUIEvent:AddUIComponentToMainCanvas = new AddUIComponentToMainCanvas(AddUIComponentToMainCanvas.ADD_COMPONENT);
@ -839,6 +922,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<poll:QuickPollButton id="quickPollBtn" height="30"
click="quickPollClicked(event)"
includeInLayout="{quickPollBtn.visible}" />
<mx:ComboBox id="presentationPodControls"
dataProvider = "{listOfPodControls}" height="30"
close="onPresentationPodControlsClicked();"
enter="onPresentationPodControlsClicked();" />
<mx:Button id="downloadPres" visible="false"
includeInLayout="{downloadPres.visible}" height="30"
styleName="presentationDownloadButtonStyle"

View File

@ -64,6 +64,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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;
@ -112,8 +113,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
}
public function setSlides():void {
var pres: Presentation = PresentationModel.getInstance().getCurrentPresentation();
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. */
@ -206,11 +207,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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,7 +289,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*/
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);
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
@ -315,7 +316,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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);
var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId);
if (page != null) {
setSelectedSlide(page.num);
slideLoader.source = page.swfData;
@ -377,6 +378,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function handleSlideLoadedCompleteEvent(event:Event):void {
LOGGER.debug("Page has been loaded by swfLoader.");
slideModel.resetForNewSlide(slideLoader.contentWidth, slideLoader.contentHeight);
dispatchNewSlideDisplayedEvent(slideModel.pageOrigW, slideModel.pageOrigH);
@ -392,11 +394,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
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);

View File

@ -39,7 +39,7 @@
private var rolledOver:Boolean = false;
private function showPresentation():void {
var changePresCommand:ChangePresentationCommand = new ChangePresentationCommand(data.id);
var changePresCommand:ChangePresentationCommand = new ChangePresentationCommand('AAAAAUploadedPresentationRendererAAAA', data.id);
globalDispatch.dispatchEvent(changePresCommand);
globalDispatch.dispatchEvent(new UploadEvent(UploadEvent.CLOSE_UPLOAD_WINDOW));

View File

@ -169,7 +169,7 @@ class ApiController {
if (meetingService.createMeeting(newMeeting)) {
// See if the request came with pre-uploading of presentation.
uploadDocuments(newMeeting);
uploadDocuments(newMeeting); //
respondWithConference(newMeeting, null, null)
} else {
// Translate the external meeting id into an internal meeting id.
@ -1980,7 +1980,7 @@ class ApiController {
}
}
def uploadDocuments(conf) {
def uploadDocuments(conf) { //
log.debug("ApiController#uploadDocuments(${conf.getInternalId()})");
String requestBody = request.inputStream == null ? null : request.inputStream.text;
@ -2028,7 +2028,7 @@ class ApiController {
fos.flush()
fos.close()
processUploadedFile(meetingId, presId, presFilename, pres, current);
processUploadedFile("TWO", meetingId, presId, presFilename, pres, current);
}
}
@ -2047,7 +2047,7 @@ class ApiController {
if (presDownloadService.savePresentation(meetingId, newFilePath, address)) {
def pres = new File(newFilePath)
processUploadedFile(meetingId, presId, presFilename, pres, current);
processUploadedFile("ONE", meetingId, presId, presFilename, pres, current);
} else {
log.error("Failed to download presentation=[${address}], meeting=[${meetingId}]")
}
@ -2055,9 +2055,10 @@ class ApiController {
}
def processUploadedFile(meetingId, presId, filename, presFile, current) {
def processUploadedFile(podId, meetingId, presId, filename, presFile, current) {
def presentationBaseUrl = presentationService.presentationBaseUrl
UploadedPresentation uploadedPres = new UploadedPresentation(meetingId, presId, filename, presentationBaseUrl, current);
// TODO add podId
UploadedPresentation uploadedPres = new UploadedPresentation(podId, meetingId, presId, filename, presentationBaseUrl, current);
uploadedPres.setUploadedFile(presFile);
presentationService.processUploadedPresentation(uploadedPres);
}

View File

@ -100,6 +100,8 @@ class PresentationController {
file.transferTo(pres)
def isDownloadable = params.boolean('is_downloadable') //instead of params.is_downloadable
def podId = params.pod_id
log.debug "@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..." + podId
if(isDownloadable) {
log.debug "@Creating download directory..."
@ -113,7 +115,7 @@ class PresentationController {
}
def presentationBaseUrl = presentationService.presentationBaseUrl
UploadedPresentation uploadedPres = new UploadedPresentation(meetingId, presId,
UploadedPresentation uploadedPres = new UploadedPresentation(podId, meetingId, presId,
presFilename, presentationBaseUrl, false /* default presentation */);
if(isDownloadable) {

View File

@ -143,7 +143,8 @@ class PresentationService {
if (presDir.exists()) {
File pres = new File(presDir.getAbsolutePath() + File.separatorChar + testUploadedPresentation)
if (pres.exists()) {
UploadedPresentation uploadedPres = new UploadedPresentation(testConferenceMock, testRoomMock, testPresentationName);
// TODO add podId
UploadedPresentation uploadedPres = new UploadedPresentation("B", testConferenceMock, testRoomMock, testPresentationName);
uploadedPres.setUploadedFile(pres);
// Run conversion on another thread.
new Timer().runAfter(1000)