Skip to content

Commit

Permalink
fixed demo10 to support paging
Browse files Browse the repository at this point in the history
  • Loading branch information
markoscalderon committed Nov 15, 2011
1 parent 9476e3b commit cb49700
Show file tree
Hide file tree
Showing 21 changed files with 1,010 additions and 47 deletions.
1 change: 1 addition & 0 deletions bbb-api-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ dependencies {
compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.2'
compile group: 'commons-io', name: 'commons-io', version: '2.0'
compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
compile group: 'commons-lang', name: 'commons-lang', version: '2.5'
}
68 changes: 65 additions & 3 deletions bbb-api-demo/src/main/webapp/bbb_api.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<%@ page import="org.apache.commons.codec.digest.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.nio.channels.FileChannel"%>
<%@ page import="org.apache.commons.lang.StringEscapeUtils"%>

<%@ include file="bbb_api_conf.jsp"%>

Expand Down Expand Up @@ -424,12 +425,73 @@ public String getRecordingsURL(String meetingID) {
}
public String getRecordings(String meetingID) {
//recordID,name,description,starttime,published,playback,length
String newXMLdoc = "<recordings>";
try {
return getURL( getRecordingsURL(meetingID) );
} catch (Exception e) {
Document doc = null;
String url = getRecordingsURL(meetingID);
doc = parseXml( getURL(url) );
// if the request succeeded, then calculate the checksum of each meeting and insert it into the document
NodeList recordingList = doc.getElementsByTagName("recording");
for (int i = 0; i < recordingList.getLength(); i++) {
Element recording = (Element) recordingList.item(i);
String recordID = recording.getElementsByTagName("recordID").item(0).getTextContent();
String name = recording.getElementsByTagName("name").item(0).getTextContent();
String description = "";
NodeList metadata = recording.getElementsByTagName("metadata");
if(metadata.getLength()>0){
Element metadataElem = (Element) metadata.item(0);
if(metadataElem.getElementsByTagName("description").getLength() > 0){
description = metadataElem.getElementsByTagName("description").item(0).getTextContent();
}
}
String starttime = recording.getElementsByTagName("startTime").item(0).getTextContent();
String published = recording.getElementsByTagName("published").item(0).getTextContent();
String playback = "";
String length = "";
NodeList formats = recording.getElementsByTagName("format");
for (int j = 0; j < formats.getLength(); j++){
Element format = (Element) formats.item(j);
String typeP = format.getElementsByTagName("type").item(0).getTextContent();
String urlP = format.getElementsByTagName("url").item(0).getTextContent();
String lengthP = format.getElementsByTagName("length").item(0).getTextContent();
if (j != 0){
playback +=", ";
}
playback += StringEscapeUtils.escapeXml("<a href='" + urlP + "'>" + typeP + "</a>");
if(typeP.equalsIgnoreCase("slides")){
length = lengthP;
}
}
newXMLdoc += "<recording>";
newXMLdoc += "<recordID>" + recordID + "</recordID>";
newXMLdoc += "<name>" + name + "</name>";
newXMLdoc += "<description>" + description + "</description>";
newXMLdoc += "<startTime>" + starttime + "</startTime>";
newXMLdoc += "<published>" + published + "</published>";
newXMLdoc += "<playback>" + playback + "</playback>";
newXMLdoc += "<length>" + length + "</length>";
newXMLdoc += "</recording>";
}
}catch (Exception e) {
e.printStackTrace(System.out);
return null;
return "error: "+e.getMessage();
}
newXMLdoc += "</recordings>";
return newXMLdoc;
}
public String getPublishRecordingsURL(boolean publish, String recordID) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions ...api-demo/src/main/webapp/js/jquery-ui.css → .../webapp/css/redmond/jquery-ui-redmond.css
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery UI CSS Framework 1.8.14
* jQuery UI CSS Framework 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand Down Expand Up @@ -42,7 +42,7 @@


