bbb-lti updated in preparation for the 0.81-beta1 release

[x]Views now are localized
[x]Added sp and fr translations
[x]Updated icons. icon.ico(16x16) icon.gif(24x24)
[x]Parameter custom_bbb_record is now custom_bbb_recording
[x]Removed not required files
[x]Changed behavior of extended mode. Users join directly if the recording is mot enabled for the launch.
This commit is contained in:
Jesus Federico 2013-04-19 17:52:46 -04:00
parent 4b9bf799cd
commit db46fbdf0c
15 changed files with 88 additions and 185 deletions

View File

@ -44,6 +44,8 @@ class ToolController {
def index = {
if( ltiService.consumerMap == null) ltiService.initConsumerMap()
log.debug CONTROLLER_NAME + "#index"
setLocalization(params)
params.put(REQUEST_METHOD, request.getMethod().toUpperCase())
log.debug "params: " + params
@ -64,6 +66,10 @@ class ToolController {
result = doJoinMeeting(params)
} else {
log.debug "LTI service running in extended mode."
if ( !Boolean.parseBoolean(params.get(Parameter.CUSTOM_BBB_RECORD)) ) {
log.debug "No bbb_record parameter was sent; immediately redirecting to BBB session!"
result = doJoinMeeting(params)
}
}
} else {
@ -93,40 +99,21 @@ class ToolController {
} else {
session["params"] = params
List<Object> recordings = bigbluebuttonService.getRecordings(params)
for(Map<String, Object> recording: recordings){
/// Calculate duration
long endTime = Long.parseLong((String)recording.get("endTime"))
endTime -= (endTime % 1000)
long startTime = Long.parseLong((String)recording.get("startTime"))
startTime -= (startTime % 1000)
int duration = (endTime - startTime) / 60000
/// Add duration
recording.put("duration", duration )
}
render(view: "index", model: ['params': params, 'recordingList': recordings, 'ismoderator': bigbluebuttonService.isModerator(params)])
}
}
def view = {
if( ltiService.consumerMap == null) ltiService.initConsumerMap()
log.debug CONTROLLER_NAME + "#view" + ltiService.consumerMap
Map<String, String> result
def sessionParams = session["params"]
log.debug "params: " + params
log.debug "sessionParams: " + sessionParams
if( sessionParams == null ) {
result = new HashMap<String, String>()
result.put("resultMessageKey", "InvalidSession")
result.put("resultMessage", "Session is invalid user cannot execute this action.")
} else if( !"extended".equals(ltiService.mode) ){
result = new HashMap<String, String>()
result.put("resultMessageKey", "SimpleMode")
result.put("resultMessage", "LTI service running in simple mode.")
}
if( result != null ) {
log.debug "Error [resultMessageKey:'" + result.get("resultMessageKey") + "', resultMessage:'" + result.get("resultMessage") + "']"
render(view: "error", model: ['resultMessageKey': result.get("resultMessageKey"), 'resultMessage': result.get("resultMessage")])
} else {
List<Object> recordings = bigbluebuttonService.getRecordings(sessionParams)
render(view: "index", model: ['params': params, 'recordingList': recordings, 'ismoderator':bigbluebuttonService.isModerator(sessionParams)])
}
}
def join = {
if( ltiService.consumerMap == null) ltiService.initConsumerMap()
log.debug CONTROLLER_NAME + "#join"
@ -218,10 +205,9 @@ class ToolController {
}
}
private Object doJoinMeeting(params) {
Map<String, String> result = new HashMap<String, String>()
private void setLocalization(params){
String locale = params.get(Parameter.LAUNCH_LOCALE)
locale = (locale == null || locale.equals("")?"en":locale)
log.debug "Locale code =" + locale
@ -233,6 +219,13 @@ class ToolController {
session['org.springframework.web.servlet.i18n.SessionLocaleResolver.LOCALE'] = new Locale(localeCodes[0])
log.debug "Locale has been set to " + locale
}
private Object doJoinMeeting(params) {
Map<String, String> result = new HashMap<String, String>()
setLocalization(params)
String welcome = message(code: "bigbluebutton.welcome", args: ["\"{0}\"", "\"{1}\""])
log.debug "Localized default welcome message: [" + welcome + "]"

View File

@ -17,4 +17,16 @@
#
bigbluebutton.welcome=<br>Welcome to <b>{0}</b>!<br><br>To understand how BigBlueButton works see our <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>tutorial videos</u></a>.<br><br>To join the audio bridge click the headset icon (upper-left hand corner). <b>Please use a headset to avoid causing noise for others.</b>
bigbluebutton.join=Join Meeting
tool.view.title=BigBlueButton LTI Interface
tool.view.join=Join Meeting
tool.view.recording=Recording
tool.view.activity=Activity
tool.view.description=Description
tool.view.date=Date
tool.view.duration=Duration
tool.view.actions=Actions
tool.view.publishRecording=Publish
tool.view.unpublishRecording=Unpublish
tool.view.deleteRecording=Delete
tool.view.deleteRecordingConfirmation=Are you sure to permanently delete this recording?

View File

@ -17,4 +17,16 @@
#
bigbluebutton.welcome=<br>Bienvenido a <b>{0}</b>!<br><br>Para entender como funciona BigBlueButton consulte estos <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>videos tutoriales</u></a>.<br><br>Para activar el audio haga click en el icono de auricular (equina superior izquierda). <b>Por favor utilice auricular para evitar causar ruido.</b>
bigbluebutton.join=Ingresar a la sesión
tool.view.title=Interface LTI para BigBlueButton
tool.view.join=Ingresar a la sesi&#243;n
tool.view.recording=Grabaci&#243;n
tool.view.activity=Actividad
tool.view.description=Descripci&#243;n
tool.view.date=Fecha
tool.view.duration=Duraci&#243;n
tool.view.actions=Acciones
tool.view.publishRecording=Mostrar
tool.view.unpublishRecording=Esconder
tool.view.deleteRecording=Borrar
tool.view.deleteRecordingConfirmation=Esta seguro de borrar permanentemente esta grabaci&#243;n?

View File

@ -16,5 +16,17 @@
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
#
bigbluebutton.welcome=<br>Bienvenue au <b>{0}</b>!<br><br>Pour comprendre comment fonctionne BigBlueButton, consultez les <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>didacticiels vidéo</u></a>.<br><br>Pour activer l'audio cliquez sur l'icône du casque à écouteurs (coin supérieur gauche). <b>S'il vous plaît utiliser le casque pour éviter de causer du bruit.</b>
bigbluebutton.join=Saisie de la réunion
bigbluebutton.welcome=<br>Bienvenue au <b>{0}</b>!<br><br>Pour comprendre comment fonctionne BigBlueButton, consultez les <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>didacticiels vid&#233;o</u></a>.<br><br>Pour activer l'audio cliquez sur l'ic&#244;ne du casque &#224; &#233;couteurs (coin sup&#233;rieur gauche). <b>S'il vous plaît utiliser le casque pour &#233;viter de causer du bruit.</b>
tool.view.title=LTI Interface pour BigBlueButton
tool.view.join=Saisie de la r&#233;union
tool.view.recording=Enregistrement
tool.view.activity=Activit&#233;
tool.view.description=Description
tool.view.date=Date
tool.view.duration=Dur&#233;e
tool.view.actions=Actions
tool.view.publishRecording=Publier
tool.view.unpublishRecording=D&#233;publier
tool.view.deleteRecording=Supprimer
tool.view.deleteRecordingConfirmation=Veillez &#224; supprimer d&#233;finitivement cet enregistrement?

View File

@ -88,7 +88,7 @@ class BigbluebuttonService {
String userID = getValidatedUserId(params.get(Parameter.USER_ID))
Integer voiceBridge = 0
Boolean record = false
String record = false
Integer duration = 0
if( "extended".equals(mode) ){
voiceBridge = getValidatedBBBVoiceBridge(params.get(Parameter.CUSTOM_BBB_VOICEBRIDGE))
@ -191,10 +191,10 @@ class BigbluebuttonService {
return isModerator
}
private String getCreateURL(String name, String meetingID, String attendeePW, String moderatorPW, String welcome, Integer voiceBridge, String logoutURL, Boolean record, Integer duration, String meta ) {
private String getCreateURL(String name, String meetingID, String attendeePW, String moderatorPW, String welcome, Integer voiceBridge, String logoutURL, String record, Integer duration, String meta ) {
voiceBridge = ( voiceBridge == null || voiceBridge == 0 )? 70000 + new Random(System.currentTimeMillis()).nextInt(10000): voiceBridge;
String url = bbbProxy.getCreateURL(name, meetingID, attendeePW, moderatorPW, welcome, "", voiceBridge.toString(), "", logoutURL, "", record.toString(), duration.toString(), meta );
String url = bbbProxy.getCreateURL(name, meetingID, attendeePW, moderatorPW, welcome, "", voiceBridge.toString(), "", logoutURL, "", record, duration.toString(), meta );
return url;
}
@ -242,8 +242,8 @@ class BigbluebuttonService {
return (voiceBridge != null )? voiceBridge.toInteger(): 0
}
private Boolean getValidatedBBBRecord(String record){
return (record != null && record == "true")? true: false
private String getValidatedBBBRecord(String record){
return Boolean.valueOf(record).toString();
}
private Integer getValidatedBBBDuration(String duration){

View File

@ -26,7 +26,7 @@ class LtiService {
boolean transactional = false
def endPoint = "http://192.168.0.153/lti/tool.xml"
def endPoint = "http://localhost/lti/tool.xml"
def consumers = "demo:welcome"
def mode = "simple"
Map<String, String> consumerMap

View File

@ -1,6 +1,6 @@
<html>
<head>
<title><g:layoutTitle default="BigBlueButton LTI Interface" /></title>
<title><g:layoutTitle default="<g:message code="tool.view.title" />" /></title>
<link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" />
<link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
<g:layoutHead />

View File

@ -1,6 +1,6 @@
<html>
<head>
<title><g:layoutTitle default="BigBlueButton LTI Interface" /></title>
<title><g:layoutTitle default="<g:message code="tool.view.title" />" /></title>
<link rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" />
<link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
<g:layoutHead />

View File

@ -1,22 +1,22 @@
<html>
<head>
<title>BigBlueButton LTI Interface</title>
<title><g:message code="tool.view.title" /></title>
<link rel="stylesheet" href="${resource(dir:'css',file:'bootstrap.css')}" />
<link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
</head>
<body>
<h1 style="margin-left:20px; text-align: center;"><a title="Join" class="btn btn-primary btn-large" href="${createLink(controller:'tool',action:'join')}">Join Meeting</a></h1>
<h1 style="margin-left:20px; text-align: center;"><a title="<g:message code="tool.view.join" />" class="btn btn-primary btn-large" href="${createLink(controller:'tool',action:'join')}"><g:message code="tool.view.join" /></a></h1>
<br><br>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th class="header c0" style="text-align:center;" scope="col">Recording</th>
<th class="header c1" style="text-align:center;" scope="col">Activity</th>
<th class="header c2" style="text-align:center;" scope="col">Description</th>
<th class="header c3" style="text-align:center;" scope="col">Date</th>
<th class="header c4" style="text-align:center;" scope="col">Duration</th>
<th class="header c0" style="text-align:center;" scope="col"><g:message code="tool.view.recording" /></th>
<th class="header c1" style="text-align:center;" scope="col"><g:message code="tool.view.activity" /></th>
<th class="header c2" style="text-align:center;" scope="col"><g:message code="tool.view.description" /></th>
<th class="header c3" style="text-align:center;" scope="col"><g:message code="tool.view.date" /></th>
<th class="header c4" style="text-align:center;" scope="col"><g:message code="tool.view.duration" /></th>
<g:if test="${ismoderator}">
<th class="header c5 lastcol" style="text-align:left;" scope="col">Toolbar</th>
<th class="header c5 lastcol" style="text-align:left;" scope="col"><g:message code="tool.view.actions" /></th>
</g:if>
</tr>
</thead>
@ -32,22 +32,16 @@
<td class="cell c1" style="text-align:center;">${r.name}</td>
<td class="cell c2" style="text-align:center;">${r.metadata.contextactivitydescription}</td>
<td class="cell c3" style="text-align:center;">${new Date( Long.valueOf(r.startTime).longValue() )}</td>
<td class="cell c4" style="text-align:center;">
<g:each in="${r.playback}" var="p">
<g:if test="${p.type == 'slides'}">
${p.length}
</g:if>
</g:each>
</td>
<td class="cell c4" style="text-align:center;">${r.duration}</td>
<g:if test="${ismoderator}">
<td class="cell c5 lastcol" style="text-align:left;">
<g:if test="${r.published == 'true'}">
<a title="Hide" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="Hide" alt="Hide" class="smallicon" src="${resource(dir:'images',file:'hide.gif')}" /></a>
<a title="<g:message code="tool.view.unPublishRecording" />" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="<g:message code="tool.view.unpublishRecording" />" alt="<g:message code="tool.view.unpublishRecording" />" class="smallicon" src="${resource(dir:'images',file:'hide.gif')}" /></a>
</g:if>
<g:else>
<a title="Show" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="Show" alt="Show" class="smallicon" src="${resource(dir:'images',file:'show.gif')}" /></a>
<a title="<g:message code="tool.view.publishRecording" />" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="<g:message code="tool.view.publishRecording" />" alt="<g:message code="tool.view.publishRecording" />" class="smallicon" src="${resource(dir:'images',file:'show.gif')}" /></a>
</g:else>
<a title="Delete" class="action-icon" onClick="if(confirm('Are you sure to delete this recording?')) window.location='${createLink(controller:'tool',action:'delete')}?bbb_recording_id=${r.recordID}'; return false;" href="#"><img title="Delete" alt="Delete" class="smallicon" src="${resource(dir:'images',file:'delete.gif')}" /></a>
<a title="<g:message code="tool.view.deleteRecording" />" class="action-icon" onClick="if(confirm('<g:message code="tool.view.deleteRecordingConfirmation" />')) window.location='${createLink(controller:'tool',action:'delete')}?bbb_recording_id=${r.recordID}'; return false;" href="#"><img title="<g:message code="tool.view.deleteRecording" />" alt="<g:message code="tool.view.deleteRecording" />" class="smallicon" src="${resource(dir:'images',file:'delete.gif')}" /></a>
</td>
</g:if>
</tr>

View File

@ -1,60 +0,0 @@
<html>
<head>
<title>BigBlueButton LTI Interface</title>
<meta name="layout" content="internal" />
</head>
<body>
<h1 style="margin-left:20px; text-align: center;"><a title="Join" class="action-icon" href="${createLink(controller:'tool',action:'join')}"><img title="Join" alt="Join the meeting" src="${resource(dir:'images',file:'bbb.jpg')}" /></a></h1>
<p style="margin-left:20px;width:80%"></p>
<br>
<table class="generaltable">
<thead>
<tr>
<th class="header c0" style="text-align:center;" scope="col">Recording</th>
<th class="header c1" style="text-align:center;" scope="col">Activity</th>
<th class="header c2" style="text-align:center;" scope="col">Description</th>
<th class="header c3" style="text-align:center;" scope="col">Date</th>
<th class="header c4" style="text-align:center;" scope="col">Duration</th>
<g:if test="${ismoderator}">
<th class="header c5 lastcol" style="text-align:left;" scope="col">Toolbar</th>
</g:if>
</tr>
</thead>
<tbody>
<g:each in="${recordingList}" var="r">
<g:if test="${ismoderator || r.published == 'true'}">
<tr class="r0 lastrow">
<td class="cell c0" style="text-align:center;">
<g:each in="${r.playback}" var="p">
<a title="${p.type}" target="_new" href="${p.url}">${p.type}</a>&#32;
</g:each>
</td>
<td class="cell c1" style="text-align:center;">${r.name}</td>
<td class="cell c2" style="text-align:center;">${r.metadata.contextactivitydescription}</td>
<td class="cell c3" style="text-align:center;">${new Date( Long.valueOf(r.startTime).longValue() )}</td>
<td class="cell c4" style="text-align:center;">
<g:each in="${r.playback}" var="p">
<g:if test="${p.type == 'slides'}">
${p.length}
</g:if>
</g:each>
</td>
<g:if test="${ismoderator}">
<td class="cell c5 lastcol" style="text-align:left;">
<g:if test="${r.published == 'true'}">
<a title="Hide" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="Hide" alt="Hide" class="smallicon" src="${resource(dir:'images',file:'hide.gif')}" /></a>
</g:if>
<g:else>
<a title="Show" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="Show" alt="Show" class="smallicon" src="${resource(dir:'images',file:'show.gif')}" /></a>
</g:else>
<a title="Delete" class="action-icon" onClick="if(confirm('Are you sure to delete this recording?')) window.location='${createLink(controller:'tool',action:'delete')}?bbb_recording_id=${r.recordID}'; return false;" href="#"><img title="Delete" alt="Delete" class="smallicon" src="${resource(dir:'images',file:'delete.gif')}" /></a>
</td>
</g:if>
</tr>
</g:if>
</g:each>
</tbody>
</table>
</body>
</html>

View File

@ -1,60 +0,0 @@
<html>
<head>
<title>BigBlueButton LTI Interface</title>
<link rel="stylesheet" href="${resource(dir:'css',file:'bootstrap.css')}" />
<link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
</head>
<body>
<h1 style="margin-left:20px; text-align: center;"><a title="Join" class="btn btn-primary btn-large" href="${createLink(controller:'tool',action:'join')}">Join Meeting</a></h1>
<br><br>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th class="header c0" style="text-align:center;" scope="col">Recording</th>
<th class="header c1" style="text-align:center;" scope="col">Activity</th>
<th class="header c2" style="text-align:center;" scope="col">Description</th>
<th class="header c3" style="text-align:center;" scope="col">Date</th>
<th class="header c4" style="text-align:center;" scope="col">Duration</th>
<g:if test="${ismoderator}">
<th class="header c5 lastcol" style="text-align:left;" scope="col">Toolbar</th>
</g:if>
</tr>
</thead>
<tbody>
<g:each in="${recordingList}" var="r">
<g:if test="${ismoderator || r.published == 'true'}">
<tr class="r0 lastrow">
<td class="cell c0" style="text-align:center;">
<g:each in="${r.playback}" var="p">
<a title="${p.type}" target="_new" href="${p.url}">${p.type}</a>&#32;
</g:each>
</td>
<td class="cell c1" style="text-align:center;">${r.name}</td>
<td class="cell c2" style="text-align:center;">${r.metadata.contextactivitydescription}</td>
<td class="cell c3" style="text-align:center;">${new Date( Long.valueOf(r.startTime).longValue() )}</td>
<td class="cell c4" style="text-align:center;">
<g:each in="${r.playback}" var="p">
<g:if test="${p.type == 'slides'}">
${p.length}
</g:if>
</g:each>
</td>
<g:if test="${ismoderator}">
<td class="cell c5 lastcol" style="text-align:left;">
<g:if test="${r.published == 'true'}">
<a title="Hide" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="Hide" alt="Hide" class="smallicon" src="${resource(dir:'images',file:'hide.gif')}" /></a>
</g:if>
<g:else>
<a title="Show" class="action-icon" href="${createLink(controller:'tool',action:'publish')}?bbb_recording_published=${r.published}&bbb_recording_id=${r.recordID}"><img title="Show" alt="Show" class="smallicon" src="${resource(dir:'images',file:'show.gif')}" /></a>
</g:else>
<a title="Delete" class="action-icon" onClick="if(confirm('Are you sure to delete this recording?')) window.location='${createLink(controller:'tool',action:'delete')}?bbb_recording_id=${r.recordID}'; return false;" href="#"><img title="Delete" alt="Delete" class="smallicon" src="${resource(dir:'images',file:'delete.gif')}" /></a>
</td>
</g:if>
</tr>
</g:if>
</g:each>
</tbody>
</table>
</body>
</html>

View File

@ -49,7 +49,7 @@ public class Parameter {
public static final String CUSTOM_USER_ID = "custom_lis_person_sourcedid";
//BigBlueButton custom parameters
public static final String CUSTOM_BBB_RECORD = "custom_bbb_record";
public static final String CUSTOM_BBB_RECORD = "custom_bbb_recording";
public static final String CUSTOM_BBB_VOICEBRIDGE = "custom_bbb_voicebridge";
public static final String CUSTOM_BBB_DURATION = "custom_bbb_duration";
public static final String CUSTOM_BBB_WELCOME = "custom_bbb_welcome";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB