From e96d6ae72647f5d8425fbc2a687a36926f855724 Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Tue, 3 Oct 2017 21:49:06 +0100 Subject: [PATCH] Add new API options to display a banner in the client. --- bbb-common-web/build.sbt | 2 +- .../api/ParamsProcessorUtil.java | 7 +++++- .../org/bigbluebutton/api/domain/Meeting.java | 25 +++++++++++++++++-- .../branding/default/style/css/V2Theme.css | 12 +++++++-- .../src/org/bigbluebutton/core/model/Me.as | 1 - .../org/bigbluebutton/core/model/Meeting.as | 4 ++- .../main/model/users/EnterApiResponse.as | 2 ++ .../main/model/users/JoinService.as | 4 ++- .../main/model/users/UserService.as | 7 ++++-- .../main/views/MainApplicationShell.mxml | 5 +++- .../bigbluebutton/main/views/MainToolbar.mxml | 22 +++++++++++++--- .../web/controllers/ApiController.groovy | 7 +++++- 12 files changed, 81 insertions(+), 17 deletions(-) diff --git a/bbb-common-web/build.sbt b/bbb-common-web/build.sbt index c15c183877..bef99a2e80 100755 --- a/bbb-common-web/build.sbt +++ b/bbb-common-web/build.sbt @@ -74,7 +74,7 @@ libraryDependencies += "org.libreoffice" % "juh" % "5.3.2" libraryDependencies += "org.libreoffice" % "jurt" % "5.3.2" -libraryDependencies += "org.apache.poi" % "poi-ooxml" % "3.15" +libraryDependencies += "org.apache.poi" % "poi-ooxml" % "3.17" libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.5" 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 7f6ae4a21f..f88461db1c 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 @@ -348,7 +348,11 @@ public class ParamsProcessorUtil { int maxUsers = processMaxUser(params.get("maxParticipants")); int meetingDuration = processMeetingDuration(params.get("duration")); int logoutTimer = processMeetingDuration(params.get("logoutTimer")); - + + // Banner parameters + String bannerText = params.get("bannerText"); + String bannerColor = params.get("bannerColor"); + // set is breakout room property boolean isBreakout = false; if (!StringUtils.isEmpty(params.get("isBreakout"))) { @@ -444,6 +448,7 @@ public class ParamsProcessorUtil { .withViewerPass(viewerPass).withRecording(record) .withDuration(meetingDuration).withLogoutUrl(logoutUrl) .withLogoutTimer(logoutTimer) + .withBannerText(bannerText).withBannerColor(bannerColor) .withTelVoice(telVoice).withWebVoice(webVoice) .withDialNumber(dialNumber) .withDefaultAvatarURL(defaultAvatarURL) 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 cd0fd6c939..1b70d7a460 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 @@ -47,6 +47,8 @@ public class Meeting { private String logoutUrl; private int logoutTimer = 0; private int maxUsers; + private String bannerColor = "#FFFFFF"; + private String bannerText = ""; private boolean record; private boolean autoStartRecording = false; private boolean allowStartStopRecording = false; @@ -76,6 +78,8 @@ public class Meeting { viewerPass = builder.viewerPass; moderatorPass = builder.moderatorPass; maxUsers = builder.maxUsers; + bannerColor = builder.bannerColor; + bannerText = builder.bannerText; logoutUrl = builder.logoutUrl; logoutTimer = builder.logoutTimer; defaultAvatarURL = builder.defaultAvatarURL; @@ -272,6 +276,14 @@ public class Meeting { public int getLogoutTimer() { return logoutTimer; } + + public String getBannerColor() { + return bannerColor; + } + + public String getBannerText() { + return bannerText; + } public boolean isRecord() { return record; @@ -393,8 +405,6 @@ public class Meeting { return (Map) userCustomData.get(userID); } - - /*** * Meeting Builder * @@ -416,6 +426,8 @@ public class Meeting { private String welcomeMsgTemplate; private String welcomeMsg; private String logoutUrl; + private String bannerColor; + private String bannerText; private int logoutTimer; private Map metadata; private String dialNumber; @@ -520,6 +532,15 @@ public class Meeting { return this; } + public Builder withBannerColor(String c) { + bannerColor = c; + return this; + } + + public Builder withBannerText(String t) { + bannerText = t; + return this; + } public Builder withMetadata(Map m) { metadata = m; diff --git a/bigbluebutton-client/branding/default/style/css/V2Theme.css b/bigbluebutton-client/branding/default/style/css/V2Theme.css index 72420e9da8..a06151dbe8 100755 --- a/bigbluebutton-client/branding/default/style/css/V2Theme.css +++ b/bigbluebutton-client/branding/default/style/css/V2Theme.css @@ -143,8 +143,9 @@ phonecomponents|MuteMeButton { .toolbarMainBox { backgroundColor : #FFFFFF; - paddingTop : 6; - paddingBottom : 6; + paddingTop : 0; + paddingBottom : 0; + verticalGap : 0; } .breakoutRoomRibbon { @@ -155,6 +156,13 @@ phonecomponents|MuteMeButton { horizontalAlign : center; } +.bannerStyle { + color : #FFFFFF; + fontSize : 16; + verticalAlign : middle; + horizontalAlign : center; +} + .topBoxStyle { paddingTop : 0; paddingBottom : 0; diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as b/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as index 9324ab8d6c..6d51044bf5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as @@ -20,7 +20,6 @@ package org.bigbluebutton.core.model public var authToken:String = ""; public var layout:String = ""; public var logoutURL:String = ""; - public var logoutTimer:int=0; public var welcome:String = ""; public var avatarURL:String = ""; diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/model/Meeting.as b/bigbluebutton-client/src/org/bigbluebutton/core/model/Meeting.as index bcb722efa2..95fde061de 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/model/Meeting.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/model/Meeting.as @@ -17,6 +17,8 @@ package org.bigbluebutton.core.model public var webcamsOnlyForModerator:Boolean = false; public var metadata:Object = null; public var muteOnStart:Boolean = false; - + public var logoutTimer:int=0; + public var bannerColor:String = ""; + public var bannerText:String = ""; } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/EnterApiResponse.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/EnterApiResponse.as index 75e82373b0..2fb156e409 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/EnterApiResponse.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/EnterApiResponse.as @@ -14,6 +14,8 @@ package org.bigbluebutton.main.model.users public var logoutTimer : int; public var defaultLayout: String; public var avatarURL: String; + public var bannerText: String; + public var bannerColor: String; public var dialnumber: String; public var voiceConf: String; public var welcome: String; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/JoinService.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/JoinService.as index 4123ea0506..442b0e10fc 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/JoinService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/JoinService.as @@ -151,8 +151,10 @@ package org.bigbluebutton.main.model.users apiResponse.record = (result.response.record.toUpperCase() == "TRUE"); apiResponse.allowStartStopRecording = result.response.allowStartStopRecording; apiResponse.webcamsOnlyForModerator = result.response.webcamsOnlyForModerator; - + apiResponse.bannerColor = result.response.bannerColor; + apiResponse.bannerText = result.response.bannerText; + apiResponse.dialnumber = result.response.dialnumber; apiResponse.voiceConf = result.response.voicebridge; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as index 65d1389400..b4905227c0 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as @@ -104,7 +104,6 @@ package org.bigbluebutton.main.model.users LiveMeeting.inst().me.authToken = result.authToken; LiveMeeting.inst().me.layout = result.defaultLayout; LiveMeeting.inst().me.logoutURL = result.logoutUrl; - LiveMeeting.inst().me.logoutTimer = result.logoutTimer; LiveMeeting.inst().me.role = result.role; LiveMeeting.inst().me.welcome = result.welcome; LiveMeeting.inst().me.avatarURL = result.avatarURL; @@ -130,7 +129,11 @@ package org.bigbluebutton.main.model.users LiveMeeting.inst().meeting.metadata = result.metadata; LiveMeeting.inst().meeting.muteOnStart = meetingOptions.muteOnStart; - + LiveMeeting.inst().meeting.logoutTimer = result.logoutTimer; + + LiveMeeting.inst().meeting.bannerColor = result.bannerColor; + LiveMeeting.inst().meeting.bannerText = result.bannerText; + // assign the meeting name to the document title ExternalInterface.call("setTitle", result.meetingName); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index 2383fdee80..30f265993c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -808,10 +808,13 @@ with BigBlueButton; if not, see . private function updateToolbarHeight():void { if (toolbarHeight != 0) { - toolbarHeight = Math.max(DEFAULT_TOOLBAR_HEIGHT, toolbar.logo.height + toolbar.quickLinks.includeInLayout ? toolbar.quickLinks.height : 0 + 10); + toolbarHeight = Math.max(DEFAULT_TOOLBAR_HEIGHT, toolbar.logo.height + toolbar.quickLinks.includeInLayout ? toolbar.quickLinks.height : 0); if (UsersUtil.isBreakout()) { toolbarHeight += toolbar.breakoutRibbon.height; } + if (toolbar.banner.includeInLayout) { + toolbarHeight += toolbar.banner.height; + } } calculateCanvasHeight(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml index eae83d1a72..fe4ddfea8b 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml @@ -195,6 +195,7 @@ with BigBlueButton; if not, see . initBandwidthToolTip(); } } + private function handleRemainingTimeUpdate(e:MeetingTimeRemainingEvent):void { // Display timer only if there is less than 30 minutes remaining if (!timeRemaining.visible && e.timeLeftInSec <= 1800) { @@ -218,14 +219,24 @@ with BigBlueButton; if not, see . breakoutLabel.text = ResourceUtil.getInstance().getString("bbb.users.breakout.youareinroom", [sequence]); } - if (LiveMeeting.inst().me.logoutTimer > 0 ) { - idleLogoutButton.startTimer(LiveMeeting.inst().me.logoutTimer); + if (LiveMeeting.inst().meeting.logoutTimer > 0 ) { + idleLogoutButton.startTimer(LiveMeeting.inst().meeting.logoutTimer); } else { rightBox.removeChild(idleLogoutButton); } + + initBanner(); logFlashPlayerCapabilities(); } + + private function initBanner() : void { + if (!StringUtils.isEmpty(LiveMeeting.inst().meeting.bannerText)) { + banner.visible = banner.includeInLayout = true; + banner.setStyle("backgroundColor", uint("0x" + LiveMeeting.inst().meeting.bannerColor.substr(1))); + bannerLabel.text = LiveMeeting.inst().meeting.bannerText; + } + } private function refreshModeratorButtonsVisibility(e:*):void { showGuestSettingsButton = UsersUtil.amIModerator() && usersOptions.enableGuestUI; @@ -400,7 +411,7 @@ with BigBlueButton; if not, see . } if (!StringUtils.isEmpty(brandingOptions.toolbarColor)) { - mainBox.setStyle("backgroundColor", uint("0x" + brandingOptions.toolbarColor.substr(1))); + topBox.setStyle("backgroundColor", uint("0x" + brandingOptions.toolbarColor.substr(1))); } } @@ -535,6 +546,9 @@ with BigBlueButton; if not, see . + @@ -545,7 +559,7 @@ with BigBlueButton; if not, see . toolTip="{ResourceUtil.getInstance().getString('bbb.users.breakout.timer.toolTip')}"/> - +