Long user_level = userManager.getUserLevelByID(users_id);
if (authLevelUtil.checkUserLevel(user_level)) {
IConnection current = Red5.getConnectionLocal();
Client currentClient = this.sessionManager
.getClientByStreamId(current.getClient().getId(), null);
if (currentClient == null) {
return;
}
FileExplorerItem fileExplorerItem = fileExplorerItemDao
.getFileExplorerItemsById(fileExplorerItemId);
ArrayList roomItems = libraryWmlLoader.loadWmlFile(fileExplorerItem.getWmlFilePath());
Map whiteboardObjClear = new HashMap();
whiteboardObjClear.put(2, "clear");
whiteboardObjClear.put(3, null);
whiteboardManagement.addWhiteBoardObjectById(
room_id, whiteboardObjClear, whiteboardId);
for (int k = 0; k < roomItems.size(); k++) {
ArrayList actionObject = (ArrayList) roomItems.get(k);
Map whiteboardObj = new HashMap();
whiteboardObj.put(2, "draw");
whiteboardObj.put(3, actionObject);
whiteboardManagement.addWhiteBoardObjectById(
room_id, whiteboardObj, whiteboardId);
}
Map<String, Object> sendObject = new HashMap<String, Object>();
sendObject.put("id", whiteboardId);
sendObject.put("roomitems", roomItems);
// Notify all Clients of that Scope (Room)
Collection<Set<IConnection>> conCollection = current.getScope()
.getConnections();
for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
Client rcl = this.sessionManager
.getClientByStreamId(conn.getClient()
.getId(), null);
if ((rcl == null)
|| (rcl.getIsScreenClient() != null && rcl
.getIsScreenClient())) {
continue;
} else {
((IServiceCapableConnection) conn).invoke(
"loadWmlToWhiteboardById",