Author: solomax
Date: Tue Dec 15 18:09:47 2015
New Revision: 1720210

URL: http://svn.apache.org/viewvc?rev=1720210&view=rev
Log:
[OPENMEETINGS-1267] screen-sharing rtmp url match the url of main app 

Modified:
    
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
    
openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
    
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
    
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
    
openmeetings/application/branches/3.1.x/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
    
openmeetings/application/branches/3.1.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
    
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
    
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
    
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/webapp/WEB-INF/web.xml
    
openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
    
openmeetings/application/trunk/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
    
openmeetings/application/trunk/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
    
openmeetings/application/trunk/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
    
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
    
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
    
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
    
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/web.xml

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
 Tue Dec 15 18:09:47 2015
@@ -97,7 +97,7 @@
     
        <method name="checkForApplyScreen" args="record">
                //TODO check if host is required for rtmps
-               ExternalInterface.call("startSharing", canvas.publicSID, 
canvas.thishib.getProtocol(), canvas.thishib.getPort());
+               ExternalInterface.call("startSharing", canvas.publicSID, 
canvas.thishib.getUrl());
        </method>  
     
     <labelText name="_roomName" fgcolor="0xFFFFFF" y="4" fontstyle="bold" 
fontsize="12" /> 

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 Tue Dec 15 18:09:47 2015
@@ -31,8 +31,6 @@ import static org.apache.openmeetings.ut
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANDING_ZONE;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANG_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LDAP_ID;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FRONTEND_REGISTER_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IGNORE_BAD_SSL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_LOGIN_MIN_LENGTH_KEY;
@@ -413,8 +411,6 @@ public class ImportInitvalues {
 
                cfgDao.add(CONFIG_REDIRECT_URL_FOR_EXTERNAL_KEY, "", null,
                                "Users entered the room via invitationHash or 
secureHash will be redirected to this URL on connection lost");
-               cfgDao.add(CONFIG_FLASH_PROTOCOL, "rtmp", null, "Protocol for 
flash connections, can be rtmp, rtmpt, rtmpe, rtmps");
-               cfgDao.add(CONFIG_FLASH_PORT, "1935", null, "Port for flash 
connections");
                cfgDao.add(CONFIG_CALENDAR_FIRST_DAY, "0", null, "The day that 
each week begins. The value must be a number that represents the day of the 
week. Sunday=0, Monday=1, Tuesday=2, etc.");
                
                log.debug("Configurations ADDED");

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
 Tue Dec 15 18:09:47 2015
@@ -37,6 +37,7 @@ import java.awt.datatransfer.StringSelec
 import java.awt.datatransfer.Transferable;
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
+import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -114,21 +115,23 @@ public class CoreScreenShare implements
                                log.debug("arg: " + arg);
                        }
                        String[] textArray = null;
-                       if (args.length > 12) {
-                               protocol = Protocol.valueOf(args[0]);
-                               host = args[1];
-                               port = Integer.parseInt(args[2]);
-                               app = args[3];
-                               userId = Long.parseLong(args[4]);
-                               publishName = args[5];
-                               String labelTexts = args[6];
-                               defaultQuality = Integer.parseInt(args[7]);
-                               defaultFPS = Integer.parseInt(args[8]);
-                               showFPS = bool(args[9]);
-                               allowRemote = bool(args[10]);
+                       if (args.length > 9) {
+                               String _url = args[0];
+                               URI url = new URI(_url);
+                               protocol = Protocol.valueOf(url.getScheme());
+                               host = url.getHost();
+                               port = url.getPort();
+                               app = url.getPath();
+                               userId = Long.parseLong(args[1]);
+                               publishName = args[2];
+                               String labelTexts = args[3];
+                               defaultQuality = Integer.parseInt(args[4]);
+                               defaultFPS = Integer.parseInt(args[5]);
+                               showFPS = bool(args[6]);
+                               allowRemote = bool(args[7]);
                                remoteEnabled = allowRemote;
-                               allowRecording = bool(args[11]);
-                               allowPublishing = bool(args[12]);
+                               allowRecording = bool(args[8]);
+                               allowPublishing = bool(args[9]);
 
                                if (labelTexts.length() > 0) {
                                        textArray = labelTexts.split(";");
@@ -150,8 +153,8 @@ public class CoreScreenShare implements
                                                break;
                                        case rtmps:
                                                RTMPSScreenShare client = new 
RTMPSScreenShare(this);
-                                               
client.setKeystoreBytes(Hex.decodeHex(args[13].toCharArray()));
-                                               
client.setKeyStorePassword(args[14]);
+                                               
client.setKeystoreBytes(Hex.decodeHex(args[10].toCharArray()));
+                                               
client.setKeyStorePassword(args[11]);
                                                instance = client;
                                                break;
                                        case rtmpe:

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
 Tue Dec 15 18:09:47 2015
@@ -36,10 +36,7 @@
                $dependencies
        </resources>
        <application-desc main-class='$mainClass'>
-               <argument>$protocol</argument>
-               <argument>$host</argument>
-               <argument>$port</argument>
-               <argument>$app</argument>
+               <argument>$url</argument>
                <argument>$userId</argument>
                <argument>$publicSid</argument>
                <argument>$labels</argument>

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
 Tue Dec 15 18:09:47 2015
@@ -296,18 +296,6 @@
                                        <td> The day that each week begins. The 
value must be a number that represents the day of the week. Sunday=0, Monday=1, 
Tuesday=2, etc. </td>
                                        <td> 3.0.4 </td>
                                </tr>
-                               <tr>
-                                       <td> flash.protocol </td>
-                                       <td> rtmp </td>
-                                       <td> Protocol for flash connections, 
can be rtmp, rtmpt, rtmpe, rtmps. <b>(will be used in case passed protocol is 
invalid)</b> </td>
-                                       <td> 3.1.0 </td>
-                               </tr>
-                               <tr>
-                                       <td> flash.port </td>
-                                       <td> 1935 </td>
-                                       <td> Port for flash connections. 
<b>(will be used in case passed port is invalid)</b> </td>
-                                       <td> 3.1.0 </td>
-                               </tr>
                        </table>
                </section>
 

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 Tue Dec 15 18:09:47 2015
@@ -38,8 +38,6 @@ public class OpenmeetingsVariables {
        public static final String CONFIG_APPOINTMENT_REMINDER_MINUTES = 
"number.minutes.reminder.send";
        public static final String CONFIG_APPLICATION_NAME = "application.name";
        public static final String CONFIG_APPLICATION_BASE_URL = 
"application.base.url";
-       public static final String CONFIG_FLASH_PROTOCOL = "flash.protocol";
-       public static final String CONFIG_FLASH_PORT = "flash.port";
        public static final String CONFIG_SCREENSHARING_QUALITY = 
"default.quality.screensharing";
        public static final String CONFIG_SCREENSHARING_FPS = 
"default.fps.screensharing";
        public static final String CONFIG_SCREENSHARING_FPS_SHOW = 
"screensharing.fps.show";

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 Tue Dec 15 18:09:47 2015
@@ -70,8 +70,7 @@ public class RoomPanel extends BasePanel
        private static final long serialVersionUID = 1L;
        private static final String WICKET_ROOM_ID = "wicketroomid";
        public static final String PARAM_PUBLIC_SID = "publicSid";
-       public static final String PARAM_PROTOCOL = "protocol";
-       public static final String PARAM_PORT = "port";
+       public static final String PARAM_URL = "url";
        private static final Logger log = 
Red5LoggerFactory.getLogger(RoomPanel.class, webAppRootKey);
        private final InvitationDialog invite;
        private final CreatePollDialog createPoll;
@@ -245,7 +244,7 @@ public class RoomPanel extends BasePanel
                                @Override
                                public void renderHead(Component component, 
IHeaderResponse response) {
                                        super.renderHead(component, response);
-                                       response.render(new 
PriorityHeaderItem(JavaScriptHeaderItem.forScript(getNamedFunction("startSharing",
 this, explicit(PARAM_PUBLIC_SID), explicit(PARAM_PROTOCOL), 
explicit(PARAM_PORT)), "startSharing")));
+                                       response.render(new 
PriorityHeaderItem(JavaScriptHeaderItem.forScript(getNamedFunction("startSharing",
 this, explicit(PARAM_PUBLIC_SID), explicit(PARAM_URL)), "startSharing")));
                                }
                        });
                }

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
 Tue Dec 15 18:09:47 2015
@@ -18,8 +18,6 @@
  */
 package org.apache.openmeetings.web.room;
 
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_ALLOW_REMOTE;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS_SHOW;
@@ -29,15 +27,14 @@ import static org.apache.openmeetings.we
 import static org.apache.openmeetings.web.app.WebSession.getLanguage;
 import static org.apache.openmeetings.web.app.WebSession.getUserId;
 import static org.apache.openmeetings.web.room.RoomBroadcaster.getClient;
-import static org.apache.openmeetings.web.room.RoomPanel.PARAM_PORT;
-import static org.apache.openmeetings.web.room.RoomPanel.PARAM_PROTOCOL;
 import static org.apache.openmeetings.web.room.RoomPanel.PARAM_PUBLIC_SID;
+import static org.apache.openmeetings.web.room.RoomPanel.PARAM_URL;
 import static org.apache.openmeetings.web.util.CallbackFunctionHelper.getParam;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
-import java.net.URL;
+import java.net.URI;
 import java.util.Properties;
 
 import org.apache.commons.codec.binary.Hex;
@@ -95,28 +92,21 @@ public class StartSharingEventBehavior e
                        ConfigurationDao cfgDao = 
getBean(ConfigurationDao.class);
                        app = IOUtils.toString(jnlp, "UTF-8");
                        String baseUrl = cfgDao.getBaseUrl();
-                       URL url = new URL(baseUrl);
+                       String _url = getParam(getComponent(), 
PARAM_URL).toString();
+                       URI url = new URI(_url);
                        Room room = getBean(RoomDao.class).get(roomId);
                        String publicSid = getParam(getComponent(), 
PARAM_PUBLIC_SID).toString();
                        Client rc = getClient(publicSid);
                        SessionManager sessionManager = 
getBean(SessionManager.class);
                        String path = url.getPath();
-                       path = path.substring(1, path.indexOf('/', 2) + 1);
-                       String port = getParam(getComponent(), 
PARAM_PORT).toString();
-                       if (Strings.isEmpty(port)) {
-                               cfgDao.getConfValue(CONFIG_FLASH_PORT, 
String.class, "");
+                       path = path.substring(path.lastIndexOf('/') + 1);
+                       if (Strings.isEmpty(path) || rc.getRoomId() == null || 
!path.equals(rc.getRoomId().toString()) || !rc.getRoomId().equals(roomId)) {
+                               throw new 
RuntimeException(String.format("Invalid room id passed %s, expected, %s", path, 
roomId));
                        }
-                       String _protocol = getParam(getComponent(), 
PARAM_PROTOCOL).toString();
-                       if (Strings.isEmpty(_protocol)) {
-                               _protocol = 
cfgDao.getConfValue(CONFIG_FLASH_PROTOCOL, String.class, "");
-                       }
-                       Protocol protocol = Protocol.valueOf(_protocol);
-                       app = addKeystore(app).replace("$codebase", baseUrl + 
"screenshare")
+                       Protocol protocol = Protocol.valueOf(url.getScheme());
+                       app = addKeystore(app, protocol).replace("$codebase", 
baseUrl + "screenshare")
                                        .replace("$applicationName", 
cfgDao.getAppName())
-                                       .replace("$protocol", protocol.name())
-                                       .replace("$port", port)
-                                       .replace("$host", url.getHost())
-                                       .replace("$app", path + roomId)
+                                       .replace("$url", _url)
                                        .replace("$userId", "" + getUserId())
                                        .replace("$publicSid", publicSid)
                                        .replace("$labels", "<![CDATA[" + 
getLabels(730,  731,  732,  733,  734
@@ -155,40 +145,42 @@ public class StartSharingEventBehavior e
                return result.toString();
        }
        
-       private String addKeystore(String app) {
+       private String addKeystore(String app, Protocol protocol) {
                log.debug("RTMP Sharer Keystore :: start");
                String keystore = "--dummy--", password = "--dummy--";
-               File conf = new File(OmFileHelper.getRootDir(), "conf");
-               File keyStore = new File(conf, "keystore.screen");
-               if (keyStore.exists()) {
-                       try (FileInputStream fis = new 
FileInputStream(keyStore); FileInputStream ris = new FileInputStream(new 
File(conf, "red5.properties"))) {
-                               Properties red5Props = new Properties();
-                               red5Props.load(ris);
-                               
-                               byte keyBytes[] = new 
byte[(int)keyStore.length()];
-                               fis.read(keyBytes);
-                               
-                               keystore = Hex.encodeHexString(keyBytes);
-                               password = 
red5Props.getProperty("rtmps.screen.keystorepass");
-                               
-                               /*
-                               KeyStore ksIn = 
KeyStore.getInstance(KeyStore.getDefaultType());
-                               ksIn.load(new FileInputStream(keyStore), 
red5Props.getProperty("rtmps.keystorepass").toCharArray());
-                               ByteArrayInputStream bin = new 
ByteArrayInputStream()
-                               
-                               byte fileContent[] = new 
byte[(int)file.length()];
-                               sb = addArgument(sb, Object arg)
-                               ctx.put("$KEYSTORE", users_id);
-                               /*
-                               KeyStore ksOut = 
KeyStore.getInstance(KeyStore.getDefaultType());
-                               for (Certificate cert : 
ksIn.getCertificateChain("red5")) {
-                                       PublicKey pub = cert.getPublicKey();
-                                       TrustedCertificateEntry tce = new 
TrustedCertificateEntry(cert);
-                                       tce.
+               if (Protocol.rtmps == protocol) {
+                       File conf = new File(OmFileHelper.getRootDir(), "conf");
+                       File keyStore = new File(conf, "keystore.screen");
+                       if (keyStore.exists()) {
+                               try (FileInputStream fis = new 
FileInputStream(keyStore); FileInputStream ris = new FileInputStream(new 
File(conf, "red5.properties"))) {
+                                       Properties red5Props = new Properties();
+                                       red5Props.load(ris);
+                                       
+                                       byte keyBytes[] = new 
byte[(int)keyStore.length()];
+                                       fis.read(keyBytes);
+                                       
+                                       keystore = 
Hex.encodeHexString(keyBytes);
+                                       password = 
red5Props.getProperty("rtmps.screen.keystorepass");
+                                       
+                                       /*
+                                       KeyStore ksIn = 
KeyStore.getInstance(KeyStore.getDefaultType());
+                                       ksIn.load(new 
FileInputStream(keyStore), 
red5Props.getProperty("rtmps.keystorepass").toCharArray());
+                                       ByteArrayInputStream bin = new 
ByteArrayInputStream()
+                                       
+                                       byte fileContent[] = new 
byte[(int)file.length()];
+                                       sb = addArgument(sb, Object arg)
+                                       ctx.put("$KEYSTORE", users_id);
+                                       /*
+                                       KeyStore ksOut = 
KeyStore.getInstance(KeyStore.getDefaultType());
+                                       for (Certificate cert : 
ksIn.getCertificateChain("red5")) {
+                                               PublicKey pub = 
cert.getPublicKey();
+                                               TrustedCertificateEntry tce = 
new TrustedCertificateEntry(cert);
+                                               tce.
+                                       }
+                                       */
+                               } catch (Exception e) {
+                                       //no op
                                }
-                               */
-                       } catch (Exception e) {
-                       //no op
                        }
                }
                return app.replace("$keystore", keystore).replace("$password", 
password);

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-web/src/main/webapp/WEB-INF/web.xml?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/webapp/WEB-INF/web.xml
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-web/src/main/webapp/WEB-INF/web.xml
 Tue Dec 15 18:09:47 2015
@@ -18,22 +18,17 @@
   under the License.
   
 -->
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee";
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";>
-    <context-param>
-        <param-name>globalScope</param-name>
-        <param-value>default</param-value>
-    </context-param>
-    
-    <!-- Custom logging like described in Paul Gregoire Patch: 
-    http://gregoire.org/2008/09/18/logging-work-around/
-    THIS WILL NOT WORK for us as we can hardly rewrite all logging statements 
of hibernate
-    
-    -->
-    <listener>
-        
<listener-class>org.apache.openmeetings.util.OMContextListener</listener-class>
-    </listener>
-    
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";>
+       <context-param>
+               <param-name>globalScope</param-name>
+               <param-value>default</param-value>
+       </context-param>
+       
+       <listener>
+               
<listener-class>org.apache.openmeetings.util.OMContextListener</listener-class>
+       </listener>
+       
        <servlet>
                <servlet-name>CXFServlet</servlet-name>
                
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
@@ -48,16 +43,16 @@
                <url-pattern>/services/*</url-pattern>
        </servlet-mapping>
        
-    <filter>
-        <filter-name>LoggerContextFilter</filter-name>
-        <filter-class>org.red5.logging.LoggerContextFilter</filter-class>
-    </filter>
-    
-    <filter-mapping>
-        <filter-name>LoggerContextFilter</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>   
-    
+       <filter>
+               <filter-name>LoggerContextFilter</filter-name>
+               
<filter-class>org.red5.logging.LoggerContextFilter</filter-class>
+       </filter>
+       
+       <filter-mapping>
+               <filter-name>LoggerContextFilter</filter-name>
+               <url-pattern>/*</url-pattern>
+       </filter-mapping>   
+       
        <filter>
                <filter-name>OpenmeetingsApplication</filter-name>
                
<filter-class>org.apache.wicket.protocol.ws.javax.JavaxWebSocketFilter</filter-class>
@@ -79,74 +74,74 @@
                <url-pattern>/*</url-pattern>
        </filter-mapping>
 
-    <context-param>
-        <param-name>contextConfigLocation</param-name>
-        <param-value>/WEB-INF/red5-*.xml</param-value>
-    </context-param>
-    <context-param>
-        <param-name>locatorFactorySelector</param-name>
-        <param-value>red5.xml</param-value>
-    </context-param>
-    <context-param>
-        <param-name>parentContextKey</param-name>
-        <param-value>default.context</param-value>
-    </context-param>
-    
-    <!-- remove the following servlet tags if you want to disable remoting for 
this application -->
+       <context-param>
+               <param-name>contextConfigLocation</param-name>
+               <param-value>/WEB-INF/red5-*.xml</param-value>
+       </context-param>
+       <context-param>
+               <param-name>locatorFactorySelector</param-name>
+               <param-value>red5.xml</param-value>
+       </context-param>
+       <context-param>
+               <param-name>parentContextKey</param-name>
+               <param-value>default.context</param-value>
+       </context-param>
+       
+       <!-- remove the following servlet tags if you want to disable remoting 
for this application -->
        <servlet>
                <servlet-name>spring-mvc</servlet-name>
                
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        </servlet>
-    <servlet>
-        <servlet-name>gateway</servlet-name>
-        
<servlet-class>org.red5.server.net.servlet.AMFGatewayServlet</servlet-class>
-    </servlet>
-    <servlet>
-        <servlet-name>DownloadHandler</servlet-name>
-        
<servlet-class>org.apache.openmeetings.core.servlet.outputhandler.DownloadHandler</servlet-class>
-    </servlet>
-    <servlet>
-        <servlet-name>ExportToImage</servlet-name>
-        
<servlet-class>org.apache.openmeetings.core.servlet.outputhandler.ExportToImage</servlet-class>
-    </servlet>
+       <servlet>
+               <servlet-name>gateway</servlet-name>
+               
<servlet-class>org.red5.server.net.servlet.AMFGatewayServlet</servlet-class>
+       </servlet>
+       <servlet>
+               <servlet-name>DownloadHandler</servlet-name>
+               
<servlet-class>org.apache.openmeetings.core.servlet.outputhandler.DownloadHandler</servlet-class>
+       </servlet>
+       <servlet>
+               <servlet-name>ExportToImage</servlet-name>
+               
<servlet-class>org.apache.openmeetings.core.servlet.outputhandler.ExportToImage</servlet-class>
+       </servlet>
        
        <servlet-mapping>
                <servlet-name>spring-mvc</servlet-name>
                <url-pattern>*.upload</url-pattern>
        </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>DownloadHandler</servlet-name>
-        <url-pattern>/DownloadHandler</url-pattern>
-    </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>ExportToImage</servlet-name>
-        <url-pattern>/ExportToImage</url-pattern>
-    </servlet-mapping>
-    <mime-mapping>
-        <extension>inc</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-     
-    <security-constraint>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/streams/*</url-pattern>
-        </web-resource-collection>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/conf/*</url-pattern>
-        </web-resource-collection>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/upload/*</url-pattern>
-        </web-resource-collection>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/uploadtemp/*</url-pattern>
-        </web-resource-collection>
-        <auth-constraint/>
-    </security-constraint>
-    <login-config>
-        <auth-method>BASIC</auth-method>
-    </login-config>
+       <servlet-mapping>
+               <servlet-name>DownloadHandler</servlet-name>
+               <url-pattern>/DownloadHandler</url-pattern>
+       </servlet-mapping>
+       <servlet-mapping>
+               <servlet-name>ExportToImage</servlet-name>
+               <url-pattern>/ExportToImage</url-pattern>
+       </servlet-mapping>
+       <mime-mapping>
+               <extension>inc</extension>
+               <mime-type>text/plain</mime-type>
+       </mime-mapping>
+       
+       <security-constraint>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/streams/*</url-pattern>
+               </web-resource-collection>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/conf/*</url-pattern>
+               </web-resource-collection>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/upload/*</url-pattern>
+               </web-resource-collection>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/uploadtemp/*</url-pattern>
+               </web-resource-collection>
+               <auth-constraint/>
+       </security-constraint>
+       <login-config>
+               <auth-method>BASIC</auth-method>
+       </login-config>
 </web-app>

Modified: 
openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 Tue Dec 15 18:09:47 2015
@@ -31,8 +31,6 @@ import static org.apache.openmeetings.ut
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANDING_ZONE;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANG_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LDAP_ID;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FRONTEND_REGISTER_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IGNORE_BAD_SSL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_LOGIN_MIN_LENGTH_KEY;
@@ -413,8 +411,6 @@ public class ImportInitvalues {
 
                cfgDao.add(CONFIG_REDIRECT_URL_FOR_EXTERNAL_KEY, "", null,
                                "Users entered the room via invitationHash or 
secureHash will be redirected to this URL on connection lost");
-               cfgDao.add(CONFIG_FLASH_PROTOCOL, "rtmp", null, "Protocol for 
flash connections, can be rtmp, rtmpt, rtmpe, rtmps");
-               cfgDao.add(CONFIG_FLASH_PORT, "1935", null, "Port for flash 
connections");
                cfgDao.add(CONFIG_CALENDAR_FIRST_DAY, "0", null, "The day that 
each week begins. The value must be a number that represents the day of the 
week. Sunday=0, Monday=1, Tuesday=2, etc.");
                
                log.debug("Configurations ADDED");

Modified: 
openmeetings/application/trunk/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
 Tue Dec 15 18:09:47 2015
@@ -37,6 +37,7 @@ import java.awt.datatransfer.StringSelec
 import java.awt.datatransfer.Transferable;
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
+import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -114,21 +115,23 @@ public class CoreScreenShare implements
                                log.debug("arg: " + arg);
                        }
                        String[] textArray = null;
-                       if (args.length > 12) {
-                               protocol = Protocol.valueOf(args[0]);
-                               host = args[1];
-                               port = Integer.parseInt(args[2]);
-                               app = args[3];
-                               userId = Long.parseLong(args[4]);
-                               publishName = args[5];
-                               String labelTexts = args[6];
-                               defaultQuality = Integer.parseInt(args[7]);
-                               defaultFPS = Integer.parseInt(args[8]);
-                               showFPS = bool(args[9]);
-                               allowRemote = bool(args[10]);
+                       if (args.length > 9) {
+                               String _url = args[0];
+                               URI url = new URI(_url);
+                               protocol = Protocol.valueOf(url.getScheme());
+                               host = url.getHost();
+                               port = url.getPort();
+                               app = url.getPath();
+                               userId = Long.parseLong(args[1]);
+                               publishName = args[2];
+                               String labelTexts = args[3];
+                               defaultQuality = Integer.parseInt(args[4]);
+                               defaultFPS = Integer.parseInt(args[5]);
+                               showFPS = bool(args[6]);
+                               allowRemote = bool(args[7]);
                                remoteEnabled = allowRemote;
-                               allowRecording = bool(args[11]);
-                               allowPublishing = bool(args[12]);
+                               allowRecording = bool(args[8]);
+                               allowPublishing = bool(args[9]);
 
                                if (labelTexts.length() > 0) {
                                        textArray = labelTexts.split(";");
@@ -150,8 +153,8 @@ public class CoreScreenShare implements
                                                break;
                                        case rtmps:
                                                RTMPSScreenShare client = new 
RTMPSScreenShare(this);
-                                               
client.setKeystoreBytes(Hex.decodeHex(args[13].toCharArray()));
-                                               
client.setKeyStorePassword(args[14]);
+                                               
client.setKeystoreBytes(Hex.decodeHex(args[10].toCharArray()));
+                                               
client.setKeyStorePassword(args[11]);
                                                instance = client;
                                                break;
                                        case rtmpe:

Modified: 
openmeetings/application/trunk/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
 (original)
+++ 
openmeetings/application/trunk/openmeetings-screenshare/src/main/jnlp/templates/template.jnlp
 Tue Dec 15 18:09:47 2015
@@ -36,10 +36,7 @@
                $dependencies
        </resources>
        <application-desc main-class='$mainClass'>
-               <argument>$protocol</argument>
-               <argument>$host</argument>
-               <argument>$port</argument>
-               <argument>$app</argument>
+               <argument>$url</argument>
                <argument>$userId</argument>
                <argument>$publicSid</argument>
                <argument>$labels</argument>

Modified: 
openmeetings/application/trunk/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
 (original)
+++ 
openmeetings/application/trunk/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
 Tue Dec 15 18:09:47 2015
@@ -296,18 +296,6 @@
                                        <td> The day that each week begins. The 
value must be a number that represents the day of the week. Sunday=0, Monday=1, 
Tuesday=2, etc. </td>
                                        <td> 3.0.4 </td>
                                </tr>
-                               <tr>
-                                       <td> flash.protocol </td>
-                                       <td> rtmp </td>
-                                       <td> Protocol for flash connections, 
can be rtmp, rtmpt, rtmpe, rtmps. <b>(will be used in case passed protocol is 
invalid)</b> </td>
-                                       <td> 3.1.0 </td>
-                               </tr>
-                               <tr>
-                                       <td> flash.port </td>
-                                       <td> 1935 </td>
-                                       <td> Port for flash connections. 
<b>(will be used in case passed port is invalid)</b> </td>
-                                       <td> 3.1.0 </td>
-                               </tr>
                        </table>
                </section>
 

Modified: 
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 Tue Dec 15 18:09:47 2015
@@ -38,8 +38,6 @@ public class OpenmeetingsVariables {
        public static final String CONFIG_APPOINTMENT_REMINDER_MINUTES = 
"number.minutes.reminder.send";
        public static final String CONFIG_APPLICATION_NAME = "application.name";
        public static final String CONFIG_APPLICATION_BASE_URL = 
"application.base.url";
-       public static final String CONFIG_FLASH_PROTOCOL = "flash.protocol";
-       public static final String CONFIG_FLASH_PORT = "flash.port";
        public static final String CONFIG_SCREENSHARING_QUALITY = 
"default.quality.screensharing";
        public static final String CONFIG_SCREENSHARING_FPS = 
"default.fps.screensharing";
        public static final String CONFIG_SCREENSHARING_FPS_SHOW = 
"screensharing.fps.show";

Modified: 
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 Tue Dec 15 18:09:47 2015
@@ -19,8 +19,6 @@
 package org.apache.openmeetings.web.room;
 
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_BASE_URL;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_REDIRECT_URL_FOR_EXTERNAL_KEY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 import static org.apache.openmeetings.web.app.Application.addUserToRoom;
@@ -147,9 +145,9 @@ public class RoomPanel extends BasePanel
                                                .put("audioOnly", 
r.isAudioOnly())
                                                .put("SID", WebSession.getSid())
                                                .put("interview", 
Room.Type.interview == r.getType())
-                                               .put("protocol", 
cfgDao.getConfValue(CONFIG_FLASH_PROTOCOL, String.class, ""))
+                                               //.put("protocol", 
cfgDao.getConfValue(CONFIG_FLASH_PROTOCOL, String.class, ""))
                                                .put("host", url.getHost())
-                                               .put("port", 
cfgDao.getConfValue(CONFIG_FLASH_PORT, String.class, ""))
+                                               //.put("port", 
cfgDao.getConfValue(CONFIG_FLASH_PORT, String.class, ""))
                                                .put("app", path + roomId)
                                                .put("labels", 
getStringLabels(448, 449, 450, 451, 758, 447, 52, 53, 1429, 1430, 775, 452, 
767, 764, 765, 918, 54, 761, 762))
                                                .toString()

Modified: 
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
 Tue Dec 15 18:09:47 2015
@@ -18,8 +18,6 @@
  */
 package org.apache.openmeetings.web.room;
 
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
-import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_ALLOW_REMOTE;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS_SHOW;
@@ -33,7 +31,7 @@ import static org.apache.openmeetings.we
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
-import java.net.URL;
+import java.net.URI;
 import java.util.Properties;
 
 import org.apache.commons.codec.binary.Hex;
@@ -57,8 +55,7 @@ public class StartSharingEventBehavior e
        private static final long serialVersionUID = 1L;
        private static final Logger log = 
Red5LoggerFactory.getLogger(StartSharingEventBehavior.class, webAppRootKey);
        public static final String PARAM_PUBLIC_SID = "publicSid";
-       public static final String PARAM_PROTOCOL = "protocol";
-       public static final String PARAM_PORT = "port";
+       public static final String PARAM_URL = "url";
        private final AjaxDownload download;
        private final long roomId;
        private enum Protocol {
@@ -94,28 +91,21 @@ public class StartSharingEventBehavior e
                        ConfigurationDao cfgDao = 
getBean(ConfigurationDao.class);
                        app = IOUtils.toString(jnlp, "UTF-8");
                        String baseUrl = cfgDao.getBaseUrl();
-                       URL url = new URL(baseUrl);
+                       String _url = getParam(getComponent(), 
PARAM_URL).toString();
+                       URI url = new URI(_url);
                        Room room = getBean(RoomDao.class).get(roomId);
                        String publicSid = getParam(getComponent(), 
PARAM_PUBLIC_SID).toString();
                        SessionManager sessionManager = 
getBean(SessionManager.class);
                        Client rc = 
sessionManager.getClientByPublicSID(publicSid, null);//TODO not necessary
                        String path = url.getPath();
-                       path = path.substring(1, path.indexOf('/', 2) + 1);
-                       String port = getParam(getComponent(), 
PARAM_PORT).toString();
-                       if (Strings.isEmpty(port)) {
-                               cfgDao.getConfValue(CONFIG_FLASH_PORT, 
String.class, "");
+                       path = path.substring(path.lastIndexOf('/') + 1);
+                       if (Strings.isEmpty(path) || rc.getRoomId() == null || 
!path.equals(rc.getRoomId().toString()) || !rc.getRoomId().equals(roomId)) {
+                               throw new 
RuntimeException(String.format("Invalid room id passed %s, expected, %s", path, 
roomId));
                        }
-                       String _protocol = getParam(getComponent(), 
PARAM_PROTOCOL).toString();
-                       if (Strings.isEmpty(_protocol)) {
-                               _protocol = 
cfgDao.getConfValue(CONFIG_FLASH_PROTOCOL, String.class, "");
-                       }
-                       Protocol protocol = Protocol.valueOf(_protocol);
-                       app = addKeystore(app).replace("$codebase", baseUrl + 
"screenshare")
+                       Protocol protocol = Protocol.valueOf(url.getScheme());
+                       app = addKeystore(app, protocol).replace("$codebase", 
baseUrl + "screenshare")
                                        .replace("$applicationName", 
cfgDao.getAppName())
-                                       .replace("$protocol", protocol.name())
-                                       .replace("$port", port)
-                                       .replace("$host", url.getHost())
-                                       .replace("$app", path + roomId)
+                                       .replace("$url", _url)
                                        .replace("$userId", "" + getUserId())
                                        .replace("$publicSid", publicSid)
                                        .replace("$labels", "<![CDATA[" + 
getLabels(730,  731,  732,  733,  734
@@ -154,40 +144,42 @@ public class StartSharingEventBehavior e
                return result.toString();
        }
        
-       private String addKeystore(String app) {
+       private String addKeystore(String app, Protocol protocol) {
                log.debug("RTMP Sharer Keystore :: start");
                String keystore = "--dummy--", password = "--dummy--";
-               File conf = new File(OmFileHelper.getRootDir(), "conf");
-               File keyStore = new File(conf, "keystore.screen");
-               if (keyStore.exists()) {
-                       try (FileInputStream fis = new 
FileInputStream(keyStore); FileInputStream ris = new FileInputStream(new 
File(conf, "red5.properties"))) {
-                               Properties red5Props = new Properties();
-                               red5Props.load(ris);
-                               
-                               byte keyBytes[] = new 
byte[(int)keyStore.length()];
-                               fis.read(keyBytes);
-                               
-                               keystore = Hex.encodeHexString(keyBytes);
-                               password = 
red5Props.getProperty("rtmps.screen.keystorepass");
-                               
-                               /*
-                               KeyStore ksIn = 
KeyStore.getInstance(KeyStore.getDefaultType());
-                               ksIn.load(new FileInputStream(keyStore), 
red5Props.getProperty("rtmps.keystorepass").toCharArray());
-                               ByteArrayInputStream bin = new 
ByteArrayInputStream()
-                               
-                               byte fileContent[] = new 
byte[(int)file.length()];
-                               sb = addArgument(sb, Object arg)
-                               ctx.put("$KEYSTORE", users_id);
-                               /*
-                               KeyStore ksOut = 
KeyStore.getInstance(KeyStore.getDefaultType());
-                               for (Certificate cert : 
ksIn.getCertificateChain("red5")) {
-                                       PublicKey pub = cert.getPublicKey();
-                                       TrustedCertificateEntry tce = new 
TrustedCertificateEntry(cert);
-                                       tce.
+               if (Protocol.rtmps == protocol) {
+                       File conf = new File(OmFileHelper.getRootDir(), "conf");
+                       File keyStore = new File(conf, "keystore.screen");
+                       if (keyStore.exists()) {
+                               try (FileInputStream fis = new 
FileInputStream(keyStore); FileInputStream ris = new FileInputStream(new 
File(conf, "red5.properties"))) {
+                                       Properties red5Props = new Properties();
+                                       red5Props.load(ris);
+                                       
+                                       byte keyBytes[] = new 
byte[(int)keyStore.length()];
+                                       fis.read(keyBytes);
+                                       
+                                       keystore = 
Hex.encodeHexString(keyBytes);
+                                       password = 
red5Props.getProperty("rtmps.screen.keystorepass");
+                                       
+                                       /*
+                                       KeyStore ksIn = 
KeyStore.getInstance(KeyStore.getDefaultType());
+                                       ksIn.load(new 
FileInputStream(keyStore), 
red5Props.getProperty("rtmps.keystorepass").toCharArray());
+                                       ByteArrayInputStream bin = new 
ByteArrayInputStream()
+                                       
+                                       byte fileContent[] = new 
byte[(int)file.length()];
+                                       sb = addArgument(sb, Object arg)
+                                       ctx.put("$KEYSTORE", users_id);
+                                       /*
+                                       KeyStore ksOut = 
KeyStore.getInstance(KeyStore.getDefaultType());
+                                       for (Certificate cert : 
ksIn.getCertificateChain("red5")) {
+                                               PublicKey pub = 
cert.getPublicKey();
+                                               TrustedCertificateEntry tce = 
new TrustedCertificateEntry(cert);
+                                               tce.
+                                       }
+                                       */
+                               } catch (Exception e) {
+                                       //no op
                                }
-                               */
-                       } catch (Exception e) {
-                       //no op
                        }
                }
                return app.replace("$keystore", keystore).replace("$password", 
password);

Modified: 
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/web.xml?rev=1720210&r1=1720209&r2=1720210&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/web.xml 
(original)
+++ 
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/web.xml 
Tue Dec 15 18:09:47 2015
@@ -18,22 +18,17 @@
   under the License.
   
 -->
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee";
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";>
-    <context-param>
-        <param-name>globalScope</param-name>
-        <param-value>default</param-value>
-    </context-param>
-    
-    <!-- Custom logging like described in Paul Gregoire Patch: 
-    http://gregoire.org/2008/09/18/logging-work-around/
-    THIS WILL NOT WORK for us as we can hardly rewrite all logging statements 
of hibernate
-    
-    -->
-    <listener>
-        
<listener-class>org.apache.openmeetings.util.OMContextListener</listener-class>
-    </listener>
-    
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";>
+       <context-param>
+               <param-name>globalScope</param-name>
+               <param-value>default</param-value>
+       </context-param>
+       
+       <listener>
+               
<listener-class>org.apache.openmeetings.util.OMContextListener</listener-class>
+       </listener>
+       
        <servlet>
                <servlet-name>CXFServlet</servlet-name>
                
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
@@ -48,16 +43,16 @@
                <url-pattern>/services/*</url-pattern>
        </servlet-mapping>
        
-    <filter>
-        <filter-name>LoggerContextFilter</filter-name>
-        <filter-class>org.red5.logging.LoggerContextFilter</filter-class>
-    </filter>
-    
-    <filter-mapping>
-        <filter-name>LoggerContextFilter</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>   
-    
+       <filter>
+               <filter-name>LoggerContextFilter</filter-name>
+               
<filter-class>org.red5.logging.LoggerContextFilter</filter-class>
+       </filter>
+       
+       <filter-mapping>
+               <filter-name>LoggerContextFilter</filter-name>
+               <url-pattern>/*</url-pattern>
+       </filter-mapping>   
+       
        <filter>
                <filter-name>OpenmeetingsApplication</filter-name>
                
<filter-class>org.apache.wicket.protocol.ws.javax.JavaxWebSocketFilter</filter-class>
@@ -79,66 +74,66 @@
                <url-pattern>/*</url-pattern>
        </filter-mapping>
 
-    <context-param>
-        <param-name>contextConfigLocation</param-name>
-        <param-value>/WEB-INF/red5-*.xml</param-value>
-    </context-param>
-    <context-param>
-        <param-name>locatorFactorySelector</param-name>
-        <param-value>red5.xml</param-value>
-    </context-param>
-    <context-param>
-        <param-name>parentContextKey</param-name>
-        <param-value>default.context</param-value>
-    </context-param>
-    
-    <!-- remove the following servlet tags if you want to disable remoting for 
this application -->
+       <context-param>
+               <param-name>contextConfigLocation</param-name>
+               <param-value>/WEB-INF/red5-*.xml</param-value>
+       </context-param>
+       <context-param>
+               <param-name>locatorFactorySelector</param-name>
+               <param-value>red5.xml</param-value>
+       </context-param>
+       <context-param>
+               <param-name>parentContextKey</param-name>
+               <param-value>default.context</param-value>
+       </context-param>
+       
+       <!-- remove the following servlet tags if you want to disable remoting 
for this application -->
        <servlet>
                <servlet-name>spring-mvc</servlet-name>
                
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        </servlet>
-    <servlet>
-        <servlet-name>gateway</servlet-name>
-        
<servlet-class>org.red5.server.net.servlet.AMFGatewayServlet</servlet-class>
-    </servlet>
-    <servlet>
-        <servlet-name>ExportToImage</servlet-name>
-        
<servlet-class>org.apache.openmeetings.core.servlet.outputhandler.ExportToImage</servlet-class>
-    </servlet>
+       <servlet>
+               <servlet-name>gateway</servlet-name>
+               
<servlet-class>org.red5.server.net.servlet.AMFGatewayServlet</servlet-class>
+       </servlet>
+       <servlet>
+               <servlet-name>ExportToImage</servlet-name>
+               
<servlet-class>org.apache.openmeetings.core.servlet.outputhandler.ExportToImage</servlet-class>
+       </servlet>
        
        <servlet-mapping>
                <servlet-name>spring-mvc</servlet-name>
                <url-pattern>*.upload</url-pattern>
        </servlet-mapping>
-    <servlet-mapping>
-        <servlet-name>ExportToImage</servlet-name>
-        <url-pattern>/ExportToImage</url-pattern>
-    </servlet-mapping>
-    <mime-mapping>
-        <extension>inc</extension>
-        <mime-type>text/plain</mime-type>
-    </mime-mapping>
-     
-    <security-constraint>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/streams/*</url-pattern>
-        </web-resource-collection>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/conf/*</url-pattern>
-        </web-resource-collection>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/upload/*</url-pattern>
-        </web-resource-collection>
-        <web-resource-collection>
-            <web-resource-name>Forbidden</web-resource-name>
-            <url-pattern>/uploadtemp/*</url-pattern>
-        </web-resource-collection>
-        <auth-constraint/>
-    </security-constraint>
-    <login-config>
-        <auth-method>BASIC</auth-method>
-    </login-config>
+       <servlet-mapping>
+               <servlet-name>ExportToImage</servlet-name>
+               <url-pattern>/ExportToImage</url-pattern>
+       </servlet-mapping>
+       <mime-mapping>
+               <extension>inc</extension>
+               <mime-type>text/plain</mime-type>
+       </mime-mapping>
+       
+       <security-constraint>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/streams/*</url-pattern>
+               </web-resource-collection>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/conf/*</url-pattern>
+               </web-resource-collection>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/upload/*</url-pattern>
+               </web-resource-collection>
+               <web-resource-collection>
+                       <web-resource-name>Forbidden</web-resource-name>
+                       <url-pattern>/uploadtemp/*</url-pattern>
+               </web-resource-collection>
+               <auth-constraint/>
+       </security-constraint>
+       <login-config>
+               <auth-method>BASIC</auth-method>
+       </login-config>
 </web-app>


Reply via email to