diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/BreakoutModel.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/BreakoutModel.scala index bba8d27930..0676885395 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/BreakoutModel.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/BreakoutModel.scala @@ -20,9 +20,10 @@ object BreakoutModel { captureSlidesFilename: String, allPages: Boolean, presId: String, + sourcePresentationFilename: String, ): BreakoutRoom2x = { new BreakoutRoom2x(id, externalId, name, parentId, sequence, shortName, isDefaultName, freeJoin, voiceConf, assignedUsers, Vector(), Vector(), None, false, - captureNotes, captureSlides, captureNotesFilename, captureSlidesFilename, allPages, presId) + captureNotes, captureSlides, captureNotesFilename, captureSlidesFilename, allPages, presId, sourcePresentationFilename) } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/CreateBreakoutRoomsCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/CreateBreakoutRoomsCmdMsgHdlr.scala index d2d1f14e99..72ad23721d 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/CreateBreakoutRoomsCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/CreateBreakoutRoomsCmdMsgHdlr.scala @@ -56,7 +56,7 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait { val breakout = BreakoutModel.create(parentId, internalId, externalId, room.name, room.sequence, room.shortName, room.isDefaultName, room.freeJoin, voiceConf, room.users, msg.body.captureNotes, msg.body.captureSlides, room.captureNotesFilename, room.captureSlidesFilename, - room.allPages, roomPresId) + room.allPages, roomPresId, room.sourcePresentationFilename) rooms = rooms + (breakout.id -> breakout) } @@ -78,6 +78,7 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait { liveMeeting.props.password.viewerPass, breakout.presId, roomSlides, + breakout.sourcePresentationFilename, msg.body.record, liveMeeting.props.breakoutProps.privateChatEnabled, breakout.captureNotes, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/BreakoutRoom2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/BreakoutRoom2x.scala index 5fa3a84e07..14a41b3281 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/BreakoutRoom2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/BreakoutRoom2x.scala @@ -1,26 +1,27 @@ package org.bigbluebutton.core.domain case class BreakoutRoom2x( - id: String, - externalId: String, - name: String, - parentId: String, - sequence: Int, - shortName: String, - isDefaultName: Boolean, - freeJoin: Boolean, - voiceConf: String, - assignedUsers: Vector[String], - users: Vector[BreakoutUser], - voiceUsers: Vector[BreakoutVoiceUser], - startedOn: Option[Long], - started: Boolean, - captureNotes: Boolean, - captureSlides: Boolean, - captureNotesFilename: String, - captureSlidesFilename: String, - allPages: Boolean, - presId: String, + id: String, + externalId: String, + name: String, + parentId: String, + sequence: Int, + shortName: String, + isDefaultName: Boolean, + freeJoin: Boolean, + voiceConf: String, + assignedUsers: Vector[String], + users: Vector[BreakoutUser], + voiceUsers: Vector[BreakoutVoiceUser], + startedOn: Option[Long], + started: Boolean, + captureNotes: Boolean, + captureSlides: Boolean, + captureNotesFilename: String, + captureSlidesFilename: String, + allPages: Boolean, + presId: String, + sourcePresentationFilename: String, ) { } diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala index 6f0af8d0f9..ae33f5284d 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/BreakoutMsgs.scala @@ -57,6 +57,7 @@ case class BreakoutRoomDetail( viewerPassword: String, sourcePresentationId: String, sourcePresentationSlide: Int, + sourcePresentationFilename: String, record: Boolean, privateChatEnabled: Boolean, captureNotes: Boolean, @@ -71,7 +72,7 @@ case class BreakoutRoomDetail( object CreateBreakoutRoomsCmdMsg { val NAME = "CreateBreakoutRoomsCmdMsg" } case class CreateBreakoutRoomsCmdMsg(header: BbbClientMsgHeader, body: CreateBreakoutRoomsCmdMsgBody) extends StandardMsg case class CreateBreakoutRoomsCmdMsgBody(meetingId: String, durationInMinutes: Int, record: Boolean, captureNotes: Boolean, captureSlides: Boolean, rooms: Vector[BreakoutRoomMsgBody], sendInviteToModerators: Boolean) -case class BreakoutRoomMsgBody(name: String, sequence: Int, shortName: String, captureNotesFilename: String, captureSlidesFilename: String, isDefaultName: Boolean, freeJoin: Boolean, users: Vector[String], allPages: Boolean, presId: String) +case class BreakoutRoomMsgBody(name: String, sequence: Int, shortName: String, captureNotesFilename: String, captureSlidesFilename: String, isDefaultName: Boolean, freeJoin: Boolean, users: Vector[String], allPages: Boolean, presId: String, sourcePresentationFilename: String) // Sent by user to request ending all the breakout rooms object EndAllBreakoutRoomsMsg { val NAME = "EndAllBreakoutRoomsMsg" } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index d7076d917a..ecd57f4da1 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -671,7 +671,9 @@ public class MeetingService implements MessageListener { presDownloadService.extractPresentationPage(message.parentMeetingId, message.sourcePresentationId, - message.sourcePresentationSlide, breakout.getInternalId()); + message.sourcePresentationSlide, + breakout.getInternalId(), + message.sourcePresentationFilename); } else { Map logData = new HashMap(); logData.put("meetingId", message.meetingId); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/CreateBreakoutRoom.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/CreateBreakoutRoom.java index b2989e30c2..08e88eca3d 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/CreateBreakoutRoom.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/CreateBreakoutRoom.java @@ -17,6 +17,7 @@ public class CreateBreakoutRoom implements IMessage { public final Integer durationInMinutes; // The duration of the breakout room public final String sourcePresentationId; public final Integer sourcePresentationSlide; + public final String sourcePresentationFilename; public final Boolean record; public final Boolean privateChatEnabled; public final Boolean captureNotes; // Upload shared notes to main room after breakout room end @@ -38,6 +39,7 @@ public class CreateBreakoutRoom implements IMessage { Integer duration, String sourcePresentationId, Integer sourcePresentationSlide, + String sourcePresentationFilename, Boolean record, Boolean privateChatEnabled, Boolean captureNotes, @@ -58,6 +60,7 @@ public class CreateBreakoutRoom implements IMessage { this.durationInMinutes = duration; this.sourcePresentationId = sourcePresentationId; this.sourcePresentationSlide = sourcePresentationSlide; + this.sourcePresentationFilename = sourcePresentationFilename; this.record = record; this.privateChatEnabled = privateChatEnabled; this.captureNotes = captureNotes; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java index 9add5bb657..33b669bad0 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java @@ -81,7 +81,8 @@ public class PresentationUrlDownloadService { } public void extractPresentationPage(final String sourceMeetingId, final String presentationId, - final Integer presentationSlide, final String destinationMeetingId) { + final Integer presentationSlide, final String destinationMeetingId, + final String sourcePresentationFilename) { /** * We delay processing of the presentation to make sure that the meeting has already been created. * Otherwise, the meeting won't get the conversion events. @@ -89,18 +90,25 @@ public class PresentationUrlDownloadService { ScheduledFuture scheduledFuture = scheduledThreadPool.schedule(new Runnable() { public void run() { - extractPage(sourceMeetingId, presentationId, presentationSlide, destinationMeetingId) ; + extractPage(sourceMeetingId, presentationId, presentationSlide, destinationMeetingId, sourcePresentationFilename) ; } }, 5, TimeUnit.SECONDS); } - // A negative presentationSlide indicates the entire presentation deck should be used. private void extractPage(final String sourceMeetingId, final String presentationId, - final Integer presentationSlide, final String destinationMeetingId) { + final Integer presentationSlide, final String destinationMeetingId, + final String sourcePresentationFilename) { Boolean uploadFailed = false; ArrayList uploadFailedReasons = new ArrayList(); + // A negative presentationSlide indicates the entire presentation deck should be used. + Boolean extractWholePresentation = presentationSlide < 0; + String filenameWithoutExtension = FilenameUtils.removeExtension(sourcePresentationFilename); + + // Append the slide number to the filename if a single slide is being extracted + String presentationSlideInFilename = extractWholePresentation ? "" : ("-" + presentationSlide.toString()); + // Build the source meeting path File sourceMeetingPath = new File(presentationDir + File.separatorChar + sourceMeetingId + File.separatorChar + sourceMeetingId @@ -137,7 +145,8 @@ public class PresentationUrlDownloadService { } // Build the target meeting path - String filenameExt = FilenameUtils.getExtension(sourcePresentationFile.getName()); + String filename = sourcePresentationFile.getName(); + String filenameExt = FilenameUtils.getExtension(filename); String presId = Util.generatePresentationId(presentationId); String newFilename = Util.createNewFilename(presId, filenameExt); @@ -147,7 +156,7 @@ public class PresentationUrlDownloadService { + newFilename; File newPresentation = new File(newFilePath); - if (sourcePresentationFile.getName().toLowerCase().endsWith("pdf") && presentationSlide >= 0) { + if (sourcePresentationFile.getName().toLowerCase().endsWith("pdf") && !extractWholePresentation) { pageExtractor.extractPage(sourcePresentationFile, new File( newFilePath), presentationSlide); } else { @@ -163,7 +172,7 @@ public class PresentationUrlDownloadService { processUploadedFile("DEFAULT_PRESENTATION_POD", destinationMeetingId, presId, - "default-" + presentationSlide.toString() + "." + filenameExt, + filenameWithoutExtension + presentationSlideInFilename + "." + filenameExt, newPresentation, true, "breakout-authz-token", diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala index 1486a1393f..8a15f21b49 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala @@ -11,7 +11,7 @@ sealed trait ApiMsg case class CreateBreakoutRoomMsg(meetingId: String, parentMeetingId: String, name: String, sequence: Integer, freeJoin: Boolean, dialNumber: String, voiceConfId: String, viewerPassword: String, moderatorPassword: String, duration: Int, - sourcePresentationId: String, sourcePresentationSlide: Int, + sourcePresentationId: String, sourcePresentationSlide: Int, sourcePresentationFilename: String, record: Boolean, captureNotes: Boolean, captureSlides: Boolean, captureNotesFilename: String, captureSlidesFilename: String) extends ApiMsg case class AddUserSession(token: String, session: UserSession) diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala index 8b058ae280..d7baf8157d 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/OldMeetingMsgHdlrActor.scala @@ -101,6 +101,7 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW) msg.body.room.durationInMinutes, msg.body.room.sourcePresentationId, msg.body.room.sourcePresentationSlide, + msg.body.room.sourcePresentationFilename, msg.body.room.record, msg.body.room.privateChatEnabled, msg.body.room.captureNotes, diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx index 1859fac112..88b5a22d57 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx @@ -512,6 +512,9 @@ class BreakoutRoom extends PureComponent { sequence: seq, allPages: !this.getRoomPresentation(seq).startsWith(CURRENT_SLIDE_PREFIX), presId: this.getRoomPresentation(seq).replace(CURRENT_SLIDE_PREFIX, ''), + sourcePresentationFilename: PresentationUploaderService.getPresentations() + .filter((pres) => pres.id == this.getRoomPresentation(seq).replace(CURRENT_SLIDE_PREFIX, ''))[0] + .filename || this.getRoomName(seq), })); createBreakoutRoom(rooms, durationTime, record, captureNotes, captureSlides, inviteMods);