moved demo4
git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@4005 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
parent
5cb078e8ab
commit
98ea9f40a3
@ -1,24 +1,33 @@
|
||||
<!--
|
||||
|
||||
BigBlueButton - http://www.bigbluebutton.org
|
||||
|
||||
Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
|
||||
BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU Lesser General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Author: Fred Dixon <ffdixon@bigbluebutton.org>
|
||||
|
||||
-->
|
||||
<%
|
||||
/*
|
||||
BigBlueButton - http://www.bigbluebutton.org
|
||||
|
||||
Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
|
||||
BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU Lesser General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Author: Fred Dixon <ffdixon@bigbluebutton.org>
|
||||
*/
|
||||
%>
|
||||
<%@page import="javax.xml.transform.dom.DOMSource"%>
|
||||
<%@page import="javax.xml.transform.stream.StreamResult"%>
|
||||
<%@page import="javax.xml.transform.OutputKeys"%>
|
||||
<%@page import="javax.xml.transform.TransformerFactory"%>
|
||||
<%@page import="javax.xml.transform.Transformer"%>
|
||||
<%@page import="org.w3c.dom.Element"%>
|
||||
<%@page import="com.sun.org.apache.xerces.internal.dom.ChildNode"%>
|
||||
<%@page import="org.w3c.dom.Node"%>
|
||||
<%@page import="org.w3c.dom.NodeList"%>
|
||||
|
||||
<%@ page
|
||||
import="java.util.*,java.io.*,java.net.*,javax.crypto.*,javax.xml.parsers.*,org.w3c.dom.Document,org.xml.sax.*"
|
||||
@ -310,6 +319,76 @@ public String getJoinURLViewer(String username, String meetingToken) {
|
||||
|
||||
}
|
||||
|
||||
public String getMeetingInfoURL(String meetingID, String password) {
|
||||
String meetingParameters = "meetingID=" + urlEncode(meetingID) + "&password=" + password;
|
||||
return BigBlueButtonURL + "api/getMeetingInfo?" + meetingParameters + "&checksum=" + checksum(meetingParameters + salt);
|
||||
}
|
||||
|
||||
public String getMeetingInfo(String meetingID, String password) {
|
||||
try {
|
||||
URLConnection hpCon = new URL(getMeetingInfoURL(meetingID, password)).openConnection();
|
||||
|
||||
InputStreamReader isr = new InputStreamReader(hpCon.getInputStream());
|
||||
BufferedReader br = new BufferedReader(isr);
|
||||
String data = br.readLine();
|
||||
return data;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.out);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getMeetingsURL() {
|
||||
String meetingParameters = "random=" + new Random().nextInt(9999);
|
||||
return BigBlueButtonURL + "api/getMeetings?" + meetingParameters + "&checksum=" + checksum(meetingParameters + salt);
|
||||
}
|
||||
|
||||
//
|
||||
// Calls getMeetings to obtain the list of meetings, then calls getMeetingInfo for each meeting
|
||||
// and concatenates the result.
|
||||
//
|
||||
public String getMeetings() {
|
||||
try {
|
||||
|
||||
// Call the API and get the result
|
||||
URLConnection hpCon = new URL(getMeetingsURL()).openConnection();
|
||||
InputStreamReader isr = new InputStreamReader(hpCon.getInputStream());
|
||||
BufferedReader br = new BufferedReader(isr);
|
||||
String data = br.readLine();
|
||||
Document doc = parseXml(data);
|
||||
|
||||
// tags needed for parsing xml documents
|
||||
final String startTag = "<meetings>";
|
||||
final String endTag = "</meetings>";
|
||||
final String startResponse = "<response>";
|
||||
final String endResponse = "</response>";
|
||||
|
||||
// if the request succeeded, then calculate the checksum of each meeting and insert it into the document
|
||||
NodeList meetingsList = doc.getElementsByTagName("meeting");
|
||||
|
||||
String newXMldocument = startTag;
|
||||
for (int i = 0; i < meetingsList.getLength(); i++) {
|
||||
Element meeting = (Element) meetingsList.item(i);
|
||||
String meetingID = meeting.getElementsByTagName("meetingID").item(0).getTextContent();
|
||||
String password = meeting.getElementsByTagName("moderatorPW").item(0).getTextContent();
|
||||
|
||||
data = getMeetingInfo(meetingID, password);
|
||||
|
||||
if (data.indexOf("<response>") != -1) {
|
||||
int startIndex = data.indexOf(startResponse) + startTag.length();
|
||||
int endIndex = data.indexOf(endResponse);
|
||||
newXMldocument += "<meeting>" + data.substring(startIndex, endIndex) + "</meeting>";
|
||||
}
|
||||
}
|
||||
newXMldocument += endTag;
|
||||
|
||||
return newXMldocument;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.out);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// parseXml() -- return a DOM of the XML
|
||||
//
|
||||
|
@ -40,8 +40,7 @@ if (request.getParameterMap().isEmpty()) {
|
||||
// Assume we want to create a meeting
|
||||
//
|
||||
%>
|
||||
<img src="/bigbluebutton/images/bbb_banner.jpg" /><br>
|
||||
<a href="demo1.jsp">Join a Course</a> | <a href="demo2.jsp">Join a Selected Course</a> | <a href="demo3.jsp">Join a Selected Course (password required)</a> | <a href="create.jsp">Create Your Own Meeting</a>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #1: Join a Course</h2>
|
||||
|
||||
|
@ -40,8 +40,8 @@ Author: Fred Dixon <ffdixon@bigbluebutton.org>
|
||||
// Assume we want to create a meeting
|
||||
//
|
||||
%>
|
||||
<img src="/bigbluebutton/images/bbb_banner.jpg" /><br>
|
||||
<a href="demo1.jsp">Join a Course</a> | <a href="demo2.jsp">Join a Selected Course</a> | <a href="demo3.jsp">Join a Selected Course (password required)</a> | <a href="create.jsp">Create Your Own Meeting</a>
|
||||
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #2: Join a Selected Course</h2>
|
||||
|
||||
|
@ -142,8 +142,7 @@ if (request.getParameterMap().isEmpty()) {
|
||||
// Assume we want to join a course
|
||||
//
|
||||
%>
|
||||
<img src="/bigbluebutton/images/bbb_banner.jpg" /><br>
|
||||
<a href="demo1.jsp">Join a Course</a> | <a href="demo2.jsp">Join a Selected Course</a> | <a href="demo3.jsp">Join a Selected Course (password required)</a> | <a href="create.jsp">Create Your Own Meeting</a>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #3: Join a Course (password required)</h2>
|
||||
|
||||
|
67
bigbluebutton-web/web-app/demo/demo4.jsp
Executable file
67
bigbluebutton-web/web-app/demo/demo4.jsp
Executable file
@ -0,0 +1,67 @@
|
||||
<!--
|
||||
|
||||
BigBlueButton - http://www.bigbluebutton.org
|
||||
|
||||
Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
|
||||
BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU Lesser General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Author: Islam El-Ashi <ielashi@gmail.com>
|
||||
|
||||
-->
|
||||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
|
||||
<%@page import="org.w3c.dom.*"%><html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Get Meeting Info</title>
|
||||
<% if (ENABLE_MEETING_INFO_DEMO) { %>
|
||||
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="demo4.js"></script>
|
||||
<script src="md5.js"></script>
|
||||
<script type="text/javascript" src="jquery.xml2json.js"></script>
|
||||
<style type="text/css">
|
||||
.hiddenDiv {display:none;}
|
||||
.hor-minimalist-b{font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;font-size:12px;background:#fff;width:480px;border-collapse:collapse;text-align:left;margin:20px;}.hor-minimalist-b th{font-size:14px;font-weight:normal;color:#039;border-bottom:2px solid #6678b1;padding:10px 8px;}.hor-minimalist-b td{border-bottom:1px solid #ccc;color:#669;padding:6px 8px;width:100px;}.hor-minimalist-b tbody tr:hover td{color:#009;}</style>
|
||||
<% } %>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
|
||||
<br>
|
||||
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
<!-- <a href="demo1.jsp">Join a Course</a>
|
||||
|
|
||||
<a href="demo2.jsp">Join a Selected Course</a>
|
||||
|
|
||||
<a href="demo3.jsp">Join a Selected Course (password required)</a>
|
||||
|
|
||||
<a href="create.jsp">Create Your Own Meeting</a>
|
||||
|
|
||||
<a href="demo4.jsp">Activity Monitor</a>
|
||||
|
||||
<h2>Demo #4: Activity Monitor</h2>
|
||||
-->
|
||||
<p id="no_meetings"></p>
|
||||
|
||||
<div id="meetings"></div>
|
||||
<%@ include file="demo_footer.jsp"%>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -1 +1 @@
|
||||
<a href="demo1.jsp">Join a Meeting</a> | <a href="demo2.jsp">Join a Selected Meeting</a> | <a href="demo3.jsp">Create Your Own Meeting and Invite Others</a> | <a href="/">Home</a>
|
||||
<img src="/bigbluebutton/images/bbb_banner.jpg" /><br><a href="demo1.jsp">Join a Meeting</a> | <a href="demo2.jsp">Join a Selected Meeting</a> | <a href="demo3.jsp">Create Your Own Meeting and Invite Others</a> | <a href="demo4.jsp">Activity Monitor</a> | <a href="/">Home</a>
|
Loading…
Reference in New Issue
Block a user