Author: solomax
Date: Tue Jul  7 17:35:18 2015
New Revision: 1689717

URL: http://svn.apache.org/r1689717
Log:
[OPENMEETINGS-1230] cluster seems to work as expected, additional testing is 
required

Modified:
    
openmeetings/branches/3.0.x/WebContent/src/base/hibernate/hibRtmpConnection.lzx
    openmeetings/branches/3.0.x/WebContent/src/base/mainAttributes.lzx
    openmeetings/branches/3.0.x/WebContent/src/base/mainDatasets.lzx
    openmeetings/branches/3.0.x/WebContent/src/base/mainMethods.lzx
    
openmeetings/branches/3.0.x/WebContent/src/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
    
openmeetings/branches/3.0.x/WebContent/src/modules/conference/testsetup/testSetup.lzx
    openmeetings/branches/3.0.x/WebContent/swf10/base/mainDatasets.lzx
    openmeetings/branches/3.0.x/WebContent/swf10/main.as3.lzx
    
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/ConferenceService.java
    openmeetings/branches/3.0.x/src/main/webapp/js/history.js
    
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/rooms/RoomPanel.java
    
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/util/OmUrlFragment.java
    
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
    
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/js/history.js

Modified: 
openmeetings/branches/3.0.x/WebContent/src/base/hibernate/hibRtmpConnection.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/src/base/hibernate/hibRtmpConnection.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/WebContent/src/base/hibernate/hibRtmpConnection.lzx 
(original)
+++ 
openmeetings/branches/3.0.x/WebContent/src/base/hibernate/hibRtmpConnection.lzx 
Tue Jul  7 17:35:18 2015
@@ -114,34 +114,19 @@
     
     <method name="getPort">
        if (canvas.useSSL) {
-               if (canvas.isSlaveHosted) {
-                       return canvas.slaveRtmpsslport;
-               }
             return canvas.rtmpsslport;
         }
        if (this.useRTMPT) {
-               if (canvas.isSlaveHosted) {
-                       return canvas.red5httpport; //TODO probably slave 
equivalent need to be added (or maybe this is not used)
-               }
                return canvas.red5httpport;
        }
-       if (canvas.isSlaveHosted) {
-               return canvas.slaveRtmpport;
-       }
        return canvas.rtmpport;
     </method>
     
     <method name="getHost">
-       if (canvas.isSlaveHosted) {
-               return canvas.slaveRtmphostlocal;
-       }
        return canvas.rtmphostlocal;
     </method>
     
     <method name="getWebappRootKey">
-       if (canvas.isSlaveHosted) {
-               return canvas.slaveWebAppRootKey;
-       }
        return canvas.webAppRootKey;
     </method>
          

Modified: openmeetings/branches/3.0.x/WebContent/src/base/mainAttributes.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/src/base/mainAttributes.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/WebContent/src/base/mainAttributes.lzx 
(original)
+++ openmeetings/branches/3.0.x/WebContent/src/base/mainAttributes.lzx Tue Jul  
7 17:35:18 2015
@@ -101,16 +101,7 @@ these properties will be overwritten by
 #############################################################
 Attributes needed for clustering -->
 
-<attribute name="isSlaveHosted" value="false" type="boolean" />
-
-<!-- server object's address (not loaded from public/config.xml cause this 
variable is empty by default) -->
-<attribute name="slaveRtmphostlocal" value="" type="string" />
-<!-- rtmpport from slave's public/config.xml  --> 
-<attribute name="slaveRtmpport" value="5080" type="string" />
-<!-- rtmpsslport from slave's public/config.xml -->
-<attribute name="slaveRtmpsslport" value="443" type="string" />
-<!-- from slave's public/config.xml -->
-<attribute name="slaveWebAppRootKey" value="" type="string" /> 
+<attribute name="isCluster" value="false" type="boolean" />
 
 <!--
 #############################################################

Modified: openmeetings/branches/3.0.x/WebContent/src/base/mainDatasets.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/src/base/mainDatasets.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/WebContent/src/base/mainDatasets.lzx (original)
+++ openmeetings/branches/3.0.x/WebContent/src/base/mainDatasets.lzx Tue Jul  7 
17:35:18 2015
@@ -23,11 +23,35 @@
 
 <library>
 
+       <method name="getServerBaseUrl">
+       <![CDATA[
+               var protocol = lz.Browser.getInitArg('protocol');
+               var host = lz.Browser.getInitArg('host');
+               var port = lz.Browser.getInitArg('port');
+               var context = lz.Browser.getInitArg('context');
+               if (protocol != undefined && host != undefined && port != 
undefined && !isNaN(port) && context != undefined) {
+                       canvas.setAttribute('isCluster', true);
+                       canvas.setAttribute('rtmphostlocal', host);
+                       return protocol + "://" + host + ":" + port + "/" + 
context + "/public/";
+               } else {
+                       var urlObject = lz.Browser.getBaseURL();
+                       //If Port is Null or undefinied use port 80
+                       var port = (urlObject.port != null && urlObject.port != 
undefined) ? urlObject.port : 80;
+                       //if($debug) Debug.write("getBaseUrl:: [urlObject, 
port]", urlObject, port);
+                       var url = "" + urlObject.protocol + "://" + 
urlObject.host + (port != 80 ? ":" + port : "") + urlObject.path;
+                       //if($debug) Debug.write("!!!!!!! getBaseUrl:: 
[urlObject, port, url]", urlObject, port, url);
+                       url = url + (url.slice(-1) == '/' ? '' : '/');
+                       //if($debug) Debug.write("!!!!!!! getBaseUrl:: [last, 
url]", url.slice(-1), url);
+                       return url;
+               }
+       ]]>
+       </method>
+
 <!-- get values from public/config.xml -->
 <dataset type="http" name="myConfigSet" request="false" 
ondata="parent.mainTheme.loadTheme()">
     <handler name="oninit">
         var d = new Date();
-        this.setAttribute("src","config.xml?random="+d.getTime());
+        this.setAttribute("src", canvas.getServerBaseUrl() + 
"config.xml?random=" + d.getTime());
         this.doRequest();
     </handler>
     <handler name="ondata">
@@ -45,7 +69,7 @@
 <dataset type="http" name="mainTheme" request="false" ondata="canvas.myinit()">
     <method name="loadTheme">
         var d = new Date();
-        this.setAttribute("src","theme.xml?random="+d.getTime());
+        this.setAttribute("src", canvas.getServerBaseUrl() + 
"theme.xml?random=" + d.getTime());
         this.doRequest();
     </method>
     <handler name="ondata">

Modified: openmeetings/branches/3.0.x/WebContent/src/base/mainMethods.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/src/base/mainMethods.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/WebContent/src/base/mainMethods.lzx (original)
+++ openmeetings/branches/3.0.x/WebContent/src/base/mainMethods.lzx Tue Jul  7 
17:35:18 2015
@@ -152,23 +152,9 @@
        ]]>
        </method>
 
-       <method name="getAppBaseUrlWithoutSwfSuffix">
-       <![CDATA[
-               var urlObject = lz.Browser.getBaseURL();
-               //If Port is Null or undefinied use port 80
-               var port = (urlObject.port != null && urlObject.port != 
undefined) ? urlObject.port : 80;
-               //if($debug) Debug.write("getBaseUrl:: [urlObject, port]", 
urlObject, port);
-               var url = "" + urlObject.protocol + "://" + urlObject.host + 
(port != 80 ? ":" + port : "") + urlObject.path;
-               //if($debug) Debug.write("!!!!!!! getBaseUrl:: [urlObject, 
port, url]", urlObject, port, url);
-               url = url + (url.slice(-1) == '/' ? '' : '/');
-               //if($debug) Debug.write("!!!!!!! getBaseUrl:: [last, url]", 
url.slice(-1), url);
-               return url.substring(0, url.length - 7); // the length of 
"public/"
-       ]]>
-       </method>
-
        <method name="getAppBaseUrl">
        <![CDATA[
-               return getAppBaseUrlWithoutSwfSuffix() + "swf"
+               return canvas.getServerBaseUrl() + "swf"
        ]]>
        </method>
 
@@ -178,7 +164,7 @@
                        ? hib.currentdomainObj.organisation_id : 1;
                if ($debug) Debug.write("mainMethods::getScreenSharingUrl ", 
hib.userobject, hib.currentdomainObj);
                
-               var appBase = canvas.getAppBaseUrlWithoutSwfSuffix();
+               var appBase = canvas.getServerBaseUrl();
                if ($debug) Debug.write("appBase=" + appBase);
                var downloadurl = appBase + 'screen.upload?'
                        +'rtmphostlocal=' + canvas.getHttpHost()
@@ -195,13 +181,6 @@
        ]]>
        </method>
        
-    <dataset type="http" name="languageData" request="false" 
-        src="${ canvas.currentlanguage+'.xml' }" proxied="false">
-        <handler name="ondata" args="value">
-            parent.parseLanugageObject(value);
-        </handler>
-    </dataset>
-
     <method name="myinit">
         <![CDATA[
         canvas.mediaerrortimeout = 30000;
@@ -210,7 +189,9 @@
         if($debug) Debug.write("main.lzx/config.xml ondata",this);
         
         //Set Config-values by public/config.xml, see comments on 
public/config.xml
-        
this.setAttribute('rtmphostlocal',canvas.myConfigSet.getPointer().xpathQuery('config/rtmphostlocal/text()'));
   
+        if (!canvas.isCluster) {
+               
this.setAttribute('rtmphostlocal',canvas.myConfigSet.getPointer().xpathQuery('config/rtmphostlocal/text()'));
+        }   
         
this.setAttribute('rtmpport',Number(canvas.myConfigSet.getPointer().xpathQuery('config/rtmpport/text()')));
  
         
this.setAttribute('rtmpsslport',Number(canvas.myConfigSet.getPointer().xpathQuery('config/rtmpsslport/text()')));
 
         
@@ -700,62 +681,6 @@
            ]]>
        </method>
        
