Author: solomax
Date: Sun May 19 17:12:06 2013
New Revision: 1484316

URL: http://svn.apache.org/r1484316
Log:
[OPENMEETINGS-638] proper room enter is implemented

Added:
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomEnterButton.java
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.html
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.java
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/swf-functions.js
Modified:
    openmeetings/trunk/singlewebapp/WebContent/openmeetings/css/theme.css
    
openmeetings/trunk/singlewebapp/WebContent/openmeetings/openmeetings_functions.js
    
openmeetings/trunk/singlewebapp/WebContent/src/base/hibernate/hibRtmpConnection.lzx
    openmeetings/trunk/singlewebapp/WebContent/src/base/mainAttributes.lzx
    openmeetings/trunk/singlewebapp/WebContent/src/base/mainMethods.lzx
    openmeetings/trunk/singlewebapp/WebContent/swf10/main.as3.lzx
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.html
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.java
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
    
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/OmUrlFragment.java

Modified: openmeetings/trunk/singlewebapp/WebContent/openmeetings/css/theme.css
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/openmeetings/css/theme.css?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/openmeetings/css/theme.css 
(original)
+++ openmeetings/trunk/singlewebapp/WebContent/openmeetings/css/theme.css Sun 
May 19 17:12:06 2013
@@ -16,6 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+body {
+       margin: 0;
+}
 #header {
        font-size: 28px;
        line-height: 40px;

Modified: 
openmeetings/trunk/singlewebapp/WebContent/openmeetings/openmeetings_functions.js
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/openmeetings/openmeetings_functions.js?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/openmeetings/openmeetings_functions.js
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/openmeetings/openmeetings_functions.js
 Sun May 19 17:12:06 2013
