Author: solomax
Date: Thu Jul 21 05:08:13 2016
New Revision: 1753640

URL: http://svn.apache.org/viewvc?rev=1753640&view=rev
Log:
[OPENMEETINGS-1030] more work of files section: wml drop

Modified:
    
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
    
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
    
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
    
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
    
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
    
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/remoteWhiteboard.lzx
    
openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
    
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
    
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
    
openmeetings/application/branches/3.2.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java
    
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
    
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
    
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
    
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
    
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
    
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
    
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
    
openmeetings/application/trunk/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
 Thu Jul 21 05:08:13 2016
@@ -35,7 +35,7 @@ import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.xml.XppDriver;
 
 public class LibraryChartLoader {
-       private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryWmlLoader.class, webAppRootKey);
+       private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryChartLoader.class, webAppRootKey);
 
     private static final String fileExt = ".xchart";
 

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
 Thu Jul 21 05:08:13 2016
@@ -18,6 +18,7 @@
  */
 package org.apache.openmeetings.core.documents;
 
+import static org.apache.openmeetings.util.OmFileHelper.WML_EXTENSION;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
@@ -38,13 +39,11 @@ import com.thoughtworks.xstream.io.xml.X
 public class LibraryDocumentConverter {
        private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryDocumentConverter.class, webAppRootKey);
        