-       <!-- Data Source Definition -->
-       <dataset name="getSessionVarsData" request="false" proxied="false"
-           querytype="POST" src="${ 
'http://'+canvas.rtmphost+'/webrooms/checksession.php' }" 
-           type="http" >
-           <handler name="ondata" args="value">
-           
-               //Debug.write(value);
-               
canvas.setAttribute('currentcourse',value.childNodes[0].childNodes[0].childNodes[0].childNodes[0].data);
-               canvas.setAttribute('currentcourseName',canvas.currentcourse);
-               
canvas.setAttribute('currentcourseNameLong',value.childNodes[0].childNodes[0].childNodes[1].childNodes[0].data);
-               
canvas.setAttribute('currentlanguage',value.childNodes[0].childNodes[0].childNodes[8].childNodes[0].data);
-       
-               
canvas.setAttribute('currentusename',value.childNodes[0].childNodes[1].childNodes[2].childNodes[0].data+'
 '+value.childNodes[0].childNodes[1].childNodes[1].childNodes[0].data);
-               
-               
canvas.setAttribute('user_id',value.childNodes[0].childNodes[1].childNodes[0].childNodes[0].data);
-               
canvas.setAttribute('firstName',value.childNodes[0].childNodes[1].childNodes[1].childNodes[0].data);
-               
canvas.setAttribute('lastName',value.childNodes[0].childNodes[1].childNodes[2].childNodes[0].data);
-               
canvas.setAttribute('mail',value.childNodes[0].childNodes[1].childNodes[3].childNodes[0].data);
-               canvas.setAttribute('lastLogin','');
-               
canvas.setAttribute('official_code',value.childNodes[0].childNodes[1].childNodes[5].childNodes[0].data);
-               canvas.setAttribute('picture_uri','');
-               
canvas.setAttribute('language',value.childNodes[0].childNodes[1].childNodes[7].childNodes[0].data);
-       
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[0].childNodes[0].data);
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[1].childNodes[0].data);
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[2].childNodes[0].data);
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[3].childNodes[0].data);
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[4].childNodes[0].data);
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[5].childNodes[0].data);
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[6].childNodes[0].data);
-               
//Debug.write(value.childNodes[0].childNodes[1].childNodes[7].childNodes[0].data);
-               
-               switch (canvas.currentlanguage){
-                   case 'english':
-                   break;
-                   case 'german':
-                   break;
-                   case 'french':
-                   break;          
-                   default:
-                   canvas.setAttribute('currentlanguage','english');
-                   break;
-               }
-               
-               var addIt='conf';
-               if (!canvas.isConference){
-                   addIt='meet'
-               }
-               
canvas.setAttribute('currentcourse',canvas.rtmphost+canvas.currentcourse+addIt);
-               
canvas.setAttribute('currentuser',value.childNodes[0].childNodes[1].childNodes[5].childNodes[0].data);
-               
-               canvas.setAttribute('loadingmessage','loading language data');
-               canvas.languageData.doRequest();
-           </handler>
-       </dataset>
-       
        <method name="addBrowserTabHistory" args="value">
            <![CDATA[
            //Debug.write("addBrowserTabHistory: ",value);

Modified: 
openmeetings/branches/3.0.x/WebContent/src/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/src/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/WebContent/src/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
 (original)
+++ 
openmeetings/branches/3.0.x/WebContent/src/modules/conference/flexibleConferenceRoom/baseConferenceRoom.lzx
 Tue Jul  7 17:35:18 2015
@@ -195,9 +195,6 @@
                        canvas.currentActivityList = null;
                }
                
-               //reset if the user was connected to any slave
-               canvas.isSlaveHosted = false;
-               
                //@deprecated we will not use old screen sharing implementation
                //canvas._screens.clearAllSessions();
                this.logicalRoomLeave.doCall();

Modified: 
openmeetings/branches/3.0.x/WebContent/src/modules/conference/testsetup/testSetup.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/src/modules/conference/testsetup/testSetup.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/WebContent/src/modules/conference/testsetup/testSetup.lzx
 (original)
+++ 
openmeetings/branches/3.0.x/WebContent/src/modules/conference/testsetup/testSetup.lzx
 Tue Jul  7 17:35:18 2015
@@ -46,84 +46,19 @@ RTMP-host, RTMP/RTMPT-port for the sessi
     then the window just closed -->
     <attribute name="doJustClose" value="false" type="boolean" />
     
-    <handler name="oninit">
-       <![CDATA[
-            this.getServerForSession.doCall();
-       ]]>
-    </handler>
-    
-    <!-- 
-    public Server getServerForSession(String SID, long roomId)
-     -->
-       <netRemoteCallHib name="getServerForSession" 
funcname="conferenceservice.getServerForSession" remotecontext="$once{ 
canvas.thishib }" >      
-               <netparam><method name="getValue"> return canvas.sessionId; 
</method></netparam>
-               <netparam><method name="getValue"> return 
parent.parent.roomObj.rooms_id; </method></netparam>
-               <handler name="ondata" args="value">
-                       if ($debug) Debug.write("getServerForSession ",value);
-                       //if return value is null, everything stays the same, 
session is on the current host
-                       if (value != null){
-                               //is not loaded from public/config.xml from 
slave as this is variable is empty by default!
-                               canvas.slaveRtmphostlocal = value.address;
-                               
-                               var slaveUrl = value.protocol + "://" + 
value.address + ":" + value.port + "/" + value.webapp + "/";
-                               
-                               var d = new Date();
-                       parent.myConfigSet.setAttribute("src", slaveUrl + 
"public/config.xml?random="+d.getTime());
-                       parent.myConfigSet.doRequest();
-                               
-                       } else {
-                               //Hosted on master
-                               canvas.isSlaveHosted = false;
-                               this.parent.startConference();
-                       }
-               </handler>
-       </netRemoteCallHib>     
-       
-       <!-- get values from public/config.xml from slave -->
-       <dataset type="http" name="myConfigSet" request="false" 
ondata="parent.parseResultsToSlaveClusterConfig()">
-           <handler name="ondata">
-               if ($debug) Debug.write("ondata");
-           </handler>
-           <handler name="onerror" args="e">
-               if ($debug) Debug.write("onerror",e);
-           </handler>
-           <handler name="ontimeout" args="e">
-               if ($debug) Debug.write("ontimeout",e);
-           </handler>
-       </dataset>
-       
-       <!-- 
-               Parse the results so that the RTMP traffic points to the slave
-               and the HTTP traffic points to the master
-        -->
-       <method name="parseResultsToSlaveClusterConfig">
-               
-        canvas.slaveRtmpport = 
Number(this.myConfigSet.getPointer().xpathQuery('config/rtmpport/text()'));  
-        canvas.slaveRtmpsslport = 
Number(this.myConfigSet.getPointer().xpathQuery('config/rtmpsslport/text()')); 
-        canvas.slaveWebAppRootKey = 
this.myConfigSet.getPointer().xpathQuery('config/webAppRootKey/text()'); 
-               
-               if ($debug) Debug.write("parseResults: 
",canvas.slaveRtmphostlocal,canvas.slaveRtmpport,canvas.slaveRtmpsslport,canvas.slaveWebAppRootKey);
+       <handler name="oninit">
+       <![CDATA[
+               clearStageContent();
+               if ($debug) Debug.warn("roomClassname : ", this.roomClassName);
+               if ($debug) Debug.warn("canvas.currentRoomObj will be : ", 
this.roomObj);
+               canvas.currentRoomObj = this.roomObj;
                
-               //Hosted on slave
-               canvas.isSlaveHosted = true;
-               this.startConference();
-       </method>
-    
-    <method name="startConference">
-       <![CDATA[
-            clearStageContent();
-            if ($debug) Debug.warn("roomClassname : ", this.roomClassName);
-            if ($debug) Debug.warn("canvas.currentRoomObj will be : ", 
this.roomObj);
-            canvas.currentRoomObj = this.roomObj;
-            
-            new lz[this.roomClassName](canvas.main_content._content.inner, {
-                        roomobj:this.roomObj
-                    });
-       
-            this.destroy();
-       ]]>
-    </method>
-
+               new lz[this.roomClassName](canvas.main_content._content.inner, {
+                                       roomobj:this.roomObj
+                                       });
+               this.destroy();
+       ]]>
+       </handler>
 </class>
 
 

Modified: openmeetings/branches/3.0.x/WebContent/swf10/base/mainDatasets.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/swf10/base/mainDatasets.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/WebContent/swf10/base/mainDatasets.lzx 
(original)
+++ openmeetings/branches/3.0.x/WebContent/swf10/base/mainDatasets.lzx Tue Jul  
7 17:35:18 2015
@@ -23,11 +23,39 @@
 
 <library>
 
+       <method name="getLocalBaseUrl">
+       <![CDATA[
+               var urlObject = lz.Browser.getBaseURL();
+               //If Port is Null or undefinied use port 80
+               var port = (urlObject.port != null && urlObject.port != 
undefined) ? urlObject.port : 80;
+               //if($debug) Debug.write("getBaseUrl:: [urlObject, port]", 
urlObject, port);
+               var url = "" + urlObject.protocol + "://" + urlObject.host + 
(port != 80 ? ":" + port : "") + urlObject.path;
+               //if($debug) Debug.write("!!!!!!! getBaseUrl:: [urlObject, 
port, url]", urlObject, port, url);
+               url = url + (url.slice(-1) == '/' ? '' : '/');
+               //if($debug) Debug.write("!!!!!!! getBaseUrl:: [last, url]", 
url.slice(-1), url);
+               return url;
+       ]]>
+       </method>
+
+       <method name="getServerBaseUrl">
+       <![CDATA[
+               var protocol = lz.Browser.getInitArg('protocol');
+               var host = lz.Browser.getInitArg('host');
+               var port = lz.Browser.getInitArg('port');
+               var context = lz.Browser.getInitArg('context');
+               if (protocol != undefined && host != undefined && port != 
undefined && !isNaN(port) && context != undefined) {
+                       return protocol + "://" + host + ":" + port + "/" + 
context + "/public/";
+               } else {
+                       return getLocalBaseUrl();
+               }
+       ]]>
+       </method>
+
 <!-- get values from public/config.xml -->
 <dataset type="http" name="myConfigSet" request="false" 
