Revision: 3723
Author:   seba.wagner
Date:     Tue Apr 19 02:36:37 2011
Log:      [No log message]
http://code.google.com/p/openmeetings/source/detail?r=3723

Added:
/trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/WhiteBoardObjectListManagerById.java
Modified:
/trunk/singlewebapp/WebContent/openmeetings/base/hibernate/hibRtmpConnection.lzx /trunk/singlewebapp/server/red5/webapps/openmeetings/WEB-INF/red5-services/whiteboardservice.service.xml
 /trunk/singlewebapp/server/red5/webapps/openmeetings/WEB-INF/red5-web.xml
/trunk/singlewebapp/src/app/org/openmeetings/app/remote/WhiteBoardService.java /trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java /trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/WhiteBoardObjectListManager.java

=======================================
--- /dev/null
+++ /trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/WhiteBoardObjectListManagerById.java Tue Apr 19 02:36:37 2011
@@ -0,0 +1,154 @@
+package org.openmeetings.app.remote.red5;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.red5.logging.Red5LoggerFactory;
+import org.openmeetings.app.conference.whiteboard.WhiteboardObject;
+import org.openmeetings.app.conference.whiteboard.WhiteboardObjectList;
+import org.openmeetings.app.conference.whiteboard.WhiteboardSyncLockObject;
+
+public class WhiteBoardObjectListManagerById {
+
+ private static HashMap<Long,WhiteboardObjectList> whiteBoardObjectList = new HashMap<Long,WhiteboardObjectList>();
+
+       private static Long whiteboardId = 0L;
+
+// private static HashMap<Long,Map<String,WhiteboardSyncLockObject>> whiteBoardSyncList = new HashMap<Long,Map<String,WhiteboardSyncLockObject>>();
+//
+// private static HashMap<Long,Map<String,Map<String,WhiteboardSyncLockObject>>> whiteBoardObjectSyncList = new HashMap<Long,Map<String,Map<String,WhiteboardSyncLockObject>>>();
+
+ private static final Logger log = Red5LoggerFactory.getLogger(WhiteBoardObjectListManagerById.class, "openmeetings");
+
+       private static WhiteBoardObjectListManagerById instance = null;
+
+       private WhiteBoardObjectListManagerById() {
+       }
+
+       public static synchronized WhiteBoardObjectListManagerById 
getInstance() {
+               if (instance == null) {
+                       instance = new WhiteBoardObjectListManagerById();
+               }
+               return instance;
+       }
+
+       public Long getNewWhiteboardId(Long room_id) throws Exception {
+               whiteboardId++;
+
+ this.setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id, new WhiteboardObject(), whiteboardId);
+
+               return whiteboardId;
+       }
+
+       /*
+        * Room items a Whiteboard
+        */
+ public synchronized WhiteboardObjectList getWhiteBoardObjectListByRoomId(Long room_id){ + WhiteboardObjectList whiteboardObjectList = whiteBoardObjectList.get(room_id);
+               if (whiteboardObjectList == null) {
+                       whiteboardObjectList = new WhiteboardObjectList();
+               }
+               return whiteboardObjectList;
+       }
+
+ public synchronized WhiteboardObject getWhiteBoardObjectListByRoomIdAndWhiteboard(Long room_id, Long whiteBoardId){ + WhiteboardObjectList whiteboardObjectList = whiteBoardObjectList.get(room_id);
+               if (whiteboardObjectList == null) {
+                       whiteboardObjectList = new WhiteboardObjectList();
+               }
+ WhiteboardObject whiteboardObjects = whiteboardObjectList.getWhiteboardObjects().get(whiteBoardId);
+               if (whiteboardObjects == null) {
+                       whiteboardObjects = new WhiteboardObject();
+               }
+               return whiteboardObjects;
+       }
+
+//     /*
+//      * Initial Sync Process
+//      */
+// public synchronized void setWhiteBoardSyncListByRoomid(Long room_id, Map<String,WhiteboardSyncLockObject> mapObject ){
+//             whiteBoardSyncList.put(room_id, mapObject);
+//     }
+// public synchronized Map<String,WhiteboardSyncLockObject> getWhiteBoardSyncListByRoomid(Long room_id){ +// Map<String,WhiteboardSyncLockObject> roomList = whiteBoardSyncList.get(room_id);
+//             if (roomList == null) {
+//                     roomList = new 
HashMap<String,WhiteboardSyncLockObject>();
+//             }
+//             return roomList;
+//     }
+//
+//     /*
+//      * Image Sync Process
+//      */
+// public synchronized void setWhiteBoardImagesSyncListByRoomid(Long room_id, Map<String,Map<String,WhiteboardSyncLockObject>> mapObject ){
+//             whiteBoardObjectSyncList.put(room_id, mapObject);
+//     }
+// public synchronized void setWhiteBoardImagesSyncListByRoomAndObjectId(Long room_id,
+//                     String object_id,Map<String,WhiteboardSyncLockObject> 
imageSyncList){
+// Map<String,Map<String,WhiteboardSyncLockObject>> roomList = whiteBoardObjectSyncList.get(room_id);
+//             if (roomList == null) {
+//                     roomList = new 
HashMap<String,Map<String,WhiteboardSyncLockObject>>();
+//             }
+//             if (imageSyncList.size() == 0) {
+//                     roomList.remove(object_id);
+//             } else {
+//                     roomList.put(object_id, imageSyncList);
+//             }
+//             setWhiteBoardImagesSyncListByRoomid(room_id,roomList);
+//     }
+// public synchronized Map<String,Map<String,WhiteboardSyncLockObject>> getWhiteBoardObjectSyncListByRoomid(Long room_id){ +// Map<String,Map<String,WhiteboardSyncLockObject>> roomList = whiteBoardObjectSyncList.get(room_id);
+//             if (roomList == null) {
+//                     roomList = new 
HashMap<String,Map<String,WhiteboardSyncLockObject>>();
+//             }
+//             return roomList;
+//     }
+// public synchronized Map<String,WhiteboardSyncLockObject> getWhiteBoardObjectSyncListByRoomAndObjectId(Long room_id,
+//                     String object_id){
+// log.debug("getWhiteBoardImagesSyncListByRoomAndImageid room_id: "+room_id); +// Map<String,Map<String,WhiteboardSyncLockObject>> roomList = whiteBoardObjectSyncList.get(room_id);
+//             if (roomList == null) {
+//                     roomList = new 
HashMap<String,Map<String,WhiteboardSyncLockObject>>();
+//             }
+// log.debug("getWhiteBoardImagesSyncListByRoomAndImageid roomList: "+roomList); +// log.debug("getWhiteBoardImagesSyncListByRoomAndImageid object_id: "+object_id);
+//             if (roomList.size() == 1) {
+// log.debug("getWhiteBoardImagesSyncListByRoomAndImageid roomList Key image_id: "+roomList.keySet().iterator().next());
+//             }
+// Map<String,WhiteboardSyncLockObject> imageSyncList = roomList.get(object_id);
+//             if (imageSyncList == null) {
+//                     imageSyncList = new 
HashMap<String,WhiteboardSyncLockObject>();
+//             }
+//             return imageSyncList;
+//     }
+
+       /*
+        * Whiteboard Object List
+        *
+        */
+
+// public synchronized HashMap<Long,HashMap<String,List>> getWhiteBoardObjectList(){
+//             return whiteBoardObjectList;
+//     }
+//
+// public synchronized void setWhiteBoardObjectList(HashMap<Long,HashMap<String,List>> whiteBoardObjectListNew){
+//             whiteBoardObjectList = whiteBoardObjectListNew;
+//     }
+//
+ public synchronized void setWhiteBoardObjectListRoomObj(Long room_id, WhiteboardObjectList whiteboardObjectList){
+               whiteBoardObjectList.put(room_id, whiteboardObjectList);
+       }
+
+ public synchronized void setWhiteBoardObjectListRoomObjAndWhiteboardId(Long room_id, WhiteboardObject whiteboardObjects, Long whiteBoardId){ + WhiteboardObjectList whiteboardObjectList = whiteBoardObjectList.get(room_id);
+               if (whiteboardObjectList == null) {
+                       whiteboardObjectList = new WhiteboardObjectList();
+                       whiteboardObjectList.setRoom_id(room_id);
+               }
+               whiteboardObjects.setWhiteBoardId(whiteBoardId);
+ whiteboardObjectList.getWhiteboardObjects().put(whiteBoardId, whiteboardObjects);
+               whiteBoardObjectList.put(room_id, whiteboardObjectList);
+       }
+}
=======================================
--- /trunk/singlewebapp/WebContent/openmeetings/base/hibernate/hibRtmpConnection.lzx Mon Apr 18 05:08:54 2011 +++ /trunk/singlewebapp/WebContent/openmeetings/base/hibernate/hibRtmpConnection.lzx Tue Apr 19 02:36:37 2011
@@ -1069,6 +1069,16 @@
             </handler>
         </netRemoteCallHib>

