Add support for deprecated API param learningDashboardEnabled

This commit is contained in:
Gustavo Trott 2022-03-09 18:04:34 -03:00
parent 506468e4b7
commit bedaf4de98
4 changed files with 32 additions and 2 deletions

View File

@ -57,6 +57,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 LEARNING_DASHBOARD_ENABLED = "learningDashboardEnabled";
public static final String LEARNING_DASHBOARD_CLEANUP_DELAY_IN_MINUTES = "learningDashboardCleanupDelayInMinutes";
public static final String VIRTUAL_BACKGROUNDS_DISABLED = "virtualBackgroundsDisabled";
public static final String WEBCAMS_ONLY_FOR_MODERATOR = "webcamsOnlyForModerator";

View File

@ -897,7 +897,7 @@ public class MeetingService implements MessageListener {
}
//Remove Learning Dashboard files
if(m.getLearningDashboardCleanupDelayInMinutes() > 0) {
if(!m.getDisabledFeatures().contains("learningDashboard") && m.getLearningDashboardCleanupDelayInMinutes() > 0) {
learningDashboardService.removeJsonDataFile(message.meetingId, m.getLearningDashboardCleanupDelayInMinutes());
}

View File

@ -87,6 +87,7 @@ public class ParamsProcessorUtil {
private boolean disableRecordingDefault;
private boolean autoStartRecording;
private boolean allowStartStopRecording;
private boolean learningDashboardEnabled = true;
private int learningDashboardCleanupDelayInMinutes;
private boolean webcamsOnlyForModerator;
private Integer defaultUserCameraCap = 0;
@ -487,6 +488,25 @@ public class ParamsProcessorUtil {
listOfDisabledFeatures.replaceAll(String::trim);
listOfDisabledFeatures = new ArrayList<>(new HashSet<>(listOfDisabledFeatures));
if(learningDashboardEnabled == false && !listOfDisabledFeatures.contains("learningDashboard")) {
listOfDisabledFeatures.add("learningDashboard");
}
if (!StringUtils.isEmpty(params.get(ApiParams.LEARNING_DASHBOARD_ENABLED))) {
try {
boolean learningDashboardEn = Boolean.parseBoolean(params.get(ApiParams.LEARNING_DASHBOARD_ENABLED));
if(learningDashboardEn == false) {
log.warn("[DEPRECATION] use disabledFeatures=learningDashboard instead of learningDashboardEnabled=false");
if(!listOfDisabledFeatures.contains("learningDashboard")) {
listOfDisabledFeatures.add("learningDashboard");
}
}
} catch (Exception ex) {
log.warn("Invalid param [learningDashboardEnabled] for meeting=[{}]",internalMeetingId);
}
}
int learningDashboardCleanupMins = 0;
// Learning Dashboard not allowed for Breakout Rooms
@ -1051,7 +1071,15 @@ public class ParamsProcessorUtil {
this.allowStartStopRecording = allowStartStopRecording;
}
public void setlearningDashboardCleanupDelayInMinutes(int learningDashboardCleanupDelayInMinutes) {
public void setLearningDashboardEnabled(boolean learningDashboardEnabled) {
if(learningDashboardEnabled == false) {
log.warn("[DEPRECATION] use disabledFeatures=learningDashboard instead of learningDashboardEnabled=false");
}
this.learningDashboardEnabled = learningDashboardEnabled;
}
public void setLearningDashboardCleanupDelayInMinutes(int learningDashboardCleanupDelayInMinutes) {
this.learningDashboardCleanupDelayInMinutes = learningDashboardCleanupDelayInMinutes;
}

View File

@ -151,6 +151,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="disableRecordingDefault" value="${disableRecordingDefault}"/>
<property name="autoStartRecording" value="${autoStartRecording}"/>
<property name="allowStartStopRecording" value="${allowStartStopRecording}"/>
<property name="learningDashboardEnabled" value="${learningDashboardEnabled:true}"/>
<property name="learningDashboardCleanupDelayInMinutes" value="${learningDashboardCleanupDelayInMinutes}"/>
<property name="webcamsOnlyForModerator" value="${webcamsOnlyForModerator}"/>
<property name="defaultUserCameraCap" value="${userCameraCap}"/>