%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
%>
Record (Matterhorn)
<%@ include file="bbb_api.jsp"%>
<%@ include file="demo_header.jsp"%>
<%
if (request.getParameterMap().isEmpty()) {
//
// Assume we want to create a meeting
//
%>
Customized sessions using a dynamic config.xml
<%
} else if (request.getParameter("action").equals("create")) {
String confname = "Demo Meeting";
String username = request.getParameter("username1");
Document doc = null;
try {
doc = parseXml( getDefaultConfigXML() );
} 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);
skinElement.setAttribute("url", "http://" + getBigBlueButtonIP() + "/client/branding/css/" + param_Skin + ".css.swf" );
//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);
Element videodockModule = getElementWithAttribute(firstChild, "name", "VideodockModule");
videodockModule.getParentNode().removeChild(videodockModule);
}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", "");
//
// This is the URL for to join the meeting as moderator
//
String url = BigBlueButtonURL.replace("bigbluebutton/","demo/");
String joinURL = getJoinURLwithDynamicConfigXML(username, confname, configXML);
if (joinURL.startsWith("http://")) {
%>
Customized sessions using a dynamic config.xml, submit
<%
} else {
%>
Error:
getJoinURL() failed
<%=joinURL %>
<%
}
}
%>
<%@ include file="demo_footer.jsp"%>