Author: solomax
Date: Wed Dec  2 05:49:09 2015
New Revision: 1717571

URL: http://svn.apache.org/viewvc?rev=1717571&view=rev
Log:
[OPENMEETINGS-1286] screen sharing is fixed

Added:
    
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
Removed:
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/servlet/outputhandler/ScreenController.java
Modified:
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ChatService.java
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
    
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
    
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
    
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/mainMethods.lzx
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/interviewuserlist/interviewUserList.lzx
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/participants/participants.lzx
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/restricted/restrictedUserList.lzx
    
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/fixedFileExplorerWhiteBoard.lzx
    
openmeetings/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
    
openmeetings/branches/3.1.x/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
    
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
    
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomBroadcaster.java
    
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
    
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
    
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ChatService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ChatService.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ChatService.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ChatService.java
 Wed Dec  2 05:49:09 2015
@@ -144,7 +144,7 @@ public class ChatService implements IPen
                        hsm.put("message", newMessage);
                        String publicSID = "" + messageMap.get(6);
                        if (!publicSID.equals(currentClient.getPublicSID())) {
-                               hsm.put("client", 
sessionManager.getClientByPublicSID("" + messageMap.get(6), false, null));
+                               hsm.put("client", 
sessionManager.getClientByPublicSID("" + messageMap.get(6), null));
                                //need to remove unconfirmed chat message if any
                                for (int i = myChatList.size() - 1; i > -1; 
--i) {
                                        Client msgClient = 
(Client)myChatList.get(i).get("client");
@@ -180,9 +180,6 @@ public class ChatService implements IPen
                                                if (rcl == null) {
                                                        continue;
                                                }
-                                               if (rcl.isAvClient()) {
-                                                       continue;
-                                               }
                                                if (rcl.isScreenClient()) {
                                                continue;
                                        }
@@ -235,9 +232,6 @@ public class ChatService implements IPen
                                                if 
(SessionVariablesUtil.isScreenClient(client)) {
                                                        // screen sharing 
clients do not receive events
                                                        continue;
-                                               } else if 
(SessionVariablesUtil.isAVClient(client)) {
-                                                       // AVClients or 
potential AVClients do not receive events
-                                                       continue;
                                                }
 
                                                if 
(SessionVariablesUtil.getPublicSID(client).equals(publicSID)

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/MobileService.java
 Wed Dec  2 05:49:09 2015
@@ -204,10 +204,10 @@ public class MobileService {
                                Client c = 
sessionManager.getClientByStreamId(streamId, null);
                                if (c == null) {
                                        c = 
sessionManager.addClientListItem(streamId, conn.getScope().getName(), 
conn.getRemotePort(),
-                                               conn.getRemoteAddress(), "", 
false, null);
+                                               conn.getRemoteAddress(), "", 
null);
                                }
                                
-                               
SessionVariablesUtil.initClient(conn.getClient(), false, c.getPublicSID());
+                               
SessionVariablesUtil.initClient(conn.getClient(), c.getPublicSID());
                                c.setUserId(u.getId());
                                c.setFirstname(u.getFirstname());
                                c.setLastname(u.getLastname());
@@ -235,7 +235,7 @@ public class MobileService {
                for (IConnection conn : 
current.getScope().getClientConnections()) {
                        if (conn != null && conn instanceof 
IServiceCapableConnection) {
                                Client c = 
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
-                               if ((c.isMobile() || c.isAvClient()) && 
!Strings.isEmpty(c.getAvsettings()) && !c.isScreenClient()) {
+                               if (!Strings.isEmpty(c.getAvsettings()) && 
!c.isScreenClient()) {
                                        Map<String, Object> map = new 
Hashtable<String, Object>();
                                        add(map, "streamId", c.getStreamid());
                                        add(map, "broadCastId", 
c.getBroadCastID());

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/RecordingService.java
 Wed Dec  2 05:49:09 2015
@@ -138,9 +138,7 @@ public class RecordingService implements
                                                Client rcl = 
sessionManager.getClientByStreamId(conn.getClient().getId(), null);
 
                                                // Send every user a 
notification that the recording did start
-                                               if (!rcl.isAvClient()) {
-                                                       
((IServiceCapableConnection) conn).invoke("startedRecording", new Object[] { 
client }, this);
-                                               }
+                                               ((IServiceCapableConnection) 
conn).invoke("startedRecording", new Object[] { client }, this);
 
                                                // If its the recording client 
we need another type of Meta Data
                                                if (rcl.isScreenClient()) {
@@ -159,8 +157,7 @@ public class RecordingService implements
 
                                                                
sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null);
                                                        }
-                                               } else if ((rcl.isMobile() || 
rcl.isAvClient())
-                                                               && 
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") || 
rcl.getAvsettings().equals("v"))) {
+                                               } else if 
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") || 
rcl.getAvsettings().equals("v")) {
                                                        // if the user does 
publish av, a, v
                                                        // But we only record 
av or a, video only is not interesting
                                                        String broadcastId = "" 
+ rcl.getBroadCastID();
@@ -329,8 +326,7 @@ public class RecordingService implements
                                                                // Update Meta 
Data
                                                                
metaDataDao.updateEndDate(rcl.getRecordingMetaDataId(), new Date());
                                                        }
-                                               } else if ((rcl.isMobile() || 
rcl.isAvClient())
-                                                               && 
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") || 
rcl.getAvsettings().equals("v"))) {
+                                               } else if 
(rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") || 
rcl.getAvsettings().equals("v")) {
 
                                                        stopRecordingShow(conn, 
String.valueOf(rcl.getBroadCastID()).toString(), rcl.getRecordingMetaDataId());
 
@@ -418,8 +414,7 @@ public class RecordingService implements
                                        
metaDataDao.updateEndDate(rcl.getRecordingMetaDataId(), new Date());
                                }
 
-                       } else if (rcl.isAvClient()
-                                       && (rcl.getAvsettings().equals("a") || 
rcl.getAvsettings().equals("v") || rcl.getAvsettings().equals("av"))) {
+                       } else if (rcl.getAvsettings().equals("a") || 
rcl.getAvsettings().equals("v") || rcl.getAvsettings().equals("av")) {
 
                                // FIXME: Is there really a need to stop it 
manually if the user
                                // just stops the stream?
@@ -459,8 +454,7 @@ public class RecordingService implements
 
                                        
sessionManager.updateClientByStreamId(rcl.getStreamid(), rcl, false, null);
                                }
-                       } else if (rcl.isAvClient()
-                                       && (rcl.getAvsettings().equals("av") || 
rcl.getAvsettings().equals("a") || rcl.getAvsettings().equals("v"))) {
+                       } else if (rcl.getAvsettings().equals("av") || 
rcl.getAvsettings().equals("a") || rcl.getAvsettings().equals("v")) {
                                // if the user does publish av, a, v
                                // But we only record av or a, video only is 
not interesting
 

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/UserService.java
 Wed Dec  2 05:49:09 2015
@@ -297,7 +297,7 @@ public class UserService implements IUse
                        Long userId = sessiondataDao.checkSession(SID);
                        // users only
                        if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(userId))) {
-                               Client rcl = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                               Client rcl = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                                if (rcl == null) {
                                        return true;

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/WhiteBoardService.java
 Wed Dec  2 05:49:09 2015
@@ -160,7 +160,7 @@ public class WhiteBoardService implement
                        if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
 
                                if (currentClient.getIsMod()) {
-                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                                        if (rcl != null) {
                                                rcl.setCanDraw(canDraw);
@@ -193,7 +193,7 @@ public class WhiteBoardService implement
 
                        if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
                                if (currentClient.getIsMod()) {
-                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                                        if (rcl != null) {
                                                rcl.setCanShare(canShare);
@@ -226,7 +226,7 @@ public class WhiteBoardService implement
 
                        if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(userId))) {
                                if (currentClient.getIsMod()) {
-                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                                        if (rcl != null) {
                                                rcl.setCanRemote(canRemote);
@@ -260,7 +260,7 @@ public class WhiteBoardService implement
 
                        if 
(AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
                                if (currentClient.getIsMod()) {
-                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                                       Client rcl = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                                        if (rcl != null) {
                                                
rcl.setCanGiveAudio(canGiveAudio);

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 Wed Dec  2 05:49:09 2015
@@ -153,10 +153,7 @@ public class ScopeApplicationAdapter ext
                IServiceCapableConnection service = (IServiceCapableConnection) 
conn;
                String streamId = conn.getClient().getId();
                
-               boolean isAVClient = params.length == 1 ? Boolean.valueOf("" + 
params[0]) : false;
-
-               log.debug("### Client connected to OpenMeetings, register 
Client StreamId: " + streamId + " scope "
-                               + conn.getScope().getName() + " isAVClient " + 
isAVClient);
+               log.debug("### Client connected to OpenMeetings, register 
Client StreamId: " + streamId + " scope " + conn.getScope().getName());
 
                // Set StreamId in Client
                service.invoke("setId", new Object[] { streamId }, this);
@@ -167,16 +164,16 @@ public class ScopeApplicationAdapter ext
                //TODO add similar code for other connections
                if (map.containsKey("screenClient")) {
                        String parentSid = (String)map.get("parentSid");
-                       Client parentClient = 
sessionManager.getClientByPublicSID(parentSid, false, null);
+                       Client parentClient = 
sessionManager.getClientByPublicSID(parentSid, null);
                        if (parentClient == null) {
                                rejectClient();
                        }
                }
                Client rcm = 
sessionManager.addClientListItem(conn.getClient().getId(),
                                conn.getScope().getName(), conn.getRemotePort(),
-                               conn.getRemoteAddress(), swfURL, isAVClient, 
null);
+                               conn.getRemoteAddress(), swfURL, null);
                
-               SessionVariablesUtil.initClient(conn.getClient(), isAVClient, 
rcm.getPublicSID());
+               SessionVariablesUtil.initClient(conn.getClient(), 
rcm.getPublicSID());
                //TODO add similar code for other connections, merge with above 
block
                if (map.containsKey("screenClient")) {
                        //TODO add check for room rights
@@ -210,7 +207,7 @@ public class ScopeApplicationAdapter ext
                        IConnection current = Red5.getConnectionLocal();
 
                        Client control = 
sessionManager.getClientByStreamId(current.getClient().getId(), null);
-                       Client client = 
sessionManager.getClientByPublicSID(control.getStreamPublishName(), false, 
null);
+                       Client client = 
sessionManager.getClientByPublicSID(control.getStreamPublishName(), null);
 
                        Map<String, String> returnMap = new HashMap<String, 
String>();
 
@@ -297,7 +294,7 @@ public class ScopeApplicationAdapter ext
                        IConnection current = Red5.getConnectionLocal();
 
                        Client control = 
sessionManager.getClientByStreamId(current.getClient().getId(), null);
-                       Client client = 
sessionManager.getClientByPublicSID(control.getStreamPublishName(), false, 
null);
+                       Client client = 
sessionManager.getClientByPublicSID(control.getStreamPublishName(), null);
 
                        if (client != null) {
                                boolean startRecording = Boolean.valueOf("" + 
map.get("startRecording"));
@@ -431,7 +428,7 @@ public class ScopeApplicationAdapter ext
                        if (currentClient == null) {
                                return false;
                        }
-                       SessionVariablesUtil.initClient(c, 
SessionVariablesUtil.isAVClient(c), newPublicSID);
+                       SessionVariablesUtil.initClient(c, newPublicSID);
                        currentClient.setPublicSID(newPublicSID);
                        sessionManager.updateClientByStreamId(c.getId(), 
currentClient, false, null);
                        return true;
@@ -560,11 +557,6 @@ public class ScopeApplicationAdapter ext
                                                                
recordingService.stopRecordingShowForClient(cons, currentClient);
                                                        }
                                                        
-                                                       //If the user was a 
avclient, we do not broadcast a message about that to everybody
-                                                       if 
(currentClient.isAvClient()) {
-                                                               continue;
-                                                       }
-                                                       
                                                        boolean isScreen = 
rcl.isScreenClient();
                                                        if (isScreen && 
currentClient.getPublicSID().equals(rcl.getStreamPublishName())) {
                                                                //going to 
terminate screen sharing started by this client
@@ -573,9 +565,6 @@ public class ScopeApplicationAdapter ext
                                                        } else if (isScreen) {
                                                                // screen 
sharing clients do not receive events
                                                                continue;
-                                                       } else if 
(rcl.isAvClient()) {
-                                                               // AVClients or 
potential AVClients do not receive events
-                                                               continue;
                                                        }
                                                        
                                                        // Send to all 
connected users
@@ -622,10 +611,6 @@ public class ScopeApplicationAdapter ext
                                currentClient.setScreenPublishStarted(true);
                                sessionManager.updateClientByStreamId(streamid, 
currentClient, false, null);
                        }
-                       //If its an audio/video client then send the session 
object with the full data to everybody
-                       else if (currentClient.isAvClient()) {
-                               clientObjectSendToSync = 
sessionManager.getClientByPublicSID(currentClient.getPublicSID(), false, null);
-                       }
                        
                        log.debug("newStream SEND: " + currentClient);
 
@@ -651,10 +636,6 @@ public class ScopeApplicationAdapter ext
                                                log.debug("RCL getIsRecording 
newStream SEND");
                                                
recordingService.addRecordingByStreamId(current, streamid, currentClient, 
rcl.getRecordingId());
                                        }
-                                       if (rcl.isAvClient()) {
-                                               log.debug("RCL getIsAVClient 
newStream SEND");
-                                               return true;
-                                       }
                                        if (rcl.isScreenClient()) {
                                                log.debug("RCL 
getIsScreenClient newStream SEND");
                                                return true;
@@ -792,7 +773,7 @@ public class ScopeApplicationAdapter ext
                try {
                        log.debug("-----------  addModerator: " + publicSID);
 
-                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                        if (currentClient == null) {
                                return -1L;
@@ -834,7 +815,7 @@ public class ScopeApplicationAdapter ext
                try {
                        log.debug("-----------  removeModerator: " + publicSID);
 
-                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                        if (currentClient == null) {
                                return -1L;
@@ -858,7 +839,7 @@ public class ScopeApplicationAdapter ext
                try {
                        log.debug("-----------  setBroadCastingFlag: " + 
publicSID);
 
-                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                        if (currentClient == null) {
                                return -1L;
@@ -886,7 +867,7 @@ public class ScopeApplicationAdapter ext
                        IConnection current = Red5.getConnectionLocal();
                        // String streamid = current.getClient().getId();
 
-                       final Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       final Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                        if (currentClient == null) {
                                return -1L;
@@ -923,7 +904,7 @@ public class ScopeApplicationAdapter ext
                try {
                        log.debug("-----------  switchMicMuted: " + publicSID);
 
-                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
                        if (currentClient == null) {
                                return -1L;
                        }
@@ -943,7 +924,7 @@ public class ScopeApplicationAdapter ext
 
        public Boolean getMicMutedByPublicSID(String publicSID) {
                try {
-                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
                        if (currentClient == null) {
                                return true;
                        }
@@ -973,7 +954,7 @@ public class ScopeApplicationAdapter ext
        public synchronized Long applyForModeration(String publicSID) {
                try {
 
-                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                        List<Client> currentModList = 
sessionManager.getCurrentModeratorByRoom(currentClient.getRoomId());
 
@@ -1037,7 +1018,7 @@ public class ScopeApplicationAdapter ext
                        IClient c = current.getClient();
                        String streamid = c.getId();
                        log.debug("-----------  setUserAVSettings {} {} {}", 
new Object[] {streamid, publicSID, avsettings, newMessage});
-                       Client parentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client parentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
                        Client currentClient = 
sessionManager.getClientByStreamId(streamid, null);
                        currentClient.setAvsettings(avsettings);
                        currentClient.setRoomId(roomId);
@@ -1050,7 +1031,7 @@ public class ScopeApplicationAdapter ext
                        currentClient.setFirstname(parentClient.getFirstname());
                        
currentClient.setPicture_uri(parentClient.getPicture_uri());
                        sessionManager.updateAVClientByStreamId(streamid, 
currentClient, null);
-                       SessionVariablesUtil.initClient(c, false, publicSID);
+                       SessionVariablesUtil.initClient(c, publicSID);
 
                        HashMap<String, Object> hsm = new HashMap<String, 
Object>();
                        hsm.put("client", currentClient);
@@ -1129,8 +1110,7 @@ public class ScopeApplicationAdapter ext
         * @param colorObj - some color
         * @return RoomStatus object
         */
-       public synchronized RoomStatus setRoomValues(Long roomId, Boolean 
becomeModerator, Boolean isSuperModerator,
-                       Long groupId, String colorObj) {
+       public synchronized RoomStatus setRoomValues(Long roomId, Boolean 
becomeModerator, Boolean isSuperModerator, String colorObj) {
                try {
                        log.debug("-----------  setRoomValues");
                        IConnection current = Red5.getConnectionLocal();
@@ -1138,7 +1118,6 @@ public class ScopeApplicationAdapter ext
                        Client currentClient = 
sessionManager.getClientByStreamId(streamid, null);
                        currentClient.setRoomId(roomId);
                        currentClient.setRoomEnter(new Date());
-                       currentClient.setGroupId(groupId);
 
                        currentClient.setUsercolor(colorObj);
 
@@ -1473,7 +1452,7 @@ public class ScopeApplicationAdapter ext
                                @Override
                                public boolean filter(IConnection conn) {
                                        IClient client = conn.getClient();
-                                       return 
SessionVariablesUtil.isScreenClient(client) || 
SessionVariablesUtil.isAVClient(client);
+                                       return 
SessionVariablesUtil.isScreenClient(client);
                                }
                        }.start();
                } catch (Exception err) {
@@ -1699,7 +1678,6 @@ public class ScopeApplicationAdapter ext
                        public boolean filter(IConnection conn) {
                                IClient client = conn.getClient();
                                return (!sendScreen && 
SessionVariablesUtil.isScreenClient(client))
-                                               || 
SessionVariablesUtil.isAVClient(client)
                                                || (!sendSelf && 
client.getId().equals(current.getClient().getId()));
                        }
                }.start();
@@ -1874,7 +1852,7 @@ public class ScopeApplicationAdapter ext
                        // log.debug("webAppKeyScope "+webAppKeyScope);
 
                        // Get Room Id to send it to the correct Scope
-                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                       Client currentClient = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                        if (currentClient == null) {
                                throw new Exception("Could not Find RoomClient 
on List publicSID: " + publicSID);
@@ -1897,9 +1875,6 @@ public class ScopeApplicationAdapter ext
                                        if 
(SessionVariablesUtil.isScreenClient(client)) {
                                                // screen sharing clients do 
not receive events
                                                continue;
-                                       } else if 
(SessionVariablesUtil.isAVClient(client)) {
-                                               // AVClients or potential 
AVClients do not receive events
-                                               continue;
                                        }
                                        
                                        if 
(SessionVariablesUtil.getPublicSID(client).equals(publicSID)) {
@@ -1975,9 +1950,6 @@ public class ScopeApplicationAdapter ext
                                        if 
(SessionVariablesUtil.isScreenClient(client)) {
                                                // screen sharing clients do 
not receive events
                                                continue;
-                                       } else if 
(SessionVariablesUtil.isAVClient(client)) {
-                                               // AVClients or potential 
AVClients do not receive events
-                                               continue;
                                        }
 
                                        ((IServiceCapableConnection) 
conn).invoke("interviewStatus", new Object[] { interviewStatus }, this);
@@ -2216,7 +2188,7 @@ public class ScopeApplicationAdapter ext
                currentClient.setVHeight(90);
                currentClient.setPicture_uri("phone.png");
                sessionManager.updateClientByStreamId(streamid, currentClient, 
false, null);
-               SessionVariablesUtil.initClient(c, false, publicSID);
+               SessionVariablesUtil.initClient(c, publicSID);
 
                sendMessageToCurrentScope("addNewUser", currentClient, false);
        }

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/util/SessionVariablesUtil.java
 Wed Dec  2 05:49:09 2015
@@ -28,29 +28,15 @@ public class SessionVariablesUtil {
        private static final Logger log = 
Red5LoggerFactory.getLogger(SessionVariablesUtil.class, webAppRootKey);
 
        private enum SESSION_VARIABLES {
-               isAVClient, // if the client connection is a audio-video only 
connection
                isScreenClient, // if the client connection is from a Java 
Web-Start application
                PUBLIC_SID, // the public SID of the client
                USER_ID, // the userId of the user that is using this 
connection (if there is any)
        }
 
-       public static void initClient(IClient client, boolean isAVClient, 
String publicSID) {
-               client.setAttribute(SESSION_VARIABLES.isAVClient.toString(), 
isAVClient);
+       public static void initClient(IClient client, String publicSID) {
                client.setAttribute(SESSION_VARIABLES.PUBLIC_SID.toString(), 
publicSID);
        }
 
-       public static boolean isAVClient(IClient client) {
-               try {
-                       if 
(client.getAttribute(SESSION_VARIABLES.isAVClient.toString()) == null) {
-                               throw new Exception("Connection has no 
publicSID client: " + client);
-                       }
-                       return (Boolean) 
client.getAttribute(SESSION_VARIABLES.isAVClient.toString());
-               } catch (Exception err) {
-                       log.error("[isAVClient]", err);
-               }
-               return false;
-       }
-
        public static String getPublicSID(IClient client) {
                try {
                        if 
(client.getAttribute(SESSION_VARIABLES.PUBLIC_SID.toString()) == null) {

Modified: 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/session/SessionManager.java
 Wed Dec  2 05:49:09 2015
@@ -34,7 +34,7 @@ import org.apache.openmeetings.db.dto.ba
 import org.apache.openmeetings.db.dto.server.ClientSessionInfo;
 import org.apache.openmeetings.db.entity.room.Client;
 import org.apache.openmeetings.db.entity.server.Server;
-import org.apache.openmeetings.util.OpenmeetingsVariables;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 import org.apache.openmeetings.util.crypt.ManageCryptStyle;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
@@ -49,9 +49,7 @@ import org.springframework.beans.factory
  * 
  */
 public class SessionManager implements ISessionManager {
-       
-       protected static final Logger log = Red5LoggerFactory.getLogger(
-                       SessionManager.class, 
OpenmeetingsVariables.webAppRootKey);
+       protected static final Logger log = 
Red5LoggerFactory.getLogger(SessionManager.class, webAppRootKey);
        
        @Autowired
        private ServerUtil serverUtil;
@@ -75,7 +73,7 @@ public class SessionManager implements I
                
                public synchronized Client addClientListItem(String streamId,
                                String scopeName, Integer remotePort, String 
remoteAddress,
-                               String swfUrl, boolean isAVClient, Server 
server) {
+                               String swfUrl, Server server) {
                        try {
 
                                // Store the Connection into a bean and add it 
to the HashMap
@@ -94,7 +92,6 @@ public class SessionManager implements I
                                rcm.setSwfurl(swfUrl);
                                rcm.setIsMod(new Boolean(false));
                                rcm.setCanDraw(new Boolean(false));
-                               rcm.setAvClient(isAVClient);
 
                                if (cache.containsKey(null, streamId)) {
                                        log.error("Tried to add an existing 
Client " + streamId);
@@ -131,27 +128,20 @@ public class SessionManager implements I
                        return null;
                }
 
-               public Client getClientByPublicSID(String publicSID, boolean 
isAVClient, Server server) {
+               public Client getClientByPublicSID(String publicSID, Server 
server) {
                        try {
-                               for (Client rcl : 
cache.getClientsByPublicSID(server, publicSID)) {
-                                       if (rcl.isAvClient() != isAVClient) {
-                                               continue;
-                                       }
-                                       return rcl;
-                               }
+                               List<Client> list = 
cache.getClientsByPublicSID(server, publicSID);
+                               return list == null || list.isEmpty() ? null : 
list.get(0);
                        } catch (Exception err) {
                                log.error("[getClientByPublicSID]", err);
                        }
                        return null;
                }
                
-               public ClientSessionInfo getClientByPublicSIDAnyServer(String 
publicSID, boolean isAVClient) {
+               public ClientSessionInfo getClientByPublicSIDAnyServer(String 
publicSID) {
                        try {
                                for (Entry<Long,List<Client>> entry : 
cache.getClientsByPublicSID(publicSID).entrySet()) {
                                        for (Client rcl : entry.getValue()) {
-                                               if (rcl.isAvClient() != 
isAVClient) {
-                                                       continue;
-                                               }
                                                return new 
ClientSessionInfo(rcl, entry.getKey());
                                        }
                                }
@@ -169,10 +159,6 @@ public class SessionManager implements I
                                                continue;
                                        }
                                        
-                                       if (rcl.isAvClient()) {
-                                               continue;
-                                       }
-                                       
                                        return rcl;
                                }
                        } catch (Exception err) {
@@ -184,7 +170,7 @@ public class SessionManager implements I
                public synchronized Boolean updateAVClientByStreamId(String 
streamId, Client rcm, Server server) {
                        try {
                                // get the corresponding user session object 
and update the settings
-                               Client rclUsual = 
getClientByPublicSID(rcm.getPublicSID(), false, server);
+                               Client rclUsual = 
getClientByPublicSID(rcm.getPublicSID(), server);
                                if (rclUsual != null) {
                                        
rclUsual.setBroadCastID(rcm.getBroadCastID());
                                        
rclUsual.setAvsettings(rcm.getAvsettings());
@@ -250,9 +236,6 @@ public class SessionManager implements I
                                        if (rcl.isScreenClient()) {
                                                continue;
                                        }
-                                       if (rcl.isAvClient()) {
-                                               continue;
-                                       }
 
                                        // Only parse really those users out 
that are really a full session object
                                        // and no pseudo session object like 
the audio/video or screen
@@ -335,13 +318,11 @@ public class SessionManager implements I
        };
        
        public Client addClientListItem(String streamId, String scopeName,
-                       Integer remotePort, String remoteAddress, String swfUrl,
-                       boolean isAVClient, Server server) {
+                       Integer remotePort, String remoteAddress, String 
swfUrl, Server server) {
                if (server == null) {
                        server = serverUtil.getCurrentServer();
                }
-               return sessionManager.addClientListItem(streamId, scopeName,
-                               remotePort, remoteAddress, swfUrl, isAVClient, 
server);
+               return sessionManager.addClientListItem(streamId, scopeName, 
remotePort, remoteAddress, swfUrl, server);
        }
 
        public Collection<Client> getClients() {
@@ -359,19 +340,15 @@ public class SessionManager implements I
                return sessionManager.getClientByStreamId(streamId, server);
        }
 
-       public Client getClientByPublicSID(String publicSID, boolean isAVClient,
-                       Server server) {
+       public Client getClientByPublicSID(String publicSID, Server server) {
                if (server == null) {
                        server = serverUtil.getCurrentServer();
                }
-               return sessionManager.getClientByPublicSID(publicSID, 
isAVClient,
-                               server);
+               return sessionManager.getClientByPublicSID(publicSID, server);
        }
 
-       public ClientSessionInfo getClientByPublicSIDAnyServer(String publicSID,
-                       boolean isAVClient) {
-               return sessionManager.getClientByPublicSIDAnyServer(publicSID,
-                               isAVClient);
+       public ClientSessionInfo getClientByPublicSIDAnyServer(String 
publicSID) {
+               return sessionManager.getClientByPublicSIDAnyServer(publicSID);
        }
 
        public Client getClientByUserId(Long userId) {

Modified: 
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/server/ISessionManager.java
 Wed Dec  2 05:49:09 2015
@@ -49,13 +49,12 @@ public interface ISessionManager {
         * @param remotePort
         * @param remoteAddress
         * @param swfUrl
-        * @param isAVClient
         * @param server
         * @return
         */
        public abstract Client addClientListItem(String streamId,
                        String scopeName, Integer remotePort, String 
remoteAddress,
-                       String swfUrl, boolean isAVClient, Server server);
+                       String swfUrl, Server server);
 
        public abstract Collection<Client> getClients();
        
@@ -78,17 +77,12 @@ public interface ISessionManager {
 
        /**
         * get a client by its publicSID and the server, 
-        * isAVClient is normally false, as you want the data connection.
-        * If you set isAVClient to true, you would obtain the RTMP 
-        * connection that is used for Audio/Video streaming
         * 
         * @param publicSID
-        * @param isAVClient
         * @param server
         * @return
         */
-       public abstract Client getClientByPublicSID(String publicSID,
-                       boolean isAVClient, Server server);
+       public abstract Client getClientByPublicSID(String publicSID, Server 
server);
        
        /**
         * same as {@link #getClientByPublicSID(String, boolean, Server)} but 
it ignores 
@@ -99,10 +93,9 @@ public interface ISessionManager {
         * you should use {@link #getClientByPublicSID(String, boolean, 
Server)}!
         * 
         * @param publicSID
-        * @param isAVClient
         * @return
         */
-       public ClientSessionInfo getClientByPublicSIDAnyServer(String 
publicSID, boolean isAVClient);
+       public ClientSessionInfo getClientByPublicSIDAnyServer(String 
publicSID);
 
        /**
         * 
@@ -123,14 +116,13 @@ public interface ISessionManager {
         * @param rcm
         * @return
         */
-       public abstract Boolean updateAVClientByStreamId(String streamId,
-                       Client rcm, Server server);
+       public abstract Boolean updateAVClientByStreamId(String streamId, 
Client rcm, Server server);
 
        /**
         * Update the session object
         * 
         * updateRoomCount is only <i>one</i> time true, in
-        * ScopeApplicationAdapter#setRoomValues(Long, Boolean, Boolean, Long, 
String)
+        * ScopeApplicationAdapter#setRoomValues(Long, Boolean, Boolean, String)
         * .
         * 
         * @param streamId

Modified: 
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/room/Client.java
 Wed Dec  2 05:49:09 2015
@@ -186,12 +186,6 @@ public class Client implements IDataProv
        private boolean screenClient;
        
        /**
-        * @see Client#isAvClient()
-        */
-       @Column(name = "is_avclient")
-       private boolean avClient;
-       
-       /**
         * @see Client#getUsercolor()
         */
        @Column(name = "usercolor")
@@ -319,12 +313,6 @@ public class Client implements IDataProv
        private Long recordingMetaDataId;
        
        /**
-        * @see Client#getGroupId()
-        */
-       @Column(name = "group_id")
-       private Long groupId;
-       
-       /**
         * @see Client#isStartRecording()
         */
        @Column(name = "start_recording")
@@ -406,7 +394,7 @@ public class Client implements IDataProv
        public Client() {}
     
        public Client(String streamid, String publicSID, Long roomId,
-                       Long userId, String firstname, String lastname, boolean 
avClient,
+                       Long userId, String firstname, String lastname,
                        String username, String connectedSince, String scope) {
                super();
                this.streamid = streamid;
@@ -415,7 +403,6 @@ public class Client implements IDataProv
                this.userId = userId;
                this.firstname = firstname;
                this.lastname = lastname;
-               this.avClient = avClient;
                this.username = username;
                this.connectedSince = 
CalendarPatterns.parseDateWithHour(connectedSince);
                this.scope = scope;
@@ -786,14 +773,6 @@ public class Client implements IDataProv
                this.screenPublishStarted = screenPublishStarted;
        }
 
-       public Long getGroupId() {
-               return groupId;
-       }
-
-       public void setGroupId(Long groupId) {
-               this.groupId = groupId;
-       }
-
        public boolean isStartRecording() {
                return startRecording;
        }
@@ -850,14 +829,6 @@ public class Client implements IDataProv
                this.allowRecording = allowRecording;
        }
 
-       public boolean isAvClient() {
-               return avClient;
-       }
-
-       public void setAvClient(boolean avClient) {
-               this.avClient = avClient;
-       }
-
        public boolean isStreamPublishStarted() {
                return streamPublishStarted;
        }
@@ -893,7 +864,7 @@ public class Client implements IDataProv
        @Override
        public String toString() {
                return "Client [streamid=" + streamid + ", publicSID=" + 
publicSID + ", isScreenClient=" + screenClient
-                               + ", avClient=" + avClient + ", isMobile = " + 
mobile + ", roomId=" + roomId + ", broadCastID=" + broadCastID + ", userId="
+                               + ", isMobile = " + mobile + ", roomId=" + 
roomId + ", broadCastID=" + broadCastID + ", userId="
                                + userId + ", avsettings=" + avsettings + ", 
isRecording=" + isRecording + ", recordingId="
                                + recordingId + ", recordingMetaDataId=" + 
recordingMetaDataId + ", screenPublishStarted="
                                + screenPublishStarted + ", interviewPodId=" + 
interviewPodId + ", server=" + server + "]";

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/hibernate/hibRtmpConnection.lzx
 Wed Dec  2 05:49:09 2015
@@ -85,10 +85,6 @@
      -->
      <attribute name="currentroomid" value="0" type="number" />
      
-     <!-- This is the current domain the user has logged-in -->
-     <attribute name="currentdomain" value="domain1" type="string" />
-     <attribute name="currentdomainObj" value="domain1" type="string" />
-     
      <!--- the current Invitation-Object -->
      <attribute name="currentInvitation" value="null" />
     
@@ -198,6 +194,7 @@
         client.newStream = this.newStream;
         //TODO FIXME method is absent :( client.stopStream = this.stopStream;
         client.receiveExclusiveAudioFlag = this.receiveExclusiveAudioFlag;
+        client.setNewModeratorByList = this.setNewModeratorByList;
     </handler>
     
     <handler name="ondisconnect">
@@ -565,6 +562,7 @@
     <netRemoteCallHib name="markSessionAsLogedIn" 
funcname="xmlcrm.markSessionAsLogedIn" >
         <netparam><method name="getValue">return 
canvas.sessionId;</method></netparam>
         <handler name="ondata" args="value">
+        <![CDATA[
             //The onResult-Handler will be called be the rtmpconnection
                         
             if (value == null) {
@@ -577,10 +575,7 @@
              
             canvas.userId = hib.userobject.id;
             
-            if (value.groupUsers.length > 0){
-                hib.currentdomain = value.groupUsers[0].group.name;
-                hib.currentdomainObj = value.groupUsers[0].group;
-            } else if (!canvas.isRemoteUser()) {
+            if (value.groupUsers.length == 0 && !canvas.isRemoteUser()) {
                 new lz.errorPopup(canvas,{error:"Missing Group in User Object, 
set the Configuration value of the key 'default.rpc.userid' to a valid user Id 
that has at least one Organization assigned in the OpenMeetings Administrion 
Configuration Panel "});
             }
             
@@ -607,6 +602,7 @@
                 canvas.initroomid = Number(canvas.directRoomId);
                 parent.getRoomById.doCall();
             }
+        ]]>
         </handler>  
     </netRemoteCallHib> 
     
@@ -664,17 +660,6 @@
                </handler>
        </netRemoteCallHib>
     
-    <netRemoteCallHib name="setCurrentUserOrganization" 
funcname="xmlcrm.setCurrentUserOrganization">
-        <netparam><method name="getValue">return 
canvas.sessionId;</method></netparam>
-        <netparam><method name="getValue">return 
hib.currentdomainObj.id;</method></netparam>  
-        <handler name="ondata" args="value">
-            //Sessionmanagement.getInstance() 
-            //The onResult-Handler will be called be the rtmpconnection
-            if ($debug) Debug.write("setCurrentUserOrganization: ",value);
-        </handler>  
-    </netRemoteCallHib> 
-     
-    
        <netRemoteCallHib name="loginWicket" funcname="xmlcrm.loginWicket" >
                <netparam><method name="getValue">return 
canvas.sessionId;</method></netparam>
                <netparam><method name="getValue">return 
canvas.wicketsid;</method></netparam>
@@ -708,20 +693,6 @@
                                        return;
                                }
                                hib.userobject = value;
-                               var found = false;
-                               for (var i = 0; i < value.groupUsers.length; 
++i) {
-                                       if (value.groupUsers[i].group.id == 
value.sessionData.groupId) {
-                                               found = true;
-                                               hib.currentdomain = 
value.groupUsers[i].group.name;
-                                               hib.currentdomainObj = 
value.groupUsers[i].group;
-                                               break;
-                                       }
-                               }
-                               if ($debug) 
Debug.write("hibRtmpConnection::loginWicket 1");
-                               if (!found && value.groupUsers.length > 0) {
-                                       hib.currentdomain = 
value.groupUsers[0].group.name;
-                                       hib.currentdomainObj = 
value.groupUsers[0].group;
-                               }
                                parent.getCurrentRoomClient.doCall();
                        } else {
                                new lz.labelerrorPopup(canvas, {errorlabelid: 
1599});
@@ -1196,20 +1167,17 @@
             </handler>   
         </netRemoteCallHib>
         
-        <netRemoteCallHib name="setNewModeratorByList" 
funcname="setNewModeratorByList">
-            <handler name="ondata" args="value">
-                <![CDATA[
-                    if ($debug) Debug.write("setNewModeratorByList ",value);
-                    
-                    canvas.analyzeModerationList(value);
-                    
-                    //The onResult-Handler will be called be the rtmpconnection
-                    canvas.currentModeratorList = value;
-                    //Update Moderation Flag
-                    canvas.updateModerationFlag();
-                ]]>
-            </handler>   
-        </netRemoteCallHib> 
+               <method name="setNewModeratorByList" args="value">
+               <![CDATA[
+                       if ($debug) Debug.write("setNewModeratorByList ",value);
+                       canvas.analyzeModerationList(value);
+                       
+                       //The onResult-Handler will be called be the 
rtmpconnection
+                       canvas.currentModeratorList = value;
+                       //Update Moderation Flag
+                       canvas.updateModerationFlag();
+               ]]>
+               </method> 
         
         <netRemoteCallHib name="sendMessage" funcname="sendMessage">
             <netparam name="vars"><method name="getValue">return 
canvas.objMessage;</method></netparam>

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/mainMethods.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/mainMethods.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/mainMethods.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/mainMethods.lzx
 Wed Dec  2 05:49:09 2015
@@ -188,29 +188,6 @@
        ]]>
        </method>
 
-       <method name="getScreenSharingUrl">
-       <![CDATA[
-               var groupId = (hib.currentdomainObj != null && 
hib.currentdomainObj.id != null)
-                       ? hib.currentdomainObj.id : 1;
-               if ($debug) Debug.write("mainMethods::getScreenSharingUrl ", 
hib.userobject, hib.currentdomainObj);
-               
-               var appBase = canvas.getUrl();
-               if ($debug) Debug.write("appBase=" + appBase);
-               var downloadurl = appBase + 'screen.upload?'
-                       +'rtmphostlocal=' + canvas.getHttpHost()
-                       +'&baseurl=' + escape(appBase)
-                       +'&domain=' + hib.conferencedomain
-                       +'&groupId=' + groupId
-                       +'&sid=' + canvas.sessionId
-                       +'&connectionType=' + canvas.thishib.getProtocol()
-                       +'&port=' + canvas.thishib.getPort()
-                       +'&publicSID=' + canvas.publicSID
-                       +'&languageAsString=' + hib.userlang;
-               if ($debug) Debug.write("mainMethods::getScreenSharingUrl ", 
downloadurl); 
-               return downloadurl;
-       ]]>
-       </method>
-       
     <method name="myinit">
         <![CDATA[
         canvas.mediaerrortimeout = 30000;
@@ -438,36 +415,47 @@
        <!---
                Actions connected to the shortcuts
         -->
-    <method name="doActionmenu" args="stringSub">
-        <![CDATA[
-            if($debug) Debug.write("doActionmenu: ",stringSub);
-            if (canvas._conferencemenu.visibility == 'visible'){
-                if (stringSub == "invitation") {
-                       ExternalInterface.call("openInvitation");
-                           } else if (stringSub=='editWhiteboardDefault') {
-                    new 
lz.editWhiteboardDefault(canvas.main_content._content.inner);
-                } else if (stringSub=='createPoll') {
-                    ExternalInterface.call("createPoll", canvas.publicSID);
-                } else if (stringSub=='pollResults') {
-                    ExternalInterface.call("pollResults", canvas.publicSID);
-                } else if (stringSub=='checkPollVoted') {
-                    ExternalInterface.call("vote");
-                } else if (stringSub=='importFile') {
-                    new 
lz.uploadWindowExplorer(canvas.main_content._content.inner, {x:60});
-                } else if (stringSub=='applyForMod') {
-                    if ($debug) Debug.info("Apply For Mod through 
doActionmenu");
-                    //new 
lz.applyForModeration(canvas.main_content._content.inner);
-                    canvas.thishib.applyForModeration.doCall();
-                } else if (stringSub=='editCamMicSettings') {
-                    canvas.commonVideoViewContent.changeDevice();
-                } else if (stringSub=='showSipDialer') {
-                    new lz.sipDialer(canvas.main_content._content.inner);
-                } else if (stringSub=='quit') {
+       <method name="doActionmenu" args="stringSub">
+       <![CDATA[
+               if($debug) Debug.write("doActionmenu: ",stringSub);
+               if (canvas._conferencemenu.visible) {
+                       switch (stringSub) {
+                               case "invitation":
+                                       
ExternalInterface.call("openInvitation");
+                                       break;
+                               case 'editWhiteboardDefault':
+                                       new 
lz.editWhiteboardDefault(canvas.main_content._content.inner);
+                                       break;
+                               case 'createPoll':
+                                       ExternalInterface.call("createPoll", 
canvas.publicSID);
+                                       break;
+                               case 'pollResults':
+                                       ExternalInterface.call("pollResults", 
canvas.publicSID);
+                                       break;
+                               case 'checkPollVoted':
+                                       ExternalInterface.call("vote");
+                                       break;
+                               case 'importFile':
+                                       new 
lz.uploadWindowExplorer(canvas.main_content._content.inner, {x: 60});
+                                       break;
+                               case 'applyForMod':
+                                       if ($debug) Debug.info("Apply For Mod 
through doActionmenu");
+                                       //new 
lz.applyForModeration(canvas.main_content._content.inner);
+                                       
canvas.thishib.applyForModeration.doCall();
+                                       break;
+                               case 'editCamMicSettings':
+                                       
canvas.commonVideoViewContent.changeDevice();
+                                       break;
+                               case 'showSipDialer':
+                                       new 
lz.sipDialer(canvas.main_content._content.inner);
+                                       break;
+                               case 'quit':
                                        canvas.quit();
-            }
-          }
-        ]]>
-    </method> 
+                                       break;
+                       }
+               }
+       ]]>
+       </method> 
     
        <method name="setRoomValues" args="roomObj">
                if ($debug) Debug.warn("setRoomValues ",roomObj);

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
 Wed Dec  2 05:49:09 2015
@@ -52,7 +52,7 @@
             
             this._nc.proxyType = canvas.proxyType;
             
-            var ok = this._nc.connect(src == "null" ? null : src, false); 
//avClient = false
+            var ok = this._nc.connect(src == "null" ? null : src, false);
             if (this.debug) {
                if($debug) Debug.write("*** debug ***");
             }

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/interviewuserlist/interviewUserList.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/interviewuserlist/interviewUserList.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/interviewuserlist/interviewUserList.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/interviewuserlist/interviewUserList.lzx
 Wed Dec  2 05:49:09 2015
@@ -102,16 +102,7 @@
                 
                 canvas.currentusercolor = canvas.getColorForUser();
                 
-                var groupId = 1;
-            
                 if ($debug) Debug.write(hib.userobject); 
-                if ($debug) Debug.write(hib.currentdomainObj); 
-                
-                if (hib.currentdomainObj != null) {
-                    groupId = hib.currentdomainObj.id
-                }
-                
-                this.parent.setRoomValues.groupId = groupId;
                 this.parent.setRoomValues.doCall();
             
             ]]>
@@ -124,7 +115,6 @@
         <netparam><method name="getValue">return 
hib.currentroomid;</method></netparam>
         <netparam><method name="getValue">return 
parent.applyDefaultModeration;</method></netparam>
         <netparam><method name="getValue">return 
canvas.becomeSuperModerator;</method></netparam>
-        <netparam><method name="getValue">return 
parent.groupId;</method></netparam>
         <netparam><method name="getValue">return 
canvas.currentusercolor;</method></netparam>
         <handler name="ondata" args="roomStatus">
             <![CDATA[

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/moderation/moderationPanel.lzx
 Wed Dec  2 05:49:09 2015
@@ -47,7 +47,13 @@
 </class>
 
 <class name="moderationPanel" extends="view" layout="axis:x;spacing:2">
-    
+       <switch>
+               <when property="$as3">
+                       <passthrough>
+                               import flash.external.ExternalInterface;
+                       </passthrough>
+               </when>
+       </switch>
     <attribute name="recordingsName" value="" type="string" />
     <attribute name="initial" value="true" type="boolean" />
     <attribute name="recordingUser" value="null" />
@@ -90,7 +96,8 @@
     </method>   
     
        <method name="checkForApplyScreen" args="record">
-               lz.Browser.loadURL(canvas.getScreenSharingUrl(), '_blank');
+               //TODO check if host is required for rtmps
+               ExternalInterface.call("startSharing", canvas.publicSID, 
canvas.thishib.getProtocol(), canvas.thishib.getPort());
        </method>  
     
     <labelText name="_roomName" fgcolor="0xFFFFFF" y="4" fontstyle="bold" 
fontsize="12" /> 

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/participants/participants.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/participants/participants.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/participants/participants.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/participants/participants.lzx
 Wed Dec  2 05:49:09 2015
@@ -111,16 +111,7 @@
                 
                 canvas.currentusercolor = canvas.getColorForUser();
                 
-                var groupId = 1;
-            
                 if ($debug) Debug.write(hib.userobject); 
-                if ($debug) Debug.write(hib.currentdomainObj); 
-                
-                if (hib.currentdomainObj != null) {
-                    groupId = hib.currentdomainObj.id
-                }
-                
-                this.parent.setRoomValues.groupId = groupId;
                 
                 if ($debug) Debug.write("setRoomValues CALL: ");
                 this.parent.setRoomValues.doCall();
@@ -138,7 +129,6 @@
         <netparam><method name="getValue">return 
hib.currentroomid;</method></netparam>
         <netparam><method name="getValue">return 
parent.applyDefaultModeration;</method></netparam>
         <netparam><method name="getValue">return 
canvas.becomeSuperModerator;</method></netparam>
-        <netparam><method name="getValue">return 
parent.groupId;</method></netparam>
         <netparam><method name="getValue">return 
canvas.currentusercolor;</method></netparam>
         <handler name="ondata" args="roomStatus">
             <![CDATA[

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/restricted/restrictedUserList.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/restricted/restrictedUserList.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/restricted/restrictedUserList.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/restricted/restrictedUserList.lzx
 Wed Dec  2 05:49:09 2015
@@ -116,16 +116,7 @@
                 
                 canvas.currentusercolor = canvas.getColorForUser();
                 
-                var groupId = 1;
-            
                 if ($debug) Debug.write(hib.userobject); 
-                if ($debug) Debug.write(hib.currentdomainObj); 
-                
-                if (hib.currentdomainObj != null) {
-                    groupId = hib.currentdomainObj.id
-                }
-                
-                this.parent.setRoomValues.groupId = groupId;
                 this.parent.setRoomValues.doCall();
             
             ]]>
@@ -138,7 +129,6 @@
         <netparam><method name="getValue">return 
hib.currentroomid;</method></netparam>
         <netparam><method name="getValue">return 
parent.applyDefaultModeration;</method></netparam>
         <netparam><method name="getValue">return 
canvas.becomeSuperModerator;</method></netparam>
-        <netparam><method name="getValue">return 
parent.groupId;</method></netparam>
         <netparam><method name="getValue">return 
canvas.currentusercolor;</method></netparam>
         <handler name="ondata" args="roomStatus">
             <![CDATA[

Modified: 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/fixedFileExplorerWhiteBoard.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/fixedFileExplorerWhiteBoard.lzx?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/fixedFileExplorerWhiteBoard.lzx
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/whiteboard/fixedFileExplorerWhiteBoard.lzx
 Wed Dec  2 05:49:09 2015
@@ -136,15 +136,8 @@
     <event name="isloadingImage" />
     <event name="isloadedImage" />
     
+    <text fontsize="11" x="10" y="2" name="_sharingClientName" 
fontstyle="bold" />    
     
-    <text fontsize="11" x="10" y="2" 
-        name="_sharingClientName" fontstyle="bold" />    
-    
-    
-       <method name="checkForApplyScreen">
-               lz.Browser.loadURL(canvas.getScreenSharingUrl(), '_blank');
-       </method> 
-       
     <!-- 
         The Content Area    
      -->

Modified: 
openmeetings/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 Wed Dec  2 05:49:09 2015
@@ -31,6 +31,8 @@ import static org.apache.openmeetings.ut
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANDING_ZONE;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LANG_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DEFAULT_LDAP_ID;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FRONTEND_REGISTER_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_IGNORE_BAD_SSL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_LOGIN_MIN_LENGTH_KEY;
@@ -411,6 +413,8 @@ public class ImportInitvalues {
 
                cfgDao.add(CONFIG_REDIRECT_URL_FOR_EXTERNAL_KEY, "", null,
                                "Users entered the room via invitationHash or 
secureHash will be redirected to this URL on connection lost");
+               cfgDao.add(CONFIG_FLASH_PROTOCOL, "rtmp", null, "Protocol for 
flash connections, can be rtmp, rtmpt, rtmpe, rtmps");
+               cfgDao.add(CONFIG_FLASH_PORT, "1935", null, "Port for flash 
connections");
                cfgDao.add(CONFIG_CALENDAR_FIRST_DAY, "0", null, "The day that 
each week begins. The value must be a number that represents the day of the 
week. Sunday=0, Monday=1, Tuesday=2, etc.");
                
                log.debug("Configurations ADDED");

Modified: 
openmeetings/branches/3.1.x/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-service/src/main/java/org/apache/openmeetings/service/user/UserManager.java
 Wed Dec  2 05:49:09 2015
@@ -463,7 +463,7 @@ public class UserManager implements IUse
 
                        // admins only
                        if 
(AuthLevelUtil.hasWebServiceLevel(userDao.getRights(userId))) {
-                               Client rcl = 
sessionManager.getClientByPublicSID(publicSID, false, null);
+                               Client rcl = 
sessionManager.getClientByPublicSID(publicSID, null);
 
                                if (rcl == null) {
                                        return true;

Modified: 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
 Wed Dec  2 05:49:09 2015
@@ -94,7 +94,7 @@ public class ConnectionsPanel extends Ad
                                                                , c.getServer() 
== null ? 0 : c.getServer().getId());
                                                target.add(container, 
details.setVisible(false));
                                        }
-                               }.setEnabled(!c.isScreenClient() && 
!c.isAvClient()));
+                               }.setEnabled(!c.isScreenClient()));
                                item.add(new AjaxEventBehavior("click") {
                                        private static final long 
serialVersionUID = 1L;
 

Modified: 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomBroadcaster.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomBroadcaster.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomBroadcaster.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomBroadcaster.java
 Wed Dec  2 05:49:09 2015
@@ -29,7 +29,7 @@ import org.red5.server.api.IConnection;
 
 public class RoomBroadcaster {
        public static Client getClient(String publicSid) {
-               ClientSessionInfo csi = 
getBean(SessionManager.class).getClientByPublicSIDAnyServer(publicSid, false);
+               ClientSessionInfo csi = 
getBean(SessionManager.class).getClientByPublicSIDAnyServer(publicSid);
                return csi == null ? null : csi.getRcl();
        }
        

Modified: 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
 Wed Dec  2 05:49:09 2015
@@ -69,12 +69,15 @@ import org.slf4j.Logger;
 public class RoomPanel extends BasePanel {
        private static final long serialVersionUID = 1L;
        private static final String WICKET_ROOM_ID = "wicketroomid";
-       private static final String PARAM_PUBLIC_SID = "publicSid";
+       public static final String PARAM_PUBLIC_SID = "publicSid";
+       public static final String PARAM_PROTOCOL = "protocol";
+       public static final String PARAM_PORT = "port";
        private static final Logger log = 
Red5LoggerFactory.getLogger(RoomPanel.class, webAppRootKey);
        private final InvitationDialog invite;
        private final CreatePollDialog createPoll;
        private final VoteDialog vote;
        private final PollResultsDialog pollResults;
+       private final StartSharingEventBehavior startSharing;
        private long roomId = 0;
        
        public RoomPanel(String id) {
@@ -160,6 +163,7 @@ public class RoomPanel extends BasePanel
                add(createPoll = new CreatePollDialog("createPoll", roomId));
                add(vote = new VoteDialog("vote", roomId));
                add(pollResults = new PollResultsDialog("pollResults", roomId));
+               add(startSharing = new StartSharingEventBehavior(roomId));
                if (roomId > 0) {
                        add(new AbstractDefaultAjaxBehavior() {
                                private static final long serialVersionUID = 1L;
@@ -230,6 +234,20 @@ public class RoomPanel extends BasePanel
                                        response.render(new 
PriorityHeaderItem(JavaScriptHeaderItem.forScript(getNamedFunction("vote", 
this, explicit(PARAM_PUBLIC_SID)), "vote")));
                                }
                        });
+                       add(new AbstractDefaultAjaxBehavior() {
+                               private static final long serialVersionUID = 1L;
+       
+                               @Override
+                               protected void respond(AjaxRequestTarget 
target) {
+                                       startSharing.respond(target);
+                               }
+                               
+                               @Override
+                               public void renderHead(Component component, 
IHeaderResponse response) {
+                                       super.renderHead(component, response);
+                                       response.render(new 
PriorityHeaderItem(JavaScriptHeaderItem.forScript(getNamedFunction("startSharing",
 this, explicit(PARAM_PUBLIC_SID), explicit(PARAM_PROTOCOL), 
explicit(PARAM_PORT)), "startSharing")));
+                               }
+                       });
                }
        }
 

Added: 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java?rev=1717571&view=auto
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
 (added)
+++ 
openmeetings/branches/3.1.x/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/StartSharingEventBehavior.java
 Wed Dec  2 05:49:09 2015
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.room;
+
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PORT;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_FLASH_PROTOCOL;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_ALLOW_REMOTE;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_FPS_SHOW;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_SCREENSHARING_QUALITY;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getLanguage;
+import static org.apache.openmeetings.web.app.WebSession.getSid;
+import static org.apache.openmeetings.web.app.WebSession.getUserId;
+import static org.apache.openmeetings.web.room.RoomBroadcaster.getClient;
+import static org.apache.openmeetings.web.room.RoomPanel.PARAM_PORT;
+import static org.apache.openmeetings.web.room.RoomPanel.PARAM_PROTOCOL;
+import static org.apache.openmeetings.web.room.RoomPanel.PARAM_PUBLIC_SID;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.io.IOUtils;
+import org.apache.openmeetings.core.session.SessionManager;
+import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
+import org.apache.openmeetings.db.dao.label.LabelDao;
+import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.db.entity.room.Client;
+import org.apache.openmeetings.db.entity.room.Room;
+import org.apache.openmeetings.util.OmFileHelper;
+import org.apache.openmeetings.web.util.AjaxDownload;
+import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.util.resource.StringResourceStream;
+import org.apache.wicket.util.string.Strings;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+
+public class StartSharingEventBehavior extends AbstractDefaultAjaxBehavior {
+       private static final long serialVersionUID = 1L;
+       private static final Logger log = 
Red5LoggerFactory.getLogger(StartSharingEventBehavior.class, webAppRootKey);
+       private final AjaxDownload download;
+       private final long roomId;
+       private enum Protocol {
+               rtmp
+               , rtmpe
+               , rtmps
+               , rtmpt
+       }
+
+       public StartSharingEventBehavior(long _roomId) {
+               this.roomId = _roomId;
+               download = new AjaxDownload(true) {
+                       private static final long serialVersionUID = 1L;
+
+                       @Override
+                       protected String getFileName() {
+                               return "public_" + roomId + ".jnlp";
+                       }
+               };
+       }
+       
+       @Override
+       protected void onBind() {
+               super.onBind();
+               getComponent().add(download);
+       }
+       
+       private String getParam(String name) {
+               return 
getComponent().getRequest().getRequestParameters().getParameterValue(name).toString();
+       }
+       
+       @Override
+       protected void respond(AjaxRequestTarget target) {
+               //TODO deny download in case other screen sharing is in progress
+               String app = "";
+               try (InputStream jnlp = 
getClass().getClassLoader().getResourceAsStream("APPLICATION.jnlp")) {
+                       ConfigurationDao cfgDao = 
getBean(ConfigurationDao.class);
+                       app = IOUtils.toString(jnlp, "UTF-8");
+                       String baseUrl = cfgDao.getBaseUrl();
+                       URL url = new URL(baseUrl);
+                       Room room = getBean(RoomDao.class).get(roomId);
+                       Client rc = getClient(getParam(PARAM_PUBLIC_SID));
+                       SessionManager sessionManager = 
getBean(SessionManager.class);
+                       String path = url.getPath();
+                       path = path.substring(1, path.indexOf('/', 2) + 1);
+                       String port = getParam(PARAM_PORT);
+                       if (Strings.isEmpty(port)) {
+                               cfgDao.getConfValue(CONFIG_FLASH_PORT, 
String.class, "");
+                       }
+                       String _protocol = getParam(PARAM_PROTOCOL);
+                       if (Strings.isEmpty(_protocol)) {
+                               _protocol = 
cfgDao.getConfValue(CONFIG_FLASH_PROTOCOL, String.class, "");
+                       }
+                       Protocol protocol = Protocol.valueOf(_protocol);
+                       app = addKeystore(app).replace("$codebase", baseUrl + 
"screenshare")
+                                       .replace("$applicationName", 
cfgDao.getAppName())
+                                       .replace("$protocol", protocol.name())
+                                       .replace("$port", port)
+                                       .replace("$host", url.getHost())
+                                       .replace("$app", path + roomId)
+                                       .replace("$userId", "" + getUserId())
+                                       .replace("$publicSid", getSid())
+                                       .replace("$labels", "<![CDATA[" + 
getLabels(730,  731,  732,  733,  734
+                                                       ,  735,  737,  738,  
739,  740
+                                                       ,  741,  742,  844,  
869,  870
+                                                       ,  871,  872,  878, 
1089, 1090
+                                                       , 1091, 1092, 1093, 
1465, 1466
+                                                       , 1467, 1468, 1469, 
1470, 1471
+                                                       , 1472, 1473, 1474, 
1475, 1476
+                                                       , 1477, 1589, 1598, 
1078) + "]]>")
+                                       .replace("$defaultQuality", 
cfgDao.getConfValue(CONFIG_SCREENSHARING_QUALITY, String.class, ""))
+                                       .replace("$defaultFps", 
cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS, String.class, ""))
+                                       .replace("$showFps", 
cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS_SHOW, String.class, "true"))
+                                       .replace("$allowRemote", 
cfgDao.getConfValue(CONFIG_SCREENSHARING_ALLOW_REMOTE, String.class, "true"))
+                                       .replace("$allowRecording", "" + 
(room.isAllowRecording() && rc.isAllowRecording() && (0 == 
sessionManager.getRecordingCount(roomId))))
+                                       .replace("$allowPublishing", "" + (0 == 
sessionManager.getPublishingCount(roomId)))
+                                       ;
+               } catch (Exception e) {
+                       log.error("Unexpected error while creating jnlp file", 
e);
+               }
+               download.setResourceStream(new StringResourceStream(app, 
"application/x-java-jnlp-file"));
+               download.initiate(target);
+       }
+
+       private String getLabels(int ... ids) {
+               StringBuilder result = new StringBuilder();
+               boolean delim = false;
+               LabelDao labelDao = getBean(LabelDao.class);
+               for (int id : ids) {
+                       if (delim) {
+                               result.append(';');
+                       }
+                       result.append(labelDao.getString(id, getLanguage()));
+                       delim = true;
+               }
+               return result.toString();
+       }
+       
+       private String addKeystore(String app) {
+               log.debug("RTMP Sharer Keystore :: start");
+               String keystore = "--dummy--", password = "--dummy--";
+               File conf = new File(OmFileHelper.getRootDir(), "conf");
+               File keyStore = new File(conf, "keystore.screen");
+               if (keyStore.exists()) {
+                       try (FileInputStream fis = new 
FileInputStream(keyStore); FileInputStream ris = new FileInputStream(new 
File(conf, "red5.properties"))) {
+                               Properties red5Props = new Properties();
+                               red5Props.load(ris);
+                               
+                               byte keyBytes[] = new 
byte[(int)keyStore.length()];
+                               fis.read(keyBytes);
+                               
+                               keystore = Hex.encodeHexString(keyBytes);
+                               password = 
red5Props.getProperty("rtmps.screen.keystorepass");
+                               
+                               /*
+                               KeyStore ksIn = 
KeyStore.getInstance(KeyStore.getDefaultType());
+                               ksIn.load(new FileInputStream(keyStore), 
red5Props.getProperty("rtmps.keystorepass").toCharArray());
+                               ByteArrayInputStream bin = new 
ByteArrayInputStream()
+                               
+                               byte fileContent[] = new 
byte[(int)file.length()];
+                               sb = addArgument(sb, Object arg)
+                               ctx.put("$KEYSTORE", users_id);
+                               /*
+                               KeyStore ksOut = 
KeyStore.getInstance(KeyStore.getDefaultType());
+                               for (Certificate cert : 
ksIn.getCertificateChain("red5")) {
+                                       PublicKey pub = cert.getPublicKey();
+                                       TrustedCertificateEntry tce = new 
TrustedCertificateEntry(cert);
+                                       tce.
+                               }
+                               */
+                       } catch (Exception e) {
+                       //no op
+                       }
+               }
+               return app.replace("$keystore", keystore).replace("$password", 
password);
+       }
+}

Modified: 
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/poll/TestClientListManager.java
 Wed Dec  2 05:49:09 2015
@@ -37,7 +37,7 @@ public class TestClientListManager exten
                assertNotNull("RoomClientId created is null",
                                sessionManager.addClientListItem(rnd.nextLong() 
+ "ABCDE"
                                                + rnd.nextLong(), "scopeName", 
66666, "remoteAddress",
-                                               "swfUrl", false, null));
+                                               "swfUrl", null));
        }
 
 }

Modified: 
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java?rev=1717571&r1=1717570&r2=1717571&view=diff
==============================================================================
--- 
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java
 (original)
+++ 
openmeetings/branches/3.1.x/openmeetings-web/src/test/java/org/apache/openmeetings/test/session/TestHashMapSession.java
 Wed Dec  2 05:49:09 2015
@@ -66,9 +66,8 @@ public class TestHashMapSession extends
                        rcm.setUserport(0);
                        rcm.setUserip("remoteAddress");
                        rcm.setSwfurl("swfUrl");
-                       rcm.setIsMod(new Boolean(false));
-                       rcm.setCanDraw(new Boolean(false));
-                       rcm.setAvClient(false);
+                       rcm.setIsMod(false);
+                       rcm.setCanDraw(false);
 
                        if (cache.containsKey(null, streamId)) {
                                log.error("Tried to add an existing Client " + 
streamId);


Reply via email to