Author: seba.wagner
Date: Wed Jan 28 09:08:31 2009
New Revision: 1861

Modified:
    trunk/webapp/filetest.keystore
     
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.hbm.xml
     
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.java
    trunk/webapp/src/app/org/openmeetings/app/remote/WhiteBoardService.java
     
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ClientListManager.java
     
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
     
trunk/webapp/webapp/openmeetings/WEB-INF/red5-services/whiteboardservice.service.xml

Log:
Fixes:
Issue 601 Add Moderated Room
=> server-side part => adds new Var: canDraw to RoomClient-Object

Modified: trunk/webapp/filetest.keystore
==============================================================================
Binary files. No diff available.

Modified:  
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.hbm.xml
==============================================================================
---  
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.hbm.xml
   
(original)
+++  
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.hbm.xml
   
Wed Jan 28 09:08:31 2009
@@ -35,5 +35,6 @@
      <property name="broadCastID" type="long" column="broadcast_id"/>
      <property name="publicSID" type="string" column="public_sid"/>
      <property name="zombieCheckFlag" type="boolean"  
column="zombieCheckFlag"/>
+    <property name="canDraw" type="boolean" column="canDraw"/>
    </class>
  </hibernate-mapping>

Modified:  
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.java
==============================================================================
---  
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.java
      
(original)
+++  
trunk/webapp/src/app/org/openmeetings/app/hibernate/beans/recording/RoomClient.java
      
Wed Jan 28 09:08:31 2009
@@ -44,6 +44,7 @@
         *
         */
        private Boolean isMod = false;
+       private Boolean canDraw = false;
        private Date connectedSince;
        private String formatedDate;
        
@@ -136,50 +137,6 @@
                this.lastname = lastname;
        }
        
-       
-       public RoomClient(Long roomClientId, String username, String streamid,
-                       String scope, String publicSID, Boolean isMod, Date 
connectedSince,
-                       String formatedDate, String usercolor, Integer userpos,
-                       String userip, int userport, Long room_id, Date 
roomEnter,
-                       long broadCastID, Long user_id, String firstname, 
String lastname,
-                       String mail, String lastLogin, String official_code,
-                       String picture_uri, String language, Boolean 
isChatNotification,
-                       Long chatUserRoomId, String avsettings, String swfurl,
-                       Boolean isRecording, String roomRecordingName,
-                       Boolean zombieCheckFlag) {
-               super();
-               this.roomClientId = roomClientId;
-               this.username = username;
-               this.streamid = streamid;
-               this.scope = scope;
-               this.publicSID = publicSID;
-               this.isMod = isMod;
-               this.connectedSince = connectedSince;
-               this.formatedDate = formatedDate;
-               this.usercolor = usercolor;
-               this.userpos = userpos;
-               this.userip = userip;
-               this.userport = userport;
-               this.room_id = room_id;
-               this.roomEnter = roomEnter;
-               this.broadCastID = broadCastID;
-               this.user_id = user_id;
-               this.firstname = firstname;
-               this.lastname = lastname;
-               this.mail = mail;
-               this.lastLogin = lastLogin;
-               this.official_code = official_code;
-               this.picture_uri = picture_uri;
-               this.language = language;
-               this.isChatNotification = isChatNotification;
-               this.chatUserRoomId = chatUserRoomId;
-               this.avsettings = avsettings;
-               this.swfurl = swfurl;
-               this.isRecording = isRecording;
-               this.roomRecordingName = roomRecordingName;
-               this.zombieCheckFlag = zombieCheckFlag;
-       }
-       
        /**
       *
       * @hibernate.id
@@ -539,6 +496,18 @@
        }
        public void setZombieCheckFlag(Boolean zombieCheckFlag) {
                this.zombieCheckFlag = zombieCheckFlag;
+       }
+
+       /**
+     * @hibernate.property
+     *  column="canDraw"
+     *  type="boolean"
+     */
+       public Boolean getCanDraw() {
+               return canDraw;
+       }
+       public void setCanDraw(Boolean canDraw) {
+               this.canDraw = canDraw;
        }
        


Modified:  
trunk/webapp/src/app/org/openmeetings/app/remote/WhiteBoardService.java
==============================================================================
--- trunk/webapp/src/app/org/openmeetings/app/remote/WhiteBoardService.java     
 
(original)
+++ trunk/webapp/src/app/org/openmeetings/app/remote/WhiteBoardService.java     
 
Wed Jan 28 09:08:31 2009
@@ -7,8 +7,12 @@
  import java.util.Map;

  import org.openmeetings.app.conference.whiteboard.WhiteboardSyncLockObject;
+import org.openmeetings.app.data.basic.AuthLevelmanagement;
+import org.openmeetings.app.data.basic.Sessionmanagement;
+import org.openmeetings.app.data.user.Usermanagement;
  import org.openmeetings.app.hibernate.beans.recording.RoomClient;
  import org.openmeetings.app.remote.red5.ClientListManager;
+import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
  import org.openmeetings.app.remote.red5.WhiteBoardObjectListManager;
  import org.red5.server.api.IConnection;
  import org.red5.server.api.IScope;