+ <netRemoteCallHib name="sendVarsToWhiteboardById" funcname="sendVarsToWhiteboardById">
+            <handler name="ondata" args="value">
+                <![CDATA[
+                //The onResult-Handler will be called be the rtmpconnection
+ if ($debug) Debug.write("sendVarsToWhiteboardById : ",value); + canvas._drawarea.parent.parent.parent.sendWatchObjectByWhiteboard(value);
+                ]]>
+            </handler>
+        </netRemoteCallHib>
+
         <!--
             Adds this User to the List of current Moderators
          -->
@@ -1340,22 +1350,32 @@

                 ]]>
             </handler>
-        </netRemoteCallHib>
+        </netRemoteCallHib>
<netRemoteCallHib name="sendVarsToMessage" funcname="sendVarsToMessage">
             <handler name="ondata" args="value">
                 <![CDATA[
//The onResult-Handler will be called be the rtmpconnection
                     //Debug.write("sendVarsToMessage : ",value);
                     if (value[0]=='audioActivity'){
-                           //canvas.currentModApply
- //Debug.write("audioActivity Client ",value[1],value[2]); - canvas._videocontainer.setSpeakingByPos(value[2],value[1]);
-                       } else if (value[0]=='chat'){
-                               // Not Used
-                               Debug.warn("Not Used");
+                        //canvas.currentModApply
+ //Debug.write("audioActivity Client ",value[1],value[2]); + canvas._videocontainer.setSpeakingByPos(value[2],value[1]);
+                    } else if (value[0]=='chat'){
+                        // Not Used
+                        //Debug.warn("Not Used");
                         canvas.addChatHistory(value);
-                    } else if(value[0]=='fileslist'){
- canvas.currentImagesListdraw.parent.onvisible.sendEvent(true);
+                    } else if (value[0]=='activateWhiteboard'){
+                        // Not Used
+                        //Debug.warn("Not Used");
+ canvas._drawarea.parent.parent.parent.activateWhiteboard(value);
+                    } else if (value[0]=='newWhiteboard'){
+                        // Not Used
+                        //Debug.warn("Not Used");
+ canvas._drawarea.parent.parent.parent.newWhiteboard(value);
+                    } else if (value[0]=='removeWindow'){
+                        // Not Used
+                        //Debug.warn("Not Used");
+ canvas._drawarea.parent.parent.parent.removeWindow(value);
                     } else if(value[0]=='fileslist'){
canvas.currentImagesListdraw.parent.onvisible.sendEvent(true);
                     } else if(value[0]=='initBrowser'){
@@ -1365,9 +1385,10 @@
                     } else if(value[0]=='closeBrowserURL'){
                         canvas.closeBrowser(value);
                     }
+
                 ]]>
             </handler>
