Skip to content

Commit

Permalink
Fix thumbnails and protect recordings issues
Browse files Browse the repository at this point in the history
  • Loading branch information
HassHz committed Dec 16, 2016
1 parent 07e149e commit ad63114
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 37 deletions.
4 changes: 4 additions & 0 deletions bundle/src/resources/ToolMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions bundle/src/resources/ToolMessages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions bundle/src/resources/ToolMessages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -237,7 +237,6 @@ public BBBMeeting createMeeting(final BBBMeeting meeting)
StringBuilder presentationUrl = new StringBuilder(config.getServerUrl());
presentationUrl.append(meeting.getPresentation());
xml_presentation = "<modules> <module name=\"presentation\"> <document url=\""+presentationUrl+"\" /> </module> </modules>";
logger.debug(xml_presentation);
}
}

Expand Down Expand Up @@ -708,7 +707,7 @@ protected Map<String, Object> processNode(Node _node) {
}
if (nodeName == "preview"){
Node n = node.getChildNodes().item(0);
map.put(nodeName, processNode(n));
map.put(nodeName, new ArrayList<Object>(processNode(n).values()));
}else{
map.put(nodeName, list);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,15 +809,15 @@ public String protectRecordings(Map<String, Object> 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]");
}
if (recordID == null) {
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 {
Expand Down Expand Up @@ -1066,7 +1066,7 @@ private String getHtmlForJoining(String joinUrl, String meetingId, boolean waitf
@EntityCustomAction(viewKey = EntityView.VIEW_LIST)
public ActionReturn getGroups(Map<String, Object> params) {
if(logger.isDebugEnabled())
logger.debug("Getting Groups");
logger.debug("getGroups");

String meetingID = (String) params.get("meetingID");
if (meetingID == null) {
Expand Down
37 changes: 12 additions & 25 deletions tool/src/webapp/WEB-INF/bootstrap.vm
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,11 @@
{/if}
{if r.canDelete}
{if r.protected}
&nbsp;|&nbsp;
{if r.protected == 'true'}
&nbsp;|&nbsp;
<a href="javascript:;" onclick="return meetings.utils.protectRecordings('${D}{r.meetingID}','${D}{r.recordID}','${D}{stateFunction}');" title="${D}{bbb_action_protect_tooltip}">${D}{bbb_action_protect}</a>
{else if r.protected == 'false'}
&nbsp;|&nbsp;
<a href="javascript:;" onclick="return meetings.utils.unprotectRecordings('${D}{r.meetingID}','${D}{r.recordID}','${D}{stateFunction}');" title="${D}{bbb_action_unprotect_tooltip}">${D}{bbb_action_unprotect}</a>
{else}
<a href="javascript:;" onclick="return meetings.utils.protectRecordings('${D}{r.meetingID}','${D}{r.recordID}','${D}{stateFunction}');" title="${D}{bbb_action_protect_tooltip}">${D}{bbb_action_protect}</a>
{/if}
{/if}
{/if}
Expand All @@ -204,27 +203,15 @@
</td>
<td class="bbb_thumbnails">
<div class="bbb_preview_images">
{for p in r.playback}
{if p.preview && r.published == 'true'}
{if p.preview.image1}
<a href="${D}{p.preview.image1.url}" class="preview" target="_blank">
<img src="${D}{p.preview.image1.url}" class="thumbnails" width="44px" height="34px" alt="${D}{p.preview.image1.title}">
</a>
{/if}
{if p.preview.image2}
<a href="${D}{p.preview.image2.url}" class="preview" target="_blank">
<img src="${D}{p.preview.image2.url}" class="thumbnails" width="44px" height="34px" alt="${D}{p.preview.image2.title}">
</a>
{/if}
{if p.preview.image3}
<a href="${D}{p.preview.image3.url}" class="preview" target="_blank">
<img src="${D}{p.preview.image3.url}" class="thumbnails" width="44px" height="34px" alt="${D}{p.preview.image3.title}">
</a>
{/if}
{else if p.preview}
${D}{bbb_recording_thumbnails_hidden}
{/if}
{/for}
{if r.images && r.published == 'true'}
{for image in r.images}
<a href="${D}{image.url}" class="preview" target="_blank">
<img src="${D}{image.url}" class="thumbnails" width="44px" height="34px" alt="${D}{image.title}">
</a>
{/for}
{elseif r.images}
${D}{bbb_recording_thumbnails_hidden}
{/if}
</div>
</td>
<td>
Expand Down
13 changes: 11 additions & 2 deletions tool/src/webapp/js/bbb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<j;i++) {
for(var i=0;i<meetings.currentRecordings.length;i++) {
meetings.utils.setRecordingPermissionParams(meetings.currentRecordings[i]);
}

var images = [];
for(var j=0;j<meetings.currentRecordings[i].playback.length; j++){
if (meetings.currentRecordings[i].playback[j].preview && meetings.currentRecordings[i].playback[j].preview.length > 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');
Expand Down
8 changes: 4 additions & 4 deletions tool/src/webapp/js/bbb_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down

0 comments on commit ad63114

Please sign in to comment.