Author: solomax
Date: Fri Mar  1 10:11:10 2013
New Revision: 1451552

URL: http://svn.apache.org/r1451552
Log:
[OPENMEETINGS-530] host/port settings are now taken from config.xml

Removed:
    
openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xml
    
openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xsd
Modified:
    
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
    
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
    
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
    
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
    
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
    
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx?rev=1451552&r1=1451551&r2=1451552&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
 Fri Mar  1 10:11:10 2013
@@ -46,23 +46,23 @@
        ]]></handler>
        
     <!--
-        These attributes are rewritten by values from 
"networktesting-config.xml"
+        These attributes are rewritten by values from "config.xml"
     -->
-    <attribute name="host" type="string" value="" />
+    <attribute name="rtmpProtocol" type="string" value="rtmp" />
+    <attribute name="rtmpHost" type="string" value="" />
     <attribute name="rtmpPort" type="number" value="1935" />
+    
+    <attribute name="httpProtocol" type="string" value="http" />
+    <attribute name="httpHost" type="string" value="" />
     <attribute name="httpPort" type="number" value="5080" />
     <attribute name="uriContext" type="string" value="/openmeetings" />
     <attribute name="rtmpUriPath" type="string" 
value="/openmeetings/hibernate" />
 
-       <method name="getSettings">
-               var settingsPtr = canvas.settings.getPointer();
-               
-               canvas.setAttribute("host", 
settingsPtr.xpathQuery("config/hostAddress/text()"));
-               if (!canvas.host) {
-                       // trying to get host from JS call
-                       var url:String = 
ExternalInterface.call("window.location.href.toString");
-                       // in case of IE or some other security issues we will 
fail ...
-                       url = url ? url : canvas.proxyurl;
+       <method name="getBrowserHost">
+               var host:String = 
ExternalInterface.call("window.location.host.toString()");
+               // in case of IE or some other security issues we will fail ...
+               if (!host) {
+                       var url:String = canvas.proxyurl;
                        if (url) {
                                if ($debug) Debug.write("url ", url);
                                var paramsIdx = url.indexOf("?");
@@ -72,13 +72,31 @@
                                if ($debug) Debug.write("url ", url);
                                url = url.substr(url.indexOf("//") + 2);
                                var portIdx = url.indexOf(":");
-                               canvas.setAttribute("host", url.substr(0, 
portIdx != -1 ? portIdx : url.indexOf("/")));
+                               host = url.substr(0, portIdx != -1 ? portIdx : 
url.indexOf("/")));
                                if ($debug) Debug.write("canvas.host ", 
canvas.host);
                        }
                }
+               return host;
+       </method>
+       
+       <method name="getSettings">
+               var settingsPtr = canvas.settings.getPointer();
+               
+               var useSSL:Boolean = ("yes" == 
settingsPtr.xpathQuery("config/useSSL/text()"));
+               canvas.setAttribute("rtmpProtocol", useSSL ? "rtmps" : "rtmp");
+               canvas.setAttribute("rtmpHost", 
settingsPtr.xpathQuery("config/rtmphostlocal/text()"));
+               if (!canvas.rtmpHost) {
+                       canvas.rtmpHost = getBrowserHost();
+               }
                canvas.setAttribute("rtmpPort", 
settingsPtr.xpathQuery("config/rtmpPort/text()"));
-               canvas.setAttribute("httpPort", 
settingsPtr.xpathQuery("config/httpPort/text()"));
                
+               canvas.setAttribute("httpProtocol", 
settingsPtr.xpathQuery("config/protocol/text()"));
+               canvas.setAttribute("httpHost", 
settingsPtr.xpathQuery("config/httphostlocal/text()"));
+               if (!canvas.httpHost) {
+                       canvas.httpHost = rtmpHost;
+               }
+               canvas.setAttribute("httpPort", 
settingsPtr.xpathQuery("config/red5httpport/text()"));
+
                canvas.setAttribute("uriContext", 
settingsPtr.xpathQuery("config/uriContext/text()"));
                canvas.setAttribute("rtmpUriPath", 
settingsPtr.xpathQuery("config/rtmpUriPath/text()"));
        </method>

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx?rev=1451552&r1=1451551&r2=1451552&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
 Fri Mar  1 10:11:10 2013