-        </netRemoteCallHib>
+        </netRemoteCallHib>
<netRemoteCallHib name="sendVarsModeratorGeneral" funcname="sendVarsModeratorGeneral"> <netparam name="vars"><method name="getValue">return canvas.VarsModeratorGeneral;</method></netparam>
             <handler name="ondata" args="value">
=======================================
--- /trunk/singlewebapp/server/red5/webapps/openmeetings/WEB-INF/red5-services/whiteboardservice.service.xml Tue Jan 5 08:27:13 2010 +++ /trunk/singlewebapp/server/red5/webapps/openmeetings/WEB-INF/red5-services/whiteboardservice.service.xml Tue Apr 19 02:36:37 2011
@@ -13,6 +13,7 @@
         <property name="scopeApplicationAdapter" ref="web.handler" />
<property name="clientListManager" ref="openmeetings.ClientListManager" /> <property name="whiteBoardObjectListManager" ref="openmeetings.WhiteBoardObjectListManager" />
-    </bean>
+ <property name="whiteBoardObjectListManagerById" ref="openmeetings.WhiteBoardObjectListManagerById" />
+    </bean>

 </beans>
=======================================
--- /trunk/singlewebapp/server/red5/webapps/openmeetings/WEB-INF/red5-web.xml Wed Aug 11 14:49:22 2010 +++ /trunk/singlewebapp/server/red5/webapps/openmeetings/WEB-INF/red5-web.xml Tue Apr 19 02:36:37 2011
@@ -38,7 +38,11 @@

     <bean id="openmeetings.WhiteBoardObjectListManager"
