Merge branch 'master' of github.com:bigbluebutton/bigbluebutton
This commit is contained in:
commit
491d84f645
14
bbb-api-demo/README
Normal file
14
bbb-api-demo/README
Normal file
@ -0,0 +1,14 @@
|
||||
Steps:
|
||||
|
||||
gradle resolveDeps
|
||||
|
||||
gradle build
|
||||
|
||||
sudo rm -rf /var/lib/tomcat6/webapps/demo*
|
||||
|
||||
sudo cp build/libs/demo.war /var/lib/tomcat6/webapps/
|
||||
|
||||
sudo service tomcat6 restart
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
@ -1 +0,0 @@
|
||||
bbb_api_conf.jsp has to be overwritten by the one in your computer, or you can change the IP address to your computer's.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
|
||||
<display-name>test1</display-name>
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
<welcome-file>default.html</welcome-file>
|
||||
<welcome-file>default.htm</welcome-file>
|
||||
<welcome-file>default.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
@ -1 +0,0 @@
|
||||
<img src="/bigbluebutton/images/bbb_banner.jpg" /><br><a href="demo5.jsp">Auto Upload File</a> | <a href="demo6.jsp">Auto Upload File URL</a>
|
24
bbb-api-demo/build.gradle
Executable file
24
bbb-api-demo/build.gradle
Executable file
@ -0,0 +1,24 @@
|
||||
//usePlugin 'war'
|
||||
usePlugin 'war'
|
||||
version = '0.8'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
task resolveDeps(dependsOn: configurations.default.buildArtifacts, type: Copy) {
|
||||
into('lib')
|
||||
from configurations.default
|
||||
from configurations.default.allArtifacts*.file
|
||||
}
|
||||
|
||||
war {
|
||||
baseName = 'demo'
|
||||
version = ''
|
||||
}
|
||||
dependencies {
|
||||
|
||||
compile group: 'commons-codec', name: 'commons-codec', version: '1.4'
|
||||
compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.2'
|
||||
compile group: 'commons-io', name: 'commons-io', version: '2.0'
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<project name="demo" default="war">
|
||||
|
||||
<path id="compile.classpath">
|
||||
<fileset dir="WebContent/WEB-INF/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<target name="init">
|
||||
<mkdir dir="build/classes"/>
|
||||
<mkdir dir="dist" />
|
||||
</target>
|
||||
|
||||
<target name="compile" depends="init" >
|
||||
<javac destdir="build/classes" debug="true" srcdir="src">
|
||||
<classpath refid="compile.classpath"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="war" depends="compile">
|
||||
<war destfile="dist/demo.war" webxml="WebContent/WEB-INF/web.xml">
|
||||
<fileset dir="WebContent"/>
|
||||
<lib dir="WebContent/WEB-INF/lib"/>
|
||||
<classes dir="build/classes"/>
|
||||
</war>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="dist" />
|
||||
<delete dir="build" />
|
||||
</target>
|
||||
</project>
|
1
bbb-api-demo/build/.gitignore
vendored
1
bbb-api-demo/build/.gitignore
vendored
@ -1 +0,0 @@
|
||||
classes
|
1
bbb-api-demo/dist/.gitignore
vendored
1
bbb-api-demo/dist/.gitignore
vendored
@ -1 +0,0 @@
|
||||
*.war
|
21
bbb-api-demo/pom.xml
Executable file
21
bbb-api-demo/pom.xml
Executable file
@ -0,0 +1,21 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>bigbluebutton</groupId>
|
||||
<artifactId>bbb-api-demo</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>0.8-PRE</version>
|
||||
<name>bbb-api-demo Maven Webapp</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>demo</finalName>
|
||||
</build>
|
||||
</project>
|
7
bbb-api-demo/src/main/webapp/WEB-INF/web.xml
Normal file
7
bbb-api-demo/src/main/webapp/WEB-INF/web.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE web-app PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
||||
|
||||
<web-app>
|
||||
<display-name>Archetype Created Web Application</display-name>
|
||||
</web-app>
|
@ -137,7 +137,7 @@
|
||||
//
|
||||
// Create a meeting and return a URL to join it as moderator
|
||||
//
|
||||
public String getJoinURL(String username, String meetingID, String welcome) {
|
||||
public String getJoinURL(String username, String meetingID, String record, String welcome, Map<String, String> metadata) {
|
||||
String base_url_create = BigBlueButtonURL + "api/create?";
|
||||
String base_url_join = BigBlueButtonURL + "api/join?";
|
||||
|
||||
@ -166,7 +166,20 @@
|
||||
|
||||
String create_parameters = "name=" + urlEncode(meetingID)
|
||||
+ "&meetingID=" + urlEncode(meetingID) + welcome_param
|
||||
+ "&attendeePW=ap&moderatorPW=mp&voiceBridge=" + voiceBridge;
|
||||
+ "&attendeePW=ap&moderatorPW=mp&voiceBridge=" + voiceBridge
|
||||
+ "&record=" + record;
|
||||
|
||||
if(metadata!=null){
|
||||
String metadata_params="";
|
||||
for(String metakey : metadata.keySet()){
|
||||
metadata_params = metadata_params + "&meta_" + urlEncode(metakey) + "=" + urlEncode(metadata.get(metakey));
|
||||
}
|
||||
create_parameters = create_parameters + metadata_params;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Document doc = null;
|
||||
|
@ -3,9 +3,9 @@
|
||||
// This is the security salt that must match the value set in the BigBlueButton server
|
||||
//String salt = "4951c2aea43e5af6d9598610b9e0b6c7";
|
||||
//String salt = "5e5ff0968546b8aaacce0462a99bca30";
|
||||
String salt = "5e5ff0968546b8aaacce0462a99bca30";
|
||||
String salt = "c9181cea77a2f2a4c93a0e17d723b942";
|
||||
// This is the URL for the BigBlueButton server 4951c2aea43e5af6d9598610b9e0b6c7
|
||||
String BigBlueButtonURL = "http://192.168.0.217/bigbluebutton/";
|
||||
String BigBlueButtonURL = "http://192.168.0.104/bigbluebutton/";
|
||||
%>
|
||||
|
||||
|
308
bbb-api-demo/src/main/webapp/create.jsp
Executable file
308
bbb-api-demo/src/main/webapp/create.jsp
Executable file
@ -0,0 +1,308 @@
|
||||
<!--
|
||||
|
||||
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 language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
%>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
||||
<title>Create Your Own Meeting</title>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="heartbeat.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
<%@ page import="java.util.regex.*"%>
|
||||
|
||||
<br>
|
||||
|
||||
<%
|
||||
if (request.getParameterMap().isEmpty()) {
|
||||
//
|
||||
// Assume we want to create a meeting
|
||||
//
|
||||
%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
<h2>Create Your Own Meeting</h2>
|
||||
|
||||
<p />
|
||||
<FORM NAME="form1" METHOD="GET">
|
||||
|
||||
<table width=600 cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">Create your own meeting.
|
||||
<p />
|
||||
</td>
|
||||
<td width="50%">Step 1. Enter your name: <input type="text"
|
||||
name="username1" /> <br />
|
||||
<label for="crecord">record? </label>
|
||||
<select id="crecord" name="record1">
|
||||
<option value="true">yes</option>
|
||||
<option value="false" selected>no</option>
|
||||
</select>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create"> <br />
|
||||
<input id="submit-button" type="submit" value="Create meeting" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</FORM>
|
||||
|
||||
<script>
|
||||
//
|
||||
// We could have asked the user for both their name and a meeting title, but we'll just use their name to create a title
|
||||
// We'll use JQuery to dynamically update the button
|
||||
//
|
||||
$(document).ready(function(){
|
||||
$("input[name='username1']").keyup(function() {
|
||||
if ($("input[name='username1']").val() == "") {
|
||||
$("#submit-button").attr('value',"Create meeting" );
|
||||
} else {
|
||||
$("#submit-button").attr('value',"Create " +$("input[name='username1']").val()+ "'s meeting" );
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("create")) {
|
||||
//
|
||||
// User has requested to create a meeting
|
||||
//
|
||||
|
||||
String username = request.getParameter("username1");
|
||||
String meetingID = username + "'s meeting";
|
||||
String record = request.getParameter("record1");
|
||||
|
||||
String meeting_ID = "";
|
||||
|
||||
//
|
||||
// This is the URL for to join the meeting as moderator
|
||||
//
|
||||
String joinURL = getJoinURL(username, meetingID, record, "<br>Welcome to %%CONFNAME%%.<br>", null);
|
||||
|
||||
|
||||
String inviteURL = BigBlueButtonURL + "demo/create.jsp?action=invite&meetingID=" + URLEncoder.encode(meetingID, "UTF-8");
|
||||
%>
|
||||
|
||||
<hr />
|
||||
<h2>Meeting Created</h2>
|
||||
<hr />
|
||||
|
||||
|
||||
<table width="800" cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<center><strong> <%=username%>'s meeting</strong> has been
|
||||
created.</center>
|
||||
</td>
|
||||
|
||||
<td width="50%">
|
||||
<p> </p>
|
||||
|
||||
Step 2. Invite others using the following <a href="<%=inviteURL%>">link</a> (shown below):
|
||||
<form name="form2" method="POST">
|
||||
<textarea cols="62" rows="5" name="myname" style="overflow: hidden">
|
||||
<%=inviteURL%>
|
||||
</textarea>
|
||||
</form>
|
||||
<p>
|
||||
<p />Step 3. Click the following link to start your meeting:
|
||||
<p> </p>
|
||||
<center><a href="<%=joinURL%>">Start Meeting</a></center>
|
||||
<p> </p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("enter")) {
|
||||
//
|
||||
// The user is now attempting to joing the meeting
|
||||
//
|
||||
String meetingID = request.getParameter("meetingID");
|
||||
String username = request.getParameter("username");
|
||||
|
||||
String enterURL = BigBlueButtonURL
|
||||
+ "demo/create.jsp?action=join&username="
|
||||
+ URLEncoder.encode(username, "UTF-8") + "&meetingID="
|
||||
+ URLEncoder.encode(meetingID, "UTF-8");
|
||||
|
||||
if (isMeetingRunning(meetingID).equals("true")) {
|
||||
//
|
||||
// The meeting has started -- bring the user into the meeting.
|
||||
//
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
window.location = "<%=enterURL%>";
|
||||
</script>
|
||||
<%
|
||||
} else {
|
||||
//
|
||||
// The meeting has not yet started, so check until we get back the status that the meeting is running
|
||||
//
|
||||
String checkMeetingStatus = getURLisMeetingRunning(meetingID);
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$.jheartbeat.set({
|
||||
url: "<%=checkMeetingStatus%>",
|
||||
delay: 5000
|
||||
}, function () {
|
||||
mycallback();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function mycallback() {
|
||||
// Not elegant, but works around a bug in IE8
|
||||
var isMeetingRunning = ($("#HeartBeatDIV").text().search("true") > 0 );
|
||||
|
||||
if (isMeetingRunning) {
|
||||
window.location = "<%=enterURL%>";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<hr />
|
||||
<h2><strong><%=meetingID%></strong> has not yet started.</h2>
|
||||
<hr />
|
||||
|
||||
|
||||
<table width=600 cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
|
||||
<p>Hi <%=username%>,</p>
|
||||
<p>Now waiting for the moderator to start <strong><%=meetingID%></strong>.</p>
|
||||
<br />
|
||||
<p>(Your browser will automatically refresh and join the meeting
|
||||
when it starts.)</p>
|
||||
</td>
|
||||
<td width="50%"><img src="polling.gif"></img></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<%
|
||||
}
|
||||
} else if (request.getParameter("action").equals("invite")) {
|
||||
//
|
||||
// We have an invite to an active meeting. Ask the person for their name
|
||||
// so they can join.
|
||||
//
|
||||
String meetingID = request.getParameter("meetingID");
|
||||
%>
|
||||
|
||||
<hr />
|
||||
<h2>Invite</h2>
|
||||
<hr />
|
||||
|
||||
<FORM NAME="form3" METHOD="GET">
|
||||
|
||||
<table width=600 cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
|
||||
<p />You have been invited to join<br />
|
||||
<strong><%=meetingID%></strong>.
|
||||
</td>
|
||||
|
||||
<td width="50%">Enter your name: <input type="text"
|
||||
name="username" /> <br />
|
||||
<INPUT TYPE=hidden NAME=meetingID VALUE="<%=meetingID%>"> <INPUT
|
||||
TYPE=hidden NAME=action VALUE="enter"> <br />
|
||||
<input type="submit" value="Join" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</FORM>
|
||||
|
||||
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("join")) {
|
||||
//
|
||||
// We have an invite request to join an existing meeting and the meeting is running
|
||||
//
|
||||
// We don't need to pass a meeting descritpion as it's already been set by the first time
|
||||
// the meeting was created.
|
||||
String joinURL = getJoinURLViewer(request.getParameter("username"), request.getParameter("meetingID"));
|
||||
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p /><%=joinURL%>
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
<%@ include file="demo_footer.jsp"%>
|
||||
|
||||
</body>
|
||||
</html>
|
119
bbb-api-demo/src/main/webapp/demo1.jsp
Executable file
119
bbb-api-demo/src/main/webapp/demo1.jsp
Executable file
@ -0,0 +1,119 @@
|
||||
<!--
|
||||
|
||||
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 language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Join a Course</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
|
||||
<br>
|
||||
|
||||
<%
|
||||
if (request.getParameterMap().isEmpty()) {
|
||||
//
|
||||
// Assume we want to create a meeting
|
||||
//
|
||||
%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #1: Join a Course</h2>
|
||||
|
||||
|
||||
<FORM NAME="form1" METHOD="GET">
|
||||
<table cellpadding="5" cellspacing="5" style="width: 400px; ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td style="text-align: right; ">
|
||||
Full Name:</td>
|
||||
<td style="width: 5px; ">
|
||||
</td>
|
||||
<td style="text-align: left ">
|
||||
<input type="text" name="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Join" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create">
|
||||
</FORM>
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("create")) {
|
||||
|
||||
//
|
||||
// Got an action=create
|
||||
//
|
||||
|
||||
//
|
||||
// Request a URL to join a meeting called "Demo Meeting"
|
||||
// Pass null for welcome message to use the default message (see defaultWelcomeMessage in bigbluebutton.properties)
|
||||
// Update: Added record parameter, default: false
|
||||
//
|
||||
String joinURL = getJoinURL(request.getParameter("username"), "Demo Meeting", "false", null, null);
|
||||
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p/>
|
||||
<%=joinURL %>
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
<%@ include file="demo_footer.jsp"%>
|
||||
|
||||
</body>
|
||||
</html>
|
130
bbb-api-demo/src/main/webapp/demo2.jsp
Executable file
130
bbb-api-demo/src/main/webapp/demo2.jsp
Executable file
@ -0,0 +1,130 @@
|
||||
<!--
|
||||
|
||||
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 language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
%>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Join a Selected Course</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
|
||||
<br>
|
||||
|
||||
<%
|
||||
if (request.getParameterMap().isEmpty()) {
|
||||
//
|
||||
// Assume we want to create a meeting
|
||||
//
|
||||
%>
|
||||
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #2: Join a Selected Course</h2>
|
||||
|
||||
|
||||
<FORM NAME="form1" METHOD="GET">
|
||||
<table cellpadding="5" cellspacing="5" style="width: 400px; ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td style="text-align: right; ">
|
||||
Full Name:</td>
|
||||
<td style="width: 5px; ">
|
||||
</td>
|
||||
<td style="text-align: left ">
|
||||
<input type="text" name="username" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td style="text-align: right; ">
|
||||
Course:</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td style="text-align: left ">
|
||||
<select name="meetingID">
|
||||
<option value="English 232">English 232</option>
|
||||
<option value="English 300">English 300</option>
|
||||
<option value="English 402">English 402</option>
|
||||
<option value="Demo Meeting">Demo Meeting</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Join" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create">
|
||||
</FORM>
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("create")) {
|
||||
//
|
||||
// Got an action=create
|
||||
//
|
||||
|
||||
String username = request.getParameter("username");
|
||||
String meetingID = request.getParameter("meetingID");
|
||||
|
||||
// String joinURL = getJoinURL(username, meetingID, "Welcome to " + meetingID );
|
||||
// Update: added record parameter, default false
|
||||
String joinURL = getJoinURL(username, meetingID,"false", "<br>Welcome to course: %%CONFNAME%%.<br>", null );
|
||||
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p /><%=joinURL%> <%
|
||||
}
|
||||
}
|
||||
%> <%@ include file="demo_footer.jsp"%>
|
||||
</body>
|
||||
</html>
|
||||
|
293
bbb-api-demo/src/main/webapp/demo3.jsp
Executable file
293
bbb-api-demo/src/main/webapp/demo3.jsp
Executable file
@ -0,0 +1,293 @@
|
||||
<!--
|
||||
|
||||
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 language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
%>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Join a Course (Password Required)</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
|
||||
<br>
|
||||
|
||||
<%
|
||||
|
||||
//
|
||||
// We're going to define some sample courses (meetings) below. This API exampe shows how you can create a login page for a course.
|
||||
// The password below are not available to users as they are compiled on the server.
|
||||
//
|
||||
|
||||
HashMap<String, HashMap> allMeetings = new HashMap<String, HashMap>();
|
||||
HashMap<String, String> meeting;
|
||||
|
||||
String welcome = "<br>Welcome to %%CONFNAME%%!<br><br>For help see our <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>tutorial videos</u></a>.<br><br>To join the voice bridge for this meeting:<br> (1) click the headset icon in the upper-left, or<br> (2) dial xxx-xxx-xxxx (toll free:1-xxx-xxx-xxxx) and enter conference ID: %%CONFNUM%%.<br><br>";
|
||||
|
||||
|
||||
//
|
||||
// English courses
|
||||
//
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "ENGL-2013: Research Methods in English", meeting ); // The title that will appear in the drop-down menu
|
||||
meeting.put("welcomeMsg", welcome); // The welcome mesage
|
||||
meeting.put("moderatorPW", "prof123"); // The password for moderator
|
||||
meeting.put("viewerPW", "student123"); // The password for viewer
|
||||
meeting.put("voiceBridge", "72013"); // The extension number for the voice bridge (use if connected to phone system)
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp"); // The logout URL (use if you want to return to your pages)
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "ENGL-2213: Drama Production I", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "prof123");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "72213");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "ENGL-2023: Survey of English Literature", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "prof123");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "72023");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
//
|
||||
// Law Courses
|
||||
//
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "LAW-1323: Fundamentals of Advocacy ", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "prof123");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "71232");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "LAW-2273: Business Organizations", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "prof123");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "72273");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "LAW-3113: Corporate Finance", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "theprof");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "71642");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
|
||||
//
|
||||
// Professor's Virtaul Office Hours
|
||||
//
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "Virtual Office Hours - Steve Stoyan", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "prof123");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "70001");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "Virtual Office Hours - Michael Bailetti", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "prof123");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "70002");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
meeting = new HashMap<String, String>();
|
||||
allMeetings.put( "Virtual Office Hours - Tony Weiss", meeting );
|
||||
meeting.put("welcomeMsg", welcome);
|
||||
meeting.put("moderatorPW", "prof123");
|
||||
meeting.put("viewerPW", "student123");
|
||||
meeting.put("voiceBridge", "70003");
|
||||
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
|
||||
|
||||
|
||||
meeting = null;
|
||||
|
||||
Iterator<String> meetingIterator = new TreeSet<String>(allMeetings.keySet()).iterator();
|
||||
|
||||
if (request.getParameterMap().isEmpty()) {
|
||||
//
|
||||
// Assume we want to join a course
|
||||
//
|
||||
%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #3: Join a Course (password required)</h2>
|
||||
|
||||
|
||||
<FORM NAME="form1" METHOD="GET">
|
||||
<table cellpadding="5" cellspacing="5" style="width: 400px; ">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td style="text-align: right; ">
|
||||
Full Name:</td>
|
||||
<td style="width: 5px; ">
|
||||
</td>
|
||||
<td style="text-align: left ">
|
||||
<input type="text" name="username" /></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td style="text-align: right; ">
|
||||
Course:</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td style="text-align: left ">
|
||||
<select name="meetingID">
|
||||
<%
|
||||
String key;
|
||||
while (meetingIterator.hasNext()) {
|
||||
key = meetingIterator.next();
|
||||
out.println("<option value=\"" + key + "\">" + key + "</option>");
|
||||
}
|
||||
%>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td style="text-align: right; ">
|
||||
Password:</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="password" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Join" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create">
|
||||
</FORM>
|
||||
|
||||
Passwords:
|
||||
<ul>
|
||||
<li>prof123 - login as professor (moderator privlidges)</li>
|
||||
<li>student123 - login as student (viewer privlidges)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("create")) {
|
||||
//
|
||||
// Got an action=create
|
||||
//
|
||||
|
||||
String username = request.getParameter("username");
|
||||
String meetingID = request.getParameter("meetingID");
|
||||
String password = request.getParameter("password");
|
||||
|
||||
meeting = allMeetings.get( meetingID );
|
||||
|
||||
String welcomeMsg = meeting.get( "welcomeMsg" );
|
||||
String logoutURL = meeting.get( "logoutURL" );
|
||||
Integer voiceBridge = Integer.parseInt( meeting.get( "voiceBridge" ).trim() );
|
||||
|
||||
String viewerPW = meeting.get( "viewerPW" );
|
||||
String moderatorPW = meeting.get( "moderatorPW" );
|
||||
|
||||
//
|
||||
// Check if we have a valid password
|
||||
//
|
||||
if ( ! password.equals(viewerPW) && ! password.equals(moderatorPW) ) {
|
||||
%>
|
||||
|
||||
Invalid Password, please <a href="javascript:history.go(-1)">try again</a>.
|
||||
|
||||
<%
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Looks good, let's create the meeting
|
||||
//
|
||||
String meeting_ID = createMeeting( meetingID, welcomeMsg, moderatorPW, viewerPW, voiceBridge, logoutURL );
|
||||
|
||||
//
|
||||
// Check if we have an error.
|
||||
//
|
||||
if( meeting_ID.startsWith("Error ")) {
|
||||
%>
|
||||
|
||||
Error: createMeeting() failed
|
||||
<p /><%=meeting_ID%>
|
||||
|
||||
|
||||
<%
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// We've got a valid meeting_ID and passoword -- let's join!
|
||||
//
|
||||
|
||||
String joinURL = getJoinMeetingURL(username, meeting_ID, password);
|
||||
%>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%@ include file="demo_footer.jsp"%>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
106
bbb-api-demo/src/main/webapp/demo4.jsp
Executable file
106
bbb-api-demo/src/main/webapp/demo4.jsp
Executable file
@ -0,0 +1,106 @@
|
||||
<!--
|
||||
|
||||
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=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
%>
|
||||
|
||||
<%@page import="org.w3c.dom.*"%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Activity Monitor</title>
|
||||
<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"%>
|
||||
|
||||
|
||||
<%
|
||||
if (request.getParameterMap().isEmpty()) {
|
||||
%>
|
||||
|
||||
<h2>Demo #4: Activity Monitor</h2>
|
||||
|
||||
<p id="no_meetings"></p>
|
||||
|
||||
<div id="meetings"></div>
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("end")) {
|
||||
|
||||
String mp = request.getParameter("moderatorPW");
|
||||
String meetingID = request.getParameter("meetingID");
|
||||
|
||||
String result = endMeeting(meetingID, mp);
|
||||
|
||||
if ( result.equals("true") ){
|
||||
|
||||
%>
|
||||
|
||||
<h2>Demo #4: Activity Monitor</h2>
|
||||
|
||||
<%=meetingID%> has been terminated.
|
||||
|
||||
<p id="no_meetings"></p>
|
||||
|
||||
<div id="meetings"></div>
|
||||
|
||||
<% } else { %>
|
||||
|
||||
<h2>Demo #4: Activity Monitor</h2>
|
||||
|
||||
|
||||
Unable to end meeting: <%=meetingID%>
|
||||
|
||||
<%=result%>
|
||||
|
||||
|
||||
|
||||
|
||||
<% }
|
||||
}%>
|
||||
|
||||
<%@ include file="demo_footer.jsp"%>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
6
bbb-api-demo/src/main/webapp/demo4_helper.jsp
Executable file
6
bbb-api-demo/src/main/webapp/demo4_helper.jsp
Executable file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" ?>
|
||||
<%= getMeetings() %>
|
||||
<%@ include file="bbb_api.jsp" %>
|
||||
<%@ page contentType="text/xml" %>
|
||||
|
||||
|
308
bbb-api-demo/src/main/webapp/demo5.jsp
Executable file
308
bbb-api-demo/src/main/webapp/demo5.jsp
Executable file
@ -0,0 +1,308 @@
|
||||
<!--
|
||||
|
||||
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 language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
%>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
||||
<title>Create Your Own Meeting</title>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="heartbeat.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
<%@ page import="java.util.regex.*"%>
|
||||
|
||||
<br>
|
||||
|
||||
<%
|
||||
if (request.getParameterMap().isEmpty()) {
|
||||
//
|
||||
// Assume we want to create a meeting
|
||||
//
|
||||
%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
<h2>Create Your Own Meeting</h2>
|
||||
|
||||
<p />
|
||||
<FORM NAME="form1" METHOD="GET">
|
||||
|
||||
<table width=600 cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">Create your own meeting.
|
||||
<p />
|
||||
</td>
|
||||
<td width="50%">Step 1. Enter your name: <input type="text"
|
||||
name="username1" /> <br />
|
||||
<label for="crecord">record? </label>
|
||||
<select id="crecord" name="record1">
|
||||
<option value="true">yes</option>
|
||||
<option value="false" selected>no</option>
|
||||
</select>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create"> <br />
|
||||
<input id="submit-button" type="submit" value="Create meeting" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</FORM>
|
||||
|
||||
<script>
|
||||
//
|
||||
// We could have asked the user for both their name and a meeting title, but we'll just use their name to create a title
|
||||
// We'll use JQuery to dynamically update the button
|
||||
//
|
||||
$(document).ready(function(){
|
||||
$("input[name='username1']").keyup(function() {
|
||||
if ($("input[name='username1']").val() == "") {
|
||||
$("#submit-button").attr('value',"Create meeting" );
|
||||
} else {
|
||||
$("#submit-button").attr('value',"Create " +$("input[name='username1']").val()+ "'s meeting" );
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("create")) {
|
||||
//
|
||||
// User has requested to create a meeting
|
||||
//
|
||||
|
||||
String username = request.getParameter("username1");
|
||||
String meetingID = username + "'s meeting";
|
||||
String record = request.getParameter("record1");
|
||||
|
||||
String meeting_ID = "";
|
||||
|
||||
//
|
||||
// This is the URL for to join the meeting as moderator
|
||||
//
|
||||
String joinURL = getJoinURL(username, meetingID, record, "<br>Welcome to %%CONFNAME%%.<br>", null);
|
||||
|
||||
|
||||
String inviteURL = BigBlueButtonURL + "demo/demo5.jsp?action=invite&meetingID=" + URLEncoder.encode(meetingID, "UTF-8");
|
||||
%>
|
||||
|
||||
<hr />
|
||||
<h2>Meeting Created</h2>
|
||||
<hr />
|
||||
|
||||
|
||||
<table width="800" cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<center><strong> <%=username%>'s meeting</strong> has been
|
||||
created.</center>
|
||||
</td>
|
||||
|
||||
<td width="50%">
|
||||
<p> </p>
|
||||
|
||||
Step 2. Invite others using the following <a href="<%=inviteURL%>">link</a> (shown below):
|
||||
<form name="form2" method="POST">
|
||||
<textarea cols="62" rows="5" name="myname" style="overflow: hidden">
|
||||
<%=inviteURL%>
|
||||
</textarea>
|
||||
</form>
|
||||
<p>
|
||||
<p />Step 3. Click the following link to start your meeting:
|
||||
<p> </p>
|
||||
<center><a href="<%=joinURL%>">Start Meeting</a></center>
|
||||
<p> </p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("enter")) {
|
||||
//
|
||||
// The user is now attempting to joing the meeting
|
||||
//
|
||||
String meetingID = request.getParameter("meetingID");
|
||||
String username = request.getParameter("username");
|
||||
|
||||
String enterURL = BigBlueButtonURL
|
||||
+ "demo/demo5.jsp?action=join&username="
|
||||
+ URLEncoder.encode(username, "UTF-8") + "&meetingID="
|
||||
+ URLEncoder.encode(meetingID, "UTF-8");
|
||||
|
||||
if (isMeetingRunning(meetingID).equals("true")) {
|
||||
//
|
||||
// The meeting has started -- bring the user into the meeting.
|
||||
//
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
window.location = "<%=enterURL%>";
|
||||
</script>
|
||||
<%
|
||||
} else {
|
||||
//
|
||||
// The meeting has not yet started, so check until we get back the status that the meeting is running
|
||||
//
|
||||
String checkMeetingStatus = getURLisMeetingRunning(meetingID);
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$.jheartbeat.set({
|
||||
url: "<%=checkMeetingStatus%>",
|
||||
delay: 5000
|
||||
}, function () {
|
||||
mycallback();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function mycallback() {
|
||||
// Not elegant, but works around a bug in IE8
|
||||
var isMeetingRunning = ($("#HeartBeatDIV").text().search("true") > 0 );
|
||||
|
||||
if (isMeetingRunning) {
|
||||
window.location = "<%=enterURL%>";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<hr />
|
||||
<h2><strong><%=meetingID%></strong> has not yet started.</h2>
|
||||
<hr />
|
||||
|
||||
|
||||
<table width=600 cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
|
||||
<p>Hi <%=username%>,</p>
|
||||
<p>Now waiting for the moderator to start <strong><%=meetingID%></strong>.</p>
|
||||
<br />
|
||||
<p>(Your browser will automatically refresh and join the meeting
|
||||
when it starts.)</p>
|
||||
</td>
|
||||
<td width="50%"><img src="polling.gif"></img></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<%
|
||||
}
|
||||
} else if (request.getParameter("action").equals("invite")) {
|
||||
//
|
||||
// We have an invite to an active meeting. Ask the person for their name
|
||||
// so they can join.
|
||||
//
|
||||
String meetingID = request.getParameter("meetingID");
|
||||
%>
|
||||
|
||||
<hr />
|
||||
<h2>Invite</h2>
|
||||
<hr />
|
||||
|
||||
<FORM NAME="form3" METHOD="GET">
|
||||
|
||||
<table width=600 cellspacing="20" cellpadding="20"
|
||||
style="border-collapse: collapse; border-right-color: rgb(136, 136, 136);"
|
||||
border=3>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
|
||||
<p />You have been invited to join<br />
|
||||
<strong><%=meetingID%></strong>.
|
||||
</td>
|
||||
|
||||
<td width="50%">Enter your name: <input type="text"
|
||||
name="username" /> <br />
|
||||
<INPUT TYPE=hidden NAME=meetingID VALUE="<%=meetingID%>"> <INPUT
|
||||
TYPE=hidden NAME=action VALUE="enter"> <br />
|
||||
<input type="submit" value="Join" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</FORM>
|
||||
|
||||
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("join")) {
|
||||
//
|
||||
// We have an invite request to join an existing meeting and the meeting is running
|
||||
//
|
||||
// We don't need to pass a meeting descritpion as it's already been set by the first time
|
||||
// the meeting was created.
|
||||
String joinURL = getJoinURLViewer(request.getParameter("username"), request.getParameter("meetingID"));
|
||||
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p /><%=joinURL%>
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
<%@ include file="demo_footer.jsp"%>
|
||||
|
||||
</body>
|
||||
</html>
|
263
bbb-api-demo/src/main/webapp/demo6.jsp
Normal file
263
bbb-api-demo/src/main/webapp/demo6.jsp
Normal file
@ -0,0 +1,263 @@
|
||||
<!--
|
||||
|
||||
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 language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="heartbeat.js"></script>
|
||||
<title>Recording Meeting Demo</title>
|
||||
<style type="text/css">
|
||||
#formcreate{
|
||||
width:500px;
|
||||
height:500px;
|
||||
}
|
||||
#formcreate ul{
|
||||
list-style:none;
|
||||
}
|
||||
#formcreate li{
|
||||
display:block;
|
||||
width:400px;
|
||||
margin-bottom:5px;
|
||||
}
|
||||
#formcreate label{
|
||||
display:block;
|
||||
float:left;
|
||||
width:150px;
|
||||
text-align:right;
|
||||
}
|
||||
#labdescription{
|
||||
vertical-align:top;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
<%@ page import="java.util.regex.*"%>
|
||||
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<%
|
||||
if (request.getParameterMap().isEmpty()) {
|
||||
//
|
||||
// Assume we want to create a meeting
|
||||
//
|
||||
%>
|
||||
<h2>Demo Recording</h2>
|
||||
|
||||
<form id="formcreate" name="formcreate" method="get" action="">
|
||||
<fieldset>
|
||||
<legend>Meeting Information</legend>
|
||||
<ul>
|
||||
<li>
|
||||
<label for="confname">Meeting Name:</label>
|
||||
<input id="confname" name="confname" type="text" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="username1">Your Name:</label>
|
||||
<input id="username1" name="username1" type="text" />
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Metadata Details</legend>
|
||||
<ul>
|
||||
<li>
|
||||
<label for="meta_title">Title:</label>
|
||||
<input type="text" id="meta_title" name="meta_title" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="meta_subject">Subject:</label>
|
||||
<input type="text" id="meta_subject" name="meta_subject" />
|
||||
</li>
|
||||
<li>
|
||||
<label id="labdescription" for="meta_description">Description:</label>
|
||||
<textarea id="meta_description" name="meta_description" cols="17" rows="3"></textarea>
|
||||
</li>
|
||||
<li>
|
||||
<label for="meta_creator">Creator:</label>
|
||||
<input type="text" id="meta_creator" name="meta_creator" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="meta_contributor">Contributor:</label>
|
||||
<input type="text" id="meta_contributor" name="meta_contributor" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="meta_language">Language:</label>
|
||||
<input type="text" id="meta_language" name="meta_language" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="meta_identifier">Identifier:</label>
|
||||
<input type="text" id="meta_identifier" name="meta_identifier" />
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<input type="submit" value="Create" >
|
||||
<input type="hidden" name="action" value="create" />
|
||||
</form>
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("create")) {
|
||||
|
||||
String confname=request.getParameter("confname");
|
||||
String username = request.getParameter("username1");
|
||||
|
||||
//metadata
|
||||
Map<String,String> metadata=new HashMap<String,String>();
|
||||
|
||||
metadata.put("title",request.getParameter("meta_title"));
|
||||
metadata.put("subject",request.getParameter("meta_subject"));
|
||||
metadata.put("description",request.getParameter("meta_description"));
|
||||
metadata.put("creator",request.getParameter("meta_creator"));
|
||||
metadata.put("contributor",request.getParameter("meta_contributor"));
|
||||
metadata.put("language",request.getParameter("meta_language"));
|
||||
metadata.put("identifier",request.getParameter("meta_identifier"));
|
||||
|
||||
//
|
||||
// This is the URL for to join the meeting as moderator
|
||||
//
|
||||
String joinURL = getJoinURL(username, confname, "true", null, metadata);
|
||||
|
||||
|
||||
String inviteURL = BigBlueButtonURL + "demo/demo6.jsp?action=invite&confname=" + URLEncoder.encode(confname, "UTF-8");
|
||||
%>
|
||||
|
||||
|
||||
<h2>Session Created</h2>
|
||||
|
||||
<label style="display:block;">Use the following link to invite others:</label>
|
||||
<textarea cols="50" rows="6" style="overflow:hidden; display:block;" readonly="readonly">
|
||||
<%=inviteURL%>
|
||||
</textarea>
|
||||
|
||||
<a href="<%=joinURL%>">Start Session</a>
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("enter")) {
|
||||
//
|
||||
// The user is now attempting to joing the meeting
|
||||
//
|
||||
String confname = request.getParameter("confname");
|
||||
String username = request.getParameter("username");
|
||||
|
||||
String enterURL = BigBlueButtonURL
|
||||
+ "demo/demo6.jsp?action=join&username="
|
||||
+ URLEncoder.encode(username, "UTF-8") + "&confname="
|
||||
+ URLEncoder.encode(confname, "UTF-8");
|
||||
|
||||
if (isMeetingRunning(confname).equals("true")) {
|
||||
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
window.location = "<%=enterURL%>";
|
||||
</script>
|
||||
<%
|
||||
} else {
|
||||
|
||||
String checkMeetingStatus = getURLisMeetingRunning(confname);
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$.jheartbeat.set({
|
||||
url: "<%=checkMeetingStatus%>",
|
||||
delay: 5000
|
||||
}, function () {
|
||||
mycallback();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function mycallback() {
|
||||
// Not elegant, but works around a bug in IE8
|
||||
var isMeetingRunning = ($("#HeartBeatDIV").text().search("true") > 0 );
|
||||
|
||||
if (isMeetingRunning) {
|
||||
window.location = "<%=enterURL%>";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h2><%=confname%> has not yet started.</h2>
|
||||
<label style="display:block;">Hi <%=username%>, Now waiting for the moderator to start <%=confname%>.</label>
|
||||
<label style="display:block;">(Your browser will automatically refresh and join the meeting when it starts.)</label>
|
||||
|
||||
|
||||
<%
|
||||
}
|
||||
} else if (request.getParameter("action").equals("invite")) {
|
||||
|
||||
String meetingID = request.getParameter("confname");
|
||||
%>
|
||||
|
||||
<h2>Invite</h2>
|
||||
|
||||
<form name="inviteform" method="get" action="">
|
||||
|
||||
<label style="display:block; font-weight:bold;">You have been invited to join <%=meetingID%></label>
|
||||
<label for="username">Enter your name: </label>
|
||||
<input type="text" name="username" id="username" />
|
||||
<input type="hidden" name="confname" value="<%=meetingID%>" />
|
||||
<input type="hidden" name="action" value="enter" />
|
||||
<input type="submit" value="Join" />
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<%
|
||||
} else if (request.getParameter("action").equals("join")) {
|
||||
|
||||
String joinURL = getJoinURLViewer(request.getParameter("username"), request.getParameter("confname"));
|
||||
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p /><%=joinURL%>
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
<%@ include file="demo_footer.jsp"%>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,120 +1,120 @@
|
||||
<html>
|
||||
<head><title>Preupload Presentation</title></head></p> <p>
|
||||
<body>
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #5: Upload a presentation before joining a Course...</h2>
|
||||
<form action="demo5.jsp" method="post" enctype
|
||||
="multipart/form-data" name="form1" id="form1">
|
||||
<table cellpadding="5" cellspacing="5" style="width: 400px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: right;">Full Name:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td style="text-align: left"><input type="text"
|
||||
name="username" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: left">Upload File:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td style="text-align: left"><input type="file"
|
||||
name="filename" /><!-- <input type="submit" />-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="Join" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="java.util.Iterator" %>
|
||||
<%@ page import="java.io.File" %>
|
||||
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
|
||||
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
|
||||
<%@ page import="org.apache.commons.fileupload.*"%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@page import="sun.security.provider.SHA"%>
|
||||
<%@page import="org.apache.commons.codec.binary.Base64"%>
|
||||
<%@page import="java.security.MessageDigest"%>
|
||||
<%
|
||||
String uname="";
|
||||
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
|
||||
|
||||
if (!isMultipart) {
|
||||
}
|
||||
else {
|
||||
FileItemFactory factory = new DiskFileItemFactory();
|
||||
ServletFileUpload upload = new ServletFileUpload(factory);
|
||||
List<FileItem> items = null;
|
||||
try {
|
||||
items = upload.parseRequest(request);
|
||||
} catch (FileUploadException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
out.print(items.size());
|
||||
Iterator<FileItem> itr = items.iterator();
|
||||
while (itr.hasNext()) {
|
||||
FileItem item = (FileItem) itr.next();
|
||||
String xml = null;
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name='presentation'> <document url='http://www.samplepdf.com/sample.pdf' /> </module></modules>";
|
||||
if (item.isFormField())
|
||||
{
|
||||
String name = item.getFieldName();
|
||||
String value = item.getString();
|
||||
if(name.equals("username"))
|
||||
{
|
||||
uname=value;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
|
||||
String itemName = item.getName();
|
||||
|
||||
if(itemName==""){
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name='presentation'> <document url='http://www.samplepdf.com/sample.pdf' /> </module></modules>";
|
||||
}
|
||||
else {
|
||||
byte[] b = item.get();
|
||||
String encoded = Base64.encodeBase64String(b);
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name=\"presentation\"> <document name=\""+itemName+"\">"+encoded+"\"</document> </module></modules>";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
String joinURL = getJoinURLXML(uname, "Demo Meeting", "Presentation should be uploaded. It was uploaded as an encoded file", xml );
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
<center><h1>Your presentation has been Uploaded</h1></center>
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p />
|
||||
<%=joinURL %>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
<html>
|
||||
<head><title>Preupload Presentation</title></head></p> <p>
|
||||
<body>
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
|
||||
<h2>Demo #7: Upload a presentation before joining a Course...</h2>
|
||||
<form action="demo7.jsp" method="post" enctype
|
||||
="multipart/form-data" name="form1" id="form1">
|
||||
<table cellpadding="5" cellspacing="5" style="width: 400px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: right;">Full Name:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td style="text-align: left"><input type="text"
|
||||
name="username" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: left">Upload File:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td style="text-align: left"><input type="file"
|
||||
name="filename" /><!-- <input type="submit" />-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="Join" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="java.util.Iterator" %>
|
||||
<%@ page import="java.io.File" %>
|
||||
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
|
||||
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
|
||||
<%@ page import="org.apache.commons.fileupload.*"%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@page import="sun.security.provider.SHA"%>
|
||||
<%@page import="org.apache.commons.codec.binary.Base64"%>
|
||||
<%@page import="java.security.MessageDigest"%>
|
||||
<%
|
||||
String uname="";
|
||||
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
|
||||
|
||||
if (!isMultipart) {
|
||||
}
|
||||
else {
|
||||
FileItemFactory factory = new DiskFileItemFactory();
|
||||
ServletFileUpload upload = new ServletFileUpload(factory);
|
||||
List<FileItem> items = null;
|
||||
try {
|
||||
items = upload.parseRequest(request);
|
||||
} catch (FileUploadException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
out.print(items.size());
|
||||
Iterator<FileItem> itr = items.iterator();
|
||||
while (itr.hasNext()) {
|
||||
FileItem item = (FileItem) itr.next();
|
||||
String xml = null;
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name='presentation'> <document url='http://www.samplepdf.com/sample.pdf' /> </module></modules>";
|
||||
if (item.isFormField())
|
||||
{
|
||||
String name = item.getFieldName();
|
||||
String value = item.getString();
|
||||
if(name.equals("username"))
|
||||
{
|
||||
uname=value;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
|
||||
String itemName = item.getName();
|
||||
|
||||
if(itemName==""){
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name='presentation'> <document url='http://www.samplepdf.com/sample.pdf' /> </module></modules>";
|
||||
}
|
||||
else {
|
||||
byte[] b = item.get();
|
||||
String encoded = Base64.encodeBase64String(b);
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name=\"presentation\"> <document name=\""+itemName+"\">"+encoded+"\"</document> </module></modules>";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
String joinURL = getJoinURLXML(uname, "Demo Meeting", "Presentation should be uploaded. It was uploaded as an encoded file", xml );
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
<center><h1>Your presentation has been Uploaded</h1></center>
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p />
|
||||
<%=joinURL %>
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
@ -1,112 +1,112 @@
|
||||
<html>
|
||||
<head><title>Preupload Presentation</title></head></p> <p>
|
||||
<body>
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
<%
|
||||
String fileURL = BigBlueButtonURL.replace("/bigbluebutton",":8080/demo");
|
||||
String name1="Demo123.pdf";
|
||||
String name2="Demo456.pdf";
|
||||
String name3="Demo789.pdf";
|
||||
%>
|
||||
|
||||
<h2>Demo #6: Send a presentation URL before joining a Course...</h2>
|
||||
<form action="demo6.jsp" method="post" enctype
|
||||
="multipart/form-data" name="form1" id="form1">
|
||||
<table cellpadding="5" cellspacing="5" style="width: 400px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: right;">Full Name:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td style="text-align: left"><input type="text"
|
||||
name="username" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: right">File Name:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td><select name=filename>
|
||||
<option value=<%=name1%>><%=name1.substring(0,name1.length()-4)%></option>
|
||||
<option value=<%=name2%>><%=name2.substring(0,name2.length()-4)%></option>
|
||||
<option value=<%=name3%>><%=name3.substring(0,name3.length()-4)%></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="Join" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="java.util.Iterator" %>
|
||||
<%@ page import="java.io.File" %>
|
||||
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
|
||||
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
|
||||
<%@ page import="org.apache.commons.fileupload.*"%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@page import="sun.security.provider.SHA"%>
|
||||
<%@page import="org.apache.commons.codec.binary.Base64"%>
|
||||
<%@page import="java.security.MessageDigest"%>
|
||||
<%
|
||||
|
||||
String uname="";
|
||||
String fname="";
|
||||
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
|
||||
|
||||
if (!isMultipart) {
|
||||
}
|
||||
else {
|
||||
FileItemFactory factory = new DiskFileItemFactory();
|
||||
ServletFileUpload upload = new ServletFileUpload(factory);
|
||||
List<FileItem> items = null;
|
||||
try {
|
||||
items = upload.parseRequest(request);
|
||||
} catch (FileUploadException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Iterator<FileItem> itr = items.iterator();
|
||||
String xml = null;
|
||||
while (itr.hasNext()) {
|
||||
FileItem item = (FileItem) itr.next();
|
||||
String name = item.getFieldName();
|
||||
String value = item.getString();
|
||||
if(name.equals("username")) {
|
||||
uname=value;
|
||||
}
|
||||
if(name.equals("filename")) {
|
||||
fname=value;
|
||||
}
|
||||
}
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name='presentation'> <document url='"+fileURL+fname+"' /> </module></modules>";
|
||||
String joinURL = getJoinURLXML(uname, "Demo Meeting", "Presentation URL should be passed.", xml );
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
<center><h1>Your presentation URL has been passed</h1></center>
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p />
|
||||
<%=joinURL %>
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
<html>
|
||||
<head><title>Preupload Presentation</title></head></p> <p>
|
||||
<body>
|
||||
<%@ include file="bbb_api.jsp"%>
|
||||
<%@ include file="demo_header.jsp"%>
|
||||
<%
|
||||
String fileURL = BigBlueButtonURL.replace("/bigbluebutton",":8080/demo");
|
||||
String name1="Demo123.pdf";
|
||||
String name2="Demo456.pdf";
|
||||
String name3="Demo789.pdf";
|
||||
%>
|
||||
|
||||
<h2>Demo #8: Send a presentation URL before joining a Course...</h2>
|
||||
<form action="demo8.jsp" method="post" enctype
|
||||
="multipart/form-data" name="form1" id="form1">
|
||||
<table cellpadding="5" cellspacing="5" style="width: 400px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: right;">Full Name:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td style="text-align: left"><input type="text"
|
||||
name="username" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td style="text-align: right">File Name:</td>
|
||||
<td style="width: 5px;"> </td>
|
||||
<td><select name=filename>
|
||||
<option value=<%=name1%>><%=name1.substring(0,name1.length()-4)%></option>
|
||||
<option value=<%=name2%>><%=name2.substring(0,name2.length()-4)%></option>
|
||||
<option value=<%=name3%>><%=name3.substring(0,name3.length()-4)%></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="Join" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<INPUT TYPE=hidden NAME=action VALUE="create">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="java.util.Iterator" %>
|
||||
<%@ page import="java.io.File" %>
|
||||
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
|
||||
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
|
||||
<%@ page import="org.apache.commons.fileupload.*"%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@page import="sun.security.provider.SHA"%>
|
||||
<%@page import="org.apache.commons.codec.binary.Base64"%>
|
||||
<%@page import="java.security.MessageDigest"%>
|
||||
<%
|
||||
|
||||
String uname="";
|
||||
String fname="";
|
||||
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
|
||||
|
||||
if (!isMultipart) {
|
||||
}
|
||||
else {
|
||||
FileItemFactory factory = new DiskFileItemFactory();
|
||||
ServletFileUpload upload = new ServletFileUpload(factory);
|
||||
List<FileItem> items = null;
|
||||
try {
|
||||
items = upload.parseRequest(request);
|
||||
} catch (FileUploadException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Iterator<FileItem> itr = items.iterator();
|
||||
String xml = null;
|
||||
while (itr.hasNext()) {
|
||||
FileItem item = (FileItem) itr.next();
|
||||
String name = item.getFieldName();
|
||||
String value = item.getString();
|
||||
if(name.equals("username")) {
|
||||
uname=value;
|
||||
}
|
||||
if(name.equals("filename")) {
|
||||
fname=value;
|
||||
}
|
||||
}
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?> <modules> <module name='presentation'> <document url='"+fileURL+fname+"' /> </module></modules>";
|
||||
String joinURL = getJoinURLXML(uname, "Demo Meeting", "Presentation URL should be passed.", xml );
|
||||
if (joinURL.startsWith("http://")) {
|
||||
%>
|
||||
<center><h1>Your presentation URL has been passed</h1></center>
|
||||
<script language="javascript" type="text/javascript">
|
||||
window.location.href="<%=joinURL%>";
|
||||
</script>
|
||||
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
Error: getJoinURL() failed
|
||||
<p />
|
||||
<%=joinURL %>
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
2
bbb-api-demo/src/main/webapp/demo_footer.jsp
Executable file
2
bbb-api-demo/src/main/webapp/demo_footer.jsp
Executable file
@ -0,0 +1,2 @@
|
||||
<p/>
|
||||
<small>These demos use the <a href="http://code.google.com/p/bigbluebutton/wiki/API">BigBlueButton API</a>. The source code for these demos is available <a href="http://github.com/bigbluebutton/bigbluebutton/tree/master/bigbluebutton-web/web-app/demo/"> here</a>.</small>
|
10
bbb-api-demo/src/main/webapp/demo_header.jsp
Executable file
10
bbb-api-demo/src/main/webapp/demo_header.jsp
Executable file
@ -0,0 +1,10 @@
|
||||
<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 Course (password required)</a> |
|
||||
<a href="demo4.jsp">Activity Monitor</a> |
|
||||
<a href="create.jsp">Create Your Own Meeting</a> |
|
||||
<a href="demo6.jsp">Record Meeting</a> |
|
||||
<a href="demo7.jsp">Auto Upload File</a> |
|
||||
<a href="demo8.jsp">Auto Upload File URL</a>
|
||||
|
128
bbb-api-demo/src/main/webapp/error.jsp
Executable file
128
bbb-api-demo/src/main/webapp/error.jsp
Executable file
@ -0,0 +1,128 @@
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
|
||||
<%@ page isErrorPage="true" %>
|
||||
<%@ page language="java" %>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
||||
Object statusCode = request.getAttribute("javax.servlet.error.status_code");
|
||||
Object exceptionType = request.getAttribute("javax.servlet.error.exception_type");
|
||||
Object message = request.getAttribute("javax.servlet.error.message");
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Error Page</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF">
|
||||
<P><A href="<%=response.encodeURL(request.getContextPath()) %>">Home</A></P>
|
||||
<hr>
|
||||
<H2>An Error has occured:</H2>
|
||||
|
||||
<TABLE CELLPADDING="2" CELLSPACING="2" BORDER="1" WIDTH="100%">
|
||||
<TR>
|
||||
<TD WIDTH="20%"><B>Status Code</B></TD>
|
||||
<TD WIDTH="80%"><%= statusCode %></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="20%"><B>Exception Type</B></TD>
|
||||
<TD WIDTH="80%"><%= exceptionType %></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="20%"><B>Message</B></TD>
|
||||
<TD WIDTH="80%"><%= message %></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="20%"><B>Exception</B></TD>
|
||||
<TD WIDTH="80%">
|
||||
<%
|
||||
if( exception != null )
|
||||
{
|
||||
out.print("<PRE>");
|
||||
exception.printStackTrace(new PrintWriter(out));
|
||||
out.print("</PRE>");
|
||||
}
|
||||
%>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD WIDTH="20%"><B>Root Cause</B></TD>
|
||||
<TD>
|
||||
<%
|
||||
if( (exception != null) && (exception instanceof ServletException) )
|
||||
{
|
||||
Throwable cause = ((ServletException)exception).getRootCause();
|
||||
if( cause != null )
|
||||
{
|
||||
out.print("<PRE>");
|
||||
cause.printStackTrace(new PrintWriter(out));
|
||||
out.print("</PRE>");
|
||||
}
|
||||
}
|
||||
%>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<hr>
|
||||
Header List
|
||||
<table border=3>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Value</td>
|
||||
</tr>
|
||||
<%
|
||||
String name = "";
|
||||
String value = "";
|
||||
|
||||
java.util.Enumeration headers = request.getHeaderNames();
|
||||
while(headers.hasMoreElements())
|
||||
{
|
||||
name = (String) headers.nextElement();
|
||||
value = request.getHeader(name);
|
||||
%>
|
||||
<tr>
|
||||
<td><%=name%></td>
|
||||
<td><%=value%></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</table>
|
||||
|
||||
Attribute List
|
||||
<!-- "javax.servlet.jsp.jspException" for getting an Exception -->
|
||||
<table border=3>
|
||||
<%
|
||||
java.util.Enumeration attributes = request.getAttributeNames();
|
||||
while(attributes.hasMoreElements())
|
||||
{
|
||||
name = (String) attributes.nextElement();
|
||||
|
||||
if (request.getAttribute(name) == null)
|
||||
{
|
||||
value = "null";
|
||||
}
|
||||
else
|
||||
{
|
||||
value = request.getAttribute(name).toString();
|
||||
}
|
||||
%>
|
||||
<tr>
|
||||
<td><%=name%></td>
|
||||
<td><%=value%></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -2,6 +2,7 @@ bbb.logout.usercommand = আপনি বৈঠক থেকে লগ আউট
|
||||
bbb.settings.flash.command = নতুনতম ফ্ল্যাশ ইনস্টল করুন
|
||||
bbb.oldlocalewindow.reminder2 = দয়া করে আপনার ব্রাউজারের ক্যাশ পরিষ্কার করুন এবং পুনরায় চেষ্টা করুন।
|
||||
bbb.presentation.maxUploadFileExceededAlert = ত্রুটি: ফাইলের আকৃতি সর্বোচ্চ অনুমোদিত আকৃতির চেয়ে বৃহত্তর।
|
||||
bbb.logout.invalidapp = Red5 অ্যাপ্লিকেশনের অস্তিত্ব নেই
|
||||
bbb.fileupload.title = উপস্হাপন আপলোড করুন
|
||||
bbb.chat.publicMsgAwaiting2 = * জনগণ বার্তা অপেক্ষা করছে *
|
||||
bbb.viewers.viewersGrid.roleItemRenderer = ভূমিকা
|
||||
@ -36,6 +37,7 @@ bbb.mainToolbar.helpBtn = সাহায্য
|
||||
bbb.fileupload.showBtn = দেখান
|
||||
bbb.fileupload.fileLbl = ফাইল:
|
||||
bbb.listenerItem.talkImg.toolTip = কথা বলছে
|
||||
bbb.settings.warning.label = সতর্কবাণী
|
||||
bbb.mainshell.copyrightLabel2 = (c) 2011, BigBlueButton build {0} - আরও বেশি তথ্যের জন্য দেখুন http://www.bigbluebutton.org/.
|
||||
bbb.presentation.uploadwindow.powerpoint = POWERPOINT
|
||||
bbb.toolbar.video.toolTip = আমার ক্যামেরা শেয়ার করুন
|
||||
@ -70,6 +72,7 @@ bbb.presentation.uploaded = আপলোড হয়েছে।
|
||||
bbb.mainshell.logBtn.toolTip = লগ উইন্ডোটি খুলুন
|
||||
bbb.desktopPublish.stop.tooltip = স্ক্রীন শেয়ার বন্ধ করুন
|
||||
bbb.presentation.uploadwindow.excel = EXCEL
|
||||
bbb.settings.voice.volume = মাইক্রোফোন সক্রিয়তা
|
||||
bbb.logout.unknown = আপনার গ্রাহক সার্ভারের সঙ্গে সংযোগ হারিয়েছে
|
||||
bbb.presentation.slideNumLbl.toolTip = স্লাইড নির্বাচন করতে ক্লিক করুন
|
||||
bbb.settings.flash.text = আপনার ফ্ল্যাশ {0} ইনস্টল, কিন্তু সঠিকভাবে BigBlueButton চালানোর জন্য আপনার অন্তত {1} সংস্করণ প্রয়োজন।
|
||||
|
Loading…
Reference in New Issue
Block a user