-       private static final String fileExt = ".wml";
-       
        public static String writeToLocalFolder(String fileName, 
@SuppressWarnings("rawtypes")ArrayList objList) {
                try {
                        log.debug("filePath: " + 
OmFileHelper.getUploadWmlDir().getCanonicalPath());
                        
-                       File file = new File(OmFileHelper.getUploadWmlDir(), 
fileName + fileExt);
+                       File file = new File(OmFileHelper.getUploadWmlDir(), 
fileName + WML_EXTENSION);
                        
                        if (file.exists()){
                                return "-20";

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
 Thu Jul 21 05:08:13 2016
@@ -18,6 +18,7 @@
  */
 package org.apache.openmeetings.core.documents;
 
+import static org.apache.openmeetings.util.OmFileHelper.WML_EXTENSION;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.BufferedReader;
@@ -27,11 +28,9 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
+import java.util.List;
 
 import org.apache.openmeetings.util.OmFileHelper;
-import org.dom4j.Element;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 
@@ -40,14 +39,12 @@ import com.thoughtworks.xstream.io.xml.X
 
 public class LibraryWmlLoader {
        private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryWmlLoader.class, webAppRootKey);
-       private static final String fileExt = ".wml";
        
-       @SuppressWarnings({ "rawtypes" })
-       public ArrayList loadWmlFile(String fileName){
+       public static List<?> loadWmlFile(String fileName){
                try {
                        String name = fileName;
-                       if (!name.endsWith(fileExt)) {
-                               name += fileExt;
+                       if (!name.endsWith(WML_EXTENSION)) {
+                               name += WML_EXTENSION;
                        }
                        File file = new File(OmFileHelper.getUploadWmlDir(), 
name);
                        log.debug("filepathComplete: " + file);
@@ -58,7 +55,7 @@ public class LibraryWmlLoader {
                        try (InputStream is = new FileInputStream(file);
                                        BufferedReader reader = new 
BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)))
                        {
-                               ArrayList lMapList = (ArrayList) 
xStream.fromXML(reader);
+                               List<?> lMapList = (List<?>) 
xStream.fromXML(reader);
                                
                                return lMapList;
                        }
@@ -66,185 +63,6 @@ public class LibraryWmlLoader {
                        log.error("loadWmlFile",err);
                }
                
-               return null;
+               return new ArrayList<>();
        }
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       @SuppressWarnings({ "unused", "rawtypes" })
-       private static void createListObjectPaintByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-                       
-                       LinkedHashMap<Integer,LinkedHashMap> pointMap = new 
LinkedHashMap<Integer,LinkedHashMap>();
-                       Element pointElements = paintElement.element("points");
-                       Integer k = 0;
-                       
-                       for ( Iterator i = pointElements.elementIterator( 
"point" ); i.hasNext(); ) {
-                               Element pointElement = (Element) i.next();
-                               LinkedHashMap<Integer,Object> singlePoint = new 
LinkedHashMap<Integer,Object>();
-                               singlePoint.put(0, pointElement.getName());
-                               singlePoint.put(1, 
Integer.valueOf(pointElement.attribute("val1").getText()));
-                               singlePoint.put(2, 
Integer.valueOf(pointElement.attribute("val2").getText()));
-                               singlePoint.put(3, 
Integer.valueOf(pointElement.attribute("val3").getText()));
-                               singlePoint.put(4, 
Integer.valueOf(pointElement.attribute("val4").getText()));
-                               pointMap.put(k, singlePoint);
-                               
log.debug("createListObjectPaintByNode"+singlePoint);
-                               k++;
-                       }
-                       subMap.put(1, pointMap);
-
-                       subMap.put(2, 
paintElement.element("fillstyle").getText());
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("linewidth").getText()));
-                       subMap.put(4, 
Integer.valueOf(paintElement.element("strokestyle").getText()));
-                       subMap.put(5, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(8, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(10, 
paintElement.element("layername").getText());            
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectPaintByNode",err);
-               }
-       }
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectLetterByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-
-                       subMap.put(1, 
paintElement.element("textforfield").getText());
-                       subMap.put(2, 
Integer.valueOf(paintElement.element("fgcolor").getText()));
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("fontsize").getText()));
-                       subMap.put(4, 
paintElement.element("fontstyle").getText());
-                       subMap.put(5, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("y").getText()));                      
-                       subMap.put(8, 
Float.valueOf(paintElement.element("width").getText()));          
-                       subMap.put(9, 
Float.valueOf(paintElement.element("height").getText()));         
-                       subMap.put(10, 
paintElement.element("layername").getText());
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectLetterByNode",err);
-               }
-       }       
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectImageByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-
-                       subMap.put(1, 
paintElement.element("urlname").getText());
-                       subMap.put(2, 
paintElement.element("baseurl").getText());
-                       subMap.put(3, 
paintElement.element("filename").getText());
-                       subMap.put(4, 
paintElement.element("modulename").getText());
-                       subMap.put(5, 
paintElement.element("parentpath").getText());
-                       subMap.put(6, paintElement.element("room").getText());
-                       subMap.put(7, paintElement.element("domain").getText());
-                       subMap.put(8, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(10, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(11, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(12, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(13, 
paintElement.element("layername").getText());            
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectImageByNode",err);
-               }
-       }       
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectObjecByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {   
-                       
-                       subMap.put(1, 
paintElement.element("fillstyle").getText());
-                       subMap.put(2, 
paintElement.element("linewidth").getText());
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("strokestyle").getText()));
-                       subMap.put(4, 
Float.valueOf(paintElement.element("startx").getText()));
-                       subMap.put(5, 
Float.valueOf(paintElement.element("starty").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("endx").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("endy").getText()));
-                       subMap.put(8, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(10, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(11, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(12, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(13, 
paintElement.element("layername").getText());
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectObjecByNode",err);
-               }
-       }               
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectRectAndEllipseByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {   
-                       
-                       subMap.put(1, 
Integer.valueOf(paintElement.element("stroke").getText()));
-                       subMap.put(2, paintElement.element("line").getText());
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(4, 
Float.valueOf(paintElement.element("x").getText()));              
-                       subMap.put(5, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(8, 
paintElement.element("layername").getText());
-
-               } catch (Exception err) {
-                       log.error("createListObjectObjecByNode",err);
-               }
-       }
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectSWFByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-
-                       subMap.put(1, 
paintElement.element("urlname").getText());
-                       subMap.put(2, 
paintElement.element("baseurl").getText());
-                       subMap.put(3, 
paintElement.element("filename").getText());
-                       subMap.put(4, 
paintElement.element("modulename").getText());
-                       subMap.put(5, 
paintElement.element("parentpath").getText());
-                       subMap.put(6, paintElement.element("room").getText());
-                       subMap.put(7, paintElement.element("domain").getText());
-                       subMap.put(8, 
Integer.valueOf(paintElement.element("slideNumber").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("innerx").getText()));
-                       subMap.put(10, 
Float.valueOf(paintElement.element("innery").getText()));
-                       subMap.put(11, 
Float.valueOf(paintElement.element("innerwidth").getText()));
-                       subMap.put(12, 
Float.valueOf(paintElement.element("innerheight").getText()));
-                       subMap.put(13, 
Integer.valueOf(paintElement.element("zoomlevel").getText()));
-                       subMap.put(14, 
Float.valueOf(paintElement.element("initwidth").getText()));
-                       subMap.put(15, 
Float.valueOf(paintElement.element("initheight").getText()));
-                       subMap.put(16, 
Integer.valueOf(paintElement.element("currentzoom").getText()));
-                       subMap.put(17, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(18, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(19, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(20, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(21, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(22, 
paintElement.element("layername").getText());            
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectImageByNode",err);
-               }
-       }               
-       
 }

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
 Thu Jul 21 05:08:13 2016
@@ -24,6 +24,7 @@ import static org.apache.openmeetings.ut
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.transaction.util.FileHelper;
@@ -32,12 +33,14 @@ import org.apache.openmeetings.core.docu
 import org.apache.openmeetings.core.documents.LibraryDocumentConverter;
 import org.apache.openmeetings.core.documents.LibraryWmlLoader;
 import org.apache.openmeetings.core.documents.LoadLibraryPresentation;
+import org.apache.openmeetings.core.remote.red5.ScopeApplicationAdapter;
 import org.apache.openmeetings.db.dao.file.FileExplorerItemDao;
 import org.apache.openmeetings.db.dao.server.ISessionManager;
 import org.apache.openmeetings.db.dao.server.SessiondataDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
 import org.apache.openmeetings.db.dto.file.LibraryPresentation;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
+import org.apache.openmeetings.db.entity.file.FileItem;
 import org.apache.openmeetings.db.entity.file.FileItem.Type;
 import org.apache.openmeetings.db.entity.room.Client;
 import org.apache.openmeetings.db.util.AuthLevelUtil;
@@ -47,7 +50,6 @@ import org.red5.server.api.IConnection;
 import org.red5.server.api.Red5;
 import org.red5.server.api.service.IPendingServiceCall;
 import org.red5.server.api.service.IPendingServiceCallback;
-import org.red5.server.api.service.IServiceCapableConnection;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -68,9 +70,9 @@ public class ConferenceLibrary implement
        @Autowired
        private FileExplorerItemDao fileDao;
        @Autowired
-       private LibraryWmlLoader libraryWmlLoader;
-       @Autowired
        private WhiteboardManager whiteboardManagement;
+       @Autowired
+       private ScopeApplicationAdapter scopeAdapter;
 
        public LibraryPresentation getPresentationPreviewFileExplorer(String 
SID, String parentFolder) {
                try {
@@ -134,73 +136,45 @@ public class ConferenceLibrary implement
        }
 
        /**
-        * 
         * Loads a Object from the library into the whiteboard of all 
participant of
         * the current room
         * 
-        * @param SID
-        * @param room_id
-        * @param fileId
-        * @param whiteboardId
+        * @param uid - uid of the client performing operation
+        * @param wbId - id of whiteboard
+        * @param fi - FileItem of the Wml being loaded
         */
-       @SuppressWarnings({ "rawtypes", "unchecked" })
-       public void loadWmlObject(String SID, Long room_id, Long fileId, Long 
whiteboardId) {
-               try {
-                       Long users_id = sessiondataDao.check(SID);
-
-                       if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-                               IConnection current = Red5.getConnectionLocal();
-                               Client currentClient = 
sessionManager.getClientByStreamId(current.getClient().getId(), null);
+       public void sendToWhiteboard(String uid, Long wbId, FileItem fi) {
+               Client client = 
sessionManager.getClientByPublicSIDAnyServer(uid).getRcl();
 
-                               if (currentClient == null) {
-                                       return;
-                               }
+               if (client == null) {
+                       log.warn("No client was found to send Wml:: {}", uid);
+                       return;
+               }
 
-                               FileExplorerItem fileExplorerItem = 
fileDao.get(fileId);
-                               if (fileExplorerItem == null) {
-                                       log.warn("[loadWmlObject] Unable to 
load Wml file by Id {}", fileId);
-                                       return;
-                               }
+               List<?> roomItems = LibraryWmlLoader.loadWmlFile(fi.getHash());
 
-                               ArrayList roomItems = 
libraryWmlLoader.loadWmlFile(fileExplorerItem.getHash());
+               Map<Integer, String> wbClear = new HashMap<>();
+               wbClear.put(2, "clear");
+               wbClear.put(3, null);
 
-                               Map whiteboardObjClear = new HashMap();
-                               whiteboardObjClear.put(2, "clear");
-                               whiteboardObjClear.put(3, null);
+               Long roomId = client.getRoomId();
+               whiteboardManagement.addWhiteBoardObjectById(roomId, wbClear, 
wbId);
 
-                               
whiteboardManagement.addWhiteBoardObjectById(room_id, whiteboardObjClear, 
whiteboardId);
+               for (int k = 0; k < roomItems.size(); k++) {
+                       List<?> actionObject = (List<?>)roomItems.get(k);
 
-                               for (int k = 0; k < roomItems.size(); k++) {
-                                       ArrayList actionObject = 
(ArrayList)roomItems.get(k);
+                       Map<Integer, Object> whiteboardObj = new HashMap<>();
+                       whiteboardObj.put(2, "draw");
+                       whiteboardObj.put(3, actionObject);
 
-                                       Map whiteboardObj = new HashMap();
-                                       whiteboardObj.put(2, "draw");
-                                       whiteboardObj.put(3, actionObject);
+                       whiteboardManagement.addWhiteBoardObjectById(roomId, 
whiteboardObj, wbId);
+               }
 
-                                       
whiteboardManagement.addWhiteBoardObjectById(room_id, whiteboardObj, 
whiteboardId);
-                               }
+               Map<String, Object> sendObject = new HashMap<String, Object>();
+               sendObject.put("id", wbId);
+               sendObject.put("roomitems", roomItems);
 
-                               Map<String, Object> sendObject = new 
HashMap<String, Object>();
-                               sendObject.put("id", whiteboardId);
-                               sendObject.put("roomitems", roomItems);
-
-                               // Notify all Clients of that Scope (Room)
-                               for (IConnection conn : 
current.getScope().getClientConnections()) {
-                                       if (conn != null) {
-                                               if (conn instanceof 
IServiceCapableConnection) {
-                                                       Client rcl = 
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
-                                                       if ((rcl == null) || 
rcl.isScreenClient()) {
-                                                               continue;
-                                                       } else {
-                                                               
((IServiceCapableConnection) conn).invoke("loadWmlToWhiteboardById", new 
Object[] { sendObject }, this);
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               } catch (Exception err) {
-                       log.error("[loadWmlObject] ", err);
-               }
+               scopeAdapter.sendToScope(roomId, "loadWmlToWhiteboardById", 
sendObject);
        }
 
        /**

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 Thu Jul 21 05:08:13 2016
@@ -1471,7 +1471,7 @@ public class ScopeApplicationAdapter ext
 
                        boolean showDrawStatus = getWhiteboardDrawStatus();
 
-                       sendToScope(roomId, "sendVarsToWhiteboardById", new 
Object[]{showDrawStatus ? client : null, sendObject});
+                       sendToScope(roomId, "sendVarsToWhiteboardById", new 
Object[] { showDrawStatus ? client : null, sendObject });
                } catch (Exception err) {
                        log.error("[sendToWhiteboard]", err);
                        return -1;

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/remoteWhiteboard.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/remoteWhiteboard.lzx?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/remoteWhiteboard.lzx
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/remoteWhiteboard.lzx
 Thu Jul 21 05:08:13 2016
@@ -126,20 +126,6 @@
        </method>
        
        
-       <netRemoteCallHib name="loadWMLFile" 
funcname="fileservice.loadWmlObject" remotecontext="$once{ canvas.thishib }" >
-               <attribute name="fileId" type="number" value="0"/>
-               <netparam><method name="getValue">return 
canvas.sessionId;</method></netparam>
-               <netparam><method name="getValue">return 
hib.currentroomid;</method></netparam> 
-               <netparam><method name="getValue">return 
parent.fileId;</method></netparam> 
-               <netparam><method name="getValue">return 
parent.parent.parent.parent.whiteboardId;</method></netparam>
-               <handler name="ondata" args="value">
-               <![CDATA[
-                       //The onResult-Handler will be called be the 
rtmpconnection
-                       if ($debug) Debug.write("loadWMLFile: ",value);
-               ]]>
-               </handler>   
-       </netRemoteCallHib> 
-       
        <method name="loadWmlToWhiteboardById" args="roomItems">
                this.clearRemote();
                this.loadSavedObjectList(roomItems);

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
 Thu Jul 21 05:08:13 2016
@@ -70,6 +70,7 @@ public class OmFileHelper {
        public static final String profileImagePrefix = "_profile_";
        public static final String thumbImagePrefix = "_thumb_";
        public static final String dashboardFile = "dashboard.xml";
+       public static final String WML_EXTENSION = ".wml";
        public static final String FLV_EXTENSION = ".flv";
        public static final String MP4_EXTENSION = ".mp4";
        public static final String OGG_EXTENSION = ".ogg";

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 Thu Jul 21 05:08:13 2016
@@ -31,6 +31,7 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Calendar;
 
+import org.apache.openmeetings.core.remote.ConferenceLibrary;
 import org.apache.openmeetings.core.remote.red5.ScopeApplicationAdapter;
 import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
@@ -170,9 +171,12 @@ public class RoomPanel extends BasePanel
                                Object o = component.getDefaultModelObject();
                                if (activeWbId > -1 && o instanceof FileItem) {
                                        FileItem fi = (FileItem)o;
-                                       String url = urlFor(new 
RoomResourceReference(), new PageParameters().add("id", fi.getId())).toString();
-                                       getBean(ScopeApplicationAdapter.class)
-                                               
.sendToWhiteboard(getClient().getUid(), activeWbId, fi, url);
+                                       if (fi.getType() == 
FileItem.Type.WmlFile) {
+                                               
getBean(ConferenceLibrary.class).sendToWhiteboard(getClient().getUid(), 
activeWbId, fi);
+                                       } else {
+                                               String url = urlFor(new 
RoomResourceReference(), new PageParameters().add("id", fi.getId())).toString();
+                                               
getBean(ScopeApplicationAdapter.class).sendToWhiteboard(getClient().getUid(), 
activeWbId, fi, url);
+                                       }
                                }
                        }
                };

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
 Thu Jul 21 05:08:13 2016
@@ -241,7 +241,6 @@
        <bean id="generatePDF" 
class="org.apache.openmeetings.core.documents.GeneratePDF" />
        <bean id="smsHandler" 
class="org.apache.openmeetings.core.mail.SMSHandler" />
        <bean id="importInitvalues" 
class="org.apache.openmeetings.installation.ImportInitvalues" />
-       <bean id="libraryWmlLoader" 
class="org.apache.openmeetings.core.documents.LibraryWmlLoader" />
        <bean id="generateSWF" 
class="org.apache.openmeetings.core.converter.GenerateSWF" />
        <bean id="fileUtils" 
class="org.apache.openmeetings.core.data.file.FileUtils" />
        <bean id="ldapLoginManagement" 
class="org.apache.openmeetings.core.ldap.LdapLoginManagement" />

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java
 Thu Jul 21 05:08:13 2016
@@ -25,20 +25,16 @@ import org.apache.openmeetings.test.Abst
 import org.junit.Test;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
 
 public class TestFileParser extends AbstractJUnitDefaults {
        private static final Logger log = 
Red5LoggerFactory.getLogger(TestFileParser.class, webAppRootKey);
 
-       @Autowired
-       private LibraryWmlLoader libraryWmlLoader;
-       
        @Test
        public void testLoadWmlFile(){
                
                try {
                        
-                       libraryWmlLoader.loadWmlFile("filename1");
+                       LibraryWmlLoader.loadWmlFile("filename1");
                        
                } catch (Exception err) {
                        

Modified: 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryChartLoader.java
 Thu Jul 21 05:08:13 2016
@@ -35,7 +35,7 @@ import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.xml.XppDriver;
 
 public class LibraryChartLoader {
-       private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryWmlLoader.class, webAppRootKey);
+       private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryChartLoader.class, webAppRootKey);
 
     private static final String fileExt = ".xchart";
 

Modified: 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryDocumentConverter.java
 Thu Jul 21 05:08:13 2016
@@ -18,6 +18,7 @@
  */
 package org.apache.openmeetings.core.documents;
 
+import static org.apache.openmeetings.util.OmFileHelper.WML_EXTENSION;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
@@ -38,13 +39,11 @@ import com.thoughtworks.xstream.io.xml.X
 public class LibraryDocumentConverter {
        private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryDocumentConverter.class, webAppRootKey);
        
-       private static final String fileExt = ".wml";
-       
        public static String writeToLocalFolder(String fileName, 
@SuppressWarnings("rawtypes")ArrayList objList) {
                try {
                        log.debug("filePath: " + 
OmFileHelper.getUploadWmlDir().getCanonicalPath());
                        
-                       File file = new File(OmFileHelper.getUploadWmlDir(), 
fileName + fileExt);
+                       File file = new File(OmFileHelper.getUploadWmlDir(), 
fileName + WML_EXTENSION);
                        
                        if (file.exists()){
                                return "-20";

Modified: 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LibraryWmlLoader.java
 Thu Jul 21 05:08:13 2016
@@ -18,6 +18,7 @@
  */
 package org.apache.openmeetings.core.documents;
 
+import static org.apache.openmeetings.util.OmFileHelper.WML_EXTENSION;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.BufferedReader;
@@ -27,11 +28,9 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
+import java.util.List;
 
 import org.apache.openmeetings.util.OmFileHelper;
-import org.dom4j.Element;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 
@@ -40,14 +39,12 @@ import com.thoughtworks.xstream.io.xml.X
 
 public class LibraryWmlLoader {
        private static final Logger log = 
Red5LoggerFactory.getLogger(LibraryWmlLoader.class, webAppRootKey);
-       private static final String fileExt = ".wml";
        
-       @SuppressWarnings({ "rawtypes" })
-       public ArrayList loadWmlFile(String fileName){
+       public static List<?> loadWmlFile(String fileName){
                try {
                        String name = fileName;
-                       if (!name.endsWith(fileExt)) {
-                               name += fileExt;
+                       if (!name.endsWith(WML_EXTENSION)) {
+                               name += WML_EXTENSION;
                        }
                        File file = new File(OmFileHelper.getUploadWmlDir(), 
name);
                        log.debug("filepathComplete: " + file);
@@ -58,7 +55,7 @@ public class LibraryWmlLoader {
                        try (InputStream is = new FileInputStream(file);
                                        BufferedReader reader = new 
BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)))
                        {
-                               ArrayList lMapList = (ArrayList) 
xStream.fromXML(reader);
+                               List<?> lMapList = (List<?>) 
xStream.fromXML(reader);
                                
                                return lMapList;
                        }
@@ -66,185 +63,6 @@ public class LibraryWmlLoader {
                        log.error("loadWmlFile",err);
                }
                
-               return null;
+               return new ArrayList<>();
        }
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       @SuppressWarnings({ "unused", "rawtypes" })
-       private static void createListObjectPaintByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-                       
-                       LinkedHashMap<Integer,LinkedHashMap> pointMap = new 
LinkedHashMap<Integer,LinkedHashMap>();
-                       Element pointElements = paintElement.element("points");
-                       Integer k = 0;
-                       
-                       for ( Iterator i = pointElements.elementIterator( 
"point" ); i.hasNext(); ) {
-                               Element pointElement = (Element) i.next();
-                               LinkedHashMap<Integer,Object> singlePoint = new 
LinkedHashMap<Integer,Object>();
-                               singlePoint.put(0, pointElement.getName());
-                               singlePoint.put(1, 
Integer.valueOf(pointElement.attribute("val1").getText()));
-                               singlePoint.put(2, 
Integer.valueOf(pointElement.attribute("val2").getText()));
-                               singlePoint.put(3, 
Integer.valueOf(pointElement.attribute("val3").getText()));
-                               singlePoint.put(4, 
Integer.valueOf(pointElement.attribute("val4").getText()));
-                               pointMap.put(k, singlePoint);
-                               
log.debug("createListObjectPaintByNode"+singlePoint);
-                               k++;
-                       }
-                       subMap.put(1, pointMap);
-
-                       subMap.put(2, 
paintElement.element("fillstyle").getText());
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("linewidth").getText()));
-                       subMap.put(4, 
Integer.valueOf(paintElement.element("strokestyle").getText()));
-                       subMap.put(5, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(8, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(10, 
paintElement.element("layername").getText());            
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectPaintByNode",err);
-               }
-       }
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectLetterByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-
-                       subMap.put(1, 
paintElement.element("textforfield").getText());
-                       subMap.put(2, 
Integer.valueOf(paintElement.element("fgcolor").getText()));
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("fontsize").getText()));
-                       subMap.put(4, 
paintElement.element("fontstyle").getText());
-                       subMap.put(5, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("y").getText()));                      
-                       subMap.put(8, 
Float.valueOf(paintElement.element("width").getText()));          
-                       subMap.put(9, 
Float.valueOf(paintElement.element("height").getText()));         
-                       subMap.put(10, 
paintElement.element("layername").getText());
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectLetterByNode",err);
-               }
-       }       
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectImageByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-
-                       subMap.put(1, 
paintElement.element("urlname").getText());
-                       subMap.put(2, 
paintElement.element("baseurl").getText());
-                       subMap.put(3, 
paintElement.element("filename").getText());
-                       subMap.put(4, 
paintElement.element("modulename").getText());
-                       subMap.put(5, 
paintElement.element("parentpath").getText());
-                       subMap.put(6, paintElement.element("room").getText());
-                       subMap.put(7, paintElement.element("domain").getText());
-                       subMap.put(8, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(10, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(11, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(12, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(13, 
paintElement.element("layername").getText());            
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectImageByNode",err);
-               }
-       }       
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectObjecByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {   
-                       
-                       subMap.put(1, 
paintElement.element("fillstyle").getText());
-                       subMap.put(2, 
paintElement.element("linewidth").getText());
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("strokestyle").getText()));
-                       subMap.put(4, 
Float.valueOf(paintElement.element("startx").getText()));
-                       subMap.put(5, 
Float.valueOf(paintElement.element("starty").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("endx").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("endy").getText()));
-                       subMap.put(8, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(10, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(11, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(12, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(13, 
paintElement.element("layername").getText());
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectObjecByNode",err);
-               }
-       }               
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectRectAndEllipseByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {   
-                       
-                       subMap.put(1, 
Integer.valueOf(paintElement.element("stroke").getText()));
-                       subMap.put(2, paintElement.element("line").getText());
-                       subMap.put(3, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(4, 
Float.valueOf(paintElement.element("x").getText()));              
-                       subMap.put(5, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(6, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(7, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(8, 
paintElement.element("layername").getText());
-
-               } catch (Exception err) {
-                       log.error("createListObjectObjecByNode",err);
-               }
-       }
-       
-       /**
-        * @deprecated
-        * @param paintElement
-        * @param subMap
-        */
-       public void createListObjectSWFByNode(Element paintElement, 
LinkedHashMap<Integer,Object> subMap){
-               try {
-
-                       subMap.put(1, 
paintElement.element("urlname").getText());
-                       subMap.put(2, 
paintElement.element("baseurl").getText());
-                       subMap.put(3, 
paintElement.element("filename").getText());
-                       subMap.put(4, 
paintElement.element("modulename").getText());
-                       subMap.put(5, 
paintElement.element("parentpath").getText());
-                       subMap.put(6, paintElement.element("room").getText());
-                       subMap.put(7, paintElement.element("domain").getText());
-                       subMap.put(8, 
Integer.valueOf(paintElement.element("slideNumber").getText()));
-                       subMap.put(9, 
Float.valueOf(paintElement.element("innerx").getText()));
-                       subMap.put(10, 
Float.valueOf(paintElement.element("innery").getText()));
-                       subMap.put(11, 
Float.valueOf(paintElement.element("innerwidth").getText()));
-                       subMap.put(12, 
Float.valueOf(paintElement.element("innerheight").getText()));
-                       subMap.put(13, 
Integer.valueOf(paintElement.element("zoomlevel").getText()));
-                       subMap.put(14, 
Float.valueOf(paintElement.element("initwidth").getText()));
-                       subMap.put(15, 
Float.valueOf(paintElement.element("initheight").getText()));
-                       subMap.put(16, 
Integer.valueOf(paintElement.element("currentzoom").getText()));
-                       subMap.put(17, 
Integer.valueOf(paintElement.element("counter").getText()));
-                       subMap.put(18, 
Float.valueOf(paintElement.element("x").getText()));
-                       subMap.put(19, 
Float.valueOf(paintElement.element("y").getText()));
-                       subMap.put(20, 
Float.valueOf(paintElement.element("width").getText()));
-                       subMap.put(21, 
Float.valueOf(paintElement.element("height").getText()));
-                       subMap.put(22, 
paintElement.element("layername").getText());            
-                       
-               } catch (Exception err) {
-                       log.error("createListObjectImageByNode",err);
-               }
-       }               
-       
 }

Modified: 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java
 Thu Jul 21 05:08:13 2016
@@ -24,6 +24,7 @@ import static org.apache.openmeetings.ut
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.transaction.util.FileHelper;
@@ -32,12 +33,14 @@ import org.apache.openmeetings.core.docu
 import org.apache.openmeetings.core.documents.LibraryDocumentConverter;
 import org.apache.openmeetings.core.documents.LibraryWmlLoader;
 import org.apache.openmeetings.core.documents.LoadLibraryPresentation;
+import org.apache.openmeetings.core.remote.red5.ScopeApplicationAdapter;
 import org.apache.openmeetings.db.dao.file.FileExplorerItemDao;
 import org.apache.openmeetings.db.dao.server.ISessionManager;
 import org.apache.openmeetings.db.dao.server.SessiondataDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
 import org.apache.openmeetings.db.dto.file.LibraryPresentation;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
+import org.apache.openmeetings.db.entity.file.FileItem;
 import org.apache.openmeetings.db.entity.file.FileItem.Type;
 import org.apache.openmeetings.db.entity.room.Client;
 import org.apache.openmeetings.db.util.AuthLevelUtil;
@@ -47,7 +50,6 @@ import org.red5.server.api.IConnection;
 import org.red5.server.api.Red5;
 import org.red5.server.api.service.IPendingServiceCall;
 import org.red5.server.api.service.IPendingServiceCallback;
-import org.red5.server.api.service.IServiceCapableConnection;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -68,9 +70,9 @@ public class ConferenceLibrary implement
        @Autowired
        private FileExplorerItemDao fileDao;
        @Autowired
-       private LibraryWmlLoader libraryWmlLoader;
-       @Autowired
        private WhiteboardManager whiteboardManagement;
+       @Autowired
+       private ScopeApplicationAdapter scopeAdapter;
 
        public LibraryPresentation getPresentationPreviewFileExplorer(String 
SID, String parentFolder) {
                try {
@@ -134,73 +136,45 @@ public class ConferenceLibrary implement
        }
 
        /**
-        * 
         * Loads a Object from the library into the whiteboard of all 
participant of
         * the current room
         * 
-        * @param SID
-        * @param room_id
-        * @param fileId
-        * @param whiteboardId
+        * @param uid - uid of the client performing operation
+        * @param wbId - id of whiteboard
+        * @param fi - FileItem of the Wml being loaded
         */
-       @SuppressWarnings({ "rawtypes", "unchecked" })
-       public void loadWmlObject(String SID, Long room_id, Long fileId, Long 
whiteboardId) {
-               try {
-                       Long users_id = sessiondataDao.check(SID);
-
-                       if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
-                               IConnection current = Red5.getConnectionLocal();
-                               Client currentClient = 
sessionManager.getClientByStreamId(current.getClient().getId(), null);
+       public void sendToWhiteboard(String uid, Long wbId, FileItem fi) {
+               Client client = 
sessionManager.getClientByPublicSIDAnyServer(uid).getRcl();
 
-                               if (currentClient == null) {
-                                       return;
-                               }
+               if (client == null) {
+                       log.warn("No client was found to send Wml:: {}", uid);
+                       return;
+               }
 
-                               FileExplorerItem fileExplorerItem = 
fileDao.get(fileId);
-                               if (fileExplorerItem == null) {
-                                       log.warn("[loadWmlObject] Unable to 
load Wml file by Id {}", fileId);
-                                       return;
-                               }
+               List<?> roomItems = LibraryWmlLoader.loadWmlFile(fi.getHash());
 
-                               ArrayList roomItems = 
libraryWmlLoader.loadWmlFile(fileExplorerItem.getHash());
+               Map<Integer, String> wbClear = new HashMap<>();
+               wbClear.put(2, "clear");
+               wbClear.put(3, null);
 
-                               Map whiteboardObjClear = new HashMap();
-                               whiteboardObjClear.put(2, "clear");
-                               whiteboardObjClear.put(3, null);
+               Long roomId = client.getRoomId();
+               whiteboardManagement.addWhiteBoardObjectById(roomId, wbClear, 
wbId);
 
-                               
whiteboardManagement.addWhiteBoardObjectById(room_id, whiteboardObjClear, 
whiteboardId);
+               for (int k = 0; k < roomItems.size(); k++) {
+                       List<?> actionObject = (List<?>)roomItems.get(k);
 
-                               for (int k = 0; k < roomItems.size(); k++) {
-                                       ArrayList actionObject = 
(ArrayList)roomItems.get(k);
+                       Map<Integer, Object> whiteboardObj = new HashMap<>();
+                       whiteboardObj.put(2, "draw");
+                       whiteboardObj.put(3, actionObject);
 
-                                       Map whiteboardObj = new HashMap();
-                                       whiteboardObj.put(2, "draw");
-                                       whiteboardObj.put(3, actionObject);
+                       whiteboardManagement.addWhiteBoardObjectById(roomId, 
whiteboardObj, wbId);
+               }
 
-                                       
whiteboardManagement.addWhiteBoardObjectById(room_id, whiteboardObj, 
whiteboardId);
-                               }
+               Map<String, Object> sendObject = new HashMap<String, Object>();
+               sendObject.put("id", wbId);
+               sendObject.put("roomitems", roomItems);
 
-                               Map<String, Object> sendObject = new 
HashMap<String, Object>();
-                               sendObject.put("id", whiteboardId);
-                               sendObject.put("roomitems", roomItems);
-
-                               // Notify all Clients of that Scope (Room)
-                               for (IConnection conn : 
current.getScope().getClientConnections()) {
-                                       if (conn != null) {
-                                               if (conn instanceof 
IServiceCapableConnection) {
-                                                       Client rcl = 
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
-                                                       if ((rcl == null) || 
rcl.isScreenClient()) {
-                                                               continue;
-                                                       } else {
-                                                               
((IServiceCapableConnection) conn).invoke("loadWmlToWhiteboardById", new 
Object[] { sendObject }, this);
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               } catch (Exception err) {
-                       log.error("[loadWmlObject] ", err);
-               }
+               scopeAdapter.sendToScope(roomId, "loadWmlToWhiteboardById", 
sendObject);
        }
 
        /**

Modified: 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 Thu Jul 21 05:08:13 2016
@@ -1471,7 +1471,7 @@ public class ScopeApplicationAdapter ext
 
                        boolean showDrawStatus = getWhiteboardDrawStatus();
 
-                       sendToScope(roomId, "sendVarsToWhiteboardById", new 
Object[]{showDrawStatus ? client : null, sendObject});
+                       sendToScope(roomId, "sendVarsToWhiteboardById", new 
Object[] { showDrawStatus ? client : null, sendObject });
                } catch (Exception err) {
                        log.error("[sendToWhiteboard]", err);
                        return -1;

Modified: 
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-util/src/main/java/org/apache/openmeetings/util/OmFileHelper.java
 Thu Jul 21 05:08:13 2016
@@ -70,6 +70,7 @@ public class OmFileHelper {
        public static final String profileImagePrefix = "_profile_";
        public static final String thumbImagePrefix = "_thumb_";
        public static final String dashboardFile = "dashboard.xml";
+       public static final String WML_EXTENSION = ".wml";
        public static final String FLV_EXTENSION = ".flv";
        public static final String MP4_EXTENSION = ".mp4";
        public static final String OGG_EXTENSION = ".ogg";

Modified: 
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
 (original)
+++ 
openmeetings/application/trunk/openmeetings-web/src/main/webapp/WEB-INF/classes/openmeetings-applicationContext.xml
 Thu Jul 21 05:08:13 2016
@@ -239,7 +239,6 @@
        <bean id="generatePDF" 
class="org.apache.openmeetings.core.documents.GeneratePDF" />
        <bean id="smsHandler" 
class="org.apache.openmeetings.core.mail.SMSHandler" />
        <bean id="importInitvalues" 
class="org.apache.openmeetings.installation.ImportInitvalues" />
-       <bean id="libraryWmlLoader" 
class="org.apache.openmeetings.core.documents.LibraryWmlLoader" />
        <bean id="generateSWF" 
class="org.apache.openmeetings.core.converter.GenerateSWF" />
        <bean id="fileUtils" 
class="org.apache.openmeetings.core.data.file.FileUtils" />
        <bean id="ldapLoginManagement" 
class="org.apache.openmeetings.core.ldap.LdapLoginManagement" />

Modified: 
openmeetings/application/trunk/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java?rev=1753640&r1=1753639&r2=1753640&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-web/src/test/java/org/apache/openmeetings/test/library/TestFileParser.java
 Thu Jul 21 05:08:13 2016
@@ -25,20 +25,16 @@ import org.apache.openmeetings.test.Abst
 import org.junit.Test;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
 
 public class TestFileParser extends AbstractJUnitDefaults {
        private static final Logger log = 
Red5LoggerFactory.getLogger(TestFileParser.class, webAppRootKey);
 
-       @Autowired
-       private LibraryWmlLoader libraryWmlLoader;
-       
        @Test
        public void testLoadWmlFile(){
                
                try {
                        
-                       libraryWmlLoader.loadWmlFile("filename1");
+                       LibraryWmlLoader.loadWmlFile("filename1");
                        
                } catch (Exception err) {
                        


Reply via email to