class="org.openmeetings.app.remote.red5.WhiteBoardObjectListManager">
-    </bean>
+    </bean>
+
+    <bean id="openmeetings.WhiteBoardObjectListManagerById"
+ class="org.openmeetings.app.remote.red5.WhiteBoardObjectListManagerById">
+    </bean>

     <!-- DATABASE Connection via hibernate
<bean id="theSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
=======================================
--- /trunk/singlewebapp/src/app/org/openmeetings/app/remote/WhiteBoardService.java Sun Oct 10 08:55:53 2010 +++ /trunk/singlewebapp/src/app/org/openmeetings/app/remote/WhiteBoardService.java Tue Apr 19 02:36:37 2011
@@ -1,5 +1,6 @@
 package org.openmeetings.app.remote;

+import java.io.File;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
@@ -9,7 +10,8 @@
 import java.util.Map;
 import java.util.Set;

-import org.openmeetings.app.conference.whiteboard.WhiteBoardObject;
+import org.openmeetings.app.conference.whiteboard.WhiteboardObject;
+import org.openmeetings.app.conference.whiteboard.WhiteboardObjectList;
 import org.openmeetings.app.conference.whiteboard.WhiteboardSyncLockObject;
 import org.openmeetings.app.data.basic.AuthLevelmanagement;
 import org.openmeetings.app.data.basic.Sessionmanagement;
@@ -18,6 +20,7 @@
 import org.openmeetings.app.remote.red5.ClientListManager;
 import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
 import org.openmeetings.app.remote.red5.WhiteBoardObjectListManager;
+import org.openmeetings.app.remote.red5.WhiteBoardObjectListManagerById;
 import org.red5.server.api.IConnection;
 import org.red5.server.api.IScope;
 import org.red5.server.api.Red5;
