Author: sebawagner
Date: Tue Apr 17 18:35:47 2012
New Revision: 1327213

URL: http://svn.apache.org/viewvc?rev=1327213&view=rev
Log:
OPENMEETINGS-177 Meeting Room Invitation Link Not working

Modified:
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/flexibleConferenceRoom/appointmentNotificationPopUp.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/invitation/invitationQuickLoader.lzx
    
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java
    
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ConferenceService.java

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/flexibleConferenceRoom/appointmentNotificationPopUp.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/flexibleConferenceRoom/appointmentNotificationPopUp.lzx?rev=1327213&r1=1327212&r2=1327213&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/flexibleConferenceRoom/appointmentNotificationPopUp.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/conference/flexibleConferenceRoom/appointmentNotificationPopUp.lzx
 Tue Apr 17 18:35:47 2012
@@ -34,11 +34,10 @@
        <netRemoteCallHib name="getAppointMentAndTimeZones" 
remotecontext="$once{ canvas.thishib }" 
                funcname="conferenceservice.getAppointMentAndTimeZones" >   
                <netparam><method name="getValue">return 
parent.parent.roomobj.rooms_id;</method></netparam>
-               <netparam><method name="getValue">return 
canvas.user_id;</method></netparam>
-               
                <handler name="ondata" args="value">    
                    <![CDATA[
-                       if ($debug) Debug.write("getAppointmentData: ",value);
+                       if ($debug) Debug.write("getAppointMentAndTimeZones 1: 
",parent.roomobj.rooms_id);
+                       if ($debug) Debug.write("getAppointMentAndTimeZones 2: 
",value);
                        
                        if(value!=null){
                                

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/invitation/invitationQuickLoader.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/invitation/invitationQuickLoader.lzx?rev=1327213&r1=1327212&r2=1327213&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/invitation/invitationQuickLoader.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/invitation/invitationQuickLoader.lzx
 Tue Apr 17 18:35:47 2012
@@ -39,7 +39,7 @@
                                this.showLoginStep();
                 if ($debug) Debug.write("invitationQuickLoader:oninit userlang 
= [",userlang,"]; canvas.lang = [",canvas.language_id,"]");
                 if (canvas.language_id > 0) {
-                    this.getRoomClients.doCall();
+                    this.isRoomFull.doCall();
                 } else {
                     this.showLoginStep();
                 }
@@ -59,24 +59,20 @@
                        this.checkInvitationPass.doCall();
                </method>
                
-               <netRemoteCallHib name="getRoomClients" 
funcname="getRoomClients" 
+               <netRemoteCallHib name="isRoomFull" 
funcname="conferenceservice.isRoomFull" 
                                                        remotecontext="$once{ 
canvas.thishib }" activeErrorHandler="true" >     
                <netparam name="pass"><method name="getValue">return 
canvas.thishib.currentInvitation.room.rooms_id;</method></netparam>
                <handler name="ondata" args="value">
                        <![CDATA[
                        //The onResult-Handler will be called be the 
rtmpconnection
-                       if ($debug) 
Debug.write(canvas.thishib.currentInvitation.room);
-                                       if ($debug) 
Debug.write("getRoomClients: ",value);
-                                       var number = 0;
-                                       for (var eg in value) {
-                                               number++;
-                                       }
-                                       if ($debug) 
Debug.write(canvas.thishib.currentInvitation.room.numberOfPartizipants);
-                                       if ($debug) Debug.write("number: 
",number);
-                                       if 
(canvas.thishib.currentInvitation.room.numberOfPartizipants >= number+1) {
-                                               parent.login();
-                                       } else {
+                       if ($debug) 
Debug.write(canvas.thishib.currentInvitation.room.rooms_id);
+                                       if ($debug) Debug.write("isRoomFull: 
",value);
+                                       
+                                       if (value) {
                                                new 
lz.labelerrorPopup(canvas,{errorlabelid:618});
+                                               parent.close();
+                                       } else {
+                                               parent.login();
                                        }
                ]]>
                </handler>   

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java?rev=1327213&r1=1327212&r2=1327213&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java
 Tue Apr 17 18:35:47 2012
@@ -1472,7 +1472,7 @@ public class Usermanagement {
        public Users getUserById(Long id) {
                log.debug("Usermanagement.getUserById");
 
-               if (id == 0) {
+               if (id == null || id <= 0) {
                        return null;
                }
                CriteriaBuilder cb = em.getCriteriaBuilder();

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ConferenceService.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ConferenceService.java?rev=1327213&r1=1327212&r2=1327213&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ConferenceService.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/ConferenceService.java
 Tue Apr 17 18:35:47 2012
@@ -299,25 +299,24 @@ public class ConferenceService {
 
        // 
--------------------------------------------------------------------------------------------
 
-       public Map<String, Object> getAppointMentAndTimeZones(Long room_id,
-                       Long user_id) {
-               log.debug("getAppointMentDataForRoom");
-
-               IConnection current = Red5.getConnectionLocal();
-               String streamid = current.getClient().getId();
-
-               log.debug("getCurrentRoomClient -2- " + streamid);
-
-               RoomClient currentClient = this.clientListManager
-                               .getClientByStreamId(streamid);
-               currentClient.setUser_id(user_id);
-
-               Rooms room = roommanagement.getRoomById(room_id);
-
-               if (room.getAppointment() == false)
-                       return null;
-
+       public Map<String, Object> getAppointMentAndTimeZones(Long room_id) {
                try {
+                       log.debug("getAppointMentDataForRoom");
+                       
+                       IConnection current = Red5.getConnectionLocal();
+                       String streamid = current.getClient().getId();
+       
+                       log.debug("getCurrentRoomClient -2- " + streamid);
+       
+                       RoomClient currentClient = this.clientListManager
+                                       .getClientByStreamId(streamid);
+       
+                       Rooms room = roommanagement.getRoomById(room_id);
+       
+                       if (room.getAppointment() == false) {
+                               throw new IllegalStateException("Room has no 
appointment");
+                       }
+               
                        Appointment appointment = appointmentLogic
                                        .getAppointmentByRoom(room_id);
 
@@ -326,7 +325,6 @@ public class ConferenceService {
                        returnMap.put("appointment", appointment);
 
                        Users us = 
userManagement.getUserById(currentClient.getUser_id());
-
                        TimeZone timezone = timezoneUtil.getTimezoneByUser(us);
 
                        returnMap.put("appointment", appointment);
@@ -339,11 +337,11 @@ public class ConferenceService {
                                        "end",
                                        
CalendarPatterns.getDateWithTimeByMiliSeconds(
                                                        
appointment.getAppointmentEndtime(), timezone));
-                       returnMap.put("timeZone", us.getOmTimeZone().getIcal());
+                       returnMap.put("timeZone", timezone.getDisplayName());
 
                        return returnMap;
                } catch (Exception e) {
-                       log.error("getAppointMentAndTimeZones " + 
e.getMessage());
+                       log.error("getAppointMentAndTimeZones " , e );
                        return null;
                }
 
@@ -727,6 +725,28 @@ public class ConferenceService {
                long user_level = userManagement.getUserLevelByID(users_id);
                return roommanagement.deleteRoomById(user_level, rooms_id);
        }
+       
+       /**
+        * return all participants of a room
+        * 
+        * @param room_id
+        * @return
+        */
+       public boolean isRoomFull(Long room_id) {
+               try {
+                       Rooms room = roommanagement.getRoomById(room_id);
+                       
+                       if (room.getNumberOfPartizipants() <= 
this.clientListManager
+                                       .getClientListByRoom(room_id).size()) {
+                               return true;
+                       }
+                       
+                       return false;
+               } catch (Exception err) {
+                       log.error("[isRoomFull]", err);
+               }
+               return true;
+       }
 
        /**
         * return all participants of a room
@@ -737,14 +757,12 @@ public class ConferenceService {
        public List<RoomClient> getRoomClientsListByRoomId(Long room_id) {
                log.debug("getRoomClientsListByRoomId");
                try {
-                       // log.error("getRoomClientsListByRoomId: "+room_id);
                        LinkedList<RoomClient> clients = new 
LinkedList<RoomClient>();
                        HashMap<String, RoomClient> clientList = 
this.clientListManager
                                        .getClientListByRoom(room_id);
                        for (Iterator<String> iter = 
clientList.keySet().iterator(); iter
                                        .hasNext();) {
                                RoomClient rcl = clientList.get(iter.next());
-                               // log.error("COMPARE: "+rcl.getRoom_id()+" || 
"+room_id);
                                clients.add(rcl);
                        }
                        return clients;


Reply via email to