From ad63114487e086c1941eab97064d7527ad690478 Mon Sep 17 00:00:00 2001 From: HassHz Date: Fri, 16 Dec 2016 15:00:57 +0000 Subject: [PATCH] Fix thumbnails and protect recordings issues --- bundle/src/resources/ToolMessages.properties | 4 ++ .../src/resources/ToolMessages_en.properties | 4 ++ .../resources/ToolMessages_en_US.properties | 4 ++ .../bbb/impl/bbbapi/BaseBBBAPI.java | 5 +-- .../tool/entity/BBBMeetingEntityProvider.java | 6 +-- tool/src/webapp/WEB-INF/bootstrap.vm | 37 ++++++------------- tool/src/webapp/js/bbb.js | 13 ++++++- tool/src/webapp/js/bbb_utils.js | 8 ++-- 8 files changed, 44 insertions(+), 37 deletions(-) diff --git a/bundle/src/resources/ToolMessages.properties b/bundle/src/resources/ToolMessages.properties index 37996986..b6ae7b2c 100644 --- a/bundle/src/resources/ToolMessages.properties +++ b/bundle/src/resources/ToolMessages.properties @@ -53,6 +53,10 @@ bbb_action_show_tooltip = Click to make this recording visible for Students bbb_action_delete_recording = Delete bbb_action_delete_recording_tooltip = Click to delete this recordings from the server bbb_action_delete_recording_question = Are you sure you want to delete permanently this recording {0}?\n\nClick OK to continue. +bbb_action_protect = Protect +bbb_action_unprotect = Unprotect +bbb_action_protect_tooltip = Click to make this recording protected +bbb_action_unprotect_tooltip = Click to unprotect this recording bbb_recording_status_hidden = Unpublished bbb_recording_status_shown = Published bbb_recording_thumbnails_hidden = Only for published recordings diff --git a/bundle/src/resources/ToolMessages_en.properties b/bundle/src/resources/ToolMessages_en.properties index 37744ff6..511846c5 100644 --- a/bundle/src/resources/ToolMessages_en.properties +++ b/bundle/src/resources/ToolMessages_en.properties @@ -53,6 +53,10 @@ bbb_action_show_tooltip = Click to make this recording visible for Students bbb_action_delete_recording = Delete bbb_action_delete_recording_tooltip = Click to delete this recordings from the server bbb_action_delete_recording_question = Are you sure you want to delete permanently this recording {0}?\n\nClick OK to continue. +bbb_action_protect = Protect +bbb_action_unprotect = Unprotect +bbb_action_protect_tooltip = Click to make this recording protected +bbb_action_unprotect_tooltip = Click to unprotect this recording bbb_recording_status_hidden = Unpublished bbb_recording_status_shown = Published bbb_recording_thumbnails_hidden = Only for published recordings diff --git a/bundle/src/resources/ToolMessages_en_US.properties b/bundle/src/resources/ToolMessages_en_US.properties index 5a7630ab..2eaa90a2 100644 --- a/bundle/src/resources/ToolMessages_en_US.properties +++ b/bundle/src/resources/ToolMessages_en_US.properties @@ -53,6 +53,10 @@ bbb_action_show_tooltip = Click to make this recording visible for Students bbb_action_delete_recording = Delete bbb_action_delete_recording_tooltip = Click to delete this recordings from the server bbb_action_delete_recording_question = Are you sure you want to delete permanently this recording {0}?\n\nClick OK to continue. +bbb_action_protect = Protect +bbb_action_unprotect = Unprotect +bbb_action_protect_tooltip = Click to make this recording protected +bbb_action_unprotect_tooltip = Click to unprotect this recording bbb_recording_status_hidden = Unpublished bbb_recording_status_shown = Published bbb_recording_thumbnails_hidden = Only for published recordings diff --git a/impl/src/java/org/sakaiproject/bbb/impl/bbbapi/BaseBBBAPI.java b/impl/src/java/org/sakaiproject/bbb/impl/bbbapi/BaseBBBAPI.java index f0f63b5e..5449f503 100644 --- a/impl/src/java/org/sakaiproject/bbb/impl/bbbapi/BaseBBBAPI.java +++ b/impl/src/java/org/sakaiproject/bbb/impl/bbbapi/BaseBBBAPI.java @@ -96,7 +96,7 @@ public class BaseBBBAPI implements BBBAPI { protected final static String APICALL_VERSION = ""; protected final static String APICALL_GETRECORDINGS = "getRecordings"; protected final static String APICALL_PUBLISHRECORDINGS = "publishRecordings"; - protected final static String APICALL_PROTECTRECORDINGS = "protectRecordings"; + protected final static String APICALL_PROTECTRECORDINGS = "updateRecordings"; protected final static String APICALL_DELETERECORDINGS = "deleteRecordings"; // API Response Codes @@ -237,7 +237,6 @@ public BBBMeeting createMeeting(final BBBMeeting meeting) StringBuilder presentationUrl = new StringBuilder(config.getServerUrl()); presentationUrl.append(meeting.getPresentation()); xml_presentation = " "; - logger.debug(xml_presentation); } } @@ -708,7 +707,7 @@ protected Map processNode(Node _node) { } if (nodeName == "preview"){ Node n = node.getChildNodes().item(0); - map.put(nodeName, processNode(n)); + map.put(nodeName, new ArrayList(processNode(n).values())); }else{ map.put(nodeName, list); } diff --git a/tool/src/java/org/sakaiproject/bbb/tool/entity/BBBMeetingEntityProvider.java b/tool/src/java/org/sakaiproject/bbb/tool/entity/BBBMeetingEntityProvider.java index e5d9a5b0..cfed4ef8 100644 --- a/tool/src/java/org/sakaiproject/bbb/tool/entity/BBBMeetingEntityProvider.java +++ b/tool/src/java/org/sakaiproject/bbb/tool/entity/BBBMeetingEntityProvider.java @@ -809,7 +809,7 @@ public String protectRecordings(Map params) { logger.debug("protectRecordings"); String meetingID = (String) params.get("meetingID"); String recordID = (String) params.get("recordID"); - String publish = (String) params.get("protect"); + String protect = (String) params.get("protect"); if (meetingID == null) { throw new IllegalArgumentException("Missing required parameter [meetingID]"); } @@ -817,7 +817,7 @@ public String protectRecordings(Map params) { throw new IllegalArgumentException("Missing required parameter [recordID]"); } if (protect == null) { - throw new IllegalArgumentException("Missing required parameter [publish]"); + throw new IllegalArgumentException("Missing required parameter [protect]"); } try { @@ -1066,7 +1066,7 @@ private String getHtmlForJoining(String joinUrl, String meetingId, boolean waitf @EntityCustomAction(viewKey = EntityView.VIEW_LIST) public ActionReturn getGroups(Map params) { if(logger.isDebugEnabled()) - logger.debug("Getting Groups"); + logger.debug("getGroups"); String meetingID = (String) params.get("meetingID"); if (meetingID == null) { diff --git a/tool/src/webapp/WEB-INF/bootstrap.vm b/tool/src/webapp/WEB-INF/bootstrap.vm index 77de30ce..dcd352c3 100644 --- a/tool/src/webapp/WEB-INF/bootstrap.vm +++ b/tool/src/webapp/WEB-INF/bootstrap.vm @@ -190,12 +190,11 @@ {/if} {if r.canDelete} {if r.protected} +  |  {if r.protected == 'true'} -  |  - ${D}{bbb_action_protect} - {else if r.protected == 'false'} -  |  ${D}{bbb_action_unprotect} + {else} + ${D}{bbb_action_protect} {/if} {/if} {/if} @@ -204,27 +203,15 @@
- {for p in r.playback} - {if p.preview && r.published == 'true'} - {if p.preview.image1} - - ${D}{p.preview.image1.title} - - {/if} - {if p.preview.image2} - - ${D}{p.preview.image2.title} - - {/if} - {if p.preview.image3} - - ${D}{p.preview.image3.title} - - {/if} - {else if p.preview} - ${D}{bbb_recording_thumbnails_hidden} - {/if} - {/for} + {if r.images && r.published == 'true'} + {for image in r.images} + + ${D}{image.title} + + {/for} + {elseif r.images} + ${D}{bbb_recording_thumbnails_hidden} + {/if}
diff --git a/tool/src/webapp/js/bbb.js b/tool/src/webapp/js/bbb.js index 84a6b3ca..a1fbfa26 100644 --- a/tool/src/webapp/js/bbb.js +++ b/tool/src/webapp/js/bbb.js @@ -492,10 +492,19 @@ meetings.switchState = function (state, arg) { meetings.refreshRecordingList(); // watch for permissions changes, check meeting dates - for(var i=0,j=meetings.currentRecordings.length;i images.length){ + images = meetings.currentRecordings[i].playback[j].preview; + } + } + if(images.length){ + meetings.currentRecordings[i].images = images; + } + } meetings.utils.render('bbb_recordings_template',{'recordings':meetings.currentRecordings,'stateFunction':'recordings'},'bbb_content'); var $rows = $('#bbb_recording_table tbody tr'); diff --git a/tool/src/webapp/js/bbb_utils.js b/tool/src/webapp/js/bbb_utils.js index 4960f2e1..711191bd 100644 --- a/tool/src/webapp/js/bbb_utils.js +++ b/tool/src/webapp/js/bbb_utils.js @@ -611,22 +611,22 @@ }; meetings.utils.protectRecordings = function (meetingID, recordID, stateFunction) { - meetings.utils.setProtectRecordings(meetingID, recordID, "true", stateFunction); + meetings.utils.updateRecordings(meetingID, recordID, "true", stateFunction); }; meetings.utils.unprotectRecordings = function (meetingID, recordID, stateFunction) { - meetings.utils.setProtectRecordings(meetingID, recordID, "false", stateFunction); + meetings.utils.updateRecordings(meetingID, recordID, "false", stateFunction); } // Protect the specified recording from the BigBlueButton server. - meetings.utils.setProtectRecordings = function (meetingID, recordID, action, stateFunction) { + meetings.utils.updateRecordings = function (meetingID, recordID, action, stateFunction) { jQuery.ajax({ url : "/direct/bbb-tool/protectRecordings?meetingID=" + meetingID + "&recordID=" + recordID + "&protect=" + action, dataType:'text', type: "GET", success : function (result) { - if(stateFunction == 'recordings'); + if(stateFunction == 'recordings') meetings.switchState('recordings'); else meetings.switchState('recordings_meeting',{'meetingID':meetingID});