ondata="parent.mainTheme.loadTheme()" proxied="false">
     <handler name="oninit">
         var d = new Date();
-        this.setAttribute("src","config.xml?random="+d.getTime());
+        this.setAttribute("src", canvas.getServerBaseUrl() + 
"config.xml?random=" + d.getTime());
         this.doRequest();
     </handler>
     <handler name="ondata">
@@ -49,7 +77,7 @@
 <dataset type="http" name="mainTheme" request="false" ondata="canvas.myinit()" 
proxied="false">
     <method name="loadTheme">
         var d = new Date();
-        this.setAttribute("src","theme.xml?random="+d.getTime());
+        this.setAttribute("src", canvas.getServerBaseUrl() + 
"theme.xml?random=" + d.getTime());
         this.doRequest();
     </method>
     <handler name="ondata">

Modified: openmeetings/branches/3.0.x/WebContent/swf10/main.as3.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/WebContent/swf10/main.as3.lzx?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/WebContent/swf10/main.as3.lzx (original)
+++ openmeetings/branches/3.0.x/WebContent/swf10/main.as3.lzx Tue Jul  7 
17:35:18 2015
@@ -93,26 +93,12 @@
         return "" + Math.floor(999999*Math.random());
     </method>
 
-       <method name="getAppBaseUrlWithoutSwfSuffix">
-       <![CDATA[
-               var urlObject = lz.Browser.getBaseURL();
-               //If Port is Null or undefinied use port 80
-               var port = (urlObject.port != null && urlObject.port != 
undefined) ? urlObject.port : 80;
-               //if($debug) Debug.write("getBaseUrl:: [urlObject, port]", 
urlObject, port);
-               var url = "" + urlObject.protocol + "://" + urlObject.host + 
(port != 80 ? ":" + port : "") + urlObject.path;
-               //if($debug) Debug.write("!!!!!!! getBaseUrl:: [urlObject, 
port, url]", urlObject, port, url);
-               url = url + (url.slice(-1) == '/' ? '' : '/');
-               //if($debug) Debug.write("!!!!!!! getBaseUrl:: [last, url]", 
url.slice(-1), url);
-               return url;
-       ]]>
-       </method>
-
     <handler name="oninit"><![CDATA[
                doDebugInit();
     
         var tInitArgsArry = new 
Array('secureHash','invitationHash','sid','roomid','directRoomId'
                
,'language','hash','cuser','tAccept','moodleRoom','becomemoderator','wwwroot','user_id'
-               ,'picture','scopeRoomId', 'wicketsid', 'wicketroomid');
+               ,'picture','scopeRoomId', 'wicketsid', 'wicketroomid', 
'protocol', 'host', 'port', 'context');
     
         this.setAttribute('lc_SID', this.getLCSID());
         this.setAttribute('vid_lc_name', lc_SID + '__videoLC');
@@ -136,7 +122,7 @@
             }
         }
         
-        var tSWFURL = getAppBaseUrlWithoutSwfSuffix() + "main" + ($debug ? 
"debug" : "") + ".swf8.swf?lzproxied=solo&lc_SID="+lc_SID+tqueryString;
+        var tSWFURL = canvas.getLocalBaseUrl() + "main" + ($debug ? "debug" : 
"") + ".swf8.swf?lzproxied=solo&lc_SID="+lc_SID+tqueryString;
         
         if ($debug) Debug.write("tSWFURL :: ",tSWFURL);
         

Modified: 
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/ConferenceService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/ConferenceService.java?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/ConferenceService.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/ConferenceService.java
 Tue Jul  7 17:35:18 2015
@@ -23,10 +23,8 @@ import static org.apache.openmeetings.ut
 
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.openmeetings.data.calendar.management.AppointmentLogic;
 import org.apache.openmeetings.data.conference.RoomManager;
@@ -40,14 +38,12 @@ import org.apache.openmeetings.db.dao.se
 import org.apache.openmeetings.db.dao.server.SessiondataDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
 import org.apache.openmeetings.db.dto.basic.SearchResult;
-import org.apache.openmeetings.db.dto.server.ServerDTO;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.room.Client;
 import org.apache.openmeetings.db.entity.room.Room;
 import org.apache.openmeetings.db.entity.room.RoomModerator;
 import org.apache.openmeetings.db.entity.room.RoomOrganisation;
 import org.apache.openmeetings.db.entity.room.RoomType;
-import org.apache.openmeetings.db.entity.server.Server;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.util.TimezoneUtil;
 import org.apache.openmeetings.util.AuthLevelUtil;
@@ -522,48 +518,4 @@ public class ConferenceService {
                }
                return null;
        }
-
-       /**
-        * Gives a {@link Server} entity, in case there is a cluster configured
-        * 
-        * @param SID
-        * @param roomId
-        * @return null means the user should stay on the master, otherwise a
-        *         {@link Server} entity is returned
-        */
-       public ServerDTO getServerForSession(String SID, long roomId) {
-               Long users_id = sessiondataDao.checkSession(SID);
-               if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-                       List<Server> serverList = serverDao.getActiveServers();
-
-                       long minimum = -1;
-                       Server result = null;
-                       HashMap<Server, List<Long>> activeRoomsMap = new 
HashMap<Server, List<Long>>();
-                       for (Server server : serverList) {
-                               List<Long> roomIds = 
sessionManager.getActiveRoomIdsByServer(server);
-                               if (roomIds.contains(roomId)) {
-                                       // if the room is already opened on a 
server, redirect the user to that one,
-                                       log.debug("Room is already opened on a 
server " + server.getAddress());
-                                       return new ServerDTO(server);
-                               }
-                               activeRoomsMap.put(server, roomIds);
-                       }
-                       for (Map.Entry<Server, List<Long>> entry : 
activeRoomsMap.entrySet()) {
-                               List<Long> roomIds = entry.getValue();
-                               Long capacity = 
roomDao.getRoomsCapacityByIds(roomIds);
-                               if (minimum < 0 || capacity < minimum) {
-                                       minimum = capacity;
-                                       result = entry.getKey();
-                               }
-                               log.debug("Checking server: " + entry.getKey() 
+ " Number of rooms " + roomIds.size() + " RoomIds: "
-                                               + roomIds + " max(Sum): " + 
capacity);
-                       }
-                       return result == null ? null : new ServerDTO(result);
-               }
-
-               log.error("Could not get server for cluster session");
-               // Empty server object
-               return null;
-       }
-       
 }

Modified: openmeetings/branches/3.0.x/src/main/webapp/js/history.js
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/webapp/js/history.js?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/main/webapp/js/history.js (original)
+++ openmeetings/branches/3.0.x/src/main/webapp/js/history.js Tue Jul  7 
17:35:18 2015
@@ -22,12 +22,10 @@ BrowserHistoryUtils = {
         if (elm.addEventListener) {
             elm.addEventListener(evType, fn, useCapture);
             return true;
-        }
-        else if (elm.attachEvent) {
+        } else if (elm.attachEvent) {
             var r = elm.attachEvent('on' + evType, fn);
             return r;
-        }
-        else {
+        } else {
             elm['on' + evType] = fn;
         }
     }
