Got demo3.jsp working with spaces in usernames

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3165 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Fred Dixon 2009-12-30 22:53:57 +00:00
parent e9fc475dc8
commit 689624afdd
4 changed files with 24 additions and 24 deletions

View File

@ -22,7 +22,7 @@ Author: Fred Dixon <ffdixon@bigbluebutton.org>
<%@ page
import="java.util.*,java.io.*,java.net.*,javax.crypto.*,javax.xml.parsers.*,org.w3c.dom.Document,org.xml.sax.*"
errorPage="/error.jsp" %>
errorPage="error.jsp" %>
<%@ page import="org.apache.commons.codec.digest.*"%>

View File

@ -26,7 +26,7 @@ Author: Fred Dixon <ffdixon@bigbluebutton.org>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<title>BigBlueButton API Demos</title>
</head>
<body>
@ -43,7 +43,7 @@ if (request.getParameterMap().isEmpty()) {
%>
<hr />
<h2>Demo #1: Join the Demo Meeting</h2>
<h2>Demo #1: Join the Demo Meeting.</h2>
<hr />
<FORM NAME="form1" METHOD="GET">
@ -82,9 +82,8 @@ Join: Demo Meeting
// Got an action=create
//
String username = request.getParameter("username");
String username = URLEncoder.encode(request.getParameter("username"),"UTF-8");
String meetingID = URLEncoder.encode("Demo Meeting","UTF-8");
out.println( "<p>Joining Demo Meeting ..." );
String joinURL = getJoinURL(username, meetingID);
%>

View File

@ -26,7 +26,7 @@ Author: Fred Dixon <ffdixon@bigbluebutton.org>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<title>BigBlueButton API Demos</title>
</head>
<body>
@ -44,7 +44,7 @@ if (request.getParameterMap().isEmpty()) {
%>
<hr />
<h2>Demo #2: Join a Selected Meeting</h2>
<h2>Demo #2: Join a Selected Meeting.</h2>
<hr />
<FORM NAME="form1" METHOD="GET">
@ -55,7 +55,7 @@ if (request.getParameterMap().isEmpty()) {
<td width="50%">
Enter your name: <input type="text"
name="name" /> <br />
name="username" /> <br />
<p/>
@ -88,10 +88,10 @@ Join:&nbsp;<select name="meetingID">
// Got an action=create
//
String name = request.getParameter("name");
String username = URLEncoder.encode(request.getParameter("username"),"UTF-8");
String meetingID = URLEncoder.encode(request.getParameter("meetingID"),"UTF-8");
String joinURL = getJoinURL(name, meetingID);
String joinURL = getJoinURL(username, meetingID);
%>

View File

@ -39,7 +39,7 @@ Author: Fred Dixon <ffdixon@bigbluebutton.org>
<%@ include file="bbb_api.jsp"%>
<%@ include file="demo_header.jsp"%>
<%@ page import="java.util.regex.*" errorPage="/error.jsp"%>
<%@ page import="java.util.regex.*" %>
<br>
@ -51,7 +51,7 @@ if (request.getParameterMap().isEmpty()) {
%>
<hr />
<h2>Demo #3: Create a You Own Meeting.1</h2>
<h2>Demo #3: Create a You Own Meeting.2.</h2>
<hr />
<p />
@ -84,11 +84,11 @@ if (request.getParameterMap().isEmpty()) {
//
String username = request.getParameter("username");
String meetingID = URLEncoder.encode(username+"xxxmeeting","UTF-8");
String meetingID = URLEncoder.encode(username+"'s meeting","UTF-8");
String meetingToken = "";
String joinURL = getJoinURL(username, meetingID);
String joinURL = getJoinURL(URLEncoder.encode(username,"UTF-8"), meetingID);
String p = "meetingToken=[^&]*";
Pattern pattern =
@ -108,7 +108,7 @@ if (request.getParameterMap().isEmpty()) {
%>
<hr />
<h2><%=username %>'s meeting has been created.</h2>
<h2>Created: <%=username %>'s meeting.</h2>
<hr />
@ -122,12 +122,12 @@ if (request.getParameterMap().isEmpty()) {
created.</center>
</td>
<td width="50%">Click (or book mark) the following link to join:
<td width="50%">Click (or bookmark) the following link to join:
<p />
<center><a href="<%=joinURL%>">Join</a> <a
href="<%=inviteURL%>">Invite</a></center>
<center><a href="<%=joinURL%>">Join</a> </center>
<p />&nbsp;
<p />To invite others, send them the following link:
<p />To invite others, send them the following <a
href="<%=inviteURL%>">link</a>:
<form name="empty" method="POST"><textarea cols="60" rows="5"
name="myname" style="overflow: hidden">
<%=inviteURL%>
@ -149,14 +149,15 @@ if (request.getParameterMap().isEmpty()) {
String meetingID = request.getParameter("meetingID");
String username = request.getParameter("username");
String meetingToken = request.getParameter("meetingToken");
String enterURL = BigBlueButtonURL+"demo/demo3.jsp?action=join&username="+username+"&meetingID="+meetingID+"&"+meetingToken;
out.println( "MeetingID: #"+meetingID+"#");
String enterURL = BigBlueButtonURL+"demo/demo3.jsp?action=join&username="+URLEncoder.encode(username,"UTF-8")+"&meetingID="+URLEncoder.encode(meetingID,"UTF-8");
//out.print( "meetingID: # 1 #" + meetingID +"#" );
//out.print( "meetingToken: ##" + meetingToken +"#" );
// out.print( "meetingRunning: ## ##" + isMeetingRunning( meetingToken, meetingID ) + "## #");
//out.print( "meetingRunning: ##" + getURLisMeetingRunning(meetingToken, meetingID ));
// String hard = "http://192.168.0.154/bigbluebutton/api/isMeetingRunning?meetingToken=34e57723-2529-4e33-b4ba-3626d2941bdb&meetingID=asfsdxxxmeeting&checksum=aea313057ef4cc9b32913c8c257381b47fde86ca";
if ( isMeetingRunning( meetingToken, meetingID ).equals("true") ) {
if ( isMeetingRunning( meetingToken, URLEncoder.encode(meetingID,"UTF-8")).equals("true") ) {
//
// The meeting is running so let's join now
//
@ -169,7 +170,7 @@ if (request.getParameterMap().isEmpty()) {
//
// The meeting has not yet started, so let's poll every five seconds until the meeting begins
//
String checkMeetingStatus = getURLisMeetingRunning(meetingToken, meetingID );
String checkMeetingStatus = getURLisMeetingRunning(meetingToken, URLEncoder.encode(meetingID,"UTF-8") );
%>
@ -272,7 +273,7 @@ function mycallback() {
//
// We have an invite request to join an existing meeting and the meeting is running
//
String username = request.getParameter("username");
String username = URLEncoder.encode(request.getParameter("username"),"UTF-8");
String meetingID = URLEncoder.encode(request.getParameter("meetingID"),"UTF-8");
String joinURL = getJoinURL(username, meetingID);
%>