Skip to content

Commit

Permalink
Merge pull request bigbluebutton#3397 from riadvice/breakout-rooms-us…
Browse files Browse the repository at this point in the history
…e-current-presentation

Breakout rooms use current presentation slide
  • Loading branch information
ffdixon authored Sep 30, 2016
2 parents 09dec16 + 0e72d75 commit 3552fca
Show file tree
Hide file tree
Showing 20 changed files with 405 additions and 423 deletions.
1 change: 0 additions & 1 deletion akka-bbb-apps/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ http {
services {
bbbWebAPI = "http://192.168.23.33/bigbluebutton/api"
sharedSecret = "changeme"
defaultPresentationURL = "http://localhost/default.pdf"
}

red5 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ trait SystemConfiguration {
lazy val bbbWebSharedSecret = Try(config.getString("services.sharedSecret")).getOrElse("changeme")
lazy val bbbWebModeratorPassword = Try(config.getString("services.moderatorPassword")).getOrElse("changeme")
lazy val bbbWebViewerPassword = Try(config.getString("services.viewerPassword")).getOrElse("changeme")
lazy val bbbWebDefaultPresentationURL = Try(config.getString("services.defaultPresentationURL")).getOrElse("changeme")
lazy val keysExpiresInSec = Try(config.getInt("redis.keyExpiry")).getOrElse(14 * 86400) // 14 days
lazy val red5DeskShareIP = Try(config.getString("red5.deskshareip")).getOrElse("127.0.0.1")
lazy val red5DeskShareApp = Try(config.getString("red5.deskshareapp")).getOrElse("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class JsonMessageSenderActor(val service: MessageSender)
private def handleCreateBreakoutRoom(msg: CreateBreakoutRoom) {
val payload = new CreateBreakoutRoomRequestPayload(msg.room.breakoutId, msg.room.parentId, msg.room.name,
msg.room.voiceConfId, msg.room.viewerPassword, msg.room.moderatorPassword,
msg.room.durationInMinutes, msg.room.defaultPresentationURL, msg.room.record)
msg.room.durationInMinutes, msg.room.sourcePresentationId, msg.room.sourcePresentationSlide, msg.room.record)
val request = new CreateBreakoutRoomRequest(payload)
service.send(MessagingConstants.FROM_MEETING_CHANNEL, request.toJson())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class LiveMeeting(val mProps: MeetingProperties,
meetingModel.meetingHasEnded

/**
* See if this meeting has breakout rooms. If so, we also need to end them.
* Check if this meeting has breakout rooms. If so, we also need to end them.
*/
handleEndAllBreakoutRooms(new EndAllBreakoutRooms(msg.meetingId))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object UserMessagesProtocol extends DefaultJsonProtocol {
implicit val inMsgHeaderFormat = jsonFormat1(InMessageHeader)
implicit val outMsgHeaderFormat = jsonFormat1(OutMsgHeader)
implicit val outMsgEnvelopeHeaderFormat = jsonFormat2(OutMsgEnvelopeHeader)
implicit val createBreakoutRoomOutMsgPayloadFormat = jsonFormat8(CreateBreakoutRoomOutMsgPayload)
implicit val createBreakoutRoomOutMsgPayloadFormat = jsonFormat10(CreateBreakoutRoomOutMsgPayload)
implicit val createBreakoutRoomOutMsgEnvelopePayloadFormat = jsonFormat2(CreateBreakoutRoomOutMsgEnvelopePayload)
implicit val createBreakoutRoomOutMsgEnvelopeFormat = jsonFormat2(CreateBreakoutRoomOutMsgEnvelope)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ case class OutMsgEnvelopeHeader(`type`: MessageType.MessageType, address: String

trait OutMessage

case class CreateBreakoutRoomOutMsgEnvelope(header: OutMsgEnvelopeHeader,
payload: CreateBreakoutRoomOutMsgEnvelopePayload)
case class CreateBreakoutRoomOutMsgEnvelopePayload(header: OutMsgHeader,
payload: CreateBreakoutRoomOutMsgPayload)
case class CreateBreakoutRoomOutMsgEnvelope(header: OutMsgEnvelopeHeader, payload: CreateBreakoutRoomOutMsgEnvelopePayload)
case class CreateBreakoutRoomOutMsgEnvelopePayload(header: OutMsgHeader, payload: CreateBreakoutRoomOutMsgPayload)
case class CreateBreakoutRoomOutMsgPayload(breakoutId: String, name: String, parentId: String,
voiceConfId: String, durationInMinutes: Int,
moderatorPassword: String, viewerPassword: String,
defaultPresentationUrl: String)
sourcePresentationId: String, sourcePresentationSlide: Int, record: Boolean)

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ case class CreateBreakoutRoom(meetingId: String, room: BreakoutRoomOutPayload) e
case class EndBreakoutRoom(breakoutId: String) extends IOutMessage
case class BreakoutRoomOutPayload(breakoutId: String, name: String, parentId: String,
voiceConfId: String, durationInMinutes: Int, moderatorPassword: String, viewerPassword: String,
defaultPresentationURL: String, record: Boolean)
sourcePresentationId: String, sourcePresentationSlide: Int, record: Boolean)
case class BreakoutRoomJoinURLOutMessage(meetingId: String, recorded: Boolean, breakoutId: String, userId: String, joinURL: String) extends IOutMessage
case class BreakoutRoomStartedOutMessage(meetingId: String, recorded: Boolean, breakout: BreakoutRoomBody) extends IOutMessage
case class BreakoutRoomBody(name: String, breakoutId: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ trait BreakoutRoomApp extends SystemConfiguration {
val outGW: OutMessageGateway
val eventBus: IncomingEventBus

def getDefaultPresentationURL(): String = {
var presURL = bbbWebDefaultPresentationURL
val page = presModel.getCurrentPage()
page foreach { p =>
presURL = BreakoutRoomsUtil.fromSWFtoPDF(p.swfUri)
}
presURL
}

def handleBreakoutRoomsList(msg: BreakoutRoomsListMessage) {
val breakoutRooms = breakoutModel.getRooms().toVector map { r => new BreakoutRoomBody(r.name, r.id) }
outGW.send(new BreakoutRoomsListOutMessage(mProps.meetingID, breakoutRooms, breakoutModel.pendingRoomsNumber == 0 && breakoutRooms.length > 0));
Expand All @@ -40,17 +31,20 @@ trait BreakoutRoomApp extends SystemConfiguration {
log.warning("CreateBreakoutRooms event received while {} are pending to be created for meeting {}", breakoutModel.pendingRoomsNumber, mProps.meetingID)
return
}

var i = 0
val sourcePresentationId = presModel.getCurrentPresentation().get.id
val sourcePresentationSlide = presModel.getCurrentPage().get.num
breakoutModel.pendingRoomsNumber = msg.rooms.length;

for (room <- msg.rooms) {
i += 1
val presURL = bbbWebDefaultPresentationURL
val breakoutMeetingId = BreakoutRoomsUtil.createMeetingId(mProps.meetingID, i)
val voiceConfId = BreakoutRoomsUtil.createVoiceConfId(mProps.voiceBridge, i)
val r = breakoutModel.createBreakoutRoom(breakoutMeetingId, room.name, voiceConfId, room.users, presURL)
val r = breakoutModel.createBreakoutRoom(breakoutMeetingId, room.name, voiceConfId, room.users)
val p = new BreakoutRoomOutPayload(r.id, r.name, mProps.meetingID,
r.voiceConfId, msg.durationInMinutes, mProps.moderatorPass, mProps.viewerPass,
r.defaultPresentationURL, msg.record)
sourcePresentationId, sourcePresentationSlide, msg.record)
outGW.send(new CreateBreakoutRoom(mProps.meetingID, p))
}
meetingModel.breakoutRoomsdurationInMinutes = msg.durationInMinutes;
Expand Down Expand Up @@ -85,7 +79,7 @@ trait BreakoutRoomApp extends SystemConfiguration {
breakoutModel.getRooms().foreach { room =>
breakoutModel.getAssignedUsers(room.id) foreach { users =>
users.foreach { u =>
log.debug("## Sending Join URL for users: {}", u);
log.debug("Sending Join URL for users: {}", u);
sendJoinURL(u, room.id)
}
}
Expand Down Expand Up @@ -181,7 +175,7 @@ object BreakoutRoomsUtil {
}

def joinParams(username: String, userId: String, isBreakout: Boolean, breakoutId: String,
password: String, redirect: Boolean): mutable.Map[String, String] = {
password: String, redirect: Boolean): mutable.Map[String, String] = {
val params = new collection.mutable.HashMap[String, String]
params += "fullName" -> urlEncode(username)
params += "userID" -> urlEncode(userId + "-" + breakoutId.substring(breakoutId.lastIndexOf("-") + 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import scala.collection.immutable.HashMap

case class BreakoutUser(id: String, name: String)
case class BreakoutRoom(id: String, name: String, voiceConfId: String,
assignedUsers: Vector[String], users: Vector[BreakoutUser], defaultPresentationURL: String)
assignedUsers: Vector[String], users: Vector[BreakoutUser])

class BreakoutRoomModel {
private var rooms = new collection.immutable.HashMap[String, BreakoutRoom]
Expand All @@ -22,8 +22,8 @@ class BreakoutRoomModel {
}

def createBreakoutRoom(id: String, name: String, voiceConfId: String,
assignedUsers: Vector[String], defaultPresentationURL: String): BreakoutRoom = {
val room = new BreakoutRoom(id, name, voiceConfId, assignedUsers, Vector(), defaultPresentationURL)
assignedUsers: Vector[String]): BreakoutRoom = {
val room = new BreakoutRoom(id, name, voiceConfId, assignedUsers, Vector())
add(room)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,10 @@ trait PresentationApp {
}

def handleGotoSlide(msg: GotoSlide) {
// println("Received GotoSlide for meeting=[" + msg.meetingID + "] page=[" + msg.page + "]")
// println("*** Before change page ****")
// printPresentations
presModel.changePage(msg.page) foreach { page =>
// println("Switching page for meeting=[" + msg.meetingID + "] page=[" + page.id + "]")
log.debug("Switching page for meeting=[{}] page=[{}]", msg.meetingID, page.num);
outGW.send(new GotoSlideOutMsg(mProps.meetingID, mProps.recorded, page))

}
// println("*** After change page ****")
// printPresentations

usersModel.getCurrentPresenter() foreach { pres =>
handleStopPollRequest(StopPollRequest(mProps.meetingID, pres.userID))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
package org.bigbluebutton.messages.payload;

public class CreateBreakoutRoomRequestPayload {
public final String breakoutId;
public final String parentId; // The main meeting internal id
public final String name; // The name of the breakout room
public final String voiceConfId; // The voice conference id
public final String viewerPassword;
public final String moderatorPassword;
public final Integer durationInMinutes; // The duration of the breakout room
public final String defaultPresentationURL;
public final Boolean record;

public CreateBreakoutRoomRequestPayload(String breakoutId, String parentId, String name,
String voiceConfId, String viewerPassword, String moderatorPassword,
Integer duration, String defaultPresentationURL, Boolean record) {
this.breakoutId = breakoutId;
this.parentId = parentId;
this.name = name;
this.voiceConfId = voiceConfId;
this.viewerPassword = viewerPassword;
this.moderatorPassword = moderatorPassword;
this.durationInMinutes = duration;
this.defaultPresentationURL = defaultPresentationURL;
this.record = record;
}
public final String breakoutId;
public final String parentId; // The main meeting internal id
public final String name; // The name of the breakout room
public final String voiceConfId; // The voice conference id
public final String viewerPassword;
public final String moderatorPassword;
public final Integer durationInMinutes; // The duration of the breakout room
public final String sourcePresentationId;
public final Integer sourcePresentationSlide;
public final Boolean record;

public CreateBreakoutRoomRequestPayload(String breakoutId, String parentId,
String name, String voiceConfId, String viewerPassword,
String moderatorPassword, Integer duration,
String sourcePresentationId, Integer sourcePresentationSlide,
Boolean record) {
this.breakoutId = breakoutId;
this.parentId = parentId;
this.name = name;
this.voiceConfId = voiceConfId;
this.viewerPassword = viewerPassword;
this.moderatorPassword = moderatorPassword;
this.durationInMinutes = duration;
this.sourcePresentationId = sourcePresentationId;
this.sourcePresentationSlide = sourcePresentationSlide;
this.record = record;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
public class CreateBreakoutRoomRequestTest {
@Test
public void testCreateBreakoutRoomRequest() {
String breakoutId = "abc123";
String breakoutId = "183f0bf3a0982a127bdb8161e0c44eb696b3e75c-1474984695664";
String parentId = "abc-123";
Integer durationInMinutes = 20;
String name = "Breakout room 1";
String voiceConfId = "851153";
String viewerPassword = "vp";
String moderatorPassword = "mp";
String defaultPresentationURL = "http://localhost/foo.pdf";
String sourcePresentationId = "d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1474984695907";
Integer sourePresentationSlide = 5;
Boolean record = false;

CreateBreakoutRoomRequestPayload payload =
new CreateBreakoutRoomRequestPayload(breakoutId, parentId, name, voiceConfId,
viewerPassword, moderatorPassword, durationInMinutes, defaultPresentationURL, record);
viewerPassword, moderatorPassword, durationInMinutes, sourcePresentationId, sourePresentationSlide, record);
CreateBreakoutRoomRequest msg = new CreateBreakoutRoomRequest(payload);
Gson gson = new Gson();
String json = gson.toJson(msg);
Expand All @@ -36,7 +37,8 @@ public void testCreateBreakoutRoomRequest() {
Assert.assertEquals(rxMsg.payload.viewerPassword, viewerPassword);
Assert.assertEquals(rxMsg.payload.moderatorPassword, moderatorPassword);
Assert.assertEquals(rxMsg.payload.durationInMinutes, durationInMinutes);
Assert.assertEquals(rxMsg.payload.defaultPresentationURL, defaultPresentationURL);
Assert.assertEquals(rxMsg.payload.sourcePresentationId, sourcePresentationId);
Assert.assertEquals(rxMsg.payload.sourcePresentationSlide, sourePresentationSlide);
Assert.assertEquals(rxMsg.payload.record, record);
}
}
2 changes: 1 addition & 1 deletion bigbluebutton-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
compile 'commons-io:commons-io:2.4'
compile 'com.google.code.gson:gson:1.7.1'
compile 'commons-httpclient:commons-httpclient:3.1'
compile 'com.zaxxer:nuprocess:1.0.4'
compile 'com.zaxxer:nuprocess:1.1.0'

compile 'org.bigbluebutton:bbb-common-message:0.0.18-SNAPSHOT'

Expand Down
5 changes: 3 additions & 2 deletions bigbluebutton-web/grails-app/conf/spring/resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.

<bean id="presDownloadService" class="org.bigbluebutton.presentation.PresentationUrlDownloadService">
<property name="presentationDir" value="${presentationDir}"/>
<property name="presentationBaseURL" value="${presentationBaseURL}"/>
<property name="documentConversionService" ref="documentConversionService"/>
<property name="presentationBaseURL" value="${presentationBaseURL}"/>
<property name="pageExtractor" ref="pageExtractor"/>
<property name="documentConversionService" ref="documentConversionService"/>
</bean>

<bean id="recordingService" class="org.bigbluebutton.api.RecordingService" >
Expand Down
Loading

0 comments on commit 3552fca

Please sign in to comment.