@@ -36,11 +34,11 @@ BrowserHistoryUtils = {
 BrowserHistory = (function() {
     // type of browser
     var browser = {
-        ie: false, 
-        ie8: false, 
-        firefox: false, 
-        safari: false, 
-        opera: false, 
+        ie: false,
+        ie8: false,
+        firefox: false,
+        safari: false,
+        opera: false,
         version: -1
     };
 
@@ -61,7 +59,7 @@ BrowserHistory = (function() {
 
     // History maintenance (used only by Safari)
     var currentHistoryLength = -1;
-    
+
     // Flag to denote the existence of onhashchange
     var browserHasHashChange = false;
 
@@ -82,8 +80,7 @@ BrowserHistory = (function() {
     } else if (useragent.indexOf("msie") != -1) {
         browser.ie = true;
         browser.version = 
parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
-        if (browser.version == 8)
-        {
+        if (browser.version == 8) {
             browser.ie = false;
             browser.ie8 = true;
         }
@@ -98,8 +95,7 @@ BrowserHistory = (function() {
         window["_ie_firstload"] = false;
     }
 
-    function hashChangeHandler()
-    {
+    function hashChangeHandler() {
         currentHref = document.location.href;
         var flexAppUrl = getHash();
         //ADR: to fix multiple
@@ -114,34 +110,32 @@ BrowserHistory = (function() {
     }
 
     // Accessor functions for obtaining specific elements of the page.
-    function getHistoryFrame()
-    {
+
+    function getHistoryFrame() {
         return document.getElementById('ie_historyFrame');
     }
 
-    function getFormElement()
-    {
+    function getFormElement() {
         return document.getElementById('safari_formDiv');
     }
 
-    function getRememberElement()
-    {
+    function getRememberElement() {
         return document.getElementById("safari_remember_field");
     }
 
     // Get the Flash player object for performing ExternalInterface callbacks.
     // Updated for changes to SWFObject2.
+
     function getPlayer(id) {
         var i;
 
-               if (id && document.getElementById(id)) {
-                       var r = document.getElementById(id);
-                       if (typeof r.SetVariable != "undefined") {
-                               return r;
-                       }
-                       else {
-                               var o = r.getElementsByTagName("object");
-                               var e = r.getElementsByTagName("embed");
+        if (id && document.getElementById(id)) {
+            var r = document.getElementById(id);
+            if (typeof r.SetVariable != "undefined") {
+                return r;
+            } else {
+                var o = r.getElementsByTagName("object");
+                var e = r.getElementsByTagName("embed");
                 for (i = 0; i < o.length; i++) {
                     if (typeof o[i].browserURLChange != "undefined")
                         return o[i];
@@ -150,42 +144,37 @@ BrowserHistory = (function() {
                     if (typeof e[i].browserURLChange != "undefined")
                         return e[i];
                 }
-                       }
-               }
-               else {
-                       var o = document.getElementsByTagName("object");
-                       var e = document.getElementsByTagName("embed");
+            }
+        } else {
+            var o = document.getElementsByTagName("object");
+            var e = document.getElementsByTagName("embed");
             for (i = 0; i < e.length; i++) {
-                if (typeof e[i].browserURLChange != "undefined")
-                {
+                if (typeof e[i].browserURLChange != "undefined") {
                     return e[i];
                 }
             }
             for (i = 0; i < o.length; i++) {
-                if (typeof o[i].browserURLChange != "undefined")
-                {
+                if (typeof o[i].browserURLChange != "undefined") {
                     return o[i];
                 }
             }
-               }
-               return undefined;
-       }
-    
+        }
+        return undefined;
+    }
+
     function getPlayers() {
         var i;
         var players = [];
         if (players.length == 0) {
             var tmp = document.getElementsByTagName('object');
-            for (i = 0; i < tmp.length; i++)
-            {
+            for (i = 0; i < tmp.length; i++) {
                 if (typeof tmp[i].browserURLChange != "undefined")
                     players.push(tmp[i]);
             }
         }
         if (players.length == 0 || players[0].object == null) {
             var tmp = document.getElementsByTagName('embed');
-            for (i = 0; i < tmp.length; i++)
-            {
+            for (i = 0; i < tmp.length; i++) {
                 if (typeof tmp[i].browserURLChange != "undefined")
                     players.push(tmp[i]);
             }
@@ -193,36 +182,42 @@ BrowserHistory = (function() {
         return players;
     }
 
-       function getIframeHash() {
-               var doc = getHistoryFrame().contentWindow.document;
-               var hash = String(doc.location.search);
-               if (hash.length == 1 && hash.charAt(0) == "?") {
-                       hash = "";
-               }
-               else if (hash.length >= 2 && hash.charAt(0) == "?") {
-                       hash = hash.substring(1);
-               }
-               return hash;
-       }
+    function getIframeHash() {
+        var doc = getHistoryFrame().contentWindow.document;
+        var hash = String(doc.location.search);
+        if (hash.length == 1 && hash.charAt(0) == "?") {
+            hash = "";
+        } else if (hash.length >= 2 && hash.charAt(0) == "?") {
+            hash = hash.substring(1);
+        }
+        return hash;
+    }
 
     /* Get the current location hash excluding the '#' symbol. */
+
     function getHash() {
-       // It would be nice if we could use document.location.hash here,
-       // but it's faulty sometimes.
-       var idx = document.location.href.indexOf('#');
-       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+        // It would be nice if we could use document.location.hash here,
+        // but it's faulty sometimes.
+        var idx = document.location.href.indexOf('#');
+        return (idx >= 0) ? document.location.href.substr(idx + 1) : '';
     }
 
     /* Get the current location hash excluding the '#' symbol. */
+
     function setHash(hash) {
-       // It would be nice if we could use document.location.hash here,
-       // but it's faulty sometimes.
-       if (hash == '') hash = '#'
-       document.location.hash = hash;
+        // It would be nice if we could use document.location.hash here,
+        // but it's faulty sometimes.
+        if (hash == '') hash = '#'
+        document.location.hash = hash;
     }
 
     function createState(baseUrl, newUrl, flexAppUrl) {
-        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': 
flexAppUrl, 'title': null };
+        return {
+            'baseUrl': baseUrl,
+            'newUrl': newUrl,
+            'flexAppUrl': flexAppUrl,
+            'title': null
+        };
     }
 
     /* Add a history entry to the browser.
@@ -230,6 +225,7 @@ BrowserHistory = (function() {
      *   newUrl: the entire new URL, including '#' and following fragment
      *   flexAppUrl: the portion of the location following the '#' only
      */
+
     function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
 
         //delete all the history entries
@@ -257,7 +253,7 @@ BrowserHistory = (function() {
             //ADR
             if (backStack.length == 0 && initialState.flexAppUrl == 
flexAppUrl) {
                 initialState = createState(baseUrl, newUrl, flexAppUrl);
-            } else if(backStack.length > 0 && backStack[backStack.length - 
1].flexAppUrl == flexAppUrl) {
+            } else if (backStack.length > 0 && backStack[backStack.length - 
1].flexAppUrl == flexAppUrl) {
                 backStack[backStack.length - 1] = createState(baseUrl, newUrl, 
flexAppUrl);
             }
 
@@ -265,8 +261,8 @@ BrowserHistory = (function() {
                 // for Safari, submit a form whose action points to the 
desired URL
                 if (browser.version <= 419.3) {
                     var file = window.location.pathname.toString();
-                    file = file.substring(file.lastIndexOf("/")+1);
-                    getFormElement().innerHTML = '<form name="historyForm" 
action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    file = file.substring(file.lastIndexOf("/") + 1);
+                    getFormElement().innerHTML = '<form name="historyForm" 
action="' + file + '#' + flexAppUrl + '" method="GET"></form>';
                     //get the current elements and add them to the form
                     var qs = window.location.search.substring(1);
                     var qs_arr = qs.split("&");
@@ -302,9 +298,11 @@ BrowserHistory = (function() {
     function handleBackButton() {
         //The "current" page is always at the top of the history stack.
         var current = backStack.pop();
-        if (!current) { return; }
+        if (!current) {
+            return;
+        }
         var last = backStack[backStack.length - 1];
-        if (!last && backStack.length == 0){
+        if (!last && backStack.length == 0) {
             last = initialState;
         }
         forwardStack.push(current);
@@ -314,7 +312,9 @@ BrowserHistory = (function() {
         //summary: private method. Do not call this directly.
 
         var last = forwardStack.pop();
-        if (!last) { return; }
+        if (!last) {
+            return;
+        }
         backStack.push(last);
     }
 
@@ -324,6 +324,7 @@ BrowserHistory = (function() {
     }
 
     /* Called periodically to poll to see if we need to detect navigation that 
has occurred */
+
     function checkForUrlChange() {
 
         if (browser.ie) {
@@ -338,12 +339,12 @@ BrowserHistory = (function() {
                     currentHref = document.location.href;
                     document.location.reload();
                 } else {
-                                       if (getHash() != getIframeHash()) {
-                                               // this.iframe.src = 
this.blankURL + hash;
-                                               var sourceToSet = 
historyFrameSourcePrefix + getHash();
-                                               getHistoryFrame().src = 
sourceToSet;
+                    if (getHash() != getIframeHash()) {
+                        // this.iframe.src = this.blankURL + hash;
+                        var sourceToSet = historyFrameSourcePrefix + getHash();
+                        getHistoryFrame().src = sourceToSet;
                         currentHref = document.location.href;
-                                       }
+                    }
                 }
             }
         }
@@ -353,13 +354,12 @@ BrowserHistory = (function() {
             if (currentHistoryLength >= 0 && history.length != 
currentHistoryLength) {
                 //alert("did change: " + history.length + ", " + 
historyHash.length + "|" + historyHash[history.length] + "|>" + 
historyHash.join("|"));
                 var flexAppUrl = getHash();
-                if (browser.version < 528.16 /* Anything earlier than Safari 
4.0 */)
-                {    
+                if (browser.version < 528.16 /* Anything earlier than Safari 
4.0 */ ) {
                     // If it did change and we're running Safari 3.x or 
earlier, 
                     // then we have to look the old state up in our 
hand-maintained 
                     // array since document.location.hash won't have changed, 
                     // then call back into BrowserManager.
-                currentHistoryLength = history.length;
+                    currentHistoryLength = history.length;
                     flexAppUrl = historyHash[currentHistoryLength];
                 }
 
@@ -380,8 +380,8 @@ BrowserHistory = (function() {
                 var bsl = backStack.length;
 
                 var urlActions = {
-                    back: false, 
-                    forward: false, 
+                    back: false,
+                    forward: false,
                     set: false
                 }
 
@@ -392,11 +392,11 @@ BrowserHistory = (function() {
                     // clearInterval(this.locationTimer);
                     handleBackButton();
                 }
-                
+
                 // first check to see if we could have gone forward. We always 
halt on
                 // a no-hash item.
                 if (forwardStack.length > 0) {
-                    if (forwardStack[forwardStack.length-1].flexAppUrl == 
getHash()) {
+                    if (forwardStack[forwardStack.length - 1].flexAppUrl == 
getHash()) {
                         urlActions.forward = true;
                         handleForwardButton();
                     }
@@ -409,10 +409,10 @@ BrowserHistory = (function() {
                         handleBackButton();
                     }
                 }
-                
+
                 if (!urlActions.back && !urlActions.forward) {
                     var foundInStacks = {
-                        back: -1, 
+                        back: -1,
                         forward: -1
                     }
 
@@ -447,12 +447,11 @@ BrowserHistory = (function() {
         }
     }
 
-    var _initialize = function () {
-        
+    var _initialize = function() {
+
         browserHasHashChange = ("onhashchange" in document.body);
-        
-        if (browser.ie)
-        {
+
+        if (browser.ie) {
             var scripts = document.getElementsByTagName('script');
             for (var i = 0, s; s = scripts[i]; i++) {
                 if (s.src.indexOf("history.js") > -1) {
@@ -465,19 +464,18 @@ BrowserHistory = (function() {
             var iframe = document.createElement("iframe");
             iframe.id = 'ie_historyFrame';
             iframe.name = 'ie_historyFrame';
-            iframe.src = 'javascript:false;'; 
+            iframe.src = 'javascript:false;';
 
             try {
                 document.body.appendChild(iframe);
-            } catch(e) {
+            } catch (e) {
                 setTimeout(function() {
                     document.body.appendChild(iframe);
                 }, 0);
             }
         }
 
-        if (browser.safari && !browserHasHashChange)
-        {
+        if (browser.safari && !browserHasHashChange) {
             var rememberDiv = document.createElement("div");
             rememberDiv.id = 'safari_rememberDiv';
             document.body.appendChild(rememberDiv);
@@ -501,58 +499,60 @@ BrowserHistory = (function() {
             reloader_content.style.left = reloader_content.style.top = 
'-9999px';
             iframe = reloader_content.getElementsByTagName('iframe')[0];
 
-            if (document.getElementById("safari_remember_field").value != "" ) 
{
+            if (document.getElementById("safari_remember_field").value != "") {
                 historyHash = 
document.getElementById("safari_remember_field").value.split(",");
             }
         }
 
-        if (browserHasHashChange)        
+        if (browserHasHashChange)
             document.body.onhashchange = hashChangeHandler;
     }
 
     return {
-        historyHash: historyHash, 
-        backStack: function() { return backStack; }, 
-        forwardStack: function() { return forwardStack }, 
-        getPlayer: getPlayer, 
+        historyHash: historyHash,
+        backStack: function() {
+            return backStack;
+        },
+        forwardStack: function() {
+            return forwardStack
+        },
+        getPlayer: getPlayer,
         initialize: function(src) {
             _initialize(src);
-        }, 
+        },
         setURL: function(url) {
             document.location.href = url;
-        }, 
+        },
         getURL: function() {
             return document.location.href;
-        }, 
+        },
         getTitle: function() {
             return document.title;
-        }, 
+        },
         setTitle: function(title) {
             try {
                 backStack[backStack.length - 1].title = title;
-            } catch(e) { }
+            } catch (e) {}
             //if on safari, set the title to be the empty string. 
             if (browser.safari) {
                 if (title == "") {
                     try {
-                    var tmp = window.location.href.toString();
-                    title = tmp.substring((tmp.lastIndexOf("/")+1), 
tmp.lastIndexOf("#"));
-                    } catch(e) {
+                        var tmp = window.location.href.toString();
+                        title = tmp.substring((tmp.lastIndexOf("/") + 1), 
tmp.lastIndexOf("#"));
+                    } catch (e) {
                         title = "";
                     }
                 }
             }
             document.title = title;
-        }, 
-        setDefaultURL: function(def)
-        {
+        },
+        setDefaultURL: function(def) {
             defaultHash = def;
             def = getHash();
             //trailing ? is important else an extra frame gets added to the 
history
             //when navigating back to the first page.  Alternatively could 
check
             //in history frame navigation to compare # and ?.
-            if (browser.ie)
-            {
+            if (browser.ie) {
                 window['_ie_firstload'] = true;
                 var sourceToSet = historyFrameSourcePrefix + def;
                 var func = function() {
@@ -562,13 +562,14 @@ BrowserHistory = (function() {
                 }
                 try {
                     func();
-                } catch(e) {
-                    window.setTimeout(function() { func(); }, 0);
+                } catch (e) {
+                    window.setTimeout(function() {
+                        func();
+                    }, 0);
                 }
             }
 
-            if (browser.safari)
-            {
+            if (browser.safari) {
                 currentHistoryLength = history.length;
                 if (historyHash.length == 0) {
                     historyHash[currentHistoryLength] = def;
@@ -579,20 +580,18 @@ BrowserHistory = (function() {
                 }
                 setInterval(checkForUrlChange, 50);
             }
-            
-            
-            if (browser.firefox || browser.opera)
-            {
+
+
+            if (browser.firefox || browser.opera) {
                 var reg = new RegExp("#" + def + "$");
-                if (window.location.toString().match(reg)) {
-                } else {
-                    var newloc ="#" + def;
+                if (window.location.toString().match(reg)) {} else {
+                    var newloc = "#" + def;
                     window.location.replace(newloc);
                 }
                 setInterval(checkForUrlChange, 50);
             }
 
-        }, 
+        },
 
         /* Set the current browser URL; called from inside BrowserManager to 
propagate
          * the application state out to the container.
@@ -601,39 +600,39 @@ BrowserHistory = (function() {
             if (browser.ie && typeof objectId != "undefined") {
                 currentObjectId = objectId;
             }
-           //fromIframe = fromIframe || false;
-           //fromFlex = fromFlex || false;
-           //alert("setBrowserURL: " + flexAppUrl);
-           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
-
-           var pos = document.location.href.indexOf('#');
-           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : 
document.location.href;
-           var newUrl = baseUrl + '#' + flexAppUrl;
-
-           if (document.location.href != newUrl && document.location.href + 
'#' != newUrl) {
-               currentHref = newUrl;
-               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
-               currentHistoryLength = history.length;
-           }
-        }, 
+            //fromIframe = fromIframe || false;
+            //fromFlex = fromFlex || false;
+            //alert("setBrowserURL: " + flexAppUrl);
+            //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+            var pos = document.location.href.indexOf('#');
+            var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : 
document.location.href;
+            var newUrl = baseUrl + '#' + flexAppUrl;
+
+            if (document.location.href != newUrl && document.location.href + 
'#' != newUrl) {
+                currentHref = newUrl;
+                addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+                currentHistoryLength = history.length;
+            }
+        },
 
         browserURLChange: function(flexAppUrl) {
             var objectId = null;
             if (browser.ie && currentObjectId != null) {
                 objectId = currentObjectId;
             }
-            
+
             if (typeof BrowserHistory_multiple != "undefined" && 
BrowserHistory_multiple == true) {
                 var pl = getPlayers();
                 for (var i = 0; i < pl.length; i++) {
                     try {
                         pl[i].browserURLChange(flexAppUrl);
-                    } catch(e) { }
+                    } catch (e) {}
                 }
             } else {
                 try {
                     getPlayer(objectId).browserURLChange(flexAppUrl);
-                } catch(e) { }
+                } catch (e) {}
             }
 
             currentObjectId = null;
@@ -653,44 +652,52 @@ BrowserHistory = (function() {
 
 // Automated unit testing and other diagnostics
 
-function setURL(url)
-{
+function setURL(url) {
     document.location.href = url;
 }
 
-function backButton()
-{
+function backButton() {
     history.back();
 }
 
-function forwardButton()
-{
+function forwardButton() {
     history.forward();
 }
 
-function goForwardOrBackInHistory(step)
-{
+function goForwardOrBackInHistory(step) {
     history.go(step);
 }
 
 //BrowserHistoryUtils.addEvent(window, "load", function() { 
BrowserHistory.initialize(); });
 (function(i) {
-    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var u = navigator.userAgent;
+    var e = /*@cc_on!@*/ false;
     var st = setTimeout;
-    if(/webkit/i.test(u)){
-        st(function(){
-            var dr=document.readyState;
-            if(dr=="loaded"||dr=="complete"){i()}
-            else{st(arguments.callee,10);}},10);
-    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || 
(/opera/i.test(u))){
-        document.addEventListener("DOMContentLoaded",i,false);
-    } else if(e){
-    (function(){
-        var t=document.createElement('doc:rdy');
-        try{t.doScroll('left');
-            i();t=null;
-        }catch(e){st(arguments.callee,0);}})();
-    } else{
-        window.onload=i;
-    }
-})( function() {BrowserHistory.initialize();} );
+    if (/webkit/i.test(u)) {
+        st(function() {
+            var dr = document.readyState;
+            if (dr == "loaded" || dr == "complete") {
+                i()
+            } else {
+                st(arguments.callee, 10);
+            }
+        }, 10);
+    } else if ((/mozilla/i.test(u) && !/(compati)/.test(u)) || 
(/opera/i.test(u))) {
+        document.addEventListener("DOMContentLoaded", i, false);
+    } else if (e) {
+        (function() {
+            var t = document.createElement('doc:rdy');
+            try {
+                t.doScroll('left');
+                i();
+                t = null;
+            } catch (e) {
+                st(arguments.callee, 0);
+            }
+        })();
+    } else {
+        window.onload = i;
+    }
+})(function() {
+    BrowserHistory.initialize();
+});
\ No newline at end of file

Modified: 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/rooms/RoomPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/rooms/RoomPanel.java?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/rooms/RoomPanel.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/rooms/RoomPanel.java
 Tue Jul  7 17:35:18 2015
@@ -18,9 +18,20 @@
  */
 package org.apache.openmeetings.web.user.rooms;
 
+import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getLanguage;
+import static org.apache.openmeetings.web.app.WebSession.getSid;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.db.dao.server.ServerDao;
 import org.apache.openmeetings.db.dao.server.SessiondataDao;
+import org.apache.openmeetings.db.entity.server.Server;
+import org.apache.openmeetings.session.SessionManager;
 import org.apache.openmeetings.web.app.WebSession;
 import org.apache.openmeetings.web.common.BasePanel;
 import org.apache.wicket.RuntimeConfigurationType;
@@ -37,9 +48,12 @@ import org.apache.wicket.request.resourc
 import org.apache.wicket.request.resource.ResourceReference;
 import org.apache.wicket.util.string.StringValue;
 import org.apache.wicket.util.time.Duration;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
 
 public class RoomPanel extends BasePanel {
-       private static final long serialVersionUID = 2308988314987829510L;
+       private static final long serialVersionUID = 1L;
+       private static final Logger log = 
Red5LoggerFactory.getLogger(RoomPanel.class, webAppRootKey);
        
        public RoomPanel(String id) {
                this(id, new PageParameters());
@@ -50,6 +64,43 @@ public class RoomPanel extends BasePanel
                                ? "maindebug.as3.swf11.swf" : 
"main.as3.swf11.swf";
        }
        
+       private static PageParameters addServer(PageParameters pp, Server s) {
+               return pp.add("protocol", s.getProtocol()).add("host", 
s.getAddress()).add("port", s.getPort()).add("context", s.getWebapp());
+       }
+       
+       private static PageParameters addServer(long roomId) {
+               PageParameters pp = new PageParameters().add("wicketsid", 
getSid()).add("wicketroomid", roomId).add("language", getLanguage());
+               List<Server> serverList = 
getBean(ServerDao.class).getActiveServers();
+
+               long minimum = -1;
+               Server result = null;
+               HashMap<Server, List<Long>> activeRoomsMap = new 
HashMap<Server, List<Long>>();
+               for (Server server : serverList) {
+                       List<Long> roomIds = 
getBean(SessionManager.class).getActiveRoomIdsByServer(server);
+                       if (roomIds.contains(roomId)) {
+                               // if the room is already opened on a server, 
redirect the user to that one,
+                               log.debug("Room is already opened on a server " 
+ server.getAddress());
+                               return addServer(pp, server);
+                       }
+                       activeRoomsMap.put(server, roomIds);
+               }
+               for (Map.Entry<Server, List<Long>> entry : 
activeRoomsMap.entrySet()) {
+                       List<Long> roomIds = entry.getValue();
+                       Long capacity = 
getBean(RoomDao.class).getRoomsCapacityByIds(roomIds);
+                       if (minimum < 0 || capacity < minimum) {
+                               minimum = capacity;
+                               result = entry.getKey();
+                       }
+                       log.debug("Checking server: " + entry.getKey() + " 
Number of rooms " + roomIds.size() + " RoomIds: "
+                                       + roomIds + " max(Sum): " + capacity);
+               }
+               return result == null ? pp : addServer(pp, result);
+       }
+
+       public RoomPanel(String id, long roomId) {
+               this(id, addServer(roomId));
+       }
+       
        public RoomPanel(String id, PageParameters pp) {
                super(id);
 

Modified: 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/util/OmUrlFragment.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/util/OmUrlFragment.java?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/util/OmUrlFragment.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/util/OmUrlFragment.java
 Tue Jul  7 17:35:18 2015
@@ -20,8 +20,6 @@ package org.apache.openmeetings.web.util
 
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANDING_ZONE;
 import static org.apache.openmeetings.web.app.Application.getBean;
-import static org.apache.openmeetings.web.app.WebSession.getLanguage;
-import static org.apache.openmeetings.web.app.WebSession.getSid;
 import static 
org.apache.openmeetings.web.user.profile.SettingsPanel.EDIT_PROFILE_TAB_ID;
 import static 
org.apache.openmeetings.web.user.profile.SettingsPanel.MESSAGES_TAB_ID;
 
@@ -45,7 +43,6 @@ import org.apache.openmeetings.web.user.
 import org.apache.openmeetings.web.user.record.RecordingsPanel;
 import org.apache.openmeetings.web.user.rooms.RoomPanel;
 import org.apache.openmeetings.web.user.rooms.RoomsSelectorPanel;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
 
 public class OmUrlFragment implements Serializable {
        private static final long serialVersionUID = 7382435810352033914L;
@@ -259,11 +256,7 @@ public class OmUrlFragment implements Se
                                try {
                                        Long roomId = Long.parseLong(type);
                                        if (roomId != null) {
-                                               PageParameters pp = new 
PageParameters();
-                                               pp.add("wicketsid", getSid());
-                                               pp.add("wicketroomid", roomId);
-                                               pp.add("language", 
getLanguage());
-                                               basePanel = new 
RoomPanel(CHILD_ID, pp);
+                                               basePanel = new 
RoomPanel(CHILD_ID, roomId);
                                        }
                                } catch(NumberFormatException ne) {
                                        //skipit, bad roomid passed

Modified: 
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceService.java
 Tue Jul  7 17:35:18 2015
@@ -514,48 +514,4 @@ public class ConferenceService {
                }
                return null;
        }
-
-       /**
-        * Gives a {@link Server} entity, in case there is a cluster configured
-        * 
-        * @param SID
-        * @param roomId
-        * @return null means the user should stay on the master, otherwise a
-        *         {@link Server} entity is returned
-        */
-       public ServerDTO getServerForSession(String SID, long roomId) {
-               Long userId = sessiondataDao.checkSession(SID);
-               if (AuthLevelUtil.hasUserLevel(userDao.getRights(userId))) {
-                       List<Server> serverList = serverDao.getActiveServers();
-
-                       long minimum = -1;
-                       Server result = null;
-                       Map<Server, List<Long>> activeRoomsMap = new 
HashMap<Server, List<Long>>();
-                       for (Server server : serverList) {
-                               List<Long> roomIds = 
sessionManager.getActiveRoomIdsByServer(server);
-                               if (roomIds.contains(roomId)) {
-                                       // if the room is already opened on a 
server, redirect the user to that one,
-                                       log.debug("Room is already opened on a 
server " + server.getAddress());
-                                       return new ServerDTO(server);
-                               }
-                               activeRoomsMap.put(server, roomIds);
-                       }
-                       for (Map.Entry<Server, List<Long>> entry : 
activeRoomsMap.entrySet()) {
-                               List<Long> roomIds = entry.getValue();
-                               Long capacity = 
roomDao.getRoomsCapacityByIds(roomIds);
-                               if (minimum < 0 || capacity < minimum) {
-                                       minimum = capacity;
-                                       result = entry.getKey();
-                               }
-                               log.debug("Checking server: " + entry.getKey() 
+ " Number of rooms " + roomIds.size() + " RoomIds: "
-                                               + roomIds + " max(Sum): " + 
capacity);
-                       }
-                       return result == null ? null : new ServerDTO(result);
-               }
-
-               log.error("Could not get server for cluster session");
-               // Empty server object
-               return null;
-       }
-       
 }

Modified: 
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/js/history.js
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/js/history.js?rev=1689717&r1=1689716&r2=1689717&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/js/history.js 
(original)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/webapp/js/history.js 
Tue Jul  7 17:35:18 2015
@@ -22,25 +22,23 @@ BrowserHistoryUtils = {
         if (elm.addEventListener) {
             elm.addEventListener(evType, fn, useCapture);
             return true;
-        }
-        else if (elm.attachEvent) {
+        } else if (elm.attachEvent) {
             var r = elm.attachEvent('on' + evType, fn);
             return r;
-        }
-        else {
+        } else {
             elm['on' + evType] = fn;
         }
     }
-};
+}
 
 BrowserHistory = (function() {
     // type of browser
     var browser = {
-        ie: false, 
-        ie8: false, 
-        firefox: false, 
-        safari: false, 
-        opera: false, 
+        ie: false,
+        ie8: false,
+        firefox: false,
+        safari: false,
+        opera: false,
         version: -1
     };
 
@@ -61,7 +59,7 @@ BrowserHistory = (function() {
 
     // History maintenance (used only by Safari)
     var currentHistoryLength = -1;
-    
+
     // Flag to denote the existence of onhashchange
     var browserHasHashChange = false;
 
@@ -82,8 +80,7 @@ BrowserHistory = (function() {
     } else if (useragent.indexOf("msie") != -1) {
         browser.ie = true;
         browser.version = 
parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
-        if (browser.version == 8)
-        {
+        if (browser.version == 8) {
             browser.ie = false;
             browser.ie8 = true;
         }
@@ -98,8 +95,7 @@ BrowserHistory = (function() {
         window["_ie_firstload"] = false;
     }
 
-    function hashChangeHandler()
-    {
+    function hashChangeHandler() {
         currentHref = document.location.href;
         var flexAppUrl = getHash();
         //ADR: to fix multiple
@@ -114,34 +110,32 @@ BrowserHistory = (function() {
     }
 
     // Accessor functions for obtaining specific elements of the page.
-    function getHistoryFrame()
-    {
+
+    function getHistoryFrame() {
         return document.getElementById('ie_historyFrame');
     }
 
-    function getFormElement()
-    {
+    function getFormElement() {
         return document.getElementById('safari_formDiv');
     }
 
-    function getRememberElement()
-    {
+    function getRememberElement() {
         return document.getElementById("safari_remember_field");
     }
 
     // Get the Flash player object for performing ExternalInterface callbacks.
     // Updated for changes to SWFObject2.
+
     function getPlayer(id) {
         var i;
 
-               if (id && document.getElementById(id)) {
-                       var r = document.getElementById(id);
-                       if (typeof r.SetVariable != "undefined") {
-                               return r;
-                       }
-                       else {
-                               var o = r.getElementsByTagName("object");
-                               var e = r.getElementsByTagName("embed");
+        if (id && document.getElementById(id)) {
+            var r = document.getElementById(id);
+            if (typeof r.SetVariable != "undefined") {
+                return r;
+            } else {
+                var o = r.getElementsByTagName("object");
+                var e = r.getElementsByTagName("embed");
                 for (i = 0; i < o.length; i++) {
                     if (typeof o[i].browserURLChange != "undefined")
                         return o[i];
@@ -150,42 +144,37 @@ BrowserHistory = (function() {
                     if (typeof e[i].browserURLChange != "undefined")
                         return e[i];
                 }
-                       }
-               }
-               else {
-                       var o = document.getElementsByTagName("object");
-                       var e = document.getElementsByTagName("embed");
+            }
+        } else {
+            var o = document.getElementsByTagName("object");
+            var e = document.getElementsByTagName("embed");
             for (i = 0; i < e.length; i++) {
-                if (typeof e[i].browserURLChange != "undefined")
-                {
+                if (typeof e[i].browserURLChange != "undefined") {
                     return e[i];
                 }
             }
             for (i = 0; i < o.length; i++) {
-                if (typeof o[i].browserURLChange != "undefined")
-                {
+                if (typeof o[i].browserURLChange != "undefined") {
                     return o[i];
                 }
             }
-               }
-               return undefined;
-       }
-    
+        }
+        return undefined;
+    }
+
     function getPlayers() {
         var i;
         var players = [];
         if (players.length == 0) {
             var tmp = document.getElementsByTagName('object');
-            for (i = 0; i < tmp.length; i++)
-            {
+            for (i = 0; i < tmp.length; i++) {
                 if (typeof tmp[i].browserURLChange != "undefined")
                     players.push(tmp[i]);
             }
         }
         if (players.length == 0 || players[0].object == null) {
             var tmp = document.getElementsByTagName('embed');
-            for (i = 0; i < tmp.length; i++)
-            {
+            for (i = 0; i < tmp.length; i++) {
                 if (typeof tmp[i].browserURLChange != "undefined")
                     players.push(tmp[i]);
             }
@@ -193,36 +182,42 @@ BrowserHistory = (function() {
         return players;
     }
 
-       function getIframeHash() {
-               var doc = getHistoryFrame().contentWindow.document;
-               var hash = String(doc.location.search);
-               if (hash.length == 1 && hash.charAt(0) == "?") {
-                       hash = "";
-               }
-               else if (hash.length >= 2 && hash.charAt(0) == "?") {
-                       hash = hash.substring(1);
-               }
-               return hash;
-       }
+    function getIframeHash() {
+        var doc = getHistoryFrame().contentWindow.document;
+        var hash = String(doc.location.search);
+        if (hash.length == 1 && hash.charAt(0) == "?") {
+            hash = "";
+        } else if (hash.length >= 2 && hash.charAt(0) == "?") {
+            hash = hash.substring(1);
+        }
+        return hash;
+    }
 
     /* Get the current location hash excluding the '#' symbol. */
+
     function getHash() {
-       // It would be nice if we could use document.location.hash here,
-       // but it's faulty sometimes.
-       var idx = document.location.href.indexOf('#');
-       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+        // It would be nice if we could use document.location.hash here,
+        // but it's faulty sometimes.
+        var idx = document.location.href.indexOf('#');
+        return (idx >= 0) ? document.location.href.substr(idx + 1) : '';
     }
 
     /* Get the current location hash excluding the '#' symbol. */
+
     function setHash(hash) {
-       // It would be nice if we could use document.location.hash here,
-       // but it's faulty sometimes.
-       if (hash == '') hash = '#';
-       document.location.hash = hash;
+        // It would be nice if we could use document.location.hash here,
+        // but it's faulty sometimes.
+        if (hash == '') hash = '#'
+        document.location.hash = hash;
     }
 
     function createState(baseUrl, newUrl, flexAppUrl) {
-        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': 
flexAppUrl, 'title': null };
+        return {
+            'baseUrl': baseUrl,
+            'newUrl': newUrl,
+            'flexAppUrl': flexAppUrl,
+            'title': null
+        };
     }
 
     /* Add a history entry to the browser.
@@ -230,6 +225,7 @@ BrowserHistory = (function() {
      *   newUrl: the entire new URL, including '#' and following fragment
      *   flexAppUrl: the portion of the location following the '#' only
      */
+
     function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
 
         //delete all the history entries
@@ -257,7 +253,7 @@ BrowserHistory = (function() {
             //ADR
             if (backStack.length == 0 && initialState.flexAppUrl == 
flexAppUrl) {
                 initialState = createState(baseUrl, newUrl, flexAppUrl);
-            } else if(backStack.length > 0 && backStack[backStack.length - 
1].flexAppUrl == flexAppUrl) {
+            } else if (backStack.length > 0 && backStack[backStack.length - 
1].flexAppUrl == flexAppUrl) {
                 backStack[backStack.length - 1] = createState(baseUrl, newUrl, 
flexAppUrl);
             }
 
@@ -265,8 +261,8 @@ BrowserHistory = (function() {
                 // for Safari, submit a form whose action points to the 
desired URL
                 if (browser.version <= 419.3) {
                     var file = window.location.pathname.toString();
-                    file = file.substring(file.lastIndexOf("/")+1);
-                    getFormElement().innerHTML = '<form name="historyForm" 
action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    file = file.substring(file.lastIndexOf("/") + 1);
+                    getFormElement().innerHTML = '<form name="historyForm" 
action="' + file + '#' + flexAppUrl + '" method="GET"></form>';
                     //get the current elements and add them to the form
                     var qs = window.location.search.substring(1);
                     var qs_arr = qs.split("&");
@@ -302,9 +298,11 @@ BrowserHistory = (function() {
     function handleBackButton() {
         //The "current" page is always at the top of the history stack.
         var current = backStack.pop();
-        if (!current) { return; }
+        if (!current) {
+            return;
+        }
         var last = backStack[backStack.length - 1];
-        if (!last && backStack.length == 0){
+        if (!last && backStack.length == 0) {
             last = initialState;
         }
         forwardStack.push(current);
@@ -314,7 +312,9 @@ BrowserHistory = (function() {
         //summary: private method. Do not call this directly.
 
         var last = forwardStack.pop();
-        if (!last) { return; }
+        if (!last) {
+            return;
+        }
         backStack.push(last);
     }
 
@@ -324,6 +324,7 @@ BrowserHistory = (function() {
     }
 
     /* Called periodically to poll to see if we need to detect navigation that 
has occurred */
+
     function checkForUrlChange() {
 
         if (browser.ie) {
@@ -338,12 +339,12 @@ BrowserHistory = (function() {
                     currentHref = document.location.href;
                     document.location.reload();
                 } else {
-                                       if (getHash() != getIframeHash()) {
-                                               // this.iframe.src = 
this.blankURL + hash;
-                                               var sourceToSet = 
historyFrameSourcePrefix + getHash();
-                                               getHistoryFrame().src = 
sourceToSet;
+                    if (getHash() != getIframeHash()) {
+                        // this.iframe.src = this.blankURL + hash;
+                        var sourceToSet = historyFrameSourcePrefix + getHash();
+                        getHistoryFrame().src = sourceToSet;
                         currentHref = document.location.href;
-                                       }
+                    }
                 }
             }
         }
@@ -353,13 +354,12 @@ BrowserHistory = (function() {
             if (currentHistoryLength >= 0 && history.length != 
currentHistoryLength) {
                 //alert("did change: " + history.length + ", " + 
historyHash.length + "|" + historyHash[history.length] + "|>" + 
historyHash.join("|"));
                 var flexAppUrl = getHash();
-                if (browser.version < 528.16 /* Anything earlier than Safari 
4.0 */)
-                {    
+                if (browser.version < 528.16 /* Anything earlier than Safari 
4.0 */ ) {
                     // If it did change and we're running Safari 3.x or 
earlier, 
                     // then we have to look the old state up in our 
hand-maintained 
                     // array since document.location.hash won't have changed, 
                     // then call back into BrowserManager.
-                currentHistoryLength = history.length;
+                    currentHistoryLength = history.length;
                     flexAppUrl = historyHash[currentHistoryLength];
                 }
 
@@ -380,8 +380,8 @@ BrowserHistory = (function() {
                 var bsl = backStack.length;
 
                 var urlActions = {
-                    back: false, 
-                    forward: false, 
+                    back: false,
+                    forward: false,
                     set: false
                 }
 
@@ -392,11 +392,11 @@ BrowserHistory = (function() {
                     // clearInterval(this.locationTimer);
                     handleBackButton();
                 }
-                
+
                 // first check to see if we could have gone forward. We always 
halt on
                 // a no-hash item.
                 if (forwardStack.length > 0) {
-                    if (forwardStack[forwardStack.length-1].flexAppUrl == 
getHash()) {
+                    if (forwardStack[forwardStack.length - 1].flexAppUrl == 
getHash()) {
                         urlActions.forward = true;
                         handleForwardButton();
                     }
@@ -409,10 +409,10 @@ BrowserHistory = (function() {
                         handleBackButton();
                     }
                 }
-                
+
                 if (!urlActions.back && !urlActions.forward) {
                     var foundInStacks = {
-                        back: -1, 
+                        back: -1,
                         forward: -1
                     }
 
@@ -447,12 +447,11 @@ BrowserHistory = (function() {
         }
     }
 
-    var _initialize = function () {
-        
+    var _initialize = function() {
+
         browserHasHashChange = ("onhashchange" in document.body);
-        
-        if (browser.ie)
-        {
+
+        if (browser.ie) {
             var scripts = document.getElementsByTagName('script');
             for (var i = 0, s; s = scripts[i]; i++) {
                 if (s.src.indexOf("history.js") > -1) {
@@ -465,19 +464,18 @@ BrowserHistory = (function() {
             var iframe = document.createElement("iframe");
             iframe.id = 'ie_historyFrame';
             iframe.name = 'ie_historyFrame';
-            iframe.src = 'javascript:false;'; 
+            iframe.src = 'javascript:false;';
 
             try {
                 document.body.appendChild(iframe);
-            } catch(e) {
+            } catch (e) {
                 setTimeout(function() {
                     document.body.appendChild(iframe);
                 }, 0);
             }
         }
 
-        if (browser.safari && !browserHasHashChange)
-        {
+        if (browser.safari && !browserHasHashChange) {
             var rememberDiv = document.createElement("div");
             rememberDiv.id = 'safari_rememberDiv';
             document.body.appendChild(rememberDiv);
@@ -501,58 +499,60 @@ BrowserHistory = (function() {
             reloader_content.style.left = reloader_content.style.top = 
'-9999px';
             iframe = reloader_content.getElementsByTagName('iframe')[0];
 
-            if (document.getElementById("safari_remember_field").value != "" ) 
{
+            if (document.getElementById("safari_remember_field").value != "") {
                 historyHash = 
document.getElementById("safari_remember_field").value.split(",");
             }
         }
 
-        if (browserHasHashChange)        
+        if (browserHasHashChange)
             document.body.onhashchange = hashChangeHandler;
     }
 
     return {
-        historyHash: historyHash, 
-        backStack: function() { return backStack; }, 
-        forwardStack: function() { return forwardStack }, 
-        getPlayer: getPlayer, 
+        historyHash: historyHash,
+        backStack: function() {
+            return backStack;
+        },
+        forwardStack: function() {
+            return forwardStack
+        },
+        getPlayer: getPlayer,
         initialize: function(src) {
             _initialize(src);
-        }, 
+        },
         setURL: function(url) {
             document.location.href = url;
-        }, 
+        },
         getURL: function() {
             return document.location.href;
-        }, 
+        },
         getTitle: function() {
             return document.title;
-        }, 
+        },
         setTitle: function(title) {
             try {
                 backStack[backStack.length - 1].title = title;
-            } catch(e) { }
+            } catch (e) {}
             //if on safari, set the title to be the empty string. 
             if (browser.safari) {
                 if (title == "") {
                     try {
-                    var tmp = window.location.href.toString();
-                    title = tmp.substring((tmp.lastIndexOf("/")+1), 
tmp.lastIndexOf("#"));
-                    } catch(e) {
+                        var tmp = window.location.href.toString();
+                        title = tmp.substring((tmp.lastIndexOf("/") + 1), 
tmp.lastIndexOf("#"));
+                    } catch (e) {
                         title = "";
                     }
                 }
             }
             document.title = title;
-        }, 
-        setDefaultURL: function(def)
-        {
+        },
+        setDefaultURL: function(def) {
             defaultHash = def;
             def = getHash();
             //trailing ? is important else an extra frame gets added to the 
history
             //when navigating back to the first page.  Alternatively could 
check
             //in history frame navigation to compare # and ?.
-            if (browser.ie)
-            {
+            if (browser.ie) {
                 window['_ie_firstload'] = true;
                 var sourceToSet = historyFrameSourcePrefix + def;
                 var func = function() {
@@ -562,13 +562,14 @@ BrowserHistory = (function() {
                 }
                 try {
                     func();
-                } catch(e) {
-                    window.setTimeout(function() { func(); }, 0);
+                } catch (e) {
+                    window.setTimeout(function() {
+                        func();
+                    }, 0);
                 }
             }
 
-            if (browser.safari)
-            {
+            if (browser.safari) {
                 currentHistoryLength = history.length;
                 if (historyHash.length == 0) {
                     historyHash[currentHistoryLength] = def;
@@ -579,20 +580,18 @@ BrowserHistory = (function() {
                 }
                 setInterval(checkForUrlChange, 50);
             }
-            
-            
-            if (browser.firefox || browser.opera)
-            {
+
+
+            if (browser.firefox || browser.opera) {
                 var reg = new RegExp("#" + def + "$");
-                if (window.location.toString().match(reg)) {
-                } else {
-                    var newloc ="#" + def;
+                if (window.location.toString().match(reg)) {} else {
+                    var newloc = "#" + def;
                     window.location.replace(newloc);
                 }
                 setInterval(checkForUrlChange, 50);
             }
 
-        }, 
+        },
 
         /* Set the current browser URL; called from inside BrowserManager to 
propagate
          * the application state out to the container.
@@ -601,39 +600,39 @@ BrowserHistory = (function() {
             if (browser.ie && typeof objectId != "undefined") {
                 currentObjectId = objectId;
             }
-           //fromIframe = fromIframe || false;
-           //fromFlex = fromFlex || false;
-           //alert("setBrowserURL: " + flexAppUrl);
-           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
-
-           var pos = document.location.href.indexOf('#');
-           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : 
document.location.href;
-           var newUrl = baseUrl + '#' + flexAppUrl;
-
-           if (document.location.href != newUrl && document.location.href + 
'#' != newUrl) {
-               currentHref = newUrl;
-               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
-               currentHistoryLength = history.length;
-           }
-        }, 
+            //fromIframe = fromIframe || false;
+            //fromFlex = fromFlex || false;
+            //alert("setBrowserURL: " + flexAppUrl);
+            //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+            var pos = document.location.href.indexOf('#');
+            var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : 
document.location.href;
+            var newUrl = baseUrl + '#' + flexAppUrl;
+
+            if (document.location.href != newUrl && document.location.href + 
'#' != newUrl) {
+                currentHref = newUrl;
+                addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+                currentHistoryLength = history.length;
+            }
+        },
 
         browserURLChange: function(flexAppUrl) {
             var objectId = null;
             if (browser.ie && currentObjectId != null) {
                 objectId = currentObjectId;
             }
-            
+
             if (typeof BrowserHistory_multiple != "undefined" && 
BrowserHistory_multiple == true) {
                 var pl = getPlayers();
                 for (var i = 0; i < pl.length; i++) {
                     try {
                         pl[i].browserURLChange(flexAppUrl);
-                    } catch(e) { }
+                    } catch (e) {}
                 }
             } else {
                 try {
                     getPlayer(objectId).browserURLChange(flexAppUrl);
-                } catch(e) { }
+                } catch (e) {}
             }
 
             currentObjectId = null;
@@ -653,44 +652,52 @@ BrowserHistory = (function() {
 
 // Automated unit testing and other diagnostics
 
-function setURL(url)
-{
+function setURL(url) {
     document.location.href = url;
 }
 
-function backButton()
-{
+function backButton() {
     history.back();
 }
 
-function forwardButton()
-{
+function forwardButton() {
     history.forward();
 }
 
-function goForwardOrBackInHistory(step)
-{
+function goForwardOrBackInHistory(step) {
     history.go(step);
 }
 
 //BrowserHistoryUtils.addEvent(window, "load", function() { 
BrowserHistory.initialize(); });
 (function(i) {
-    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var u = navigator.userAgent;
+    var e = /*@cc_on!@*/ false;
     var st = setTimeout;
-    if(/webkit/i.test(u)){
-        st(function(){
-            var dr=document.readyState;
-            if(dr=="loaded"||dr=="complete"){i();}
-            else{st(arguments.callee,10);}},10);
-    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || 
(/opera/i.test(u))){
-        document.addEventListener("DOMContentLoaded",i,false);
-    } else if(e){
-    (function(){
-        var t=document.createElement('doc:rdy');
-        try{t.doScroll('left');
-            i();t=null;
-        }catch(e){st(arguments.callee,0);}})();
-    } else{
-        window.onload=i;
-    }
-})( function() {BrowserHistory.initialize();} );
+    if (/webkit/i.test(u)) {
+        st(function() {
+            var dr = document.readyState;
+            if (dr == "loaded" || dr == "complete") {
+                i()
+            } else {
+                st(arguments.callee, 10);
+            }
+        }, 10);
+    } else if ((/mozilla/i.test(u) && !/(compati)/.test(u)) || 
(/opera/i.test(u))) {
+        document.addEventListener("DOMContentLoaded", i, false);
+    } else if (e) {
+        (function() {
+            var t = document.createElement('doc:rdy');
+            try {
+                t.doScroll('left');
+                i();
+                t = null;
+            } catch (e) {
+                st(arguments.callee, 0);
+            }
+        })();
+    } else {
+        window.onload = i;
+    }
+})(function() {
+    BrowserHistory.initialize();
+});
\ No newline at end of file


Reply via email to