/*
* jQuery UI CSS Framework 1.8.14
* jQuery UI CSS Framework 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand Down Expand Up @@ -288,7 +288,7 @@
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
* jQuery UI Resizable 1.8.14
* jQuery UI Resizable 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -307,7 +307,7 @@
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* jQuery UI Selectable 1.8.14
* jQuery UI Selectable 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -317,7 +317,7 @@
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* jQuery UI Accordion 1.8.14
* jQuery UI Accordion 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -336,7 +336,7 @@
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
/*
* jQuery UI Autocomplete 1.8.14
* jQuery UI Autocomplete 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -350,7 +350,7 @@
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */

/*
* jQuery UI Menu 1.8.14
* jQuery UI Menu 1.8.16
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand Down Expand Up @@ -389,7 +389,7 @@
margin: -1px;
}
/*
* jQuery UI Button 1.8.14
* jQuery UI Button 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand Down Expand Up @@ -427,7 +427,7 @@ input.ui-button { padding: .4em 1em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI Dialog 1.8.14
* jQuery UI Dialog 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -448,7 +448,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* jQuery UI Slider 1.8.14
* jQuery UI Slider 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -471,7 +471,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* jQuery UI Tabs 1.8.14
* jQuery UI Tabs 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -489,7 +489,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI Datepicker 1.8.14
* jQuery UI Datepicker 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand Down Expand Up @@ -556,7 +556,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* jQuery UI Progressbar 1.8.14
* jQuery UI Progressbar 1.8.16
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Expand Down
43 changes: 12 additions & 31 deletions bbb-api-demo/src/main/webapp/demo10.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" href="js/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="css/redmond/jquery-ui-redmond.css" />
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script src="js/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/jquery.xml2json.js" type="text/javascript"></script>
<title>Recording Meeting Demo</title>
Expand Down Expand Up @@ -125,6 +127,7 @@ with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
<option value="delete">Delete</option>
</select>
<table id="recordgrid"></table>
<div id="pager"></div>
<p>Note: New recordings will appear in the above list after processing. Refresh your browser to update the list.</p>
<script>
function onChangeMeeting(meetingID){
Expand Down Expand Up @@ -218,19 +221,21 @@ with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
colNames:['Id','Course','Description', 'Date Recorded', 'Published', 'Playback', 'Length'],
colModel:[
{name:'id',index:'id', width:50, hidden:true, xmlmap: "recordID"},
{name:'course',index:'course', width:150, xmlmap: "meetingID", sortable:false},
{name:'description',index:'description', width:300, xmlmap: "metadata>description",sortable: false},
{name:'course',index:'course', width:150, xmlmap: "name", sortable:true},
{name:'description',index:'description', width:300, xmlmap: "description",sortable: true},
{name:'daterecorded',index:'daterecorded', width:200, xmlmap: "startTime", sortable: false},
{name:'published',index:'published', width:80, xmlmap: "published", sortable:false },
{name:'playback',index:'playback', width:150, formatter:playbackFormat, sortable:false},
{name:'length',index:'length', width:80, sortable:false}
{name:'published',index:'published', width:80, xmlmap: "published", sortable:true },
{name:'playback',index:'playback', width:150, xmlmap:"playback", sortable:false},
{name:'length',index:'length', width:80, xmlmap:"length", sortable:true}
],
xmlReader: {
root : "recordings",
row: "recording",
repeatitems:false,
id: "id"
id: "recordID"
},
pager : '#pager',
emptyrecords: "Nothing to display",
multiselect: true,
caption: "Recorded Sessions",
loadComplete: function(){
Expand All @@ -239,30 +244,6 @@ with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
});
});
function playbackFormat( cellvalue, options, rowObject ){
if($(rowObject).find('published:first').text()=="true"){
var newval="<p>";
$(rowObject).find('playback format').each(function() {
if (newval != "<p>") {
newval += ", ";
}
newval += '<a href="'+$(this).find("url").text()+'">'+$(this).find("type").text()+'</a>';
});
newval = newval + "</p>"
return newval;
}
return "";
}
function lengthFormat( cellvalue, options, rowObject ){
var duration = 0;
$(rowObject).find('playback format').each(function() {
var duration = parseInt($(this).find("length").text());
if (duration != 0) {
return false;
}
});
return duration;
}
</script>
<%
} else if (request.getParameter("action").equals("create")) {
Expand Down
Loading

0 comments on commit cb49700

Please sign in to comment.