@@ -34,7 +37,7 @@
  */
 public class WhiteBoardService implements IPendingServiceCallback {

- private static final Logger log = Red5LoggerFactory.getLogger(WhiteBoardService.class, ScopeApplicationAdapter.webAppRootKey); +private static final Logger log = Red5LoggerFactory.getLogger(WhiteBoardService.class, "openmeetings");

        private WhiteBoardService() {}

@@ -44,6 +47,7 @@
        private ScopeApplicationAdapter scopeApplicationAdapter = null;
        private ClientListManager clientListManager = null;
        private WhiteBoardObjectListManager whiteBoardObjectListManager = null;
+ private WhiteBoardObjectListManagerById whiteBoardObjectListManagerById = null;

        public static synchronized WhiteBoardService getInstance() {
                if (instance == null) {
@@ -73,12 +77,18 @@
                        ScopeApplicationAdapter scopeApplicationAdapter) {
                this.scopeApplicationAdapter = scopeApplicationAdapter;
        }
-
+ public WhiteBoardObjectListManagerById getWhiteBoardObjectListManagerById() {
+               return whiteBoardObjectListManagerById;
+       }
+       public void setWhiteBoardObjectListManagerById(
+                       WhiteBoardObjectListManagerById 
whiteBoardObjectListManagerById) {
+               this.whiteBoardObjectListManagerById = 
whiteBoardObjectListManagerById;
+       }
        /**
         * Loading the List of Objects on the whiteboard
         * @return HashMap<String,Map>
         */
-       public WhiteBoardObject getRoomItems(){
+       public WhiteboardObject getRoomItems(){
                try {
                        IConnection current = Red5.getConnectionLocal();
                        String streamid = current.getClient().getId();
@@ -102,6 +112,122 @@
                } catch (Exception err) {
                        log.error("[getRoomItems]",err);
                }
+               return null;
+       }
+
+       public Long getNewWhiteboardId() {
+               try {
+
+                       IConnection current = Red5.getConnectionLocal();
+                       String streamid = current.getClient().getId();
+ RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
+                       Long room_id = currentClient.getRoom_id();
+
+
+ Long whiteBoardId = this.whiteBoardObjectListManagerById.getNewWhiteboardId(room_id);
+
+                       return whiteBoardId;
+
+               } catch (Exception err) {
+                       log.error("[deleteWhiteboard]",err);
+               }
+               return null;
+       }
+
+       public Boolean deleteWhiteboard(Long whiteBoardId) {
+               try {
+                       IConnection current = Red5.getConnectionLocal();
+                       String streamid = current.getClient().getId();
+ RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
+                       Long room_id = currentClient.getRoom_id();
+
+ WhiteboardObjectList whiteboardObjectList = this.whiteBoardObjectListManagerById.getWhiteBoardObjectListByRoomId(room_id);
+
+ for (Iterator<Long> iter = whiteboardObjectList.getWhiteboardObjects().keySet().iterator();iter.hasNext();) {
+                               Long storedWhiteboardId = iter.next();
+
+                               log.debug(" :: storedWhiteboardId :: 
"+storedWhiteboardId);
+
+                               if (storedWhiteboardId.equals(whiteBoardId)) {
+                                       log.debug("Found Whiteboard to Remove");
+                               }
+                       }
+ Object returnValue = whiteboardObjectList.getWhiteboardObjects().remove(whiteBoardId);
+
+                       log.debug(" :: whiteBoardId :: "+whiteBoardId);
+
+ this.whiteBoardObjectListManagerById.setWhiteBoardObjectListRoomObj(room_id, whiteboardObjectList);
+
+                       if (returnValue != null) {
+                               return true;
+                       } else {
+                               return false;
+                       }
+
+               } catch (Exception err) {
+                       log.error("[deleteWhiteboard]",err);
+               }
+               return null;
+       }
+
+       public WhiteboardObjectList getRoomItemsBy(){
+               try {
+                       IConnection current = Red5.getConnectionLocal();
+                       String streamid = current.getClient().getId();
+ RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
+                       Long room_id = currentClient.getRoom_id();
+
+                       log.debug("getRoomItems: "+room_id);
+ WhiteboardObjectList whiteboardObjectList = this.whiteBoardObjectListManagerById.getWhiteBoardObjectListByRoomId(room_id);
+
+                       LinkedList<List> completeList = new LinkedList<List>();
+
+                       //LinkedList<List> itemList = new LinkedList<List>();
+
+                       if (whiteboardObjectList.getWhiteboardObjects().size() 
== 0) {
+
+ Long whiteBoardId = this.whiteBoardObjectListManagerById.getNewWhiteboardId(room_id);
+
+ this.whiteBoardObjectListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id, new WhiteboardObject(), whiteBoardId);
+
+                               log.debug("Init New Room List");
+
+ whiteboardObjectList = this.whiteBoardObjectListManagerById.getWhiteBoardObjectListByRoomId(room_id);
+
+                               return whiteboardObjectList;
+
+                       } else {
+
+                               return whiteboardObjectList;
+
+// for (Iterator<Long> it = whiteboardObjectList.getWhiteboardObjects().keySet().iterator();it.hasNext();){ +// WhiteboardObject whiteboardObject = whiteboardObjectList.getWhiteboardObjects().get(it.next());
+//
+//                                     LinkedList<List> itemList = new 
LinkedList<List>();
+// for (Iterator<String> it2 = whiteboardItems.keySet().iterator();it2.hasNext();){
+//                                             
itemList.add(whiteboardItems.get(it2.next()));
+//                                     }
+//
+//                                     completeList.add(itemList);
+//                             }
+
+// for (Iterator<Long> it = roomItems.keySet().iterator();it.hasNext();){
+//                                     HashMap<String,List> whiteboardItems = 
roomItems.get(it.next());
+//
+//                                     LinkedList<List> itemList = new 
LinkedList<List>();
+// for (Iterator<String> it2 = whiteboardItems.keySet().iterator();it2.hasNext();){
+//                                             
itemList.add(whiteboardItems.get(it2.next()));
+//                                     }
+//
+//                                     completeList.add(itemList);
+//                             }
+
+                       }
+
+                       //return completeList;
+               } catch (Exception err) {
+                       log.error("[getRoomItemsBy]",err);
+               }
                return null;
        }

@@ -712,6 +838,23 @@
                        log.error("[removeUserFromAllLists]",err);
                }
        }
+
+       public String[] getClipArtIcons() {
+               try {
+
+                       String current_dir = ScopeApplicationAdapter.webAppPath
+                                                                       + 
File.separatorChar + "public"
+                                                                       + 
File.separatorChar + "cliparts";
+
+                       File clipart_dir = new File(current_dir);
+
+                       return clipart_dir.list();
+
+               } catch (Exception err) {
+                       log.error("[getClipArtIcons]",err);
+               }
+               return null;
+       }

        public void resultReceived(IPendingServiceCall arg0) {
                // TODO Auto-generated method stub
=======================================
--- /trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java Sun Feb 27 07:02:40 2011 +++ /trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java Tue Apr 19 02:36:37 2011
@@ -2156,6 +2156,132 @@
                }
        }

