Include timestamp in exported content

This commit is contained in:
Daniel Petri Rocha 2022-12-09 23:48:04 +01:00
parent 5a432289cf
commit d06a642ae9
5 changed files with 30 additions and 19 deletions

View File

@ -15,6 +15,8 @@ trait EndBreakoutRoomInternalMsgHdlr extends HandlerHelpers {
if (liveMeeting.props.breakoutProps.captureSlides) {
val captureSlidesEvent = BigBlueButtonEvent(msg.breakoutId, CapturePresentationReqInternalMsg("system", msg.parentId))
eventBus.publish(captureSlidesEvent)
println(liveMeeting.props.breakoutProps.breakoutRooms);
}
if (liveMeeting.props.breakoutProps.captureNotes) {

View File

@ -9,10 +9,16 @@ import org.bigbluebutton.core.running.LiveMeeting
import org.bigbluebutton.core.util.RandomStringGenerator
import org.bigbluebutton.core.models.{ PresentationPod, PresentationPage, PresentationInPod }
import java.io.File
import java.util.Calendar
trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
this: PresentationPodHdlrs =>
def generateFilename(filename: String): String = {
val calendar = Calendar.getInstance()
s"${filename}-${calendar.get(Calendar.HOUR_OF_DAY)}_${calendar.get(Calendar.MINUTE)}"
}
def buildStoreAnnotationsInRedisSysMsg(annotations: StoredAnnotations, liveMeeting: LiveMeeting): BbbCommonEnvCoreMsg = {
val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(StoreAnnotationsInRedisSysMsg.NAME, routing)
@ -159,9 +165,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
val pagesRange: List[Int] = if (allPages) (1 to pageCount).toList else List(currentPage.num)
val presentationUploadToken: String = PresentationPodsApp.generateToken("DEFAULT_PRESENTATION_POD", userId)
// Set filename, checking if it is already in use
val filename: String = liveMeeting.props.meetingProp.name
val filename: String = generateFilename(liveMeeting.props.meetingProp.name)
// Informs bbb-web about the token so that when we use it to upload the presentation, it is able to look it up in the list of tokens
bus.outGW.send(buildPresentationUploadTokenSysPubMsg(parentMeetingId, userId, presentationUploadToken, filename))
@ -190,7 +194,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, parentMeetingId, "not-used")
val envelope = BbbCoreEnvelope(PresentationPageConversionStartedEventMsg.NAME, routing)
val header = BbbClientMsgHeader(CaptureSharedNotesReqEvtMsg.NAME, parentMeetingId, "not-used")
val body = CaptureSharedNotesReqEvtMsgBody(m.breakoutId, m.meetingName)
val body = CaptureSharedNotesReqEvtMsgBody(m.breakoutId)
val event = CaptureSharedNotesReqEvtMsg(header, body)
bus.outGW.send(BbbCommonEnvCoreMsg(envelope, event))
@ -205,7 +209,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait {
val userId: String = "system"
val jobId: String = s"${m.body.breakoutId}-notes" // Used as the temporaryPresentationId upon upload
val jobType = "PadCaptureJob"
val filename = m.body.filename
val filename = generateFilename(m.body.filename)
val presentationUploadToken: String = PresentationPodsApp.generateToken("DEFAULT_PRESENTATION_POD", userId)
bus.outGW.send(buildPresentationUploadTokenSysPubMsg(m.body.parentMeetingId, userId, presentationUploadToken, filename))

View File

@ -47,6 +47,6 @@ case class PresAnnStatusEvtMsgBody(presId: String, pageNumber: Int, totalPages:
object CaptureSharedNotesReqEvtMsg { val NAME = "CaptureSharedNotesReqEvtMsg" }
case class CaptureSharedNotesReqEvtMsg(header: BbbClientMsgHeader, body: CaptureSharedNotesReqEvtMsgBody) extends BbbCoreMsg
case class CaptureSharedNotesReqEvtMsgBody(breakoutId: String, meetingName: String)
case class CaptureSharedNotesReqEvtMsgBody(breakoutId: String)
// ------------ akka-apps to client ------------

View File

@ -1,14 +1,20 @@
import { check } from 'meteor/check';
import padCapture from '../methods/padCapture';
export default function captureSharedNotes({ body }, parentMeetingId) {
export default function captureSharedNotes({ header, body }) {
check(header, Object);
check(body, Object);
check(parentMeetingId, String);
const { breakoutId, meetingName } = body;
const {
meetingId: parentMeetingId,
} = header;
const {
breakoutId,
} = body;
check(breakoutId, String);
check(meetingName, String);
check(parentMeetingId, String);
padCapture(breakoutId, parentMeetingId, meetingName);
padCapture(breakoutId, parentMeetingId);
}

View File

@ -1,18 +1,15 @@
import { check } from 'meteor/check';
import Pads from '/imports/api/pads';
import Breakouts from '/imports/api/breakouts';
import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger';
export default function padCapture(breakoutId, parentMeetingId, meetingName) {
export default function padCapture(breakoutId, parentMeetingId) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'PadCapturePubMsg';
const EXTERNAL_ID = Meteor.settings.public.notes.id;
try {
check(breakoutId, String);
check(parentMeetingId, String);
check(meetingName, String);
try {
const pad = Pads.findOne(
{
meetingId: breakoutId,
@ -25,12 +22,14 @@ export default function padCapture(breakoutId, parentMeetingId, meetingName) {
},
);
if (pad && pad.padId) {
const breakout = Breakouts.findOne({ breakoutId });
if (pad?.padId && breakout?.shortName) {
const payload = {
parentMeetingId,
breakoutId,
padId: pad.padId,
filename: `${meetingName}-notes`,
filename: `${breakout.shortName}-notes`,
};
Logger.info(`Sending PadCapturePubMsg for meetingId=${breakoutId} parentMeetingId=${parentMeetingId} padId=${pad.padId}`);