Modified: openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/swfResourceView.lzx URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/swfResourceView.lzx?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/swfResourceView.lzx (original) +++ openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/swfResourceView.lzx Mon Nov 30 19:22:24 2015 @@ -59,8 +59,9 @@ <!-- holds the reference_id to the SyncProcess --> <attribute name="uniqueObjectSyncName" value="" type="string" /> + <attribute name="swfUrl" value="" type="string" /> - <view name="_swfView" play="false"> + <omMiniIcon name="_swfView" play="false" imgUrl="${ parent.swfUrl }"> <!-- Do not send update events in case this is sync event broadcasted by another user --> <attribute name="doSendChangeValue" value="false" type="boolean" /> @@ -78,134 +79,137 @@ </handler> <method name="initialLoadFullFit"> - <![CDATA[ - - if ($debug) Debug.write(" -- fullFit -- ",parent.parent.fullFit); - - if (parent.parent.fullFit) { - - if ($debug) Debug.write(" -- fullFit -2- ",this.width,this.height); - if ($debug) Debug.write(" -- fullFit -3- ",parent.parent.width,parent.parent.height); - - //Scale to container width/height - var xScale = (parent.parent.parent.width-16)/this.width; - var yScale = (parent.parent.parent.height-16)/this.height; - - if ($debug) Debug.write(" -- fullFit -4- ",xScale,yScale); - - if (xScale < yScale) { - parent.parent.setCurrentScaleByFullFit(xScale); - } else { - parent.parent.setCurrentScaleByFullFit(yScale); - } - + <![CDATA[ + if ($debug) Debug.write(" -- fullFit -- ",parent.parent.fullFit); + + if (parent.parent.fullFit) { + if ($debug) Debug.write(" -- fullFit -2- ",this.width,this.height); + if ($debug) Debug.write(" -- fullFit -3- ",parent.parent.width,parent.parent.height); + + //Scale to container width/height + var xScale = (parent.parent.parent.width-16)/this.width; + var yScale = (parent.parent.parent.height-16)/this.height; + + if ($debug) Debug.write(" -- fullFit -4- ",xScale,yScale); + + if (xScale < yScale) { + parent.parent.setCurrentScaleByFullFit(xScale); + } else { + parent.parent.setCurrentScaleByFullFit(yScale); } - - ]]> + } + ]]> + </method> + + <method name="completeCallback" args="event"> + //if ($debug) Debug.info("OVERRIDEN swfResourceView::_swfView::completeCallback: ", this.width, this,height); + //designed to be empty to override default behavior </method> <handler name="onload"> - <![CDATA[ - if ($debug) Debug.info("onload: ",this.width,this,height); + <![CDATA[ + if ($debug) Debug.info("swfResourceView::_swfView::onload: ", this.width, this,height); + + this.stop(); + this.setAttribute('play',false); + + this.parent.initwidth = this.width; + this.parent.initheight = this.height; + + this.setAttribute('frame',parent.slideNumber); + + //only send syncCommand if alterModus is true (meaning that this is the Moderator) + //otherwise just send a notification to moderator that this iamge has been loaded + if (this.parent.recorderModus) { + this.parent.refObj.storeTempValsAndLoadSyncListSWFRecording(this.parent); + } else if (this.parent.alterModus){ - this.stop(); - this.setAttribute('play',false); + //this code is invoked when the Moderator loads the Document - this.parent.initwidth = this.width; - this.parent.initheight = this.height; + this.parent.refObj.storeTempValsAndLoadSyncListSWF(this.parent); + if ($debug) Debug.write("==> doShowObjectBounds MOD "); - this.setAttribute('frame',parent.slideNumber); - - //only send syncCommand if alterModus is true (meaning that this is the Moderator) - //otherwise just send a notification to moderator that this iamge has been loaded - if (this.parent.recorderModus) { - this.parent.refObj.storeTempValsAndLoadSyncListSWFRecording(this.parent); - } else if (this.parent.alterModus){ - - //this code is invoked when the Moderator loads the Document - - this.parent.refObj.storeTempValsAndLoadSyncListSWF(this.parent); - if ($debug) Debug.write("==> doShowObjectBounds MOD "); - - this.initialLoadFullFit(); - - this.parent.refObj.doShowObjectBounds(this.parent.name); - this.parent.refObj.doUpdateDocumentToolBar(); - } else { - - //this code is invoked when any participants syncronizes and loads the document - //because a Moderator has loaded it - - if ($debug) Debug.write("==> doShowObjectBounds Participant "); - - this.initialLoadFullFit(); - - this.parent.refObj.sendLoadNotificationSWF(this.parent); - - this.parent.refObj.doUpdateDocumentToolBarByParticipant(this.parent.name); - - } + this.initialLoadFullFit(); - if ($debug) Debug.write("swf loaded -2- ",this.parent.refObj.isWmlLoaderImage); - if (this.parent.refObj.isWmlLoaderImage){ - if ($debug) Debug.write("swf loaded ",this.parent.innerwidth,this.parent.innerheight); - if (this.parent.innerwidth != 0 && this.parent.innerheight != 0) { - this.setAttribute('width',this.parent.innerwidth); - this.setAttribute('height',this.parent.innerheight); - this.setAttribute('x',this.parent.innerx); - this.setAttribute('y',this.parent.innery); - } - this.parent.currentzoomFactor = this.parent.currentzoom; - } - - this.parent.refObj.layers.push(this.parent); + this.parent.refObj.doShowObjectBounds(this.parent.name); + this.parent.refObj.doUpdateDocumentToolBar(); + } else { - this.doSendChangeValue = true; + //this code is invoked when any participants syncronizes and loads the document + //because a Moderator has loaded it - this.oninit.sendEvent(); - ]]> - </handler> - <handler name="onerror" args="error"> - <![CDATA[ - new lz.errorPopup(canvas,{error:"onerror SWF!! "+error}); + if ($debug) Debug.write("==> doShowObjectBounds Participant "); - this.parent.initwidth = this.width; - this.parent.initheight = this.height; - - //only send syncCommand if alterModus is true (meaning that this is the Moderator) - //otherwise just send a notification to moderator that this iamge has been loaded - if (this.parent.recorderModus) { - this.parent.refObj.storeTempValsAndLoadSyncListSWFRecording(this.parent); - } else if (this.parent.alterModus){ - this.parent.refObj.storeTempValsAndLoadSyncListSWF(this.parent); - } else { - this.parent.refObj.sendLoadNotificationSWF(this.parent); - } - this.parent.refObj.layers.push(this.parent); + this.initialLoadFullFit(); - this.oninit.sendEvent(); - ]]> - </handler> - <handler name="ontimeout" args="error"> - <![CDATA[ - new lz.errorPopup(canvas,{error:"ontimeout SWF!! "+error}); + this.parent.refObj.sendLoadNotificationSWF(this.parent); - this.parent.initwidth = this.width; - this.parent.initheight = this.height; - - //only send syncCommand if alterModus is true (meaning that this is the Moderator) - //otherwise just send a notification to moderator that this iamge has been loaded - if (this.parent.recorderModus) { - this.parent.refObj.storeTempValsAndLoadSyncListSWFRecording(this.parent); - } else if (this.parent.alterModus){ - this.parent.refObj.storeTempValsAndLoadSyncListSWF(this.parent); - } else { - this.parent.refObj.sendLoadNotificationSWF(this.parent); - } - this.parent.refObj.layers.push(this.parent); + this.parent.refObj.doUpdateDocumentToolBarByParticipant(this.parent.name); - this.oninit.sendEvent(); - ]]> + } + + if ($debug) Debug.write("swf loaded -2- ",this.parent.refObj.isWmlLoaderImage); + if (this.parent.refObj.isWmlLoaderImage){ + if ($debug) Debug.write("swf loaded ",this.parent.innerwidth,this.parent.innerheight); + if (this.parent.innerwidth != 0 && this.parent.innerheight != 0) { + this.setAttribute('width',this.parent.innerwidth); + this.setAttribute('height',this.parent.innerheight); + this.setAttribute('x',this.parent.innerx); + this.setAttribute('y',this.parent.innery); + } + this.parent.currentzoomFactor = this.parent.currentzoom; + } + + this.parent.refObj.layers.push(this.parent); + + this.doSendChangeValue = true; + + this.oninit.sendEvent(); + ]]> + </handler> + + <handler name="onerror" args="error"> + <![CDATA[ + new lz.errorPopup(canvas,{error:"onerror SWF!! "+error}); + + this.parent.initwidth = this.width; + this.parent.initheight = this.height; + + //only send syncCommand if alterModus is true (meaning that this is the Moderator) + //otherwise just send a notification to moderator that this iamge has been loaded + if (this.parent.recorderModus) { + this.parent.refObj.storeTempValsAndLoadSyncListSWFRecording(this.parent); + } else if (this.parent.alterModus){ + this.parent.refObj.storeTempValsAndLoadSyncListSWF(this.parent); + } else { + this.parent.refObj.sendLoadNotificationSWF(this.parent); + } + this.parent.refObj.layers.push(this.parent); + + this.oninit.sendEvent(); + ]]> + </handler> + + <handler name="ontimeout" args="error"> + <![CDATA[ + new lz.errorPopup(canvas,{error:"ontimeout SWF!! "+error}); + + this.parent.initwidth = this.width; + this.parent.initheight = this.height; + + //only send syncCommand if alterModus is true (meaning that this is the Moderator) + //otherwise just send a notification to moderator that this iamge has been loaded + if (this.parent.recorderModus) { + this.parent.refObj.storeTempValsAndLoadSyncListSWFRecording(this.parent); + } else if (this.parent.alterModus){ + this.parent.refObj.storeTempValsAndLoadSyncListSWF(this.parent); + } else { + this.parent.refObj.sendLoadNotificationSWF(this.parent); + } + this.parent.refObj.layers.push(this.parent); + + this.oninit.sendEvent(); + ]]> </handler> <handler name="onwidth" args="w"> @@ -216,7 +220,7 @@ if ($debug) Debug.write("onheight ",h); </handler> - </view> + </omMiniIcon> </class> </library>
Modified: openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/tools/baseDrawClipArt.lzx URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/tools/baseDrawClipArt.lzx?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/tools/baseDrawClipArt.lzx (original) +++ openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/base/tools/baseDrawClipArt.lzx Mon Nov 30 19:22:24 2015 @@ -22,31 +22,11 @@ <class name="drawClipArtWhiteBoard" > - <attribute name="clipArtEndx" value="0" type="number" /> <attribute name="clipArtEndy" value="0" type="number" /> - - <!-- Not needed anymore, use LzView.setColor instead - <method name="setTint" args="color, brightness"> - <![CDATA[ - if (color != "" && color != null){ - if (brightness == null) { brightness = 0; } - var rgb = color; - var red=(rgb >> 16) & 0xFF; - var green=(rgb >> 8) & 0xFF; - var blue=rgb & 0xFF; - - this.setColorTransform( { ra : red, ga : green, ba : blue, - rb : 0, gb : 0, bb : 100 } ); - } - ]]> - </method> - --> - </class> <class name="baseDrawClipArt" extends="baseDrawArrow" > - <attribute name="minClipArtx" value="0" type="number" /> <attribute name="maxClipArtx" value="0" type="number" /> <attribute name="minClipArty" value="0" type="number" /> Modified: openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx (original) +++ openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/video/baseVideoObject.lzx Mon Nov 30 19:22:24 2015 @@ -538,7 +538,7 @@ var userData = so.data; var dontShowExclusiveAudioConfirmation = userData["dontShowExclusiveAudioConfirmation"]; var exclusiveAudioListener = new Object(); - exclusiveAudioListener.sendNoConfirmation = function() {}; + exclusiveAudioListener.sendNoConfirmation = function(none) {}; exclusiveAudioListener.sendConfirmation = function(answer, remember) { if (answer) { giveExclusiveAudio(); Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/FlvExplorerConverter.java Mon Nov 30 19:22:24 2015 @@ -38,12 +38,11 @@ import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; public class FlvExplorerConverter extends BaseConverter { - private static final Logger log = Red5LoggerFactory.getLogger(FlvExplorerConverter.class, webAppRootKey); // Spring loaded Beans @Autowired - private FileExplorerItemDao fileExplorerItemDaoImpl; + private FileExplorerItemDao fileDao; @Autowired private RecordingLogDao recordingLogDao; @@ -59,7 +58,7 @@ public class FlvExplorerConverter extend public List<ConverterProcessResult> startConversion(Long fileId, String moviePath) { List<ConverterProcessResult> returnLog = new ArrayList<ConverterProcessResult>(); try { - FileExplorerItem fileExplorerItem = fileExplorerItemDaoImpl.get(fileId); + FileExplorerItem fileExplorerItem = fileDao.get(fileId); log.debug("fileExplorerItem " + fileExplorerItem.getId()); @@ -117,7 +116,7 @@ public class FlvExplorerConverter extend returnLog.add(ProcessHelper.executeScript("previewUpload ID :: " + fileExplorerItem.getId(), argv_previewFLV)); - fileExplorerItemDaoImpl.update(fileExplorerItem); + fileDao.update(fileExplorerItem); for (ConverterProcessResult returnMap : returnLog) { recordingLogDao.add("generateFFMPEG", null, returnMap); Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileProcessor.java Mon Nov 30 19:22:24 2015 @@ -51,7 +51,7 @@ public class FileProcessor { @Autowired private FlvExplorerConverter flvExplorerConverter; @Autowired - private FileExplorerItemDao fileExplorerItemDao; + private FileExplorerItemDao fileDao; @Autowired private GenerateImage generateImage; @Autowired @@ -113,7 +113,7 @@ public class FileProcessor { } f.setHash(hash); - f = fileExplorerItemDao.update(f); + f = fileDao.update(f); log.debug("fileId: " + f.getId()); log.debug("canBeConverted: " + canBeConverted); Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileUtils.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileUtils.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileUtils.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/file/FileUtils.java Mon Nov 30 19:22:24 2015 @@ -19,18 +19,17 @@ package org.apache.openmeetings.core.data.file; import static org.apache.openmeetings.util.OmFileHelper.thumbImagePrefix; +import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.List; import java.util.Locale; import org.apache.openmeetings.db.dao.file.FileExplorerItemDao; import org.apache.openmeetings.db.entity.file.FileExplorerItem; import org.apache.openmeetings.db.entity.file.FileItem.Type; import org.apache.openmeetings.util.OmFileHelper; -import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; import org.red5.logging.Red5LoggerFactory; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -39,7 +38,7 @@ public class FileUtils { private static final Logger log = Red5LoggerFactory.getLogger(FileProcessor.class, webAppRootKey); @Autowired - private FileExplorerItemDao fileExplorerItemDao; + private FileExplorerItemDao fileDao; public long getSizeOfDirectoryAndSubs(FileExplorerItem file) { try { @@ -67,13 +66,10 @@ public class FileUtils { } } - log.debug("calling [1] FileExplorerItemDaoImpl.updateFileOrFolder()"); - fileExplorerItemDao.update(file); - - List<FileExplorerItem> childElements = fileExplorerItemDao.getByParent(file.getId()); - - for (FileExplorerItem childExplorerItem : childElements) { - fileSize += this.getSizeOfDirectoryAndSubs(childExplorerItem); + log.debug("calling [1] fileDao.update()"); + fileDao.update(file); + for (FileExplorerItem child : fileDao.getByParent(file.getId())) { + fileSize += getSizeOfDirectoryAndSubs(child); } return fileSize; Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectListManagerById.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectListManagerById.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectListManagerById.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectListManagerById.java Mon Nov 30 19:22:24 2015 @@ -18,7 +18,8 @@ */ package org.apache.openmeetings.core.data.whiteboard; -import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.openmeetings.db.dto.room.WhiteboardObject; import org.apache.openmeetings.db.dto.room.WhiteboardObjectList; @@ -30,8 +31,7 @@ import org.apache.openmeetings.db.dto.ro * */ public class WhiteBoardObjectListManagerById { - - private HashMap<Long,WhiteboardObjectList> whiteBoardObjectList = new HashMap<Long,WhiteboardObjectList>(); + private Map<Long,WhiteboardObjectList> whiteBoardObjectList = new ConcurrentHashMap<Long, WhiteboardObjectList>(); private Long whiteboardId = 0L; Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectSyncManager.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectSyncManager.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectSyncManager.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteBoardObjectSyncManager.java Mon Nov 30 19:22:24 2015 @@ -20,6 +20,7 @@ package org.apache.openmeetings.core.dat import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.openmeetings.db.dto.room.WhiteboardSyncLockObject; import org.apache.openmeetings.util.OpenmeetingsVariables; @@ -33,10 +34,8 @@ import org.slf4j.Logger; * */ public class WhiteBoardObjectSyncManager { - - private HashMap<Long, Map<String, WhiteboardSyncLockObject>> whiteBoardSyncList = new HashMap<Long, Map<String, WhiteboardSyncLockObject>>(); - - private HashMap<Long, Map<String, Map<String, WhiteboardSyncLockObject>>> whiteBoardObjectSyncList = new HashMap<Long, Map<String, Map<String, WhiteboardSyncLockObject>>>(); + private Map<Long, Map<String, WhiteboardSyncLockObject>> whiteBoardSyncList = new ConcurrentHashMap<Long, Map<String, WhiteboardSyncLockObject>>(); + private Map<Long, Map<String, Map<String, WhiteboardSyncLockObject>>> whiteBoardObjectSyncList = new ConcurrentHashMap<Long, Map<String, Map<String, WhiteboardSyncLockObject>>>(); private static final Logger log = Red5LoggerFactory.getLogger( WhiteBoardObjectSyncManager.class, @@ -60,16 +59,12 @@ public class WhiteBoardObjectSyncManager /* * Image Sync Process */ - public synchronized void setWhiteBoardImagesSyncListByRoomid(Long roomId, - Map<String, Map<String, WhiteboardSyncLockObject>> mapObject) { + public synchronized void setWhiteBoardImagesSyncListByRoomid(Long roomId, Map<String, Map<String, WhiteboardSyncLockObject>> mapObject) { whiteBoardObjectSyncList.put(roomId, mapObject); } - public synchronized void setWhiteBoardImagesSyncListByRoomAndObjectId( - Long roomId, String objectId, - Map<String, WhiteboardSyncLockObject> imageSyncList) { - Map<String, Map<String, WhiteboardSyncLockObject>> roomList = whiteBoardObjectSyncList - .get(roomId); + public synchronized void setWhiteBoardImagesSyncListByRoomAndObjectId(Long roomId, String objectId, Map<String, WhiteboardSyncLockObject> imageSyncList) { + Map<String, Map<String, WhiteboardSyncLockObject>> roomList = whiteBoardObjectSyncList.get(roomId); if (roomList == null) { roomList = new HashMap<String, Map<String, WhiteboardSyncLockObject>>(); } @@ -92,21 +87,16 @@ public class WhiteBoardObjectSyncManager public synchronized Map<String, WhiteboardSyncLockObject> getWhiteBoardObjectSyncListByRoomAndObjectId(Long roomId, String objectId) { log.debug("getWhiteBoardImagesSyncListByRoomAndImageid roomId: " + roomId); - Map<String, Map<String, WhiteboardSyncLockObject>> roomList = whiteBoardObjectSyncList - .get(roomId); + Map<String, Map<String, WhiteboardSyncLockObject>> roomList = whiteBoardObjectSyncList.get(roomId); if (roomList == null) { roomList = new HashMap<String, Map<String, WhiteboardSyncLockObject>>(); } - log.debug("getWhiteBoardImagesSyncListByRoomAndImageid roomList: " - + roomList); - log.debug("getWhiteBoardImagesSyncListByRoomAndImageid objectId: " - + objectId); + log.debug("getWhiteBoardImagesSyncListByRoomAndImageid roomList: " + roomList); + log.debug("getWhiteBoardImagesSyncListByRoomAndImageid objectId: " + objectId); if (roomList.size() == 1) { - log.debug("getWhiteBoardImagesSyncListByRoomAndImageid roomList Key imageId: " - + roomList.keySet().iterator().next()); + log.debug("getWhiteBoardImagesSyncListByRoomAndImageid roomList Key imageId: " + roomList.keySet().iterator().next()); } - Map<String, WhiteboardSyncLockObject> imageSyncList = roomList - .get(objectId); + Map<String, WhiteboardSyncLockObject> imageSyncList = roomList.get(objectId); if (imageSyncList == null) { imageSyncList = new HashMap<String, WhiteboardSyncLockObject>(); } Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteboardManager.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteboardManager.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteboardManager.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/whiteboard/WhiteboardManager.java Mon Nov 30 19:22:24 2015 @@ -18,16 +18,14 @@ */ package org.apache.openmeetings.core.data.whiteboard; +import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; + import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.openmeetings.db.dto.room.WhiteboardObject; - -import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey; - import org.red5.logging.Red5LoggerFactory; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -43,14 +41,6 @@ public class WhiteboardManager { try { log.debug("addWhiteBoardObjectById: ", whiteboardObj); - // log.debug("whiteboardObj 0: Event: "+whiteboardObj.get(0)); - // log.debug("whiteboardObj 1: Event: "+whiteboardObj.get(1)); - // log.debug("whiteboardObj 2: Event: "+whiteboardObj.get(2)); - // log.debug("whiteboardObj 3: Event: "+whiteboardObj.get(3)); - - // log.debug("whiteboardObj NUMB3: Event: "+whiteboardObj.get(3).getClass().getName()); - - // Date dateOfEvent = (Date) whiteboardObj.get(1); String action = whiteboardObj.get(2).toString(); log.debug("action: " + action); @@ -59,63 +49,37 @@ public class WhiteboardManager { List actionObject = (List) whiteboardObj.get(3); if (action.equals("moveMap")) { - WhiteboardObject whiteboardObject = wbListManagerById - .getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, - whiteBoardId); + WhiteboardObject whiteboardObject = wbListManagerById.getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, whiteBoardId); whiteboardObject.setX(Integer.valueOf(actionObject.get(1).toString())); whiteboardObject.setY(Integer.valueOf(actionObject.get(2).toString())); - wbListManagerById - .setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, - whiteboardObject, whiteBoardId); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, whiteboardObject, whiteBoardId); } else if (action.equals("draw") || action.equals("redo")) { - WhiteboardObject whiteboardObject = wbListManagerById - .getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, - whiteBoardId); + WhiteboardObject whiteboardObject = wbListManagerById.getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, whiteBoardId); // log.debug(actionObject); // log.debug(actionObject.size()-1); // log.debug(actionObject.get(actionObject.size()-1)); String objectType = actionObject.get(0).toString(); if (!objectType.equals("pointerWhiteBoard")) { - String objectOID = actionObject - .get(actionObject.size() - 1).toString(); + String objectOID = actionObject.get(actionObject.size() - 1).toString(); log.debug("objectOID: " + objectOID); - whiteboardObject.getRoomItems() - .put(objectOID, actionObject); - wbListManagerById - .setWhiteBoardObjectListRoomObjAndWhiteboardId( - roomId, whiteboardObject, whiteBoardId); + whiteboardObject.getRoomItems().put(objectOID, actionObject); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, whiteboardObject, whiteBoardId); } } else if (action.equals("clear")) { - WhiteboardObject whiteboardObject = wbListManagerById - .getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, - whiteBoardId); + WhiteboardObject whiteboardObject = wbListManagerById.getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, whiteBoardId); whiteboardObject.setRoomItems(new HashMap<String, List>()); - wbListManagerById - .setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, - whiteboardObject, whiteBoardId); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, whiteboardObject, whiteBoardId); } else if (action.equals("delete") || action.equals("undo")) { - WhiteboardObject whiteboardObject = wbListManagerById - .getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, - whiteBoardId); - String objectOID = actionObject.get(actionObject.size() - 1) - .toString(); + WhiteboardObject whiteboardObject = wbListManagerById.getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, whiteBoardId); + String objectOID = actionObject.get(actionObject.size() - 1).toString(); String objectType = actionObject.get(0).toString(); log.debug("removal of objectOID: " + objectOID); log.debug("removal of objectOID: " + objectOID); - // "ellipse" - // || this.baseactionobjectList[i][0] == "drawarrow" - // || this.baseactionobjectList[i][0] == "line" - // || this.baseactionobjectList[i][0] == "paint" - // || this.baseactionobjectList[i][0] == "rectangle" - // || this.baseactionobjectList[i][0] == "uline" - // || this.baseactionobjectList[i][0] == "image" - // || this.baseactionobjectList[i][0] == "letter" - // Re-Index all items in its zIndex if (objectType.equals("ellipse") || objectType.equals("drawarrow") @@ -133,29 +97,21 @@ public class WhiteboardManager { Integer zIndex = Integer.valueOf(actionObject.get(actionObject.size() - 8).toString()); log.debug("1|zIndex " + zIndex); - log.debug("2|zIndex " - + actionObject.get(actionObject.size() - 8) - .toString()); - log.debug("3|zIndex " - + actionObject.get(actionObject.size() - 8)); + log.debug("2|zIndex " + actionObject.get(actionObject.size() - 8).toString()); + log.debug("3|zIndex " + actionObject.get(actionObject.size() - 8)); int l = 0; - for (Iterator debugIter = actionObject.iterator(); debugIter - .hasNext();) { - log.debug("4|zIndex " + l + " -- " + debugIter.next()); + for (Object o : actionObject) { + log.debug("4|zIndex " + l + " -- " + o); l++; } - for (Iterator<String> iter = whiteboardObject - .getRoomItems().keySet().iterator(); iter.hasNext();) { - String whiteboardObjKey = iter.next(); - List actionObjectStored = whiteboardObject - .getRoomItems().get(whiteboardObjKey); + for (Entry<String, List> e : whiteboardObject.getRoomItems().entrySet()) { + List actionObjectStored = e.getValue(); Integer zIndexStored = Integer.valueOf(actionObjectStored.get(actionObjectStored.size() - 8).toString()); - log.debug("zIndexStored|zIndex " + zIndexStored + "|" - + zIndex); + log.debug("zIndexStored|zIndex " + zIndexStored + "|" + zIndex); if (zIndexStored >= zIndex) { zIndexStored -= 1; @@ -163,25 +119,19 @@ public class WhiteboardManager { } actionObjectStored.set(actionObjectStored.size() - 8, zIndexStored); - whiteboardObject.getRoomItems().put(whiteboardObjKey, actionObjectStored); + whiteboardObject.getRoomItems().put(e.getKey(), actionObjectStored); } - } - whiteboardObject.getRoomItems().remove(objectOID); - wbListManagerById - .setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, - whiteboardObject, whiteBoardId); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, whiteboardObject, whiteBoardId); } else if (action.equals("size") || action.equals("editProp") || action.equals("editTextMindMapNode") || action.equals("editText") || action.equals("swf") || action.equals("flv") || action.equals("editTextMindMapColor") || action.equals("editTextMindMapFontColor")) { - WhiteboardObject whiteboardObject = wbListManagerById - .getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, - whiteBoardId); + WhiteboardObject whiteboardObject = wbListManagerById.getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, whiteBoardId); String objectOID = actionObject.get(actionObject.size() - 1).toString(); // List roomItem = roomList.get(objectOID); List currentObject = whiteboardObject.getRoomItems().get(objectOID); @@ -193,13 +143,9 @@ public class WhiteboardManager { Map<String, List> roomList = whiteboardObject.getRoomItems(); if (action.equals("swf")) { - log.debug("actionObject " + actionObject); - if (actionObject.get(0).equals("swf")) { - if (actionObject.get(8) != currentObject.get(8)) { - String baseObjectName = actionObject.get(actionObject.size() - 1).toString(); Integer slidesNumber = Integer.valueOf(actionObject.get(8).toString()); @@ -229,55 +175,35 @@ public class WhiteboardManager { } log.debug("swfObj :1: " + swfObj); - } - } - } - } } - wbListManagerById - .setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, - whiteboardObject, whiteBoardId); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, whiteboardObject, whiteBoardId); } else if (action.equals("clearSlide")) { - - WhiteboardObject whiteboardObject = wbListManagerById - .getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, - whiteBoardId); + WhiteboardObject whiteboardObject = wbListManagerById.getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, whiteBoardId); Map roomList = whiteboardObject.getRoomItems(); for (String objectName : (List<String>) actionObject) { - roomList.remove(objectName); - } - wbListManagerById - .setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, - whiteboardObject, whiteBoardId); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, whiteboardObject, whiteBoardId); } else if (action.equals("whiteboardObj")) { - WhiteboardObject whiteboardObject = wbListManagerById - .getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, - whiteBoardId); + WhiteboardObject whiteboardObject = wbListManagerById.getWhiteBoardObjectListByRoomIdAndWhiteboard(roomId, whiteBoardId); whiteboardObject.setFullFit((Boolean) actionObject.get(1)); whiteboardObject.setZoom((Integer) actionObject.get(2)); - wbListManagerById - .setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, - whiteboardObject, whiteBoardId); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, whiteboardObject, whiteBoardId); } else { - log.warn("Unkown Type: " + action + " actionObject: " - + actionObject); + log.warn("Unkown Type: " + action + " actionObject: " + actionObject); } - } catch (Exception err) { log.error("[addWhiteBoardObject]", err); } } - } Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LoadLibraryPresentation.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LoadLibraryPresentation.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LoadLibraryPresentation.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/LoadLibraryPresentation.java Mon Nov 30 19:22:24 2015 @@ -54,10 +54,6 @@ public class LoadLibraryPresentation { String nodeVal = item.getName(); - //LinkedHashMap<String,Object> subMap = new LinkedHashMap<String,Object>(); - - //subMap.put("name", nodeVal); - if (nodeVal.equals("originalDocument")){ lPresentation.setOriginalDocument(createListObjectLibraryByFileDocument(item)); Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ConferenceLibrary.java Mon Nov 30 19:22:24 2015 @@ -67,7 +67,7 @@ public class ConferenceLibrary implement @Autowired private UserDao userDao; @Autowired - private FileExplorerItemDao fileExplorerItemDao; + private FileExplorerItemDao fileDao; @Autowired private LibraryWmlLoader libraryWmlLoader; @Autowired @@ -139,7 +139,7 @@ public class ConferenceLibrary implement // String wmlPath = current_dir + File.separatorChar+fileName // +".xml"; // OwnerID == null - Long fileExplorerId = fileExplorerItemDao.add(fileName, "", 0L, + Long fileExplorerId = fileDao.add(fileName, "", 0L, null, room_id, users_id, false, // isFolder false, // isImage false, // isPresentation @@ -180,7 +180,7 @@ public class ConferenceLibrary implement return; } - FileExplorerItem fileExplorerItem = fileExplorerItemDao.get(fileId); + FileExplorerItem fileExplorerItem = fileDao.get(fileId); ArrayList roomItems = libraryWmlLoader.loadWmlFile(fileExplorerItem.getWmlFilePath()); @@ -218,9 +218,7 @@ public class ConferenceLibrary implement if ((rcl == null) || rcl.isScreenClient()) { continue; } else { - ((IServiceCapableConnection) conn).invoke( - "loadWmlToWhiteboardById", - new Object[] { sendObject }, this); + ((IServiceCapableConnection) conn).invoke("loadWmlToWhiteboardById", new Object[] { sendObject }, this); } } } Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/PrintService.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/PrintService.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/PrintService.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/PrintService.java Mon Nov 30 19:22:24 2015 @@ -21,6 +21,7 @@ package org.apache.openmeetings.core.rem import java.util.Date; import java.util.HashMap; import java.util.List; +import java.util.Map; import org.apache.openmeetings.core.batik.beans.PrintBean; import org.apache.openmeetings.db.dao.server.SessiondataDao; @@ -33,11 +34,9 @@ import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; public class PrintService { - - private static final Logger log = Red5LoggerFactory.getLogger(PrintService.class, OpenmeetingsVariables.webAppRootKey); - private static HashMap<String,PrintBean> currentExportList = new HashMap<String,PrintBean>(); + private static Map<String,PrintBean> currentExportList = new HashMap<String,PrintBean>(); @Autowired private SessiondataDao sessiondataDao; @Autowired Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java Mon Nov 30 19:22:24 2015 @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.Comparator; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedList; import java.util.Map; @@ -63,30 +62,26 @@ public class WhiteBoardService implement @Autowired private UserDao userDao; @Autowired - private final ScopeApplicationAdapter scopeApplicationAdapter = null; + private ScopeApplicationAdapter scopeApplicationAdapter; @Autowired - private final ISessionManager sessionManager = null; + private ISessionManager sessionManager; @Autowired - private final WhiteBoardObjectSyncManager whiteBoardObjectListManager = null; + private WhiteBoardObjectSyncManager wbListManager; @Autowired - private final WhiteBoardObjectListManagerById whiteBoardObjectListManagerById = null; + private WhiteBoardObjectListManagerById wbListManagerById; @Autowired private SessiondataDao sessiondataDao; public Long getNewWhiteboardId() { try { - IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); - Client currentClient = this.sessionManager - .getClientByStreamId(streamid, null); - Long room_id = currentClient.getRoomId(); + Client currentClient = sessionManager.getClientByStreamId(streamid, null); + Long roomId = currentClient.getRoomId(); - Long whiteBoardId = this.whiteBoardObjectListManagerById - .getNewWhiteboardId(room_id); + Long whiteBoardId = wbListManagerById.getNewWhiteboardId(roomId); return whiteBoardId; - } catch (Exception err) { log.error("[deleteWhiteboard]", err); } @@ -97,38 +92,21 @@ public class WhiteBoardService implement try { IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); - Client currentClient = this.sessionManager - .getClientByStreamId(streamid, null); - Long room_id = currentClient.getRoomId(); - - 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); + Client currentClient = sessionManager.getClientByStreamId(streamid, null); + Long roomId = currentClient.getRoomId(); - if (storedWhiteboardId.equals(whiteBoardId)) { - log.debug("Found Whiteboard to Remove"); - } - } - Object returnValue = whiteboardObjectList.getWhiteboardObjects() - .remove(whiteBoardId); + WhiteboardObjectList whiteboardObjectList = wbListManagerById.getWhiteBoardObjectListByRoomId(roomId); + Object returnValue = whiteboardObjectList.getWhiteboardObjects().remove(whiteBoardId); log.debug(" :: whiteBoardId :: " + whiteBoardId); - this.whiteBoardObjectListManagerById - .setWhiteBoardObjectListRoomObj(room_id, - whiteboardObjectList); + wbListManagerById.setWhiteBoardObjectListRoomObj(roomId, whiteboardObjectList); if (returnValue != null) { return true; } else { return false; } - } catch (Exception err) { log.error("[deleteWhiteboard]", err); } @@ -143,16 +121,16 @@ public class WhiteBoardService implement Long roomId = currentClient.getRoomId(); log.debug("getRoomItems: " + roomId); - WhiteboardObjectList whiteboardObjectList = whiteBoardObjectListManagerById.getWhiteBoardObjectListByRoomId(roomId); + WhiteboardObjectList whiteboardObjectList = wbListManagerById.getWhiteBoardObjectListByRoomId(roomId); if (whiteboardObjectList.getWhiteboardObjects().size() == 0) { - Long whiteBoardId = whiteBoardObjectListManagerById.getNewWhiteboardId(roomId); + Long whiteBoardId = wbListManagerById.getNewWhiteboardId(roomId); - whiteBoardObjectListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, new WhiteboardObject(), whiteBoardId); + wbListManagerById.setWhiteBoardObjectListRoomObjAndWhiteboardId(roomId, new WhiteboardObject(), whiteBoardId); log.debug("Init New Room List"); - whiteboardObjectList = whiteBoardObjectListManagerById.getWhiteBoardObjectListByRoomId(roomId); + whiteboardObjectList = wbListManagerById.getWhiteBoardObjectListByRoomId(roomId); } return whiteboardObjectList; } catch (Exception err) { @@ -240,31 +218,24 @@ public class WhiteBoardService implement public Boolean setCanRemote(String SID, String publicSID, boolean canRemote) { try { - IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); - Client currentClient = this.sessionManager - .getClientByStreamId(streamid, null); - - Long users_id = sessiondataDao.checkSession(SID); + Client currentClient = sessionManager.getClientByStreamId(streamid, null); - if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) { + Long userId = sessiondataDao.checkSession(SID); + if (AuthLevelUtil.hasUserLevel(userDao.getRights(userId))) { if (currentClient.getIsMod()) { - Client rcl = this.sessionManager - .getClientByPublicSID(publicSID, false, null); + Client rcl = sessionManager.getClientByPublicSID(publicSID, false, null); if (rcl != null) { rcl.setCanRemote(canRemote); - this.sessionManager.updateClientByStreamId( - rcl.getStreamid(), rcl, false, null); + sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null); HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>(); newMessage.put(0, "updateDrawStatus"); newMessage.put(1, rcl); - this.scopeApplicationAdapter - .sendMessageWithClientWithSyncObject(newMessage, true); - + scopeApplicationAdapter.sendMessageWithClientWithSyncObject(newMessage, true); } else { return false; } @@ -272,7 +243,6 @@ public class WhiteBoardService implement return false; } } - } catch (Exception err) { log.error("[setCanDraw]", err); } @@ -284,26 +254,22 @@ public class WhiteBoardService implement log.debug("[setCanGiveAudio] " + SID + ", " + publicSID + ", " + canGiveAudio); IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); - Client currentClient = this.sessionManager - .getClientByStreamId(streamid, null); + Client currentClient = sessionManager.getClientByStreamId(streamid, null); Long users_id = sessiondataDao.checkSession(SID); if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) { if (currentClient.getIsMod()) { - Client rcl = this.sessionManager - .getClientByPublicSID(publicSID, false, null); + Client rcl = sessionManager.getClientByPublicSID(publicSID, false, null); if (rcl != null) { rcl.setCanGiveAudio(canGiveAudio); - this.sessionManager.updateClientByStreamId( - rcl.getStreamid(), rcl, false, null); + sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null); HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>(); newMessage.put(0, "updateGiveAudioStatus"); newMessage.put(1, rcl); - this.scopeApplicationAdapter - .sendMessageWithClientWithSyncObject(newMessage, true); + scopeApplicationAdapter.sendMessageWithClientWithSyncObject(newMessage, true); } else { return false; } @@ -311,7 +277,6 @@ public class WhiteBoardService implement return false; } } - } catch (Exception err) { log.error("[setCanGiveAudio]", err); } @@ -320,33 +285,28 @@ public class WhiteBoardService implement public WhiteboardSyncLockObject startNewSyncprocess() { try { - IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); - Client currentClient = this.sessionManager - .getClientByStreamId(streamid, null); - Long room_id = currentClient.getRoomId(); + Client currentClient = sessionManager.getClientByStreamId(streamid, null); + Long roomId = currentClient.getRoomId(); WhiteboardSyncLockObject wSyncLockObject = new WhiteboardSyncLockObject(); wSyncLockObject.setAddtime(new Date()); wSyncLockObject.setPublicSID(currentClient.getPublicSID()); wSyncLockObject.setInitialLoaded(true); - Map<String, WhiteboardSyncLockObject> syncListRoom = this.whiteBoardObjectListManager - .getWhiteBoardSyncListByRoomid(room_id); + Map<String, WhiteboardSyncLockObject> syncListRoom = wbListManager.getWhiteBoardSyncListByRoomid(roomId); wSyncLockObject.setCurrentLoadingItem(true); wSyncLockObject.setInserted(new Date()); syncListRoom.put(currentClient.getPublicSID(), wSyncLockObject); - this.whiteBoardObjectListManager.setWhiteBoardSyncListByRoomid( - room_id, syncListRoom); + wbListManager.setWhiteBoardSyncListByRoomid(roomId, syncListRoom); //Sync to clients - this.scopeApplicationAdapter.sendMessageToCurrentScope("sendSyncFlag", wSyncLockObject, true); + scopeApplicationAdapter.sendMessageToCurrentScope("sendSyncFlag", wSyncLockObject, true); return wSyncLockObject; - } catch (Exception err) { log.error("[startNewSyncprocess]", err); } @@ -355,34 +315,27 @@ public class WhiteBoardService implement public void sendCompletedSyncEvent() { try { - IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); - Client currentClient = this.sessionManager - .getClientByStreamId(streamid, null); - Long room_id = currentClient.getRoomId(); + Client currentClient = sessionManager.getClientByStreamId(streamid, null); + Long roomId = currentClient.getRoomId(); - Map<String, WhiteboardSyncLockObject> syncListRoom = this.whiteBoardObjectListManager - .getWhiteBoardSyncListByRoomid(room_id); + Map<String, WhiteboardSyncLockObject> syncListRoom = wbListManager.getWhiteBoardSyncListByRoomid(roomId); - WhiteboardSyncLockObject wSyncLockObject = syncListRoom - .get(currentClient.getPublicSID()); + WhiteboardSyncLockObject wSyncLockObject = syncListRoom.get(currentClient.getPublicSID()); if (wSyncLockObject == null) { log.error("WhiteboardSyncLockObject not found for this Client " + syncListRoom); return; } else if (!wSyncLockObject.isCurrentLoadingItem()) { - log.warn("WhiteboardSyncLockObject was not started yet " - + syncListRoom); + log.warn("WhiteboardSyncLockObject was not started yet " + syncListRoom); return; } else { syncListRoom.remove(currentClient.getPublicSID()); - this.whiteBoardObjectListManager.setWhiteBoardSyncListByRoomid( - room_id, syncListRoom); + wbListManager.setWhiteBoardSyncListByRoomid(roomId, syncListRoom); - int numberOfInitial = this - .getNumberOfInitialLoaders(syncListRoom); + int numberOfInitial = getNumberOfInitialLoaders(syncListRoom); if (numberOfInitial == 0) { scopeApplicationAdapter.sendMessageToCurrentScope("sendSyncCompleteFlag", wSyncLockObject, true); @@ -390,21 +343,16 @@ public class WhiteBoardService implement return; } } - } catch (Exception err) { log.error("[sendCompletedSyncEvent]", err); } return; } - private int getNumberOfInitialLoaders( - Map<String, WhiteboardSyncLockObject> syncListRoom) - throws Exception { + private int getNumberOfInitialLoaders(Map<String, WhiteboardSyncLockObject> syncListRoom) throws Exception { int number = 0; - for (Iterator<String> iter = syncListRoom.keySet().iterator(); iter - .hasNext();) { - WhiteboardSyncLockObject lockObject = syncListRoom.get(iter.next()); - if (lockObject.isInitialLoaded()) { + for (Map.Entry<String, WhiteboardSyncLockObject> e : syncListRoom.entrySet()) { + if (e.getValue().isInitialLoaded()) { number++; } } @@ -415,24 +363,23 @@ public class WhiteBoardService implement * Image Sync Sequence */ - public void startNewObjectSyncProcess(String object_id, boolean isStarting) { + public void startNewObjectSyncProcess(String objectId, boolean isStarting) { try { - - log.debug("startNewObjectSyncprocess: " + object_id); + log.debug("startNewObjectSyncprocess: " + objectId); IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); Client currentClient = sessionManager.getClientByStreamId(streamid, null); - Long room_id = currentClient.getRoomId(); + Long roomId = currentClient.getRoomId(); WhiteboardSyncLockObject wSyncLockObject = new WhiteboardSyncLockObject(); wSyncLockObject.setAddtime(new Date()); wSyncLockObject.setPublicSID(currentClient.getPublicSID()); wSyncLockObject.setInserted(new Date()); - Map<String, WhiteboardSyncLockObject> syncListImage = whiteBoardObjectListManager.getWhiteBoardObjectSyncListByRoomAndObjectId(room_id, object_id); + Map<String, WhiteboardSyncLockObject> syncListImage = wbListManager.getWhiteBoardObjectSyncListByRoomAndObjectId(roomId, objectId); syncListImage.put(currentClient.getPublicSID(), wSyncLockObject); - whiteBoardObjectListManager.setWhiteBoardImagesSyncListByRoomAndObjectId(room_id, object_id, syncListImage); + wbListManager.setWhiteBoardImagesSyncListByRoomAndObjectId(roomId, objectId, syncListImage); // Do only send the Token to show the Loading Splash for the // initial-Request that starts the loading @@ -444,49 +391,34 @@ public class WhiteBoardService implement } } - public int sendCompletedObjectSyncEvent(String object_id) { + public int sendCompletedObjectSyncEvent(String objectId) { try { - - log.debug("sendCompletedObjectSyncEvent: " + object_id); + log.debug("sendCompletedObjectSyncEvent: " + objectId); IConnection current = Red5.getConnectionLocal(); String streamid = current.getClient().getId(); - Client currentClient = this.sessionManager - .getClientByStreamId(streamid, null); - Long room_id = currentClient.getRoomId(); + Client currentClient = sessionManager.getClientByStreamId(streamid, null); + Long roomId = currentClient.getRoomId(); - Map<String, WhiteboardSyncLockObject> syncListImage = this.whiteBoardObjectListManager - .getWhiteBoardObjectSyncListByRoomAndObjectId(room_id, - object_id); + Map<String, WhiteboardSyncLockObject> syncListImage = wbListManager.getWhiteBoardObjectSyncListByRoomAndObjectId(roomId, objectId); - log.debug("sendCompletedObjectSyncEvent syncListImage: " - + syncListImage); + log.debug("sendCompletedObjectSyncEvent syncListImage: " + syncListImage); - WhiteboardSyncLockObject wSyncLockObject = syncListImage - .get(currentClient.getPublicSID()); + WhiteboardSyncLockObject wSyncLockObject = syncListImage.get(currentClient.getPublicSID()); if (wSyncLockObject == null) { - log.error("WhiteboardSyncLockObject not found for this Client " - + currentClient.getPublicSID()); - log.error("WhiteboardSyncLockObject not found for this syncListImage " - + syncListImage); + log.error("WhiteboardSyncLockObject not found for this Client " + currentClient.getPublicSID()); + log.error("WhiteboardSyncLockObject not found for this syncListImage " + syncListImage); return -2; - } else { - - log.debug("sendCompletedImagesSyncEvent remove: " - + currentClient.getPublicSID()); + log.debug("sendCompletedImagesSyncEvent remove: " + currentClient.getPublicSID()); syncListImage.remove(currentClient.getPublicSID()); - this.whiteBoardObjectListManager - .setWhiteBoardImagesSyncListByRoomAndObjectId(room_id, - object_id, syncListImage); + wbListManager.setWhiteBoardImagesSyncListByRoomAndObjectId(roomId, objectId, syncListImage); - int numberOfInitial = this.whiteBoardObjectListManager - .getWhiteBoardObjectSyncListByRoomid(room_id).size(); + int numberOfInitial = wbListManager.getWhiteBoardObjectSyncListByRoomid(roomId).size(); - log.debug("sendCompletedImagesSyncEvent numberOfInitial: " - + numberOfInitial); + log.debug("sendCompletedImagesSyncEvent numberOfInitial: " + numberOfInitial); if (numberOfInitial == 0) { scopeApplicationAdapter.sendMessageToCurrentScope("sendObjectSyncCompleteFlag", wSyncLockObject, true); @@ -495,79 +427,57 @@ public class WhiteBoardService implement return -4; } } - } catch (Exception err) { log.error("[sendCompletedObjectSyncEvent]", err); } return -1; } - public synchronized void removeUserFromAllLists(IScope scope, - Client currentClient) { + public synchronized void removeUserFromAllLists(IScope scope, Client currentClient) { try { - - Long room_id = currentClient.getRoomId(); + Long roomId = currentClient.getRoomId(); // TODO: Maybe we should also check all rooms, independent from the - // current room_id if there is any user registered - if (room_id != null) { - - log.debug("removeUserFromAllLists this.whiteBoardObjectListManager: " - + this.whiteBoardObjectListManager); - log.debug("removeUserFromAllLists room_id: " + room_id); + // current roomId if there is any user registered + if (roomId != null) { + log.debug("removeUserFromAllLists this.whiteBoardObjectListManager: " + wbListManager); + log.debug("removeUserFromAllLists roomId: " + roomId); // Check Initial Loaders - Map<String, WhiteboardSyncLockObject> syncListRoom = this.whiteBoardObjectListManager - .getWhiteBoardSyncListByRoomid(room_id); + Map<String, WhiteboardSyncLockObject> syncListRoom = wbListManager.getWhiteBoardSyncListByRoomid(roomId); - WhiteboardSyncLockObject wSyncLockObject = syncListRoom - .get(currentClient.getPublicSID()); + WhiteboardSyncLockObject wSyncLockObject = syncListRoom.get(currentClient.getPublicSID()); if (wSyncLockObject != null) { syncListRoom.remove(currentClient.getPublicSID()); } - this.whiteBoardObjectListManager.setWhiteBoardSyncListByRoomid( - room_id, syncListRoom); + wbListManager.setWhiteBoardSyncListByRoomid(roomId, syncListRoom); - int numberOfInitial = this - .getNumberOfInitialLoaders(syncListRoom); + int numberOfInitial = getNumberOfInitialLoaders(syncListRoom); log.debug("scope " + scope); if (numberOfInitial == 0 && scope != null) { - scopeApplicationAdapter.sendMessageToCurrentScope("sendSyncCompleteFlag", wSyncLockObject, false); - } // Check Image Loaders - Map<String, Map<String, WhiteboardSyncLockObject>> syncListRoomImages = this.whiteBoardObjectListManager - .getWhiteBoardObjectSyncListByRoomid(room_id); + Map<String, Map<String, WhiteboardSyncLockObject>> syncListRoomImages = wbListManager.getWhiteBoardObjectSyncListByRoomid(roomId); - for (Iterator<String> iter = syncListRoomImages.keySet() - .iterator(); iter.hasNext();) { - String object_id = iter.next(); - Map<String, WhiteboardSyncLockObject> syncListImages = syncListRoomImages - .get(object_id); - WhiteboardSyncLockObject wImagesSyncLockObject = syncListImages - .get(currentClient.getPublicSID()); + for (Map.Entry<String, Map<String, WhiteboardSyncLockObject>> e : syncListRoomImages.entrySet()) { + WhiteboardSyncLockObject wImagesSyncLockObject = e.getValue().get(currentClient.getPublicSID()); if (wImagesSyncLockObject != null) { - syncListImages.remove(currentClient.getPublicSID()); + e.getValue().remove(currentClient.getPublicSID()); } - this.whiteBoardObjectListManager - .setWhiteBoardImagesSyncListByRoomAndObjectId( - room_id, object_id, syncListImages); + wbListManager.setWhiteBoardImagesSyncListByRoomAndObjectId(roomId, e.getKey(), e.getValue()); } - int numberOfImageLoaders = this.whiteBoardObjectListManager - .getWhiteBoardObjectSyncListByRoomid(room_id).size(); + int numberOfImageLoaders = wbListManager.getWhiteBoardObjectSyncListByRoomid(roomId).size(); if (numberOfImageLoaders == 0 && scope != null) { scopeApplicationAdapter.sendMessageToCurrentScope("sendImagesSyncCompleteFlag", new Object[] { "remove" }, true); } - } - } catch (Exception err) { log.error("[removeUserFromAllLists]", err); } Modified: openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java Mon Nov 30 19:22:24 2015 @@ -1493,22 +1493,16 @@ public class ScopeApplicationAdapter ext */ @SuppressWarnings({ "rawtypes", "unchecked" }) public void sendVarsByWhiteboardId(ArrayList whiteboardObjParam, Long whiteboardId) { - // try { - 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++; + for (Object obj : whiteboardObjParam) { + whiteboardObj.put(i++, obj); } // Check if this User is the Mod: IConnection current = Red5.getConnectionLocal(); - Client currentClient = this.sessionManager - .getClientByStreamId(current.getClient().getId(), null); + Client currentClient = sessionManager.getClientByStreamId(current.getClient().getId(), null); if (currentClient == null) { return; @@ -1522,7 +1516,6 @@ public class ScopeApplicationAdapter ext String action = whiteboardObj.get(2).toString(); if (action.equals("deleteMindMapNodes")) { - // Simulate Single Delete Events for z-Index List actionObject = (List) whiteboardObj.get(3); @@ -1532,7 +1525,6 @@ public class ScopeApplicationAdapter ext 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 @@ -1546,16 +1538,10 @@ public class ScopeApplicationAdapter ext whiteboardTempObj.put(3, tempActionObject); - whiteboardManagement.addWhiteBoardObjectById( - roomId, whiteboardTempObj, whiteboardId); - + whiteboardManagement.addWhiteBoardObjectById(roomId, whiteboardTempObj, whiteboardId); } - } else { - - whiteboardManagement.addWhiteBoardObjectById( - roomId, whiteboardObj, whiteboardId); - + whiteboardManagement.addWhiteBoardObjectById(roomId, whiteboardObj, whiteboardId); } Map<String, Object> sendObject = new HashMap<String, Object>(); @@ -1575,15 +1561,12 @@ public class ScopeApplicationAdapter ext } else if (SessionVariablesUtil.isAVClient(client)) { // AVClients or potential AVClients do not receive events continue; - } if (client.getId().equals( - current.getClient().getId())) { + } if (client.getId().equals(current.getClient().getId())) { // don't send back to same user continue; } - ((IServiceCapableConnection) conn).invoke( - "sendVarsToWhiteboardById", - new Object[] { showDrawStatus ? currentClient : null, sendObject }, - this); + ((IServiceCapableConnection) conn).invoke("sendVarsToWhiteboardById", + new Object[] { showDrawStatus ? currentClient : null, sendObject }, this); } } } @@ -1619,9 +1602,7 @@ public class ScopeApplicationAdapter ext public int sendMessage(Object newMessage) { try { - sendMessageToCurrentScope("sendVarsToMessage", newMessage, false); - } catch (Exception err) { log.error("[sendMessage]", err); } @@ -1630,9 +1611,7 @@ public class ScopeApplicationAdapter ext public int sendMessageAll(Object newMessage) { try { - sendMessageToCurrentScope("sendVarsToMessage", newMessage, true); - } catch (Exception err) { log.error("[sendMessage]", err); } Modified: openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java?rev=1717305&r1=1717304&r2=1717305&view=diff ============================================================================== --- openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java (original) +++ openmeetings/trunk/singlewebapp/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/WhiteboardObjectList.java Mon Nov 30 19:22:24 2015 @@ -18,12 +18,12 @@ */ package org.apache.openmeetings.db.dto.room; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; public class WhiteboardObjectList { private Long roomId; - private Map<Long, WhiteboardObject> whiteboardObjects = new HashMap<Long, WhiteboardObject>(); + private Map<Long, WhiteboardObject> whiteboardObjects = new ConcurrentHashMap<Long, WhiteboardObject>(); public WhiteboardObjectList() {}