@@ -49,7 +49,7 @@
     <attribute name="loader" value="null" />
 
     <method name="initLoader">
-        hostUrl = "http://"; + host + ":" + port + canvas.uriContext + 
"/networktest.upload?testType=" + testTypeParameter;
+        hostUrl = protocol + "://" + host + ":" + port + canvas.uriContext + 
"/networktest.upload?testType=" + testTypeParameter;
         request = new URLRequest(hostUrl);
 
         loader = new URLLoader();

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx?rev=1451552&r1=1451551&r2=1451552&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
 Fri Mar  1 10:11:10 2013
@@ -23,6 +23,7 @@
 <class name="NetworkTest" extends="view">
 
     <attribute name="testName" type="string" value="null" />
+    <attribute name="protocol" type="string" value="null" />
     <attribute name="host" type="string" value="null" />
     <attribute name="port" type="number" value="null" />
     <attribute name="running" type="boolean" value="false" />

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx?rev=1451552&r1=1451551&r2=1451552&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
 Fri Mar  1 10:11:10 2013
@@ -39,7 +39,7 @@
     </handler>
 
     <method name="start">
-        var hostUrl = "rtmp://" + host + ":" + port + canvas.rtmpUriPath;
+        var hostUrl = protocol + "://" + host + ":" + port + 
canvas.rtmpUriPath;
         rtmp.setAttribute("src", hostUrl);
         this.log(": start test... " + hostUrl);
 

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx?rev=1451552&r1=1451551&r2=1451552&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
 Fri Mar  1 10:11:10 2013
@@ -45,7 +45,7 @@
     </handler>
 
     <method name="initLoader">
-        hostUrl = "http://"; + host + ":" + port + canvas.uriContext + 
"/networktest.upload";
+        hostUrl = protocol + "://" + host + ":" + port + canvas.uriContext + 
"/networktest.upload";
         request = new URLRequest(hostUrl);
         request.method = URLRequestMethod.POST;
         request.data = getDataString();

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx?rev=1451552&r1=1451551&r2=1451552&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx 
(original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx 
Fri Mar  1 10:11:10 2013
@@ -50,28 +50,28 @@
     />
 
     <PingTest
-        name="pingTest" host="${canvas.host}" port="${canvas.httpPort}"
+        name="pingTest" protocol="${canvas.httpProtocol}" 
host="${canvas.httpHost}" port="${canvas.httpPort}"
         x="${parent.offset}"
         y="${parent.label.y + parent.label.height + parent.offset/2}"
     />
     <PortAvailabilityTest
-        name="portTest" host="${canvas.host}" port="${canvas.rtmpPort}"
+        name="portTest" protocol="${canvas.rtmpProtocol}" 
host="${canvas.rtmpHost}" port="${canvas.rtmpPort}"
         x="${parent.pingTest.x + parent.pingTest.width + parent.offset}"
         y="${parent.pingTest.y}"
      />
     <JitterTest
-        name="jitterTest" host="${canvas.host}" port="${canvas.httpPort}"
+        name="jitterTest" protocol="${canvas.httpProtocol}" 
host="${canvas.httpHost}" port="${canvas.httpPort}"
         x="${parent.portTest.x + parent.portTest.width + parent.offset}"
         y="${parent.pingTest.y}"
     />
     <DownloadSpeedTest
-        name="downloadTest" host="${canvas.host}" port="${canvas.httpPort}"
+        name="downloadTest" protocol="${canvas.httpProtocol}" 
host="${canvas.httpHost}" port="${canvas.httpPort}"
         x="${parent.jitterTest.x + parent.jitterTest.width + parent.offset}"
         y="${parent.pingTest.y}"
     />
 
     <UploadSpeedTest
-        name="uploadTest" host="${canvas.host}" port="${canvas.httpPort}"
+        name="uploadTest" protocol="${canvas.httpProtocol}" 
host="${canvas.httpHost}" port="${canvas.httpPort}"
         x="${parent.downloadTest.x + parent.downloadTest.width + 
parent.offset}"
         y="${parent.pingTest.y}"
     />


Reply via email to