Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8691 from ritzalam/pres-url-on-page-convert
Improve presentation conversion
- Loading branch information
Showing
60 changed files
with
1,793 additions
and
773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...a/org/bigbluebutton/core/apps/presentationpod/PresentationConversionEndedSysMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 PresentationConversionEndedSysMsgHdlr { | ||
this: PresentationPodHdlrs => | ||
|
||
def handle(msg: PresentationConversionEndedSysMsg, state: MeetingState2x, | ||
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = { | ||
|
||
def broadcastEvent(msg: PresentationConversionEndedSysMsg): Unit = { | ||
val routing = Routing.addMsgToClientRouting( | ||
MessageTypes.BROADCAST_TO_MEETING, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
val envelope = BbbCoreEnvelope(PresentationConversionEndedEventMsg.NAME, routing) | ||
val header = BbbClientMsgHeader( | ||
PresentationConversionEndedEventMsg.NAME, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
|
||
val body = PresentationConversionEndedEventMsgBody( | ||
podId = msg.body.podId, | ||
presentationId = msg.body.presentationId, | ||
presName = msg.body.presName | ||
) | ||
val event = PresentationConversionEndedEventMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
bus.outGW.send(msgEvent) | ||
} | ||
|
||
broadcastEvent(msg) | ||
|
||
state | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...bigbluebutton/core/apps/presentationpod/PresentationPageConversionStartedSysMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
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.models.PresentationInPod | ||
import org.bigbluebutton.core.running.LiveMeeting | ||
|
||
trait PresentationPageConversionStartedSysMsgHdlr { | ||
this: PresentationPodHdlrs => | ||
|
||
def handle(msg: PresentationPageConversionStartedSysMsg, state: MeetingState2x, | ||
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = { | ||
|
||
def broadcastEvent(msg: PresentationPageConversionStartedSysMsg): Unit = { | ||
val routing = Routing.addMsgToClientRouting( | ||
MessageTypes.BROADCAST_TO_MEETING, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
val envelope = BbbCoreEnvelope(PresentationPageConversionStartedSysMsg.NAME, routing) | ||
val header = BbbClientMsgHeader( | ||
PresentationPageConversionStartedSysMsg.NAME, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
|
||
val body = PresentationPageConversionStartedSysMsgBody( | ||
podId = msg.body.podId, | ||
presentationId = msg.body.presentationId, | ||
current = msg.body.current, | ||
presName = msg.body.presName, | ||
downloadable = msg.body.downloadable, | ||
authzToken = msg.body.authzToken, | ||
numPages = msg.body.numPages | ||
) | ||
val event = PresentationPageConversionStartedSysMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
bus.outGW.send(msgEvent) | ||
} | ||
|
||
val downloadable = msg.body.downloadable | ||
val presentationId = msg.body.presentationId | ||
val podId = msg.body.podId | ||
|
||
val pres = new PresentationInPod(presentationId, msg.body.presName, msg.body.current, Map.empty, downloadable) | ||
|
||
val newState = for { | ||
pod <- PresentationPodsApp.getPresentationPod(state, podId) | ||
} yield { | ||
var pods = state.presentationPodManager.addPod(pod) | ||
pods = pods.addPresentationToPod(pod.id, pres) | ||
if (msg.body.current) { | ||
pods = pods.setCurrentPresentation(pod.id, pres.id) | ||
} | ||
|
||
state.update(pods) | ||
} | ||
|
||
broadcastEvent(msg) | ||
|
||
newState match { | ||
case Some(ns) => ns | ||
case None => state | ||
} | ||
|
||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
...ala/org/bigbluebutton/core/apps/presentationpod/PresentationPageConvertedSysMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package org.bigbluebutton.core.apps.presentationpod | ||
|
||
import org.bigbluebutton.common2.domain.PresentationPageVO | ||
import org.bigbluebutton.common2.msgs._ | ||
import org.bigbluebutton.core.bus.MessageBus | ||
import org.bigbluebutton.core.domain.MeetingState2x | ||
import org.bigbluebutton.core.models.{ PresentationInPod, PresentationPage } | ||
import org.bigbluebutton.core.running.LiveMeeting | ||
|
||
trait PresentationPageConvertedSysMsgHdlr { | ||
this: PresentationPodHdlrs => | ||
|
||
def handle( | ||
msg: PresentationPageConvertedSysMsg, | ||
state: MeetingState2x, | ||
liveMeeting: LiveMeeting, | ||
bus: MessageBus | ||
): MeetingState2x = { | ||
|
||
def broadcastEvent(msg: PresentationPageConvertedSysMsg): Unit = { | ||
val routing = Routing.addMsgToClientRouting( | ||
MessageTypes.BROADCAST_TO_MEETING, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
val envelope = BbbCoreEnvelope(PresentationPageConvertedEventMsg.NAME, routing) | ||
val header = BbbClientMsgHeader( | ||
PresentationPageConvertedEventMsg.NAME, | ||
liveMeeting.props.meetingProp.intId, msg.header.userId | ||
) | ||
|
||
val page = PresentationPageVO( | ||
id = msg.body.page.id, | ||
num = msg.body.page.num, | ||
urls = msg.body.page.urls, | ||
current = msg.body.page.current | ||
) | ||
|
||
val body = PresentationPageConvertedEventMsgBody( | ||
msg.body.podId, | ||
msg.body.messageKey, | ||
msg.body.code, | ||
msg.body.presentationId, | ||
msg.body.numberOfPages, | ||
msg.body.pagesCompleted, | ||
msg.body.presName, | ||
page | ||
) | ||
val event = PresentationPageConvertedEventMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
bus.outGW.send(msgEvent) | ||
} | ||
|
||
val page = PresentationPage( | ||
msg.body.page.id, | ||
msg.body.page.num, | ||
msg.body.page.urls, | ||
msg.body.page.current | ||
) | ||
|
||
val newState = for { | ||
pod <- PresentationPodsApp.getPresentationPod(state, msg.body.podId) | ||
pres <- pod.getPresentation(msg.body.presentationId) | ||
} yield { | ||
val newPres = PresentationInPod.addPage(pres, page) | ||
var pods = state.presentationPodManager.addPod(pod) | ||
pods = pods.addPresentationToPod(pod.id, newPres) | ||
|
||
state.update(pods) | ||
} | ||
|
||
broadcastEvent(msg) | ||
|
||
newState match { | ||
case Some(ns) => ns | ||
case None => state | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../main/scala/org/bigbluebutton/core/apps/presentationpod/ResizeAndMovePagePubMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.