Merge branch 'antobinary-pods_vol4'
This commit is contained in:
commit
f9818a067d
@ -23,7 +23,12 @@ trait CreateNewPresentationPodPubMsgHdlr {
|
||||
}
|
||||
|
||||
val ownerId = msg.body.ownerId
|
||||
val pod = PresentationPodsApp.createPresentationPod(ownerId)
|
||||
val pod = if (state.presentationPodManager.getNumberOfPods() == 0) {
|
||||
PresentationPodsApp.createDefaultPresentationPod(ownerId)
|
||||
} else {
|
||||
PresentationPodsApp.createPresentationPod(ownerId)
|
||||
}
|
||||
|
||||
val respMsg = buildCreateNewPresentationPodEvtMsg(
|
||||
liveMeeting.props.meetingProp.intId,
|
||||
ownerId, pod.id
|
||||
|
@ -10,6 +10,7 @@ class PresentationPodHdlrs(implicit val context: ActorContext)
|
||||
with SetCurrentPresentationPubMsgHdlr
|
||||
with PresentationConversionCompletedSysPubMsgHdlr
|
||||
with SetCurrentPagePubMsgHdlr
|
||||
with SetPresenterInPodReqMsgHdlr
|
||||
with RemovePresentationPodPubMsgHdlr {
|
||||
|
||||
val log = Logging(context.system, getClass)
|
||||
|
@ -10,12 +10,16 @@ object PresentationPodsApp {
|
||||
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 createDefaultPresentationPod(ownerId: String): PresentationPod = {
|
||||
PresentationPodFactory.createDefaultPod(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)
|
||||
@ -36,8 +40,7 @@ object PresentationPodsApp {
|
||||
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)
|
||||
PresentationPodVO(pod.id, pod.ownerId, pod.currentPresenter, presentationVOs)
|
||||
}
|
||||
|
||||
def updatePresentationPod(state: MeetingState2x, pod: PresentationPod): MeetingState2x = {
|
||||
|
@ -40,7 +40,7 @@ trait SetCurrentPagePubMsgHdlr {
|
||||
updatedPod <- pod.setCurrentPage(presentationId, pageId)
|
||||
} yield {
|
||||
|
||||
if (Users2x.userIsInPresenterGroup(liveMeeting.users2x, userId)) {
|
||||
if (Users2x.userIsInPresenterGroup(liveMeeting.users2x, userId) || userId.equals(pod.ownerId)) {
|
||||
broadcastSetCurrentPageEvtMsg(pod.id, presentationId, pageId, userId)
|
||||
|
||||
val pods = state.presentationPodManager.addPod(updatedPod)
|
||||
|
@ -0,0 +1,56 @@
|
||||
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
|
||||
import org.bigbluebutton.core.models.Users2x
|
||||
|
||||
trait SetPresenterInPodReqMsgHdlr {
|
||||
this: PresentationPodHdlrs =>
|
||||
|
||||
def handle(
|
||||
msg: SetPresenterInPodReqMsg, state: MeetingState2x,
|
||||
liveMeeting: LiveMeeting, bus: MessageBus
|
||||
): MeetingState2x = {
|
||||
|
||||
def broadcastSetPresenterInPodRespMsg(podId: String, nextPresenterId: String, requesterId: String): Unit = {
|
||||
val routing = Routing.addMsgToClientRouting(
|
||||
MessageTypes.BROADCAST_TO_MEETING,
|
||||
liveMeeting.props.meetingProp.intId, requesterId
|
||||
)
|
||||
val envelope = BbbCoreEnvelope(SetPresenterInPodRespMsg.NAME, routing)
|
||||
val header = BbbClientMsgHeader(SetPresenterInPodRespMsg.NAME, liveMeeting.props.meetingProp.intId, requesterId)
|
||||
|
||||
val body = SetPresenterInPodRespMsgBody(podId, nextPresenterId)
|
||||
val event = SetPresenterInPodRespMsg(header, body)
|
||||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
|
||||
bus.outGW.send(msgEvent)
|
||||
}
|
||||
|
||||
val podId: String = msg.body.podId
|
||||
val requesterId: String = msg.header.userId
|
||||
val nextPresenterId: String = msg.body.nextPresenterId
|
||||
|
||||
val newState = for {
|
||||
pod <- PresentationPodsApp.getPresentationPod(state, podId)
|
||||
} yield {
|
||||
|
||||
if (Users2x.userIsInPresenterGroup(liveMeeting.users2x, requesterId) || requesterId.equals(pod.ownerId)) {
|
||||
val updatedPod = pod.setCurrentPresenter(nextPresenterId)
|
||||
|
||||
broadcastSetPresenterInPodRespMsg(pod.id, nextPresenterId, requesterId)
|
||||
|
||||
val pods = state.presentationPodManager.addPod(updatedPod)
|
||||
state.update(pods)
|
||||
} else {
|
||||
state
|
||||
}
|
||||
}
|
||||
|
||||
newState match {
|
||||
case Some(ns) => ns
|
||||
case None => state
|
||||
}
|
||||
}
|
||||
}
|
@ -5,17 +5,24 @@ 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)
|
||||
val currentPresenter = ownerId
|
||||
PresentationPod(genId(), ownerId, currentPresenter, Map.empty)
|
||||
}
|
||||
|
||||
def createDefaultPod(ownerId: String): PresentationPod = {
|
||||
val currentPresenter = ownerId
|
||||
|
||||
// we hardcode the podId of the default presentation pod for the purposes of having bbb-web know the podId
|
||||
// in advance (so we can fully process default.pdf) // TODO change to a generated podId
|
||||
PresentationPod("DEFAULT_PRESENTATION_POD", ownerId, currentPresenter, Map.empty)
|
||||
}
|
||||
}
|
||||
|
||||
case class PresentationInPod(id: String, name: String, current: Boolean = false,
|
||||
pages: scala.collection.immutable.Map[String, PageVO], downloadable: Boolean) {
|
||||
|
||||
// TODO remove org.bigbluebutton.core.apps.Presentation
|
||||
|
||||
def makePageCurrent(pres: PresentationInPod, pageId: String): Option[PresentationInPod] = {
|
||||
pres.pages.get(pageId) match {
|
||||
case Some(newCurPage) =>
|
||||
@ -25,13 +32,12 @@ case class PresentationInPod(id: String, name: String, current: Boolean = false,
|
||||
Some(newPres)
|
||||
case None =>
|
||||
None
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case class PresentationPod(id: String, ownerId: String, currentPresenter: String, authorizedPresenters: Vector[String],
|
||||
case class PresentationPod(id: String, ownerId: String, currentPresenter: String,
|
||||
presentations: collection.immutable.Map[String, PresentationInPod]) {
|
||||
def addPresentation(presentation: PresentationInPod): PresentationPod = {
|
||||
copy(presentations = presentations + (presentation.id -> presentation))
|
||||
@ -39,12 +45,7 @@ case class PresentationPod(id: String, ownerId: String, currentPresenter: String
|
||||
|
||||
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[PresentationInPod] = presentations.values find (p => p.current)
|
||||
|
||||
@ -59,7 +60,7 @@ case class PresentationPod(id: String, ownerId: String, currentPresenter: String
|
||||
}
|
||||
})
|
||||
|
||||
presentations.get(presId) match { // set new current presenter
|
||||
presentations.get(presId) match { // set new current presentation
|
||||
case Some(pres) =>
|
||||
val cp = pres.copy(current = true)
|
||||
addPresentation(cp)
|
||||
|
@ -214,6 +214,8 @@ class ReceivedJsonMsgHandlerActor(
|
||||
routeGenericMsg[CreateNewPresentationPodPubMsg](envelope, jsonNode)
|
||||
case RemovePresentationPodPubMsg.NAME =>
|
||||
routeGenericMsg[RemovePresentationPodPubMsg](envelope, jsonNode)
|
||||
case SetPresenterInPodReqMsg.NAME =>
|
||||
routeGenericMsg[SetPresenterInPodReqMsg](envelope, jsonNode)
|
||||
|
||||
// Caption
|
||||
case EditCaptionHistoryPubMsg.NAME =>
|
||||
|
@ -305,6 +305,7 @@ class MeetingActor(
|
||||
case m: SetCurrentPresentationPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus)
|
||||
case m: PresentationConversionCompletedSysPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus)
|
||||
case m: SetCurrentPagePubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus)
|
||||
case m: SetPresenterInPodReqMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus)
|
||||
|
||||
// Caption
|
||||
case m: EditCaptionHistoryPubMsg => captionApp2x.handle(m, liveMeeting, msgBus)
|
||||
|
@ -8,5 +8,4 @@ case class PageVO(id: String, num: Int, thumbUri: String = "", swfUri: String,
|
||||
yOffset: Double = 0, widthRatio: Double = 100D, heightRatio: Double = 100D)
|
||||
|
||||
case class PresentationPodVO(id: String, ownerId: String, currentPresenter: String,
|
||||
authorizedPresenters: Vector[String],
|
||||
presentations: Vector[PresentationVO])
|
||||
|
@ -28,6 +28,9 @@ object SetCurrentPagePubMsg { val NAME = "SetCurrentPagePubMsg"}
|
||||
case class SetCurrentPagePubMsg(header: BbbClientMsgHeader, body: SetCurrentPagePubMsgBody) extends StandardMsg
|
||||
case class SetCurrentPagePubMsgBody(podId: String, presentationId: String, pageId: String)
|
||||
|
||||
object SetPresenterInPodReqMsg { val NAME = "SetPresenterInPodReqMsg"}
|
||||
case class SetPresenterInPodReqMsg(header: BbbClientMsgHeader, body: SetPresenterInPodReqMsgBody) extends StandardMsg
|
||||
case class SetPresenterInPodReqMsgBody(podId: String, nextPresenterId: String)
|
||||
// ------------ client to akka-apps ------------
|
||||
|
||||
|
||||
@ -106,6 +109,9 @@ object SetCurrentPageEvtMsg { val NAME = "SetCurrentPageEvtMsg"}
|
||||
case class SetCurrentPageEvtMsg(header: BbbClientMsgHeader, body: SetCurrentPageEvtMsgBody) extends BbbCoreMsg
|
||||
case class SetCurrentPageEvtMsgBody(podId: String, presentationId: String, pageId: String)
|
||||
|
||||
object SetPresenterInPodRespMsg { val NAME = "SetPresenterInPodRespMsg"}
|
||||
case class SetPresenterInPodRespMsg(header: BbbClientMsgHeader, body: SetPresenterInPodRespMsgBody) extends StandardMsg
|
||||
case class SetPresenterInPodRespMsgBody(podId: String, nextPresenterId: String)
|
||||
// ------------ akka-apps to client ------------
|
||||
|
||||
|
||||
|
@ -43,6 +43,7 @@ package org.bigbluebutton.modules.present.business
|
||||
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.SetPresenterInPodReqEvent;
|
||||
import org.bigbluebutton.modules.present.events.RequestAllPodsEvent;
|
||||
import org.bigbluebutton.modules.present.managers.PresentationSlides;
|
||||
import org.bigbluebutton.modules.present.model.Page;
|
||||
@ -283,5 +284,10 @@ package org.bigbluebutton.modules.present.business
|
||||
public function handleRequestClosePresentationPod(e: RequestClosePresentationPodEvent): void {
|
||||
sender.requestClosePresentationPod(e.requesterId, e.podId);
|
||||
}
|
||||
|
||||
public function handleSetPresenterInPodReqEvent(e: SetPresenterInPodReqEvent): void {
|
||||
sender.handleSetPresenterInPodReqEvent(e.podId, e.nextPresenterId);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
1
bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestNewPresentationPodEvent.as
Normal file → Executable file
1
bigbluebutton-client/src/org/bigbluebutton/modules/present/events/RequestNewPresentationPodEvent.as
Normal file → Executable file
@ -21,7 +21,6 @@ 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";
|
||||
|
@ -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;
|
||||
|
||||
public class SetPresenterInPodReqEvent extends Event {
|
||||
public static const SET_PRESENTER_IN_POD_REQ:String = "SET_PRESENTER_IN_POD_REQ";
|
||||
|
||||
public var podId: String;
|
||||
public var nextPresenterId: String;
|
||||
|
||||
public function SetPresenterInPodReqEvent(podId :String, nextPresenterId: String) {
|
||||
this.podId = podId;
|
||||
this.nextPresenterId = nextPresenterId;
|
||||
super(SET_PRESENTER_IN_POD_REQ, true, false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.bigbluebutton.modules.present.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class SetPresenterInPodRespEvent extends Event {
|
||||
public static const SET_PRESENTER_IN_POD_RESP:String = "SET_PRESENTER_IN_POD_RESP";
|
||||
|
||||
public var podId: String;
|
||||
public var nextPresenterId: String;
|
||||
|
||||
public function SetPresenterInPodRespEvent(podId: String, nextPresenterId: String) {
|
||||
super(SET_PRESENTER_IN_POD_RESP, true, false);
|
||||
this.podId = podId;
|
||||
this.nextPresenterId = nextPresenterId;
|
||||
}
|
||||
}
|
||||
}
|
@ -48,6 +48,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
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.events.SetPresenterInPodReqEvent;
|
||||
// import org.bigbluebutton.modules.present.events.SetPresenterInPodRespEvent;
|
||||
import org.bigbluebutton.modules.present.managers.PresentManager;
|
||||
import org.bigbluebutton.modules.present.model.PresentationPodManager;
|
||||
import org.bigbluebutton.modules.present.services.PageLoaderService;
|
||||
@ -187,5 +189,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<MethodInvoker generator="{PresentManager}" method="handleGetAllPodsRespEvent" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{SetPresenterInPodReqEvent.SET_PRESENTER_IN_POD_REQ}" >
|
||||
<MethodInvoker generator="{PresentProxy}" method="handleSetPresenterInPodReqEvent" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
||||
<!--<EventHandlers type="{SetPresenterInPodRespEvent.SET_PRESENTER_IN_POD_RESP}" >-->
|
||||
<!--<MethodInvoker generator="{PresentManager}" method="handleSetPresenterInPodRespEvent" arguments="{event}" />-->
|
||||
<!--</EventHandlers>-->
|
||||
</fx:Declarations>
|
||||
</EventMap>
|
||||
|
@ -33,19 +33,20 @@ package org.bigbluebutton.modules.present.services.messaging
|
||||
import org.bigbluebutton.modules.present.events.ConversionUnsupportedDocEvent;
|
||||
import org.bigbluebutton.modules.present.events.ConversionUpdateEvent;
|
||||
import org.bigbluebutton.modules.present.events.CreatingThumbnailsEvent;
|
||||
import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent;
|
||||
import org.bigbluebutton.modules.present.events.NewPresentationPodCreated;
|
||||
import org.bigbluebutton.modules.present.events.OfficeDocConvertFailedEvent;
|
||||
import org.bigbluebutton.modules.present.events.OfficeDocConvertInvalidEvent;
|
||||
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.events.PresentationUploadTokenFail;
|
||||
import org.bigbluebutton.modules.present.events.PresentationUploadTokenPass;
|
||||
import org.bigbluebutton.modules.present.events.SetPresenterInPodRespEvent;
|
||||
import org.bigbluebutton.modules.present.services.Constants;
|
||||
import org.bigbluebutton.modules.present.services.PresentationService;
|
||||
import org.bigbluebutton.modules.present.services.messages.PageVO;
|
||||
import org.bigbluebutton.modules.present.services.messages.PresentationVO;
|
||||
import org.bigbluebutton.modules.present.services.messages.PresentationPodVO;
|
||||
import org.bigbluebutton.modules.present.services.messages.PresentationVO;
|
||||
|
||||
|
||||
public class MessageReceiver implements IMessageListener {
|
||||
@ -106,6 +107,9 @@ package org.bigbluebutton.modules.present.services.messaging
|
||||
case "GetAllPresentationPodsRespMsg":
|
||||
handleGetAllPresentationPodsRespMsg(message);
|
||||
break;
|
||||
case "SetPresenterInPodRespMsg":
|
||||
handleSetPresenterInPodRespMsg(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,5 +312,11 @@ package org.bigbluebutton.modules.present.services.messaging
|
||||
event.pods = podsAC;
|
||||
dispatcher.dispatchEvent(event);
|
||||
}
|
||||
|
||||
private function handleSetPresenterInPodRespMsg(msg: Object): void {
|
||||
var podId: String = msg.body.podId as String;
|
||||
var nextPresenterId: String = msg.body.nextPresenterId as String;
|
||||
dispatcher.dispatchEvent(new SetPresenterInPodRespEvent(podId, nextPresenterId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,5 +157,24 @@ package org.bigbluebutton.modules.present.services.messaging
|
||||
JSON.stringify(message)
|
||||
);
|
||||
}
|
||||
|
||||
public function handleSetPresenterInPodReqEvent(podId: String, nextPresenterId: String):void {
|
||||
var message:Object = {
|
||||
header: {name: "SetPresenterInPodReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
|
||||
body: {nextPresenterId: nextPresenterId, podId: podId}
|
||||
};
|
||||
|
||||
var _nc:ConnectionManager = BBB.initConnectionManager();
|
||||
_nc.sendMessage2x(
|
||||
function(result:String):void { },
|
||||
function(status:String):void { LOGGER.error("Error while setting presenter for pod." + status); },
|
||||
JSON.stringify(message)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<mate:Listener type="{GoToPageLocalCommand.GO_TO_PAGE_LOCAL}" method="handleGoToPageLocalCommand" />
|
||||
<mate:Listener type="{UserAddedToPresenterGroupEvent.USER_ADDED_TO_PRESENTER_GROUP}" method="handleUserAddedToPresenterGroupEvent" />
|
||||
<mate:Listener type="{UserRemovedFromPresenterGroupEvent.USER_REMOVED_FROM_PRESENTER_GROUP}" method="handleUserRemovedFromPresenterGroupEvent" />
|
||||
<mate:Listener type="{SetPresenterInPodRespEvent.SET_PRESENTER_IN_POD_RESP}" method="handleSetPresenterInPodRespEvent" />
|
||||
</fx:Declarations>
|
||||
|
||||
<fx:Script>
|
||||
@ -113,6 +114,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
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.events.SetPresenterInPodRespEvent;
|
||||
import org.bigbluebutton.modules.present.events.SetPresenterInPodReqEvent;
|
||||
import org.bigbluebutton.main.model.users.events.UserAddedToPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.UserRemovedFromPresenterGroupEvent;
|
||||
import org.bigbluebutton.modules.present.model.Page;
|
||||
@ -124,6 +127,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import org.bigbluebutton.modules.whiteboard.views.WhiteboardTextToolbar;
|
||||
import org.bigbluebutton.modules.whiteboard.views.WhiteboardToolbar;
|
||||
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||
import org.bigbluebutton.main.api.JSLog;
|
||||
|
||||
private static const LOGGER:ILogger = getClassLogger(PresentationWindow);
|
||||
|
||||
@ -161,8 +165,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
private var pollMenuData:Array;
|
||||
private var pollMenu:Menu;
|
||||
|
||||
[Bindable]
|
||||
private var podId: String = "";
|
||||
private var ownerId: String = "";
|
||||
private var currentPresenterInPod: String = "";
|
||||
|
||||
[Bindable]
|
||||
private var listOfPodControls:Array = [];
|
||||
@ -191,7 +197,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
private function populatePodDropdown(): void {
|
||||
listOfPodControls = [];
|
||||
listOfPodControls.push({label: this.podId,
|
||||
icon: getStyle('iconClearStatus'), handler: setPresenterInPodHandler});
|
||||
icon: getStyle('iconClearStatus'), handler: function (): void {} });
|
||||
|
||||
listOfPodControls.push({label: UsersUtil.getUserName(this.ownerId),
|
||||
icon: getStyle('iconClearStatus'), handler: requestPodPresenterChange, data: this.ownerId});
|
||||
|
||||
listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.newPresentationWindowOpen'),
|
||||
icon: getStyle('iconClearStatus'), handler: newPresentationWindowHandler});
|
||||
@ -202,8 +211,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
var presGroup: ArrayCollection = UsersUtil.getPresenterGroup();
|
||||
for (var j:int = 0; j < presGroup.length; j++) {
|
||||
listOfPodControls.push({label: UsersUtil.getUserName(presGroup.getItemAt(j) as String),
|
||||
icon: getStyle('iconClearStatus'), handler: setPresenterInPodHandler});
|
||||
var nextPresenterId: String = presGroup.getItemAt(j) as String;
|
||||
listOfPodControls.push({label: UsersUtil.getUserName(nextPresenterId),
|
||||
icon: getStyle('iconClearStatus'), handler: requestPodPresenterChange, data: nextPresenterId});
|
||||
|
||||
}
|
||||
}
|
||||
@ -212,6 +222,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
this.podId = _podId;
|
||||
this.ownerId = _ownerId;
|
||||
populatePodDropdown();
|
||||
|
||||
// the owner is the default currentPresenter for the pod
|
||||
setPresenterInPodHelper(this.ownerId);
|
||||
}
|
||||
|
||||
public function getPodId(): String { return this.podId; }
|
||||
@ -219,7 +232,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
public function getOwnerId(): String { return this.ownerId; }
|
||||
|
||||
private function onPresentationPodControlsClicked():void {
|
||||
presentationPodControls.selectedItem.handler();
|
||||
if(presentationPodControls.selectedItem != null) {
|
||||
presentationPodControls.selectedItem.handler();
|
||||
}
|
||||
}
|
||||
|
||||
private function newPresentationWindowHandler(): void {
|
||||
@ -235,8 +250,34 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
localDispatcher.dispatchEvent(event);
|
||||
}
|
||||
|
||||
private function setPresenterInPodHandler(): void {
|
||||
// TODO
|
||||
private function requestPodPresenterChange(): void {
|
||||
if (presentationPodControls.selectedItem == null || presentationPodControls.selectedItem.data == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var nextPresenterId: String = presentationPodControls.selectedItem.data as String;
|
||||
JSLog.warn("__ PresentationWindow::requestPodPresenterChange: " + nextPresenterId, {});
|
||||
setPresenterInPodHelper(nextPresenterId);
|
||||
}
|
||||
|
||||
private function setPresenterInPodHelper(nextPresenterId: String): void {
|
||||
localDispatcher.dispatchEvent(new SetPresenterInPodReqEvent(this.podId, nextPresenterId));
|
||||
}
|
||||
|
||||
private function handleSetPresenterInPodRespEvent(event: SetPresenterInPodRespEvent): void {
|
||||
if (event.podId != this.podId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// set the dropdown current value? // TODO
|
||||
this.currentPresenterInPod = event.nextPresenterId as String;
|
||||
|
||||
var presentationModel:PresentationModel = PresentationPodManager.getInstance().getPod(podId);
|
||||
var page : Page = presentationModel.getCurrentPage();
|
||||
|
||||
displaySlideNavigationControls(false, !!page);
|
||||
setupPresenter(this.currentPresenterInPod == UsersUtil.getMyUserID());
|
||||
|
||||
}
|
||||
|
||||
private function onCreationComplete():void{
|
||||
@ -460,7 +501,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
private function displaySlideNavigationControls(isPresenter:Boolean, activePresentation:Boolean):void {
|
||||
var showButtons:Boolean = isPresenter && activePresentation;
|
||||
var showButtons:Boolean = (UsersUtil.getMyUserID() == this.currentPresenterInPod) && activePresentation;
|
||||
// var showButtons:Boolean = (isPresenter || UsersUtil.getMyUserID() == this.currentPresenterInPod) && activePresentation;
|
||||
|
||||
pollStartBtn.visible = showButtons;
|
||||
quickPollBtn.visible = showButtons;
|
||||
@ -1004,7 +1046,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
</fx:Declarations>
|
||||
|
||||
<mx:Canvas width="100%" height="100%" styleName="slideViewBackground" verticalScrollPolicy="off" horizontalScrollPolicy="off">
|
||||
<views:SlideView id="slideView" width="100%" height="100%" visible="false" mouseDown="mouseDown = true" mouseUp="mouseDown = false"/>
|
||||
<views:SlideView id="slideView" podId="{this.podId}" width="100%" height="100%" visible="false" mouseDown="mouseDown = true" mouseUp="mouseDown = false"/>
|
||||
</mx:Canvas>
|
||||
|
||||
<mx:ControlBar id="presCtrlBar" name="presCtrlBar" width="100%" verticalAlign="top" styleName="presentationWindowControlsStyle" paddingTop="6" paddingBottom="6">
|
||||
|
@ -82,7 +82,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
[Bindable]
|
||||
public var slideModel:SlideViewModel = new SlideViewModel();
|
||||
|
||||
|
||||
|
||||
public var podId:String;
|
||||
|
||||
private var pageCache:ArrayCollection = new ArrayCollection();
|
||||
|
||||
private function onCreationComplete():void {
|
||||
@ -113,8 +116,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
}
|
||||
|
||||
public function setSlides(podId: String):void {
|
||||
var pres: Presentation = PresentationPodManager.getInstance().getPod(podId).getCurrentPresentation();
|
||||
public function setSlides(_podId: String):void {
|
||||
if (_podId != this.podId) {
|
||||
return;
|
||||
}
|
||||
|
||||
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. */
|
||||
@ -289,6 +296,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
* Handles notification from presenter that the slide has moved.
|
||||
*/
|
||||
private function handlePageChangedEvent(e:PageChangedEvent):void {
|
||||
if (e.podId != this.podId) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOGGER.debug("Got a page changed event for page [{0}]", [e.pageId]);
|
||||
var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId);
|
||||
if (page != null) {
|
||||
@ -316,25 +327,29 @@ 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 = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId);
|
||||
if (page != null) {
|
||||
setSelectedSlide(page.num);
|
||||
slideLoader.source = page.swfData;
|
||||
LOGGER.debug("Displaying page [{0}]", [e.pageId]);
|
||||
// positionPage(page);
|
||||
if (whiteboardCanvas != null) {
|
||||
whiteboardCanvas.displayWhiteboardById(page.id);
|
||||
}
|
||||
|
||||
//slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end";
|
||||
slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
|
||||
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
|
||||
slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
|
||||
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
|
||||
}
|
||||
if (e.podId != this.podId) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOGGER.debug("Got a page loaded event for page [{0}]", [e.pageId]);
|
||||
var page:Page = PresentationPodManager.getInstance().getPod(e.podId).getPage(e.pageId);
|
||||
if (page != null) {
|
||||
setSelectedSlide(page.num);
|
||||
slideLoader.source = page.swfData;
|
||||
LOGGER.debug("Displaying page [{0}]", [e.pageId]);
|
||||
// positionPage(page);
|
||||
if (whiteboardCanvas != null) {
|
||||
whiteboardCanvas.displayWhiteboardById(page.id);
|
||||
}
|
||||
|
||||
//slideLoader.accessibilityProperties.description = "Slide text start: " + e.slideText + " Slide text end";
|
||||
slideLoader.accessibilityDescription = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
|
||||
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
|
||||
slideLoader.accessibilityName = ResourceUtil.getInstance().getString("bbb.presentation.slideloader.starttext") +
|
||||
page.txtData + ResourceUtil.getInstance().getString("bbb.presentation.slideloader.endtext");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function becomeViewer():void {
|
||||
removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelZoomEvent);
|
||||
this.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
||||
|
@ -2052,7 +2052,7 @@ class ApiController {
|
||||
|
||||
if (presDownloadService.savePresentation(meetingId, newFilePath, address)) {
|
||||
def pres = new File(newFilePath)
|
||||
processUploadedFile("ONE", meetingId, presId, presFilename, pres, current);
|
||||
processUploadedFile("DEFAULT_PRESENTATION_POD", meetingId, presId, presFilename, pres, current);
|
||||
} else {
|
||||
log.error("Failed to download presentation=[${address}], meeting=[${meetingId}]")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user