@@ -41,7 +41,7 @@ function redirectToUrl(url) {
 }
 
 function loadingComplete() {
-       document.getElementById("loading").style.display = 'none';
+       document.getElementById("swfloading").style.display = 'none';
        var lzApp = document.getElementById("lzappContainer");
        lzApp.style.width = '100%';
        lzApp.style.height = '100%';

Modified: 
openmeetings/trunk/singlewebapp/WebContent/src/base/hibernate/hibRtmpConnection.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/src/base/hibernate/hibRtmpConnection.lzx?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/src/base/hibernate/hibRtmpConnection.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/src/base/hibernate/hibRtmpConnection.lzx
 Sun May 19 17:12:06 2013
@@ -177,6 +177,11 @@
             canvas.thishib.reconnectedRoomInstance.destroy();
             this.overwritePublicSID.doCall();
             this.setUsernameReconnect.doCall();
+        } else if (canvas.wicketsid != null) {
+            canvas.sessionId = canvas.wicketsid;
+                       canvas.sendViaLocalConnection(canvas.vid_lc_name, 
"setSessionId", [canvas.sessionId]);
+            canvas.thishib.loaderVar.setProgress();
+            this.getPublicSID.doCall();
         } else {
             this.refreshDelegate = new LzDelegate( this, "refreshSessionMeth" 
);
             //lz.Timer.addTimer( this.refreshDelegate, 60000 );
@@ -530,6 +535,9 @@
                         var obj = new Array();
                         obj["action"] = "recordModule";
                         loadContent(obj,null,null);
+                    } else if (canvas.wicketroomid > 0) {
+                       canvas.initroomid = canvas.wicketroomid;
+                        parent.getRoomById.doCall();
                     } else {
                         canvas.thishib.loaderVar.close();
                         parent.getRoomById.doCall();
@@ -547,6 +555,9 @@
                 //The onResult-Handler will be called be the rtmpconnection
                 if ($debug) Debug.write("getRoomById: ",value);
                 if (value!=null){
+                       if (canvas.wicketsid != null) {
+                               canvas.thishib.loaderVar.close();
+                       }
                     if (canvas.directUserLogin) {
                         canvas.directRoomObj = value;
                         canvas.thishib.loaderVar.close();
@@ -720,7 +731,9 @@
             //Debug.write("getUserSalutations ",value);
             canvas.salutationsInitValues = value;
             //check for password reset
-            if (canvas.isResetUsername){
+            if (canvas.wicketsid != null) {
+               parent.loginWicket.doCall();
+            } else if (canvas.isResetUsername){
                 if (canvas.thishib.loaderVar != null) {
                   canvas.thishib.loaderVar.close();
                 }
@@ -762,6 +775,56 @@
         </handler>  
     </netRemoteCallHib>
     
+       <netRemoteCallHib name="loginWicket" funcname="xmlcrm.loginWicket" >
+               <netparam><method name="getValue">return 
canvas.sessionId;</method></netparam>
+               <netparam><method name="getValue">return 
canvas.wicketsid;</method></netparam>
+               <handler name="ondata" args="value">
+               <![CDATA[
+                       if ($debug) Debug.write("!!!!!!!!!!! loginWicket", 
value);
+                       if (value != null) {
+                               canvas.setAttribute('user_id',value.user_id);
+                               
canvas.setAttribute('firstName',value.firstname);
+                               canvas.setAttribute('lastName',value.lastname);
+                               canvas.setAttribute('mail','');
+                               canvas.setAttribute('lastLogin','');
+                               canvas.setAttribute('official_code','');
+                               canvas.setAttribute('picture_uri','');
+                               canvas.setAttribute('language','');
+                               canvas.setAttribute('currentuser',value.login);
+                               if (value.omTimeZone != null) {
+                                       
canvas.setAttribute('jNameTimeZone',value.omTimeZone.jname);
+                                       canvas.timeZoneId = 
value.omTimeZone.omtimezoneId;
+                               }
+                               canvas.becomemoderator = value.level_id >= 2;
+                               if (value.sessionData == null) {
+                                       if ($debug) Debug.write("No Language 
Found to assign");
+                                       new 
lz.checkLoginData(canvas.main_content._content.inner);
+                                       return;
+                               }
+                               var found = false;
+                               for (var 
i=0;i<value.organisation_users.length;i++) {
+                                       if 
(value.organisation_users[i].organisation.organisation_id == 
value.sessionData.organization_id) {
+                                               found = true;
+                                               hib.currentdomain = 
value.organisation_users[i].organisation.name;
+                                               hib.currentdomainObj = 
value.organisation_users[i].organisation;
+                                               break;
+                                       }
+                               }
+                               parent.getCurrentRoomClient.doCall();
+                               /*
+                               if (found) {
+                                       hib.getLanguageByIdAndMax.start = 0;
+                                       hib.getLanguageByIdAndMax.doCall();
+                                       canvas.focusOnItem = null;
+                               } else {
+                                       if ($debug) Debug.write("No 
Organization Found to assign");
+                                       new 
lz.checkLoginData(canvas.main_content._content.inner);
+                               }*/
+                       }
+               ]]>
+               </handler>
+       </netRemoteCallHib>
+    
     <netRemoteCallHib name="loginByRemember" funcname="xmlcrm.loginByRemember" 
>
         <attribute name="currentHashSession" value="" type="string"/>
         <attribute name="sipLoader" value="null"/>   
@@ -790,11 +853,7 @@
                         new lz.labelerrorPopup(canvas,{errorlabelid:1150});
                     }
                     
-                    if (value.level_id >= 2) {
-                        canvas.becomemoderator = true;
-                    } else {
-                        canvas.becomemoderator = false;
-                    }
+                    canvas.becomemoderator = value.level_id >= 2;
                     
                     if (value.sessionData == null) {
                         if ($debug) Debug.write("No Language Found to assign");

Modified: openmeetings/trunk/singlewebapp/WebContent/src/base/mainAttributes.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/src/base/mainAttributes.lzx?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/src/base/mainAttributes.lzx 
(original)
+++ openmeetings/trunk/singlewebapp/WebContent/src/base/mainAttributes.lzx Sun 
May 19 17:12:06 2013
@@ -326,6 +326,10 @@ the LAST RoomClient Object that has been
 <attribute name="secureRemoteUserLogin" value="false" type="boolean" />
 <attribute name="secureHash" value="" type="string" />
 
+<!-- Attributes for wicket login (since it hard not to break anything)-->
+<attribute name="wicketsid" type="string" />
+<attribute name="wicketroomid" value="0" type="number" />
+
 <!--- skip loading of Language -->
 <attribute name="language_id" value="0" type="number" />
 <!--- application default language -->

Modified: openmeetings/trunk/singlewebapp/WebContent/src/base/mainMethods.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/src/base/mainMethods.lzx?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/src/base/mainMethods.lzx 
(original)
+++ openmeetings/trunk/singlewebapp/WebContent/src/base/mainMethods.lzx Sun May 
19 17:12:06 2013
@@ -424,6 +424,12 @@
             hib.userScope = scopeRoomId;
         }
         
+        var wicketsid = lz.Browser.getInitArg('wicketsid');
+        var wicketroomid = lz.Browser.getInitArg('wicketroomid');
+        if (wicketsid != undefined && wicketroomid != undefined && 
!isNaN(wicketroomid)) {
+               canvas.setAttribute('wicketsid', wicketsid);
+               canvas.setAttribute('wicketroomid', Number(wicketroomid));
+        }
         this.setBaseColors();
     
         //Debug.write("rtmphostlocal,rtmphost: 
",canvas.rtmphostlocal,canvas.rtmphost); 

Modified: openmeetings/trunk/singlewebapp/WebContent/swf10/main.as3.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/main.as3.lzx?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/swf10/main.as3.lzx (original)
+++ openmeetings/trunk/singlewebapp/WebContent/swf10/main.as3.lzx Sun May 19 
17:12:06 2013
@@ -95,7 +95,9 @@
     <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');
+        var tInitArgsArry = new 
Array('secureHash','invitationHash','sid','roomid','directRoomId'
+               
,'language','hash','cuser','tAccept','moodleRoom','becomemoderator','wwwroot','user_id'
+               ,'picture','scopeRoomId', 'wicketsid', 'wicketroomid');
     
         this.setAttribute('lc_SID', this.getLCSID());
         this.setAttribute('vid_lc_name', lc_SID + '__videoLC');

Modified: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
 Sun May 19 17:12:06 2013
@@ -220,6 +220,29 @@ public class MainService implements IPen
                return -1L;
        }
 
+       public User loginWicket(String SID, String wicketSID) {
+               Long userId = sessiondataDao.checkSession(wicketSID);
+               User u = userId == null ? null : usersDao.get(userId);
+               if (u != null) {
+                       IConnection current = Red5.getConnectionLocal();
+                       Client currentClient = 
sessionManager.getClientByStreamId(current.getClient().getId(), null);
+                       
+                       if (!u.getOrganisation_users().isEmpty()) {
+                               
u.setSessionData(sessiondataDao.getSessionByHash(wicketSID));
+                               currentClient.setUser_id(u.getUser_id());
+                               
SessionVariablesUtil.setUserId(current.getClient(), u.getUser_id());
+                       
+                               currentClient.setFirstname(u.getFirstname());
+                               currentClient.setLastname(u.getLastname());
+                               
+                               
scopeApplicationAdapter.syncMessageToCurrentScope("roomConnect", currentClient, 
false);
+                               
+                               return u;
+                       }
+               }
+               return null;
+       }
+       
        public User loginByRemember(String SID, String remoteHashId) {
                try {
 

Modified: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.html
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.html?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.html
 (original)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.html
 Sun May 19 17:12:06 2013
@@ -19,53 +19,13 @@
   
 -->
 <html xmlns:wicket="http://wicket.apache.org";>
-<head>
+<wicket:head>
        <meta http-equiv="cache-control" content="no-cache">
        
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
        <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
        <title wicket:id="titleAppName"></title>
-       <script type="text/javascript">
-               // If loaded bare into a browser, set the browser size to the 
canvas size
-               if (window === top) {
-                       (function(width, height) {
-                               // Cf. 
http://www.quirksmode.org/viewport/compatibility.html
-                               if (window.innerHeight) {
-                                       // Sadly, innerHeight/Width is not r/w 
on some browsers, and resizeTo is for outerHeight/Width
-                                       window.resizeTo(
-                                                       width ? (width + 
window.outerWidth - window.innerWidth)
-                                                                       : 
window.outerWidth, height ? (height
-                                                                       + 
window.outerHeight - window.innerHeight)
-                                                                       : 
window.outerHeight);
-                               } else if (document.documentElement
-                                               && 
document.documentElement.clientHeight) {
-                                       if (width) {
-                                               
document.documentElement.clientWidth = width;
-                                       }
-                                       if (height) {
-                                               
document.documentElement.clientHeight = height;
-                                       }
-                               } else {
-                                       if (width) {
-                                               document.body.clientWidth = 
width;
-                                       }
-                                       if (height) {
-                                               document.body.clientHeight = 
height;
-                                       }
-                               }
-                       })(null, null);
-               }
-       </script>
-       
-       <script type="text/javascript" src="embed-compressed.js"></script>
-       <script type="text/javascript" src="openmeetings_functions.js"></script>
-       <script type="text/javascript">
-               function getAppletStatus() {
-                       return false;
-               }
-       </script>
-       
        <style type="text/css">
                html,body { /* http://www.quirksmode.org/css/100percheight.html 
*/
                        height: 100%;
@@ -75,41 +35,17 @@
                        border: 0 none;
                        overflow: hidden;
                }
-               
                body {
                        background-color: #ffffff;
                }
-               
                img {
                        border: 0 none;
                }
        </style>
-</head>
-<body>
-       <script type="text/javascript">
-               lz.embed.swf({
-                       url : swfurl,
-                       allowfullscreen : 'true',
-                       bgcolor : '#ffffff',
-                       width : '100%',
-                       height : '100%',
-                       id : 'lzapp',
-                       accessible : 'false'
-               });
-
-               lz.embed.lzapp.onloadstatus = function loadstatus(p) {
-                       // called with a percentage (0-100) indicating load 
progress
-               }
-
-               lz.embed.lzapp.onload = function loaded() {
-                       // called when this application is done loading
-               }
-       </script>
-       <div id="loading"
-               style="z-index: 666666; position: absolute; top: 50%; left: 
50%;">
-               <img src="images/ajax-loader.gif" />
-       </div>
-       <noscript>Please enable JavaScript in order to use this
-               application.</noscript>
-</body>
+</wicket:head>
+<wicket:extend>
+<!-- <body style="width: 100%; height: 100%;"> -->
+       <div wicket:id="room" style="width: 100%; height: 100%;"></div>
+<!--  </body> -->
+</wicket:extend>
 </html>
\ No newline at end of file

Modified: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.java?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/SwfPage.java
 Sun May 19 17:12:06 2013
@@ -21,19 +21,12 @@ package org.apache.openmeetings.web.page
 import static org.apache.openmeetings.web.app.Application.getBean;
 
 import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.JavaScriptHeaderItem;
-import org.apache.wicket.markup.html.WebPage;
+import org.apache.openmeetings.web.user.rooms.RoomPanel;
 import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.request.Url;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.mapper.parameter.PageParametersEncoder;
-import org.apache.wicket.util.string.StringValue;
 
-public class SwfPage extends WebPage {
+public class SwfPage extends BaseNotInitedPage {
        private static final long serialVersionUID = 6492618860620779445L;
-       private final String swf;
-       private final Url url;
 
        public SwfPage() {
                this(new PageParameters());
@@ -41,14 +34,7 @@ public class SwfPage extends WebPage {
 
        public SwfPage(PageParameters pp) {
                add(new Label("titleAppName", 
getBean(ConfigurationDao.class).getAppName()));
-               StringValue swfVal = pp.get("swf");
-               swf = swfVal.isEmpty() ? "main.as3.swf11.swf" : 
swfVal.toString();
-               url = new PageParametersEncoder().encodePageParameters(pp);
+               add(new RoomPanel("room", pp));
        }
        
-       @Override
-       public void renderHead(IHeaderResponse response) {
-               super.renderHead(response);
-               
response.render(JavaScriptHeaderItem.forScript(String.format("var swfurl = 
\"%1$s?%2$s\";", swf, url), "swfurl"));
-       }
 }

Added: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomEnterButton.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomEnterButton.java?rev=1484316&view=auto
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomEnterButton.java
 (added)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomEnterButton.java
 Sun May 19 17:12:06 2013
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.user.rooms;
+
+import org.apache.openmeetings.web.pages.MainPage;
+import org.apache.openmeetings.web.util.OmUrlFragment;
+import org.apache.openmeetings.web.util.OmUrlFragment.AreaKeys;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.form.Button;
+
+public class RoomEnterButton extends Button {
+       private static final long serialVersionUID = 2595652041789240294L;
+
+       public RoomEnterButton(String id, final long roomid) {
+               super(id);
+               
+               add(new AjaxEventBehavior("click"){
+                       private static final long serialVersionUID = 
-5195740583653865055L;
+
+                       @Override
+                       protected void onEvent(AjaxRequestTarget target) {
+                               ((MainPage)getPage()).updateContents(new 
OmUrlFragment(AreaKeys.room, "" + roomid), target);
+                       }
+               });
+       }
+}

Added: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.html
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.html?rev=1484316&view=auto
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.html
 (added)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.html
 Sun May 19 17:12:06 2013
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+      http://www.apache.org/licenses/LICENSE-2.0
+         
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  
+-->
+<html xmlns:wicket="http://wicket.apache.org";>
+<wicket:head>
+       <script type="text/javascript" src="openmeetings_functions.js"></script>
+</wicket:head>
+<wicket:panel>
+       <div id="swfloading"
+               style="z-index: 666666; position: absolute; top: 50%; left: 
50%;">
+               <img src="images/ajax-loader.gif" />
+       </div>
+       <noscript>Please enable JavaScript in order to use this 
application.</noscript>
+       <script type="text/javascript">
+               initSwf();
+       </script>
+</wicket:panel>
+</html>
\ No newline at end of file

Added: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.java?rev=1484316&view=auto
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.java
 (added)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomPanel.java
 Sun May 19 17:12:06 2013
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.user.rooms;
+
+import java.util.Map;
+
+import org.apache.openmeetings.web.common.BasePanel;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.JavaScriptHeaderItem;
+import org.apache.wicket.markup.head.PriorityHeaderItem;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.Url;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.mapper.parameter.PageParametersEncoder;
+import org.apache.wicket.request.resource.ResourceReference;
+import org.apache.wicket.resource.TextTemplateResourceReference;
+import org.apache.wicket.util.collections.MicroMap;
+import org.apache.wicket.util.string.StringValue;
+
+public class RoomPanel extends BasePanel {
+       private static final long serialVersionUID = 2308988314987829510L;
+       private final String swf;
+       private final PageParameters pp;
+       
+       public RoomPanel(String id) {
+               this(id, new PageParameters());
+       }
+       
+       public RoomPanel(String id, PageParameters pp) {
+               super(id);
+               this.pp = pp;
+               StringValue swfVal = pp.get("swf");
+               swf = swfVal.isEmpty() ? "maindebug.as3.swf11.swf" : 
swfVal.toString(); //FIXME
+       }
+
+       private IModel<Map<String, Object>> newResourceModel() {
+               Url url = new PageParametersEncoder().encodePageParameters(pp);
+               return Model.ofMap(new MicroMap<String, Object>("swfurl", swf + 
url));
+       }
+       
+       private ResourceReference newResourceReference() {
+               return new TextTemplateResourceReference(RoomPanel.class, 
"swf-functions.js", this.newResourceModel());
+       }
+       
+       @Override
+       public void renderHead(IHeaderResponse response) {
+               super.renderHead(response);
+               response.render(new 
PriorityHeaderItem(JavaScriptHeaderItem.forReference(newResourceReference())));
+       }
+}

Modified: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.html?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
 (original)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.html
 Sun May 19 17:12:06 2013
@@ -19,16 +19,16 @@
   
 -->
 <html xmlns:wicket="http://wicket.apache.org";>
-       <wicket:panel>
-               <table style="border-collapse: collapse;">
-                       <tr wicket:id="list" style="background-color: rgb(248, 
248, 248); border-bottom: 5px solid white;">
-                               <td>
-                                       <span wicket:id="roomName">[room 
name]</span><br/>
-                                       <wicket:ommessage key="398" 
/>&nbsp;<span wicket:id="curUsers"></span>&nbsp;/&nbsp;<span
-                                       
wicket:id="totalUsers"></span>&nbsp;&nbsp;<span wicket:id="refresh" 
-                                       class="ui-icon 
ui-icon-arrowrefresh-1-n" style="display: inline-block"></span></td>
-                               <td><button><wicket:ommessage 
key="131"/></button></td>
-                       </tr>
-               </table>
-       </wicket:panel>
+<wicket:panel>
+       <table style="border-collapse: collapse;">
+               <tr wicket:id="list" style="background-color: rgb(248, 248, 
248); border-bottom: 5px solid white;">
+                       <td>
+                               <span wicket:id="roomName">[room 
name]</span><br/>
+                               <wicket:ommessage key="398" />&nbsp;<span 
wicket:id="curUsers"></span>&nbsp;/&nbsp;<span
+                               wicket:id="totalUsers"></span>&nbsp;&nbsp;<span 
wicket:id="refresh" 
+                               class="ui-icon ui-icon-arrowrefresh-1-n" 
style="display: inline-block"></span></td>
+                       <td><button wicket:id="enter"><wicket:ommessage 
key="131"/></button></td>
+               </tr>
+       </table>
+</wicket:panel>
 </html>

Modified: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.java?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/RoomsPanel.java
 Sun May 19 17:12:06 2013
@@ -48,6 +48,7 @@ public class RoomsPanel extends UserPane
                                final Label curUsers = new Label("curUsers", 
curUsersModel);
                                item.add(curUsers.setOutputMarkupId(true));
                                item.add(new Label("totalUsers", 
r.getNumberOfPartizipants()));
+                               item.add(new RoomEnterButton("enter", 
r.getRooms_id()));
                                item.add(new AjaxLink<Void>("refresh") {
                                        private static final long 
serialVersionUID = -3426813755917489787L;
 

Added: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/swf-functions.js
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/swf-functions.js?rev=1484316&view=auto
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/swf-functions.js
 (added)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/rooms/swf-functions.js
 Sun May 19 17:12:06 2013
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+function getAppletStatus() {
+       return false;
+}
+
+function initSwf() {
+       var general = {
+                       url : "${swfurl}",
+                       bgcolor : '#ffffff',
+                       width : '100%',
+                       height : '100%',
+                       id : 'lzapp',
+                       __lzminimumversion : 8
+               };
+       var options = $.extend(general, {allowfullscreen : 'true'});
+       $('#header, #topLinks, #menu').hide();
+       var embed = $('<embed>').attr('quality', 'high').attr('bgcolor', 
options.bgcolor)
+               .attr('src', options.url)
+               .attr('wmode', 'window').attr('allowfullscreen', true)
+               .attr('width', options.width).attr('height', options.height)
+               .attr('id', 'lzapp').attr('name', 'lzapp')
+               .attr('flashvars', escape($.param(general)))
+               .attr('swliveconnect', true).attr('align', 'middle')
+               .attr('allowscriptaccess', 'sameDomain').attr('type', 
'application/x-shockwave-flash')
+               .attr('pluginspage', 
'http://www.macromedia.com/go/getflashplayer');
+       $('#swfloading').after($('<div 
id="lzappContainer">').append(embed)).width('1px').height('1px');
+}

Modified: 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/OmUrlFragment.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/OmUrlFragment.java?rev=1484316&r1=1484315&r2=1484316&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/OmUrlFragment.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/OmUrlFragment.java
 Sun May 19 17:12:06 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.openmeetings.web.util;
 
+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;
 
@@ -36,7 +37,9 @@ import org.apache.openmeetings.web.user.
 import org.apache.openmeetings.web.user.dashboard.OmDashboardPanel;
 import org.apache.openmeetings.web.user.profile.SettingsPanel;
 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;
@@ -223,6 +226,17 @@ public class OmUrlFragment implements Se
                                }
                                break;
                        case room:
+                               try {
+                                       Long roomId = Long.parseLong(type);
+                                       if (roomId != null) {
+                                               PageParameters pp = new 
PageParameters();
+                                               pp.add("wicketsid", getSid());
+                                               pp.add("wicketroomid", roomId);
+                                               basePanel = new 
RoomPanel(CHILD_ID, pp);
+                                       }
+                               } catch(NumberFormatException ne) {
+                                       //skipit, bad roomid passed
+                               }
                                break;
                        case rooms:
                                MenuParams params = MenuParams.publicTabButton;


Reply via email to