@@ -33,6 +37,7 @@
        private static WhiteBoardService instance = null;
        
        //Beans, see red5-web.xml
+       private ScopeApplicationAdapter scopeApplicationAdapter = null;
        private ClientListManager clientListManager = null;
        private WhiteBoardObjectListManager whiteBoardObjectListManager = null;
        
@@ -57,6 +62,13 @@
                        WhiteBoardObjectListManager 
whiteBoardObjectListManager) {
                this.whiteBoardObjectListManager = whiteBoardObjectListManager;
        }
+       public ScopeApplicationAdapter getScopeApplicationAdapter() {
+               return scopeApplicationAdapter;
+       }
+       public void setScopeApplicationAdapter(
+                       ScopeApplicationAdapter scopeApplicationAdapter) {
+               this.scopeApplicationAdapter = scopeApplicationAdapter;
+       }

        /**
         * Loading the List of Objects on the whiteboard
@@ -81,6 +93,53 @@
                        return itemList;
                } catch (Exception err) {
                        log.error("[getRoomItems]",err);
+               }
+               return null;
+       }
+       
+       /**
+        * change the draw status of a user, allow disallow him to draw anybody 
 
besides the Moderator to
+        * draw on the whiteboard, only a Moderator is allowed to trigger this  
function
+        *
+        * @param SID
+        * @param publicSID
+        * @param canDraw
+        * @return
+        */
+       public Boolean setCanDraw(String SID, String publicSID, boolean 
canDraw) {
+               try {
+                       
+                       IConnection current = Red5.getConnectionLocal();
+                       String streamid = current.getClient().getId();
+                       RoomClient currentClient =  
this.clientListManager.getClientByStreamId(streamid);
+                       
+                       Long users_id = 
Sessionmanagement.getInstance().checkSession(SID);
+               Long user_level =  
Usermanagement.getInstance().getUserLevelByID(users_id);
+       
+               if 
(AuthLevelmanagement.getInstance().checkUserLevel(user_level))  
{
+                       
+                       if (currentClient.getIsMod()) {
+                               RoomClient rcl =  
this.clientListManager.getClientByPublicSID(publicSID);
+                               
+                               if (rcl != null) {
+                                       rcl.setCanDraw(canDraw);
+                                        
this.clientListManager.updateClientByStreamId(rcl.getStreamid(), rcl);
+                                       
+                                       HashMap<Integer,Object> newMessage = 
new  
HashMap<Integer,Object>();
+                                       newMessage.put(0,"updateDrawStatus");
+                                       newMessage.put(1,rcl);
+                                       
this.scopeApplicationAdapter.sendMessageWithClient(newMessage);
+                                       
+                               } else {
+                                       return false;
+                               }
+                       } else {
+                               return false;
+                       }
+               }
+                       
+               } catch (Exception err) {
+                       log.error("[setCanDraw]",err);
                }
                return null;
        }

Modified:  
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ClientListManager.java
==============================================================================
---  
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ClientListManager.java    
 
(original)
+++  
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ClientListManager.java    
 
Wed Jan 28 09:08:31 2009
@@ -47,6 +47,7 @@
                        rcm.setUserip(remoteAddress);
                        rcm.setSwfurl(swfUrl);                  
                        rcm.setIsMod(new Boolean(false));
+                       rcm.setCanDraw(new Boolean(false));
                        
                        if (clientList.containsKey(streamId)){
                                log.error("Tried to add an existing Client 
"+streamId);

Modified:  
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
==============================================================================
---  
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
       
(original)
+++  
trunk/webapp/src/app/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
       
Wed Jan 28 09:08:31 2009
@@ -862,7 +862,6 @@
                try {
                        IConnection current = Red5.getConnectionLocal();
                        RoomClient currentClient =  
this.clientListManager.getClientByStreamId(current.getClient().getId());
-                       Long room_id = currentClient.getRoom_id();      
                                
                        //Send to all Clients of that Scope(Room)
                        Iterator<IConnection> it = 
current.getScope().getConnections();

Modified:  
trunk/webapp/webapp/openmeetings/WEB-INF/red5-services/whiteboardservice.service.xml
==============================================================================
---  
trunk/webapp/webapp/openmeetings/WEB-INF/red5-services/whiteboardservice.service.xml
     
(original)
+++  
trunk/webapp/webapp/openmeetings/WEB-INF/red5-services/whiteboardservice.service.xml
     
Wed Jan 28 09:08:31 2009
@@ -10,6 +10,7 @@
      <!-- Class for Methods which can be invoked by the client -->
      <bean id="whiteboardservice.service"
          class="org.openmeetings.app.remote.WhiteBoardService">
+        <property name="scopeApplicationAdapter" ref="web.handler" />
          <property name="clientListManager"  
ref="openmeetings.ClientListManager" />
          <property name="whiteBoardObjectListManager"  
ref="openmeetings.WhiteBoardObjectListManager" />
      </bean>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenMeetings developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/openmeetings-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to