2013-04-04 05:41:02 +08:00
|
|
|
<!--
|
|
|
|
|
|
|
|
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: Jesus Federico <jesus@123it.ca>
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
<%@ 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>Record (Matterhorn)</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"%>
|
|
|
|
<%@ include file="demo_header.jsp"%>
|
|
|
|
|
|
|
|
<%
|
|
|
|
if (request.getParameterMap().isEmpty()) {
|
2013-04-18 07:57:32 +08:00
|
|
|
//
|
2013-04-04 23:43:26 +08:00
|
|
|
// Assume we want to create a meeting
|
|
|
|
//
|
2013-04-04 05:41:02 +08:00
|
|
|
%>
|
2013-04-04 23:43:26 +08:00
|
|
|
<h2>Customized sessions using a dynamic config.xml</h2>
|
|
|
|
|
|
|
|
<form id="formcreate" name="formcreate" method="get" action="">
|
2013-04-04 05:41:02 +08:00
|
|
|
<fieldset>
|
2013-04-18 07:57:32 +08:00
|
|
|
<legend>Demo Meeting</legend>
|
2013-04-04 05:41:02 +08:00
|
|
|
<ul>
|
2013-04-04 23:43:26 +08:00
|
|
|
<li>
|
|
|
|
<label for="username1">Your Name:</label>
|
|
|
|
<input id="username1" required name="username1" type="text" />
|
2013-04-04 05:41:02 +08:00
|
|
|
</li>
|
2013-04-04 23:43:26 +08:00
|
|
|
</ul>
|
|
|
|
</fieldset>
|
2013-04-17 05:40:25 +08:00
|
|
|
|
2013-04-04 23:43:26 +08:00
|
|
|
<fieldset>
|
2013-04-18 07:57:32 +08:00
|
|
|
<legend>config.xml (client configuration)</legend>
|
2013-04-17 05:40:25 +08:00
|
|
|
|
|
|
|
<label for="skin">Skin:</label>
|
|
|
|
<select id="skin" name="Skin">
|
|
|
|
<option value="BBBDefault">Default</option>
|
|
|
|
<option value="BBBBlack">Black</option>
|
|
|
|
</select><br><br>
|
|
|
|
|
|
|
|
|
|
|
|
<label for="layout" >Layout:</label>
|
|
|
|
<select id="layout" name="Layout">
|
2015-01-09 03:29:27 +08:00
|
|
|
<option value="bbb.layout.name.defaultlayout" selected="selected">Default</option>
|
2015-01-09 03:31:51 +08:00
|
|
|
<option value="bbb.layout.name.videochat">Video Chat</option>
|
2015-01-09 03:29:27 +08:00
|
|
|
<option value="bbb.layout.name.webcamsfocus">Meeting</option>
|
|
|
|
<option value="bbb.layout.name.presentfocus">Webinar</option>
|
2013-04-17 05:40:25 +08:00
|
|
|
</select><br><br>
|
|
|
|
|
|
|
|
<label for="videomodule">Auto start webcam:</label>
|
|
|
|
<select id="videomodule" name="VideoModule">
|
|
|
|
<option value="false">No</option>
|
|
|
|
<option value="true">Yes</option>
|
|
|
|
<option value="disable">Disable</option>
|
|
|
|
</select><br><br>
|
|
|
|
|
|
|
|
<label for="autostartaudio">Auto start audio:</label>
|
|
|
|
<select id="autostartaudio" name="PhoneModule">
|
|
|
|
<option value="true">Yes</option>
|
|
|
|
<option value="false">No</option>
|
|
|
|
<option value="disable">Disable</option>
|
|
|
|
</select><br><br>
|
|
|
|
|
|
|
|
<label for="languagebutton">Show language button:</label>
|
|
|
|
<select id="languagebutton" name="LanguageButton">
|
|
|
|
<option value="true">Yes</option>
|
|
|
|
<option value="false">No</option>
|
|
|
|
</select><br><br>
|
|
|
|
|
|
|
|
<label for="helpbutton">Show help button:</label>
|
|
|
|
<select id="helpbutton" name="HelpButton">
|
|
|
|
<option value="true">Yes</option>
|
|
|
|
<option value="false">No</option>
|
|
|
|
</select><br><br>
|
|
|
|
|
|
|
|
<label for="helplurl">Help URL:</label>
|
|
|
|
<input type="text" id="helpurl" name="HelpUrl" value="http://<%= getBigBlueButtonIP() %>/help.html"/>
|
|
|
|
|
2013-04-04 05:41:02 +08:00
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
<input type="submit" value="Create" >
|
|
|
|
<input type="hidden" name="action" value="create" />
|
2013-04-04 23:43:26 +08:00
|
|
|
</form>
|
|
|
|
|
2013-04-04 05:41:02 +08:00
|
|
|
<%
|
|
|
|
} else if (request.getParameter("action").equals("create")) {
|
2013-04-17 05:40:25 +08:00
|
|
|
String confname = "Demo Meeting";
|
2013-04-04 05:41:02 +08:00
|
|
|
String username = request.getParameter("username1");
|
2013-04-17 05:40:25 +08:00
|
|
|
|
|
|
|
Document doc = null;
|
|
|
|
try {
|
2013-05-13 09:04:53 +08:00
|
|
|
doc = parseXml( getDefaultConfigXML() );
|
2013-04-17 05:40:25 +08:00
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get request parameters to edit config.xml
|
|
|
|
|
|
|
|
String param_Skin = request.getParameter("Skin");
|
|
|
|
String param_Layout = request.getParameter("Layout");
|
|
|
|
String param_VideoModule = request.getParameter("VideoModule");
|
|
|
|
String param_PhoneModule = request.getParameter("PhoneModule");
|
|
|
|
String param_LanguageButton = request.getParameter("LanguageButton");
|
|
|
|
String param_HelpButton = request.getParameter("HelpButton");
|
|
|
|
String param_HelpUrl = request.getParameter("HelpUrl");
|
|
|
|
|
|
|
|
|
|
|
|
Node firstChild = doc.getFirstChild();
|
|
|
|
|
|
|
|
//Set skin
|
|
|
|
Element skinElement = (Element) doc.getElementsByTagName("skinning").item(0);
|
2016-02-29 02:59:45 +08:00
|
|
|
skinElement.setAttribute("url", "https://" + getBigBlueButtonIP() + "/client/branding/css/" + param_Skin + ".css.swf" );
|
2013-04-17 05:40:25 +08:00
|
|
|
|
|
|
|
//Set layout
|
|
|
|
Element layoutElement = (Element) doc.getElementsByTagName("layout").item(0);
|
|
|
|
layoutElement.setAttribute("defaultLayout", param_Layout );
|
|
|
|
|
|
|
|
//Set auto start webcam
|
|
|
|
Element webcamElement = getElementWithAttribute(firstChild, "name", "VideoconfModule");
|
|
|
|
if(param_VideoModule.equals("disable")){
|
|
|
|
webcamElement.getParentNode().removeChild(webcamElement);
|
2015-10-05 12:52:42 +08:00
|
|
|
//This is not returning null, removing the next 2 lines fixes the issue with demo12.jsp
|
|
|
|
//Element videodockModule = getElementWithAttribute(firstChild, "name", "VideodockModule");
|
|
|
|
//videodockModule.getParentNode().removeChild(videodockModule);
|
2013-04-17 05:40:25 +08:00
|
|
|
}else{
|
|
|
|
webcamElement.setAttribute("autoStart", param_VideoModule);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Set auto join audio or disable it
|
|
|
|
Element audioElement = getElementWithAttribute(firstChild, "name", "PhoneModule");
|
|
|
|
if (param_PhoneModule.equals("disable")){
|
|
|
|
audioElement.getParentNode().removeChild(audioElement);
|
|
|
|
}else{
|
|
|
|
audioElement.setAttribute("autoJoin", param_PhoneModule);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Set language button
|
|
|
|
Element languageElement = (Element) doc.getElementsByTagName("language").item(0);
|
|
|
|
languageElement.setAttribute("userSelectionEnabled", param_LanguageButton);
|
|
|
|
|
|
|
|
//Set help button. It is in the layout element
|
|
|
|
layoutElement.setAttribute("showHelpButton", param_HelpButton );
|
|
|
|
|
|
|
|
//Set help url
|
|
|
|
Element helpElement = (Element) doc.getElementsByTagName("help").item(0);
|
|
|
|
String helpUrl = helpElement.getAttribute("url");
|
|
|
|
|
|
|
|
//Create new config.xml
|
|
|
|
TransformerFactory tf = TransformerFactory.newInstance();
|
|
|
|
Transformer transformer = tf.newTransformer();
|
|
|
|
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
|
|
|
|
StringWriter writer = new StringWriter();
|
|
|
|
transformer.transform(new DOMSource(doc), new StreamResult(writer));
|
|
|
|
String configXML = writer.getBuffer().toString().replaceAll("\n|\r", "");
|
|
|
|
|
2013-04-04 05:41:02 +08:00
|
|
|
//
|
|
|
|
// This is the URL for to join the meeting as moderator
|
|
|
|
//
|
|
|
|
String url = BigBlueButtonURL.replace("bigbluebutton/","demo/");
|
|
|
|
String joinURL = getJoinURLwithDynamicConfigXML(username, confname, configXML);
|
|
|
|
|
2016-02-29 02:59:45 +08:00
|
|
|
if (joinURL.startsWith("https://") || joinURL.startsWith("https://")) {
|
2013-04-04 05:41:02 +08:00
|
|
|
%>
|
2013-04-04 23:43:26 +08:00
|
|
|
<h2>Customized sessions using a dynamic config.xml, submit</h2>
|
2013-04-04 05:41:02 +08:00
|
|
|
|
2013-04-04 23:43:26 +08:00
|
|
|
<script language="javascript" type="text/javascript">
|
2013-04-06 00:07:00 +08:00
|
|
|
window.location.href="<%=joinURL%>";
|
2013-04-04 23:43:26 +08:00
|
|
|
</script>
|
2013-04-04 05:41:02 +08:00
|
|
|
|
|
|
|
<%
|
2013-04-04 23:43:26 +08:00
|
|
|
} else {
|
2013-04-04 05:41:02 +08:00
|
|
|
%>
|
2013-04-04 23:43:26 +08:00
|
|
|
<p>Error: <br>
|
|
|
|
getJoinURL() failed
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<%=joinURL %>
|
|
|
|
</p>
|
|
|
|
|
2013-04-04 05:41:02 +08:00
|
|
|
<%
|
2013-04-04 23:43:26 +08:00
|
|
|
}
|
|
|
|
}
|
2013-04-04 05:41:02 +08:00
|
|
|
%>
|
|
|
|
|
|
|
|
|
|
|
|
<%@ include file="demo_footer.jsp"%>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|