diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala index b1052455a4..cffeb62e49 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/Boot.scala @@ -12,7 +12,7 @@ import org.bigbluebutton.core2.AnalyticsActor import org.bigbluebutton.core2.FromAkkaAppsMsgSenderActor import org.bigbluebutton.endpoint.redis.AppsRedisSubscriberActor import org.bigbluebutton.endpoint.redis.RedisRecorderActor -import org.bigbluebutton.endpoint.redis.ActivityTrackerActor +import org.bigbluebutton.endpoint.redis.LearningDashboardActor import org.bigbluebutton.common2.bus.IncomingJsonMessageBus import org.bigbluebutton.service.{ HealthzService, MeetingInfoActor, MeetingInfoService } @@ -59,9 +59,9 @@ object Boot extends App with SystemConfiguration { "redisRecorderActor" ) - val activityTrackerActor = system.actorOf( - ActivityTrackerActor.props(system, outGW), - "activityTrackerActor" + val learningDashboardActor = system.actorOf( + LearningDashboardActor.props(system, outGW), + "LearningDashboardActor" ) recordingEventBus.subscribe(redisRecorderActor, outMessageChannel) @@ -76,8 +76,8 @@ object Boot extends App with SystemConfiguration { outBus2.subscribe(analyticsActorRef, outBbbMsgMsgChannel) bbbMsgBus.subscribe(analyticsActorRef, analyticsChannel) - outBus2.subscribe(activityTrackerActor, outBbbMsgMsgChannel) - bbbMsgBus.subscribe(activityTrackerActor, analyticsChannel) + outBus2.subscribe(learningDashboardActor, outBbbMsgMsgChannel) + bbbMsgBus.subscribe(learningDashboardActor, analyticsChannel) val bbbActor = system.actorOf(BigBlueButtonActor.props(system, eventBus, bbbMsgBus, outGW, healthzService), "bigbluebutton-actor") eventBus.subscribe(bbbActor, meetingManagerChannel) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala index 87ba7c7ce4..8cfd782fb7 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala @@ -545,12 +545,12 @@ object MsgBuilder { BbbCommonEnvCoreMsg(envelope, event) } - def buildActivityReportEvtMsg(meetingId: String, activityJson: String): BbbCommonEnvCoreMsg = { + def buildLearningDashboardEvtMsg(meetingId: String, activityJson: String): BbbCommonEnvCoreMsg = { val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka") - val envelope = BbbCoreEnvelope(ActivityReportEvtMsg.NAME, routing) - val body = ActivityReportEvtMsgBody(activityJson) - val header = BbbCoreHeaderWithMeetingId(ActivityReportEvtMsg.NAME, meetingId) - val event = ActivityReportEvtMsg(header, body) + val envelope = BbbCoreEnvelope(LearningDashboardEvtMsg.NAME, routing) + val body = LearningDashboardEvtMsgBody(activityJson) + val header = BbbCoreHeaderWithMeetingId(LearningDashboardEvtMsg.NAME, meetingId) + val event = LearningDashboardEvtMsg(header, body) BbbCommonEnvCoreMsg(envelope, event) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/ActivityTrackerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/LearningDashboardActor.scala similarity index 92% rename from akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/ActivityTrackerActor.scala rename to akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/LearningDashboardActor.scala index 83ee8e06fc..f5f1d5ce93 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/ActivityTrackerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/endpoint/redis/LearningDashboardActor.scala @@ -15,19 +15,19 @@ import ExecutionContext.Implicits.global case object SendPeriodicReport -case class MeetingActivityTracker( +case class Meeting( intId: String, extId: String, name: String, - activityReportAccessToken: String, - users: Map[String, UserActivityTracker] = Map(), + learningDashboardAccessToken: String, + users: Map[String, User] = Map(), polls: Map[String, Poll] = Map(), screenshares: Vector[Screenshare] = Vector(), createdOn: Long = System.currentTimeMillis(), endedOn: Long = 0, ) -case class UserActivityTracker( +case class User( intId: String, extId: String, name: String, @@ -73,24 +73,24 @@ case class Screenshare( ) -object ActivityTrackerActor { +object LearningDashboardActor { def props( system: ActorSystem, outGW: OutMessageGateway, ): Props = Props( - classOf[ActivityTrackerActor], + classOf[LearningDashboardActor], system, outGW ) } -class ActivityTrackerActor( +class LearningDashboardActor( system: ActorSystem, val outGW: OutMessageGateway, ) extends Actor with ActorLogging { - private var meetings: Map[String, MeetingActivityTracker] = Map() + private var meetings: Map[String, Meeting] = Map() private var meetingsLastJsonHash : Map[String,String] = Map() system.scheduler.schedule(10.seconds, 10.seconds, self, SendPeriodicReport) @@ -155,8 +155,8 @@ class ActivityTrackerActor( for { meeting <- meetings.values.find(m => m.intId == msg.header.meetingId) } yield { - val user: UserActivityTracker = meeting.users.values.find(u => u.intId == msg.body.intId).getOrElse({ - UserActivityTracker( + val user: User = meeting.users.values.find(u => u.intId == msg.body.intId).getOrElse({ + User( msg.body.intId, msg.body.extId, msg.body.name, (msg.body.role == Roles.MODERATOR_ROLE) ) }) @@ -235,8 +235,8 @@ class ActivityTrackerActor( for { meeting <- meetings.values.find(m => m.intId == msg.header.meetingId) } yield { - val user: UserActivityTracker = meeting.users.values.find(u => u.intId == msg.body.intId).getOrElse({ - UserActivityTracker( + val user: User = meeting.users.values.find(u => u.intId == msg.body.intId).getOrElse({ + User( msg.body.intId, msg.body.callerNum, msg.body.callerName, false, true ) }) @@ -286,7 +286,7 @@ class ActivityTrackerActor( } } - private def endUserTalk(meeting: MeetingActivityTracker, user: UserActivityTracker): Unit = { + private def endUserTalk(meeting: Meeting, user: User): Unit = { if(user.talk.lastTalkStartedOn > 0) { val updatedUser = user.copy( talk = user.talk.copy( @@ -354,19 +354,19 @@ class ActivityTrackerActor( } private def handleCreateMeetingReqMsg(msg: CreateMeetingReqMsg): Unit = { - if(msg.body.props.meetingProp.activityReportTracking) { - val newMeeting = MeetingActivityTracker( + if(msg.body.props.meetingProp.learningDashboardEnabled) { + val newMeeting = Meeting( msg.body.props.meetingProp.intId, msg.body.props.meetingProp.extId, msg.body.props.meetingProp.name, - msg.body.props.password.activityReportAccessToken, + msg.body.props.password.learningDashboardAccessToken, ) meetings += (newMeeting.intId -> newMeeting) - log.info("ActivityTracker created for meeting {}.",msg.body.props.meetingProp.intId) + log.info(" created for meeting {}.",msg.body.props.meetingProp.intId) } else { - log.info("ActivityTracker disabled for meeting {}.",msg.body.props.meetingProp.intId) + log.info(" disabled for meeting {}.",msg.body.props.meetingProp.intId) } } @@ -404,7 +404,7 @@ class ActivityTrackerActor( sendReport(updatedMeeting) meetings = meetings.-(updatedMeeting.intId) - log.info("ActivityTracker removed for meeting {}.",updatedMeeting.intId) + log.info(" removed for meeting {}.",updatedMeeting.intId) } } @@ -414,14 +414,14 @@ class ActivityTrackerActor( }) } - private def sendReport(meeting : MeetingActivityTracker): Unit = { + private def sendReport(meeting : Meeting): Unit = { val activityJson: String = JsonUtil.toJson(meeting) //Avoid send repeated activity jsons val activityJsonHash : String = MessageDigest.getInstance("MD5").digest(activityJson.getBytes).mkString if(!meetingsLastJsonHash.contains(meeting.intId) || meetingsLastJsonHash.get(meeting.intId).getOrElse("") != activityJsonHash) { - val event = MsgBuilder.buildActivityReportEvtMsg(meeting.intId, activityJson) + val event = MsgBuilder.buildLearningDashboardEvtMsg(meeting.intId, activityJson) outGW.send(event) meetingsLastJsonHash += (meeting.intId -> activityJsonHash) diff --git a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala index 380ac0633e..c7e999f9b2 100755 --- a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala +++ b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala @@ -29,7 +29,7 @@ trait AppsTestFixtures { val webcamsOnlyForModerator = false; val moderatorPassword = "modpass" val viewerPassword = "viewpass" - val activityReportAccessToken = "arToken" + val learningDashboardAccessToken = "ldToken" val createTime = System.currentTimeMillis val createDate = "Oct 26, 2015" val isBreakout = false @@ -53,7 +53,7 @@ trait AppsTestFixtures { val durationProps = DurationProps(duration = durationInMinutes, createdTime = createTime, createdDate = createDate, meetingExpireIfNoUserJoinedInMinutes = meetingExpireIfNoUserJoinedInMinutes, meetingExpireWhenLastUserLeftInMinutes = meetingExpireWhenLastUserLeftInMinutes, userInactivityInspectTimerInMinutes = userInactivityInspectTimerInMinutes, userInactivityThresholdInMinutes = userInactivityInspectTimerInMinutes, userActivitySignResponseDelayInMinutes = userActivitySignResponseDelayInMinutes) - val password = PasswordProp(moderatorPass = moderatorPassword, viewerPass = viewerPassword, activityReportAccessToken = activityReportAccessToken) + val password = PasswordProp(moderatorPass = moderatorPassword, viewerPass = viewerPassword, learningDashboardAccessToken = learningDashboardAccessToken) val recordProp = RecordProp(record = record, autoStartRecording = autoStartRecording, allowStartStopRecording = allowStartStopRecording, keepEvents = keepEvents ) val welcomeProp = WelcomeProp(welcomeMsgTemplate = welcomeMsgTemplate, welcomeMsg = welcomeMsg, diff --git a/bbb-activity-report/Readme.md b/bbb-activity-report/Readme.md new file mode 100644 index 0000000000..79d8c0c5c7 --- /dev/null +++ b/bbb-activity-report/Readme.md @@ -0,0 +1,23 @@ +Learning Dashboard will be accessible through https://yourdomain/learning-dashboard + +# Dev Instructions + +## Prepare destination directory +``` +mkdir /var/bigbluebutton/learning-dashboard +chown bigbluebutton /var/bigbluebutton/learning-dashboard/ +``` + +## Build instructions +``` +cd bbb-learning-dashboard +rm -r node_modules +npm install +npm run build +cp -r build/* /var/bigbluebutton/learning-dashboard +``` + +## Update nginx config +``` +cp bbb-learning-dashboard/learning-dashboard.nginx /etc/bigbluebutton/nginx/ +``` diff --git a/bbb-activity-report/activity-report.nginx b/bbb-activity-report/activity-report.nginx deleted file mode 100644 index d1cae3ec95..0000000000 --- a/bbb-activity-report/activity-report.nginx +++ /dev/null @@ -1,5 +0,0 @@ -location /learning-dashboard/ { - alias /var/bigbluebutton/activity-report/; - autoindex off; -} - diff --git a/bbb-activity-report/learning-dashboard.nginx b/bbb-activity-report/learning-dashboard.nginx new file mode 100644 index 0000000000..6f626084ac --- /dev/null +++ b/bbb-activity-report/learning-dashboard.nginx @@ -0,0 +1,5 @@ +location /learning-dashboard/ { + alias /var/bigbluebutton/learning-dashboard/; + autoindex off; +} + diff --git a/bbb-activity-report/package.json b/bbb-activity-report/package.json index 6a36d4a06e..5334993c0a 100644 --- a/bbb-activity-report/package.json +++ b/bbb-activity-report/package.json @@ -1,5 +1,5 @@ { - "name": "activity-report-app", + "name": "learning-dashboard", "homepage": "/learning-dashboard/", "version": "0.1.0", "private": true, diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala index ac206fbfbe..0e9bb0f867 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala @@ -8,7 +8,7 @@ case class DurationProps(duration: Int, createdTime: Long, createdDate: String, userActivitySignResponseDelayInMinutes: Int, endWhenNoModerator: Boolean, endWhenNoModeratorDelayInMinutes: Int) -case class MeetingProp(name: String, extId: String, intId: String, isBreakout: Boolean, activityReportTracking: Boolean) +case class MeetingProp(name: String, extId: String, intId: String, isBreakout: Boolean, learningDashboardEnabled: Boolean) case class BreakoutProps( parentId: String, @@ -20,7 +20,7 @@ case class BreakoutProps( privateChatEnabled: Boolean ) -case class PasswordProp(moderatorPass: String, viewerPass: String, activityReportAccessToken: String) +case class PasswordProp(moderatorPass: String, viewerPass: String, learningDashboardAccessToken: String) case class RecordProp(record: Boolean, autoStartRecording: Boolean, allowStartStopRecording: Boolean, keepEvents: Boolean) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PollsMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PollsMsgs.scala index eac7ef92d9..1a69c05fa0 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PollsMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PollsMsgs.scala @@ -30,7 +30,6 @@ object UserRespondedToPollRecordMsg { val NAME = "UserRespondedToPollRecordMsg" case class UserRespondedToPollRecordMsg(header: BbbClientMsgHeader, body: UserRespondedToPollRecordMsgBody) extends BbbCoreMsg case class UserRespondedToPollRecordMsgBody(pollId: String, answerId: Int, answer: String, isSecret: Boolean) - object RespondToPollReqMsg { val NAME = "RespondToPollReqMsg" } case class RespondToPollReqMsg(header: BbbClientMsgHeader, body: RespondToPollReqMsgBody) extends StandardMsg case class RespondToPollReqMsgBody(requesterId: String, pollId: String, questionId: Int, answerId: Int) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala index d6719eb981..140f846111 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala @@ -227,9 +227,9 @@ case class DeletedRecordingSysMsgBody(recordId: String) /** * Sent from akka-apps to bbb-web to inform a summary of the meeting activities */ -object ActivityReportEvtMsg { val NAME = "ActivityReportEvtMsg" } -case class ActivityReportEvtMsg( +object LearningDashboardEvtMsg { val NAME = "LearningDashboardEvtMsg" } +case class LearningDashboardEvtMsg( header: BbbCoreHeaderWithMeetingId, - body: ActivityReportEvtMsgBody + body: LearningDashboardEvtMsgBody ) extends BbbCoreMsg -case class ActivityReportEvtMsgBody(activityJson: String) +case class LearningDashboardEvtMsgBody(activityJson: String) diff --git a/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala b/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala index 3c451a9efa..77fe2b3e24 100755 --- a/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala +++ b/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala @@ -25,7 +25,7 @@ trait TestFixtures { val webcamsOnlyForModerator = false val moderatorPassword = "modpass" val viewerPassword = "viewpass" - val activityReportAccessToken = "arToken" + val learningDashboardAccessToken = "ldToken" val createTime = System.currentTimeMillis val createDate = "Oct 26, 2015" val isBreakout = false @@ -48,7 +48,7 @@ trait TestFixtures { val durationProps = DurationProps(duration = durationInMinutes, createdTime = createTime, createdDate = createDate, meetingExpireIfNoUserJoinedInMinutes = meetingExpireIfNoUserJoinedInMinutes, meetingExpireWhenLastUserLeftInMinutes = meetingExpireWhenLastUserLeftInMinutes, userInactivityInspectTimerInMinutes = userInactivityInspectTimerInMinutes, userInactivityThresholdInMinutes = userInactivityInspectTimerInMinutes, userActivitySignResponseDelayInMinutes = userActivitySignResponseDelayInMinutes) - val password = PasswordProp(moderatorPass = moderatorPassword, viewerPass = viewerPassword, activityReportAccessToken = activityReportAccessToken) + val password = PasswordProp(moderatorPass = moderatorPassword, viewerPass = viewerPassword, learningDashboardAccessToken = learningDashboardAccessToken) val recordProp = RecordProp(record = record, autoStartRecording = autoStartRecording, allowStartStopRecording = allowStartStopRecording, keepEvents = keepEvents) val welcomeProp = WelcomeProp(welcomeMsgTemplate = welcomeMsgTemplate, welcomeMsg = welcomeMsg, diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java index b1c09004ab..7942637ce4 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java @@ -55,7 +55,7 @@ public class ApiParams { public static final String SEQUENCE = "sequence"; public static final String VOICE_BRIDGE = "voiceBridge"; public static final String WEB_VOICE = "webVoice"; - public static final String ACTIVITY_REPORT_TRACKING = "activityReportTracking"; + public static final String ACTIVITY_REPORT_TRACKING = "learningDashboardEnabled"; public static final String WEBCAMS_ONLY_FOR_MODERATOR = "webcamsOnlyForModerator"; public static final String WELCOME = "welcome"; public static final String HTML5_INSTANCE_ID = "html5InstanceId"; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ActivityService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/LearningDashboardService.java similarity index 61% rename from bbb-common-web/src/main/java/org/bigbluebutton/api/ActivityService.java rename to bbb-common-web/src/main/java/org/bigbluebutton/api/LearningDashboardService.java index 4c370f187a..164f60a966 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ActivityService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/LearningDashboardService.java @@ -24,19 +24,19 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileOutputStream; -public class ActivityService { - private static Logger log = LoggerFactory.getLogger(ActivityService.class); - private static String activitiesDir = "/var/bigbluebutton/activity-report"; +public class LearningDashboardService { + private static Logger log = LoggerFactory.getLogger(LearningDashboardService.class); + private static String learningDashboardFilesDir = "/var/bigbluebutton/learning-dashboard"; - public void writeActivityJsonFile(String meetingId, String activityReportAccessToken, String activityJson) { + public void writeActivityJsonFile(String meetingId, String learningDashboardAccessToken, String activityJson) { try { - if(activityReportAccessToken.length() == 0) { - log.error("ActivityReport AccessToken not found. JSON file will not be saved for meeting {}.",meetingId); + if(learningDashboardAccessToken.length() == 0) { + log.error("LearningDashboard AccessToken not found. JSON file will not be saved for meeting {}.",meetingId); return; } - File baseDir = new File(this.getDestinationBaseDirectoryName(meetingId,activityReportAccessToken)); + File baseDir = new File(this.getDestinationBaseDirectoryName(meetingId,learningDashboardAccessToken)); if (!baseDir.exists()) baseDir.mkdirs(); File jsonFile = new File(baseDir.getAbsolutePath() + File.separatorChar + "activity_report.json"); @@ -46,17 +46,17 @@ public class ActivityService { fileOutput.close(); - log.info("Activities JSON ({}) updated for meeting {}.",jsonFile.getAbsolutePath(),meetingId); + log.info("Learning Dashboard ({}) updated for meeting {}.",jsonFile.getAbsolutePath(),meetingId); } catch(Exception e) { System.out.println(e); } } - private String getDestinationBaseDirectoryName(String meetingId, String activityReportAccessToken) { - return activitiesDir + File.separatorChar + meetingId + File.separatorChar + activityReportAccessToken; + private String getDestinationBaseDirectoryName(String meetingId, String learningDashboardAccessToken) { + return learningDashboardFilesDir + File.separatorChar + meetingId + File.separatorChar + learningDashboardAccessToken; } - public void setActivitiesDir(String dir) { - activitiesDir = dir; + public void setLearningDashboardFilesDir(String dir) { + learningDashboardFilesDir = dir; } } 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 d8f0283e68..b17ce40e31 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 @@ -90,7 +90,7 @@ public class MeetingService implements MessageListener { private final ConcurrentMap sessions; private RecordingService recordingService; - private ActivityService activityService; + private LearningDashboardService learningDashboardService; private WaitingGuestCleanupTimerTask waitingGuestCleaner; private UserCleanupTimerTask userCleaner; private EnteredUserCleanupTimerTask enteredUserCleaner; @@ -405,7 +405,7 @@ public class MeetingService implements MessageListener { gw.createMeeting(m.getInternalId(), m.getExternalId(), m.getParentMeetingId(), m.getName(), m.isRecord(), m.getTelVoice(), m.getDuration(), m.getAutoStartRecording(), m.getAllowStartStopRecording(), m.getWebcamsOnlyForModerator(), m.getModeratorPassword(), m.getViewerPassword(), - m.getActivityReportTracking(), m.getActivityReportAccessToken(), m.getCreateTime(), + m.getlearningDashboardEnabled(), m.getLearningDashboardAccessToken(), m.getCreateTime(), formatPrettyDate(m.getCreateTime()), m.isBreakout(), m.getSequence(), m.isFreeJoin(), m.getMetadata(), m.getGuestPolicy(), m.getAuthenticatedGuest(), m.getMeetingLayout(), m.getWelcomeMessageTemplate(), m.getWelcomeMessage(), m.getModeratorOnlyMessage(), m.getDialNumber(), m.getMaxUsers(), @@ -953,10 +953,10 @@ public class MeetingService implements MessageListener { } } - public void processActivityReport(ActivityReport message) { + public void processLearningDashboard(LearningDashboard message) { //Get all data from Json instead of getMeeting(message.meetingId), to process messages received even after meeting ended JsonObject activityJsonObject = new Gson().fromJson(message.activityJson, JsonObject.class).getAsJsonObject(); - String activityReportAccessToken = activityJsonObject.get("activityReportAccessToken").getAsString(); + String learningDashboardAccessToken = activityJsonObject.get("learningDashboardAccessToken").getAsString(); Map logData = new HashMap(); logData.put("meetingId", activityJsonObject.get("intId").getAsString()); @@ -970,7 +970,7 @@ public class MeetingService implements MessageListener { log.info(" --analytics-- data={}", logStr); - activityService.writeActivityJsonFile(message.meetingId, activityReportAccessToken, message.activityJson); + learningDashboardService.writeActivityJsonFile(message.meetingId, learningDashboardAccessToken, message.activityJson); } @Override @@ -1129,8 +1129,8 @@ public class MeetingService implements MessageListener { processMakePresentationDownloadableMsg((MakePresentationDownloadableMsg) message); } else if (message instanceof UpdateRecordingStatus) { processUpdateRecordingStatus((UpdateRecordingStatus) message); - } else if (message instanceof ActivityReport) { - processActivityReport((ActivityReport) message); + } else if (message instanceof LearningDashboard) { + processLearningDashboard((LearningDashboard) message); } } }; @@ -1216,8 +1216,8 @@ public class MeetingService implements MessageListener { recordingService = s; } - public void setActivityService(ActivityService s) { - activityService = s; + public void setLearningDashboardService(LearningDashboardService s) { + learningDashboardService = s; } public void setRedisStorageService(RedisStorageService mess) { diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java index a5ee031bc6..18f15d79e9 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java @@ -82,7 +82,7 @@ public class ParamsProcessorUtil { private boolean disableRecordingDefault; private boolean autoStartRecording; private boolean allowStartStopRecording; - private boolean activityReportTracking; + private boolean learningDashboardEnabled; private boolean webcamsOnlyForModerator; private boolean defaultMuteOnStart = false; private boolean defaultAllowModsToUnmuteUsers = false; @@ -416,22 +416,22 @@ public class ParamsProcessorUtil { } } - boolean activityReportTrack = activityReportTracking; + boolean learningDashboardEnabled = learningDashboardEnabled; if (!StringUtils.isEmpty(params.get(ApiParams.ACTIVITY_REPORT_TRACKING))) { try { - activityReportTrack = Boolean.parseBoolean(params + learningDashboardEnabled = Boolean.parseBoolean(params .get(ApiParams.ACTIVITY_REPORT_TRACKING)); } catch (Exception ex) { log.warn( - "Invalid param [activityReportTracking] for meeting=[{}]", + "Invalid param [learningDashboardEnabled] for meeting=[{}]", internalMeetingId); } } //Generate token to access Activity Report - String activityReportAccessToken = ""; - if(activityReportTrack == true) { - activityReportAccessToken = RandomStringUtils.randomAlphanumeric(12).toLowerCase(); + String learningDashboardAccessToken = ""; + if(learningDashboardEnabled == true) { + learningDashboardAccessToken = RandomStringUtils.randomAlphanumeric(12).toLowerCase(); } boolean webcamsOnlyForMod = webcamsOnlyForModerator; @@ -531,8 +531,8 @@ public class ParamsProcessorUtil { .withLockSettingsParams(lockSettingsParams) .withAllowDuplicateExtUserid(defaultAllowDuplicateExtUserid) .withHTML5InstanceId(html5InstanceId) - .withActivityReportTracking(activityReportTrack) - .withActivityReportAccessToken(activityReportAccessToken) + .withlearningDashboardEnabled(learningDashboardEnabled) + .withLearningDashboardAccessToken(learningDashboardAccessToken) .build(); if (!StringUtils.isEmpty(params.get(ApiParams.MODERATOR_ONLY_MESSAGE))) { @@ -922,8 +922,8 @@ public class ParamsProcessorUtil { this.allowStartStopRecording = allowStartStopRecording; } - public void setActivityReportTracking(boolean activityReportTracking) { - this.activityReportTracking = activityReportTracking; + public void setlearningDashboardEnabled(boolean learningDashboardEnabled) { + this.learningDashboardEnabled = learningDashboardEnabled; } public void setWebcamsOnlyForModerator(boolean webcamsOnlyForModerator) { diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java index 97a4aeea67..8520aeb8f5 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java @@ -51,8 +51,8 @@ public class Meeting { private String webVoice; private String moderatorPass; private String viewerPass; - private Boolean activityReportTracking; - private String activityReportAccessToken; + private Boolean learningDashboardEnabled; + private String learningDashboardAccessToken; private String welcomeMsgTemplate; private String welcomeMsg; private String modOnlyMessage = ""; @@ -110,8 +110,8 @@ public class Meeting { intMeetingId = builder.internalId; viewerPass = builder.viewerPass; moderatorPass = builder.moderatorPass; - activityReportTracking = builder.activityReportTracking; - activityReportAccessToken = builder.activityReportAccessToken; + learningDashboardEnabled = builder.learningDashboardEnabled; + learningDashboardAccessToken = builder.learningDashboardAccessToken; maxUsers = builder.maxUsers; bannerColor = builder.bannerColor; bannerText = builder.bannerText; @@ -330,12 +330,12 @@ public class Meeting { return viewerPass; } - public Boolean getActivityReportTracking() { - return activityReportTracking; + public Boolean getlearningDashboardEnabled() { + return learningDashboardEnabled; } - public String getActivityReportAccessToken() { - return activityReportAccessToken; + public String getLearningDashboardAccessToken() { + return learningDashboardAccessToken; } public String getWelcomeMessageTemplate() { @@ -726,8 +726,8 @@ public class Meeting { private boolean webcamsOnlyForModerator; private String moderatorPass; private String viewerPass; - private Boolean activityReportTracking; - private String activityReportAccessToken; + private Boolean learningDashboardEnabled; + private String learningDashboardAccessToken; private int duration; private String webVoice; private String telVoice; @@ -818,13 +818,13 @@ public class Meeting { return this; } - public Builder withActivityReportTracking(Boolean e) { - this.activityReportTracking = e; + public Builder withlearningDashboardEnabled(Boolean e) { + this.learningDashboardEnabled = e; return this; } - public Builder withActivityReportAccessToken(String t) { - this.activityReportAccessToken = t; + public Builder withLearningDashboardAccessToken(String t) { + this.learningDashboardAccessToken = t; return this; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/converters/messages/CreateMeetingMessage.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/converters/messages/CreateMeetingMessage.java index 130aa3d8b0..2810d2ce96 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/converters/messages/CreateMeetingMessage.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/converters/messages/CreateMeetingMessage.java @@ -17,8 +17,8 @@ public class CreateMeetingMessage { public boolean webcamsOnlyForModerator; public final String moderatorPass; public final String viewerPass; - public final String activityReportAccessToken; - public final Boolean activityReportTracking; + public final String learningDashboardAccessToken; + public final Boolean learningDashboardEnabled; public final Long createTime; public final String createDate; public final Map metadata; @@ -27,7 +27,7 @@ public class CreateMeetingMessage { String voiceBridge, Long duration, Boolean autoStartRecording, Boolean allowStartStopRecording, Boolean webcamsOnlyForModerator, String moderatorPass, - String viewerPass, String activityReportAccessToken, Boolean activityReportTracking, + String viewerPass, String learningDashboardAccessToken, Boolean learningDashboardEnabled, Long createTime, String createDate, Map metadata) { this.id = id; this.externalId = externalId; @@ -40,8 +40,8 @@ public class CreateMeetingMessage { this.webcamsOnlyForModerator = webcamsOnlyForModerator; this.moderatorPass = moderatorPass; this.viewerPass = viewerPass; - this.activityReportAccessToken = activityReportAccessToken; - this.activityReportTracking = activityReportTracking; + this.learningDashboardAccessToken = learningDashboardAccessToken; + this.learningDashboardEnabled = learningDashboardEnabled; this.createTime = createTime; this.createDate = createDate; this.metadata = metadata; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/ActivityReport.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/LearningDashboard.java similarity index 61% rename from bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/ActivityReport.java rename to bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/LearningDashboard.java index b0223b3313..ec6fdfc2f8 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/ActivityReport.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/messages/LearningDashboard.java @@ -1,10 +1,10 @@ package org.bigbluebutton.api.messaging.messages; -public class ActivityReport implements IMessage { +public class LearningDashboard implements IMessage { public final String meetingId; public final String activityJson; - public ActivityReport(String meetingId, String activityJson) { + public LearningDashboard(String meetingId, String activityJson) { this.meetingId = meetingId; this.activityJson = activityJson; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java b/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java index 5ab5ff71be..fd32c7759a 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java @@ -17,7 +17,7 @@ public interface IBbbWebApiGWApp { String parentMeetingID, String meetingName, Boolean recorded, String voiceBridge, Integer duration, Boolean autoStartRecording, Boolean allowStartStopRecording, Boolean webcamsOnlyForModerator, - String moderatorPass, String viewerPass, Boolean activityReportTracking, String activityReportAccessToken, Long createTime, + String moderatorPass, String viewerPass, Boolean learningDashboardEnabled, String learningDashboardAccessToken, Long createTime, String createDate, Boolean isBreakout, Integer sequence, Boolean freejoin, Map metadata, String guestPolicy, Boolean authenticatedGuest, String meetingLayout, String welcomeMsgTemplate, String welcomeMsg, String modOnlyMessage, String dialNumber, Integer maxUsers, diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala index 5c27be7c63..fbd8b01fae 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala @@ -124,7 +124,7 @@ class BbbWebApiGWApp( recorded: java.lang.Boolean, voiceBridge: String, duration: java.lang.Integer, autoStartRecording: java.lang.Boolean, allowStartStopRecording: java.lang.Boolean, webcamsOnlyForModerator: java.lang.Boolean, - moderatorPass: String, viewerPass: String, activityReportTracking: java.lang.Boolean, activityReportAccessToken: String, + moderatorPass: String, viewerPass: String, learningDashboardEnabled: java.lang.Boolean, learningDashboardAccessToken: String, createTime: java.lang.Long, createDate: String, isBreakout: java.lang.Boolean, sequence: java.lang.Integer, freeJoin: java.lang.Boolean, @@ -146,7 +146,7 @@ class BbbWebApiGWApp( html5InstanceId: java.lang.Integer): Unit = { val meetingProp = MeetingProp(name = meetingName, extId = extMeetingId, intId = meetingId, - isBreakout = isBreakout.booleanValue(), activityReportTracking = activityReportTracking.booleanValue()) + isBreakout = isBreakout.booleanValue(), learningDashboardEnabled = learningDashboardEnabled.booleanValue()) val durationProps = DurationProps( duration = duration.intValue(), createdTime = createTime.longValue(), createDate, @@ -159,7 +159,7 @@ class BbbWebApiGWApp( endWhenNoModeratorDelayInMinutes.intValue() ) - val password = PasswordProp(moderatorPass = moderatorPass, viewerPass = viewerPass, activityReportAccessToken = activityReportAccessToken) + val password = PasswordProp(moderatorPass = moderatorPass, viewerPass = viewerPass, learningDashboardAccessToken = learningDashboardAccessToken) val recordProp = RecordProp(record = recorded.booleanValue(), autoStartRecording = autoStartRecording.booleanValue(), allowStartStopRecording = allowStartStopRecording.booleanValue(), keepEvents = keepEvents.booleanValue()) diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala index 9bc662e2f5..66ae0538ab 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/bus/ReceivedJsonMsgHdlrActor.scala @@ -106,8 +106,8 @@ class ReceivedJsonMsgHdlrActor(val msgFromAkkaAppsEventBus: MsgFromAkkaAppsEvent route[SetPresentationDownloadableEvtMsg](envelope, jsonNode) case RecordingStatusChangedEvtMsg.NAME => route[RecordingStatusChangedEvtMsg](envelope, jsonNode) - case ActivityReportEvtMsg.NAME => - route[ActivityReportEvtMsg](envelope, jsonNode) + case LearningDashboardEvtMsg.NAME => + route[LearningDashboardEvtMsg](envelope, jsonNode) case _ => //log.debug("************ Cannot route envelope name " + envelope.name) 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 f1c5c8e3cd..4e9c98fc27 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 @@ -45,7 +45,7 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW) case m: RecordingChapterBreakSysMsg => handleRecordingChapterBreakSysMsg(m) case m: SetPresentationDownloadableEvtMsg => handleSetPresentationDownloadableEvtMsg(m) case m: RecordingStatusChangedEvtMsg => handleRecordingStatusChangedEvtMsg(m) - case m: ActivityReportEvtMsg => handleActivityReportEvtMsg(m) + case m: LearningDashboardEvtMsg => handleLearningDashboardEvtMsg(m) case _ => log.error("***** Cannot handle " + msg.envelope.name) } } @@ -181,8 +181,8 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW) olgMsgGW.handle(m) } - def handleActivityReportEvtMsg(msg: ActivityReportEvtMsg): Unit = { - olgMsgGW.handle(new ActivityReport(msg.header.meetingId, msg.body.activityJson)) + def handleLearningDashboardEvtMsg(msg: LearningDashboardEvtMsg): Unit = { + olgMsgGW.handle(new LearningDashboard(msg.header.meetingId, msg.body.activityJson)) } } diff --git a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js index ad929fbb38..a7bf664b7a 100755 --- a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js +++ b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js @@ -52,7 +52,7 @@ export default function addMeeting(meeting) { intId: String, extId: String, isBreakout: Boolean, - activityReportTracking: Boolean, + learningDashboardEnabled: Boolean, name: String, }, usersProp: { @@ -89,7 +89,7 @@ export default function addMeeting(meeting) { password: { viewerPass: String, moderatorPass: String, - activityReportAccessToken: String, + learningDashboardAccessToken: String, }, voiceProp: { voiceConf: String, diff --git a/bigbluebutton-html5/imports/ui/components/activity-report/service.js b/bigbluebutton-html5/imports/ui/components/learning-dashboard/service.js similarity index 65% rename from bigbluebutton-html5/imports/ui/components/activity-report/service.js rename to bigbluebutton-html5/imports/ui/components/learning-dashboard/service.js index bd71311ddb..3cddbdb75c 100644 --- a/bigbluebutton-html5/imports/ui/components/activity-report/service.js +++ b/bigbluebutton-html5/imports/ui/components/learning-dashboard/service.js @@ -20,20 +20,20 @@ const isModerator = () => { return false; }; -const getActivityReportAccessToken = () => (( +const getLearningDashboardAccessToken = () => (( Meetings.findOne( { meetingId: Auth.meetingID }, { - fields: { 'password.activityReportAccessToken': 1 }, + fields: { 'password.learningDashboardAccessToken': 1 }, }, - ) || {}).password || {}).activityReportAccessToken || null; + ) || {}).password || {}).learningDashboardAccessToken || null; -const openActivityReportUrl = () => { - window.open(`/learning-dashboard/?meeting=${Auth.meetingID}&report=${getActivityReportAccessToken()}`, '_blank'); +const openLearningDashboardUrl = () => { + window.open(`/learning-dashboard/?meeting=${Auth.meetingID}&report=${getLearningDashboardAccessToken()}`, '_blank'); }; export default { isModerator, - getActivityReportAccessToken, - openActivityReportUrl, + getLearningDashboardAccessToken, + openLearningDashboardUrl, }; diff --git a/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx b/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx index 36511a765e..b21eaef02e 100755 --- a/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { defineMessages, injectIntl } from 'react-intl'; import { Meteor } from 'meteor/meteor'; import Auth from '/imports/ui/services/auth'; -import ActivityReportService from '../activity-report/service'; +import LearningDashboardService from '../learning-dashboard/service'; import Button from '/imports/ui/components/button/component'; import allowRedirectToLogoutURL from './service'; import getFromUserSettings from '/imports/ui/services/users-settings'; @@ -98,7 +98,7 @@ const intlMessage = defineMessages({ description: 'message for whom was kicked by inactivity', }, open_activity_report_btn: { - id: 'app.activity-report.clickHereToOpen', + id: 'app.learning-dashboard.clickHereToOpen', description: 'description of link to open activity report', }, }); @@ -263,14 +263,14 @@ class MeetingEnded extends PureComponent { {!allowRedirectToLogoutURL() ? null : (
{ - ActivityReportService.isModerator() - && ActivityReportService.getActivityReportAccessToken() != null + LearningDashboardService.isModerator() + && LearningDashboardService.getLearningDashboardAccessToken() != null ? (