+       /**
+        * This Function is triggered from the Whiteboard
+        *
+        * @param whiteboardObj
+        * @return
+        */
+ public synchronized void sendVarsByWhiteboardId(ArrayList whiteboardObjParam, Long whiteboardId) {
+               //
+               try {
+
+                       //In previous version this has been always a Map, now 
its a List
+                       //so I re-wrapp that class to be a Map again.
+                       //swagner 13.02.2009
+                       //log.debug("*..*sendVars1: " + whiteboardObjParam);
+                       //log.debug("*..*sendVars2: " + 
whiteboardObjParam.getClass());
+ //log.debug("*..*sendVars3: " + whiteboardObjParam.getClass().getName());
+
+                       Map whiteboardObj = new HashMap();
+                       int i = 0;
+                       for (Iterator iter = 
whiteboardObjParam.iterator();iter.hasNext();) {
+                               Object obj = iter.next();
+                               //log.debug("obj"+obj);
+                               whiteboardObj.put(i, obj);
+                               i++;
+                       }
+
+                       //Map whiteboardObj = (Map) whiteboardObjParam;
+
+                       // Check if this User is the Mod:
+                       IConnection current = Red5.getConnectionLocal();
+ RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
+
+                       if (currentClient == null) {
+                               return;
+                       }
+
+                       Long room_id = currentClient.getRoom_id();
+
+                       //log.debug("***** sendVars: " + whiteboardObj);
+
+                       //Store event in list
+                       String action = whiteboardObj.get(2).toString();
+
+                       if (action.equals("deleteMindMapNodes")) {
+
+                               //Simulate Single Delete Events for z-Index
+                               List actionObject = (List) whiteboardObj.get(3);
+
+                               List<List> itemObjects = (List) 
actionObject.get(3);
+
+                               Map whiteboardTempObj = new HashMap();
+                               whiteboardTempObj.put(2,"delete");
+
+                               for (List itemObject : itemObjects) {
+
+                                       List<Object> tempActionObject = new 
LinkedList<Object>();
+                                       tempActionObject.add("mindmapnode");
+                                       
tempActionObject.add(itemObject.get(0)); //z-Index -8
+                                       tempActionObject.add(null); //simulate 
-7
+                                       tempActionObject.add(null); //simulate 
-6
+                                       tempActionObject.add(null); //simulate 
-5
+                                       tempActionObject.add(null); //simulate 
-4
+                                       tempActionObject.add(null); //simulate 
-3
+                                       tempActionObject.add(null); //simulate 
-2
+                                       
tempActionObject.add(itemObject.get(1)); //Object-Name -1
+
+                                       whiteboardTempObj.put(3, 
tempActionObject);
+
+ WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardTempObj, whiteboardId);
+
+                               }
+
+                       } else {
+
+ WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardObj, whiteboardId);
+
+                       }
+
+
+
+                       int numberOfUsers = 0;
+
+                       //This is no longer necessary
+                       //boolean ismod = currentClient.getIsMod();
+
+                       //log.debug("*..*ismod: " + ismod);
+
+                       //if (ismod) {
+
+                       Map<String,Object> sendObject = new 
HashMap<String,Object>();
+                       sendObject.put("id", whiteboardId);
+                       sendObject.put("param", whiteboardObjParam);
+
+                       //Notify all Clients of that Scope (Room)
+ Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
+                       for (Set<IConnection> conset : conCollection) {
+                               for (IConnection conn : conset) {
+                                       if (conn != null) {
+                                               if (conn instanceof 
IServiceCapableConnection) {
+ RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId()); + if ((rcl == null) || (rcl.getIsScreenClient() != null && rcl.getIsScreenClient())) {
+                                                       continue;
+                                               } else {
+                                                               
//log.debug("*..*idremote: " + rcl.getStreamid());
+ //log.debug("*..* sendVars room_id IS EQUAL: " + currentClient.getStreamid() + " asd " + rcl.getStreamid() + " IS eq? " +currentClient.getStreamid().equals(rcl.getStreamid()));
+                                                               if 
(!currentClient.getStreamid().equals(rcl.getStreamid())) {
+ ((IServiceCapableConnection) conn).invoke("sendVarsToWhiteboardById", new Object[] { sendObject },this); + //log.debug("sending sendVarsToWhiteboard to " + conn + " rcl " + rcl);
+                                                                       
numberOfUsers++;
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+
+                       //return numberOfUsers;
+                       //} else {
+                       //      // log.debug("*..*you are not allowed to send: 
"+ismod);
+                       //      return -1;
+                       //}
+               } catch (Exception err) {
+                       log.error("[sendVarsByWhiteboardId]",err);
+               }
+       }
+

        public synchronized int sendVarsModeratorGeneral(Object vars) {
                log.debug("*..*sendVars: " + vars);
=======================================
--- /trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/WhiteBoardObjectListManager.java Sun Oct 10 08:55:53 2010 +++ /trunk/singlewebapp/src/app/org/openmeetings/app/remote/red5/WhiteBoardObjectListManager.java Tue Apr 19 02:36:37 2011
@@ -6,12 +6,12 @@

 import org.slf4j.Logger;
 import org.red5.logging.Red5LoggerFactory;
-import org.openmeetings.app.conference.whiteboard.WhiteBoardObject;
+import org.openmeetings.app.conference.whiteboard.WhiteboardObject;
 import org.openmeetings.app.conference.whiteboard.WhiteboardSyncLockObject;

 public class WhiteBoardObjectListManager {

- private static HashMap<Long,WhiteBoardObject> whiteBoardObjectList = new HashMap<Long,WhiteBoardObject>(); + private static HashMap<Long,WhiteboardObject> whiteBoardObjectList = new HashMap<Long,WhiteboardObject>(); private static HashMap<Long,Map<String,WhiteboardSyncLockObject>> whiteBoardSyncList = new HashMap<Long,Map<String,WhiteboardSyncLockObject>>();

private static HashMap<Long,Map<String,Map<String,WhiteboardSyncLockObject>>> whiteBoardObjectSyncList = new HashMap<Long,Map<String,Map<String,WhiteboardSyncLockObject>>>();
@@ -30,10 +30,10 @@
                return instance;
        }

- public synchronized WhiteBoardObject getWhiteBoardObjectRoomId(Long room_id){
-               WhiteBoardObject whiteBoardObject = 
whiteBoardObjectList.get(room_id);
+ public synchronized WhiteboardObject getWhiteBoardObjectRoomId(Long room_id){
+               WhiteboardObject whiteBoardObject = 
whiteBoardObjectList.get(room_id);
                if (whiteBoardObject == null) {
-                       whiteBoardObject = new WhiteBoardObject();
+                       whiteBoardObject = new WhiteboardObject();
                }
                return whiteBoardObject;
        }
@@ -42,11 +42,12 @@
         * Room items a Whiteboard
         */
public synchronized HashMap<String,List> getWhiteBoardObjectListByRoomId(Long room_id){
-               WhiteBoardObject whiteBoardObject = 
whiteBoardObjectList.get(room_id);
+               WhiteboardObject whiteBoardObject = 
whiteBoardObjectList.get(room_id);
                if (whiteBoardObject == null) {
-                       whiteBoardObject = new WhiteBoardObject();
-               }
-               HashMap<String,List>roomList = whiteBoardObject.getObjList();
+                       whiteBoardObject = new WhiteboardObject();
+               }
+               //HashMap<String,List>roomList = whiteBoardObject.getObjList();
+               HashMap<String,List>roomList = null;
                if (roomList == null) {
                        roomList = new HashMap<String,List>();
                }
@@ -123,16 +124,16 @@
 //             whiteBoardObjectList = whiteBoardObjectListNew;
 //     }

- public synchronized void setWhiteBoardObject(Long room_id, WhiteBoardObject whiteBoardObject){ + public synchronized void setWhiteBoardObject(Long room_id, WhiteboardObject whiteBoardObject){
                whiteBoardObjectList.put(room_id, whiteBoardObject);
        }

public synchronized void setWhiteBoardObjectListRoomObj(Long room_id, HashMap<String,List> roomList){
-               WhiteBoardObject whiteBoardObject = 
whiteBoardObjectList.get(room_id);
+               WhiteboardObject whiteBoardObject = 
whiteBoardObjectList.get(room_id);
                if (whiteBoardObject == null) {
-                       whiteBoardObject = new WhiteBoardObject();
-               }
-               whiteBoardObject.setObjList(roomList);
+                       whiteBoardObject = new WhiteboardObject();
+               }
+               //whiteBoardObject.setObjList(roomList);
                whiteBoardObjectList.put(room_id, whiteBoardObject);
        }

--
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