You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2014/10/07 20:24:22 UTC

svn commit: r1629944 - in /openmeetings/branches/3.0.x: ./ src/ src/main/java/org/apache/openmeetings/remote/red5/ src/main/java/org/apache/openmeetings/servlet/outputhandler/ src/screenshare/java/org/apache/openmeetings/screen/webstart/ src/screenshar...

Author: solomax
Date: Tue Oct  7 18:24:21 2014
New Revision: 1629944

URL: http://svn.apache.org/r1629944
Log:
[OPENMEETINGS-1099] app-template is generated and packed as expected

Modified:
    openmeetings/branches/3.0.x/build.xml
    openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
    openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/servlet/outputhandler/ScreenController.java
    openmeetings/branches/3.0.x/src/screenshare.vm
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/IScreenShare.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPClientPublish.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPSScreenShare.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPScreenShare.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPTScreenShare.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/BlankArea.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/MouseListenerable.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/NumberSpinner.java
    openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/ScreenSharerFrame.java

Modified: openmeetings/branches/3.0.x/build.xml
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/build.xml?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/build.xml (original)
+++ openmeetings/branches/3.0.x/build.xml Tue Oct  7 18:24:21 2014
@@ -280,14 +280,14 @@
 
 	<!-- Copy any resource or configuration files -->
 	<target name="vmresources">
-		<copy todir="${main.out.dir}" includeEmptyDirs="yes">
+		<copy todir="${main.out.dir}" includeEmptyDirs="yes" force="true" overwrite="true">
 			<fileset dir="${src.base.dir}">
 				<include name="**/*.vm" />
 			</fileset>
 		</copy>
 	</target>
 	
-	<target name="resources" depends="vmresources">
+	<target name="resources" depends="prepare.jnlp">
 		<patternset id="xmlpng">
 			<include name="**/*.xml" />
 			<include name="**/*.png" />
@@ -314,7 +314,60 @@
 
 	<target name="web.only" depends="jar.web.only, web.copy"/>
 	
-	<target name="jar.web.only" depends="enhance.only.norefresh, current_revision, vmresources">
+	<target name="prepare.jnlp" depends="vmresources">
+		<copy todir="${screenshare.out.dir}" overwrite="true" force="true">
+			<fileset dir="${red5.server.lib}" includes="commons-codec*.jar" />
+			<fileset dir="${red5.server.lib}" includes="commons-beanutils*.jar" />
+			<fileset dir="${red5.server.lib}" includes="commons-collections*.jar" />
+			<fileset dir="${red5.server.lib}" includes="commons-lang3*.jar" />
+			<fileset dir="${red5.server.lib}" includes="httpclient*.jar" />
+			<fileset dir="${red5.server.lib}" includes="httpcore*.jar" />
+			<fileset dir="${red5.server.lib}" includes="bcprov*.jar" />
+			<fileset dir="${red5.server.lib}" includes="ehcache-core*.jar" />
+			<fileset dir="${red5.server.lib}" includes="slf4j-api*.jar" />
+			<fileset dir="${red5.server.lib}" includes="jcl-over-slf4j*.jar" />
+			<fileset dir="${red5.server.lib}" includes="spring-context-4*.jar" />
+			<fileset dir="${red5.server.lib}" includes="spring-core-*.jar" />
+			<fileset dir="${red5.server.lib}" includes="spring-beans-*.jar" />
+			<fileset dir="${red5.server.lib}" includes="logback*.jar" />
+			<fileset dir="${red5.server.lib}" includes="mina-core*.jar" />
+			<fileset dir="${red5.server.lib}" includes="com.springsource.slf4j.api*.jar" />
+			<fileset dir="${red5.server.lib}" includes="red5-io*.jar" />
+			<fileset dir="${red5.lib}" includes="red5-server.jar" />
+			<fileset dir="${red5.client.lib}" includes="red5*.jar" />
+		</copy>
+		<fileset id="screenshare.jars" dir="${screenshare.out.dir}" casesensitive="yes">
+			<include name="**/*.jar"/>
+		</fileset>
+		<pathconvert pathsep="&quot;/&gt;&lt;jar href=&quot;" targetos="unix" property="dependencies" refid="screenshare.jars">
+			<map from="${screenshare.out.dir}/" to=""/>
+		</pathconvert>
+		<echo>dependencies = &lt;jar href=&quot;${dependencies}&quot;/&gt;&lt;jar href=&quot;${project.distname}-screenshare-${jar.suffix}.jar&quot;/&gt;</echo>
+		<replace file="${main.out.dir}/screenshare.vm" token="$dependencies" value="&lt;jar href=&quot;${dependencies}&quot;/&gt;&lt;jar href=&quot;${project.distname}-screenshare-${jar.suffix}.jar&quot;/&gt;"/>
+		<mkdir dir="${main.out.dir}/JNLP-INF"/>
+		<property name="app.template.jnlp" value="${main.out.dir}/JNLP-INF/APPLICATION-TEMPLATE.JNLP"/>
+		<copy file="${main.out.dir}/screenshare.vm" tofile="${app.template.jnlp}" overwrite="true" force="true"/>
+		<replace file="${app.template.jnlp}" token="$codebase" value="*"/>
+		<replace file="${app.template.jnlp}" token="$codebase" value="*"/>
+		<replace file="${app.template.jnlp}" token="$APP_NAME" value="*"/>
+		<replace file="${app.template.jnlp}" token="$protocol" value="*"/>
+		<replace file="${app.template.jnlp}" token="$host" value="*"/>
+		<replace file="${app.template.jnlp}" token="$port" value="*"/>
+		<replace file="${app.template.jnlp}" token="$app" value="*"/>
+		<replace file="${app.template.jnlp}" token="$userId" value="*"/>
+		<replace file="${app.template.jnlp}" token="$publicSid" value="*"/>
+		<replace file="${app.template.jnlp}" token="$labels" value="*"/>
+		<replace file="${app.template.jnlp}" token="$defaultQuality" value="*"/>
+		<replace file="${app.template.jnlp}" token="$defaultFps" value="*"/>
+		<replace file="${app.template.jnlp}" token="$showFps" value="*"/>
+		<replace file="${app.template.jnlp}" token="$allowRemote" value="*"/>
+		<replace file="${app.template.jnlp}" token="$allowRecording" value="*"/>
+		<replace file="${app.template.jnlp}" token="$allowPublishing" value="*"/>
+		<replace file="${app.template.jnlp}" token="$keystore" value="*"/>
+		<replace file="${app.template.jnlp}" token="$password" value="*"/>
+	</target>
+		
+	<target name="jar.web.only" depends="enhance.only.norefresh, current_revision, prepare.jnlp">
 		<manifestclasspath property="jar.classpath" jarfile="${project.distname}-${jar.suffix}.jar">
 			<classpath refid="compile.classpath" />
 		</manifestclasspath>
@@ -447,6 +500,7 @@
 		<jar destfile="${screenshare.out.dir}/${project.distname}-screenshare-${jar.suffix}.jar">
 			<fileset dir="${main.out.dir}">
 				<include name="org/apache/openmeetings/screen/**" />
+				<include name="JNLP-INF/*" />
 				<include name="META-INF/LICENSE" />
 				<include name="META-INF/NOTICE" />
 			</fileset>
@@ -503,27 +557,6 @@
 	</target>
 	
 	<target name="signWebStartJars" depends="generateSignKey,jar.screen.share">
-		<copy todir="${screenshare.out.dir}" overwrite="true" force="true">
-			<fileset dir="${red5.server.lib}" includes="commons-codec*.jar" />
-			<fileset dir="${red5.server.lib}" includes="commons-beanutils*.jar" />
-			<fileset dir="${red5.server.lib}" includes="commons-collections*.jar" />
-			<fileset dir="${red5.server.lib}" includes="commons-lang3*.jar" />
-			<fileset dir="${red5.server.lib}" includes="httpclient*.jar" />
-			<fileset dir="${red5.server.lib}" includes="httpcore*.jar" />
-			<fileset dir="${red5.server.lib}" includes="bcprov*.jar" />
-			<fileset dir="${red5.server.lib}" includes="ehcache-core*.jar" />
-			<fileset dir="${red5.server.lib}" includes="slf4j-api*.jar" />
-			<fileset dir="${red5.server.lib}" includes="jcl-over-slf4j*.jar" />
-			<fileset dir="${red5.server.lib}" includes="spring-context-4*.jar" />
-			<fileset dir="${red5.server.lib}" includes="spring-core-*.jar" />
-			<fileset dir="${red5.server.lib}" includes="spring-beans-*.jar" />
-			<fileset dir="${red5.server.lib}" includes="logback*.jar" />
-			<fileset dir="${red5.server.lib}" includes="mina-core*.jar" />
-			<fileset dir="${red5.server.lib}" includes="com.springsource.slf4j.api*.jar" />
-			<fileset dir="${red5.server.lib}" includes="red5-io*.jar" />
-			<fileset dir="${red5.lib}" includes="red5-server.jar" />
-			<fileset dir="${red5.client.lib}" includes="red5*.jar" />
-		</copy>
 		<taskdef resource="net/sf/antcontrib/antlib.xml">
 			<classpath refid="check.classpath" />
 		</taskdef>

Modified: openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java (original)
+++ openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java Tue Oct  7 18:24:21 2014
@@ -316,8 +316,6 @@ public class ScopeApplicationAdapter ext
 					currentClient.setStreamPublishStarted(true);
 				}
 
-				currentClient.setOrganization_id(Long.parseLong(map.get("organization_id").toString()));
-
 				sessionManager.updateClientByStreamId(current.getClient().getId(), currentClient, false, null);
 
 				Map returnMap = new HashMap();

Modified: openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/servlet/outputhandler/ScreenController.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/servlet/outputhandler/ScreenController.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/servlet/outputhandler/ScreenController.java (original)
+++ openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/servlet/outputhandler/ScreenController.java Tue Oct  7 18:24:21 2014
@@ -25,7 +25,6 @@ import static org.apache.openmeetings.ut
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
-import java.io.FileFilter;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Properties;
@@ -139,40 +138,10 @@ public class ScreenController {
 			}
 			log.debug("Creating JNLP Template for TCP solution");
 
-			//libs
-			StringBuilder libs = new StringBuilder();
-			File screenShareDir = OmFileHelper.getScreenSharingDir();
-			for (File jar : screenShareDir.listFiles(new FileFilter() {
-				public boolean accept(File pathname) {
-					return pathname.getName().endsWith(".jar");
-				}
-			})) {
-				libs.append("\t\t<jar href=\"").append(jar.getName()).append("\"/>\n");
-			}
 			log.debug("RTMP Sharer labels :: " + label_sharer);
 
 			ConnectionType conType = ConnectionType.valueOf(request.getParameter("connectionType"));
 
-			String startUpClass;
-			switch (conType) {
-			case rtmp:
-				startUpClass = "org.apache.openmeetings.screen.webstart.RTMPScreenShare";
-				break;
-			case rtmps:
-				startUpClass = "org.apache.openmeetings.screen.webstart.RTMPSScreenShare";
-				break;
-			case rtmpt:
-				startUpClass = "org.apache.openmeetings.screen.webstart.RTMPTScreenShare";
-				break;
-			default:
-				throw new Exception("Unknown connection type");
-			}
-
-			String orgIdAsString = request.getParameter("organization_id");
-			if (orgIdAsString == null) {
-				throw new Exception("orgIdAsString is empty could not start sharer");
-			}
-
 			String port = request.getParameter("port");
 			if (port == null) {
 				throw new Exception("port is empty: ");
@@ -189,25 +158,22 @@ public class ScreenController {
 			boolean allowPublishing = (0 == sessionManager.getPublishingCount(roomId));
 			
 			Context ctx = new VelocityContext();
-			ctx.put("APP_NAME", cfgDao.getAppName());
-			ctx.put("PUBLIC_SID", publicSID);
-			ctx.put("LABELSHARER", label_sharer);
-			addKeystore(ctx);
-			ctx.put("LIBRARIES", libs);
-			ctx.put("organization_id", orgIdAsString);
-			ctx.put("startUpClass", startUpClass);
 			ctx.put("codebase", baseURL + OmFileHelper.SCREENSHARING_DIR);
-			ctx.put("red5-host", rtmphostlocal);
-			ctx.put("red5-app", OpenmeetingsVariables.webAppRootKey + "/" + roomId);
-			ctx.put("default_quality_screensharing", cfgDao.getConfValue(CONFIG_SCREENSHARING_QUALITY, String.class, "1"));
-			ctx.put("default_fps_screensharing", cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS, String.class, "10"));
-			ctx.put("show_screensharing_fps", cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS_SHOW, Boolean.class, "true"));
-			ctx.put("allow_remote", cfgDao.getConfValue(CONFIG_SCREENSHARING_ALLOW_REMOTE, Boolean.class, "true"));
-			//invited guest does not have valid user_id (have user_id == -1)
-			ctx.put("user_id", users_id);
+			ctx.put("APP_NAME", cfgDao.getAppName());
+			ctx.put("protocol", conType.name());
+			ctx.put("host", rtmphostlocal);
 			ctx.put("port", port);
+			ctx.put("app", OpenmeetingsVariables.webAppRootKey + "/" + roomId);
+			ctx.put("userId", users_id);
+			ctx.put("publicSid", publicSID);
+			ctx.put("labels", label_sharer);
+			ctx.put("defaultQuality", cfgDao.getConfValue(CONFIG_SCREENSHARING_QUALITY, String.class, "1"));
+			ctx.put("defaultFps", cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS, String.class, "10"));
+			ctx.put("showFps", cfgDao.getConfValue(CONFIG_SCREENSHARING_FPS_SHOW, Boolean.class, "true"));
+			ctx.put("allowRemote", cfgDao.getConfValue(CONFIG_SCREENSHARING_ALLOW_REMOTE, Boolean.class, "true"));
 			ctx.put("allowRecording", allowRecording);
 			ctx.put("allowPublishing", allowPublishing);
+			addKeystore(ctx);
 
 			String requestedFile = StringUtils.deleteWhitespace(domain + "_" + roomId) + ".jnlp";
 			response.setContentType("application/x-java-jnlp-file");
@@ -229,13 +195,9 @@ public class ScreenController {
 		}
 	}
 
-	private StringBuilder addArgument(StringBuilder sb, Object arg) {
-		return sb.append("\t\t<argument>").append(arg).append("</argument>\n");
-	}
-	
 	private void addKeystore(Context ctx) {
 		log.debug("RTMP Sharer Keystore :: start");
-		StringBuilder sb = new StringBuilder();
+		String keystore = "<![CDATA[]]>", password = "<![CDATA[]]>";
 		FileInputStream fis = null, ris = null;
 		try {
 			File conf = new File(OmFileHelper.getRootDir(), "conf");
@@ -250,7 +212,8 @@ public class ScreenController {
 				fis = new FileInputStream(keyStore);
 				fis.read(keyBytes);
 				
-				sb = addArgument(addArgument(sb, Hex.encodeHexString(keyBytes)), red5Props.getProperty("rtmps.keystorepass"));
+				keystore = Hex.encodeHexString(keyBytes);
+				password = red5Props.getProperty("rtmps.keystorepass");
 				
 				/*
 				KeyStore ksIn = KeyStore.getInstance(KeyStore.getDefaultType());
@@ -287,6 +250,7 @@ public class ScreenController {
 				}
 			}
 		}
-		ctx.put("KEYSTORE", sb);
+		ctx.put("keystore", keystore);
+		ctx.put("password", password);
 	}
 }

Modified: openmeetings/branches/3.0.x/src/screenshare.vm
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare.vm?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare.vm (original)
+++ openmeetings/branches/3.0.x/src/screenshare.vm Tue Oct  7 18:24:21 2014
@@ -17,38 +17,39 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<jnlp spec='1.0+' codebase='$codebase'> 
+<jnlp spec='1.0+' codebase='$codebase'>
 	<information> 
-		<title>Screen Sharing Application</title> 
+		<title>Screen Sharing Application</title>
 		<vendor>$APP_NAME</vendor> 
 		<homepage>http://openmeetings.apache.org/</homepage>
 		<icon href="icon.jpg" />
 		<icon kind="splash" href="splashicon.jpg" />
-		<description>ScreenViewer Client Application</description> 
-		<description kind="short">A File to grab a screen and send it to a Server</description> 
-		<offline-allowed/> 
+		<description>ScreenViewer Client Application</description>
+		<description kind="short">A File to grab a screen and send it to a Server</description>
+		<offline-allowed/>
 	</information>
 	<security>
-	    <all-permissions/>
-	</security>	
-	<resources> 
+		<all-permissions/>
+	</security>
+	<resources>
 		<j2se version='1.7+'/>
-$LIBRARIES
-    </resources> 
-    <application-desc main-class='$startUpClass'>
-    	<argument>$red5-host</argument> 
-    	<argument>$red5-app</argument> 
-    	<argument>$port</argument> 
-    	<argument>$PUBLIC_SID</argument>   
-    	<argument>$LABELSHARER</argument> 
-    	<argument>$organization_id</argument> 
-    	<argument>$default_quality_screensharing</argument>
-    	<argument>$default_fps_screensharing</argument>
-    	<argument>$show_screensharing_fps</argument>
-    	<argument>$allow_remote</argument>
-    	<argument>$user_id</argument>   
-    	<argument>$allowRecording</argument>
-    	<argument>$allowPublishing</argument>
-$KEYSTORE
-    </application-desc> 
-</jnlp> 
+		$dependencies
+	</resources>
+	<application-desc main-class='org.apache.openmeetings.screen.webstart.CoreScreenShare'>
+		<argument>$protocol</argument>
+		<argument>$host</argument>
+		<argument>$port</argument>
+		<argument>$app</argument>
+		<argument>$userId</argument>
+		<argument>$publicSid</argument>
+		<argument>$labels</argument>
+		<argument>$defaultQuality</argument>
+		<argument>$defaultFps</argument>
+		<argument>$showFps</argument>
+		<argument>$allowRemote</argument>
+		<argument>$allowRecording</argument>
+		<argument>$allowPublishing</argument>
+		<argument>$keystore</argument>
+		<argument>$password</argument>
+	</application-desc>
+</jnlp>

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java Tue Oct  7 18:24:21 2014
@@ -111,7 +111,7 @@ final class CaptureScreen extends Thread
 						}
 						frames.offer(data);
 						se.createUnalteredFrame();
-					} catch (IOException e) {
+					} catch (Exception e) {
 						log.error("Error while encoding: ", e);
 					}
 				}

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java Tue Oct  7 18:24:21 2014
@@ -40,6 +40,7 @@ import java.awt.event.KeyEvent;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.commons.codec.binary.Hex;
 import org.apache.openmeetings.screen.webstart.gui.ScreenSharerFrame;
 import org.red5.client.net.rtmp.INetStreamEventHandler;
 import org.red5.io.utils.ObjectMap;
@@ -57,7 +58,11 @@ import org.slf4j.Logger;
 public class CoreScreenShare implements IPendingServiceCallback, INetStreamEventHandler {
 	private static final Logger log = getLogger(CoreScreenShare.class);
 
+	enum Protocol {
+		rtmp, rtmpt, rtmpe, rtmps
+	}
 	private IScreenShare instance = null;
+	private Protocol protocol;
 	private String host;
 	private String app;
 	private int port;
@@ -73,7 +78,6 @@ public class CoreScreenShare implements 
 	public boolean showFPS = true;
 	public boolean allowRemote = true;
 
-	public Long organization_id = 0L;
 	public Long user_id = null;
 	private boolean allowRecording = true;
 	private boolean allowPublishing = true;
@@ -101,30 +105,25 @@ public class CoreScreenShare implements 
 	//
 	// ------------------------------------------------------------------------
 
-	public CoreScreenShare(IScreenShare instance, String[] args) {
-		this.instance = instance;
-		
+	public CoreScreenShare(String[] args) {
 		try {
 			for (String arg : args) {
 				log.debug("arg: " + arg);
 			}
 			String[] textArray = null;
 			if (args.length > 12) {
-				host = args[0];
-				app = args[1];
+				protocol = Protocol.valueOf(args[0]);
+				host = args[1];
 				port = Integer.parseInt(args[2]);
-				publishName = args[3];
-
-				String labelTexts = args[4];
-
-				organization_id = Long.parseLong(args[5]);
-
-				defaultQuality = Integer.parseInt(args[6]);
-				defaultFPS = Integer.parseInt(args[7]);
-				showFPS = bool(args[8]);
-				allowRemote = bool(args[9]);
+				app = args[3];
+				user_id = Long.parseLong(args[4]);
+				publishName = args[5];
+				String labelTexts = args[6];
+				defaultQuality = Integer.parseInt(args[7]);
+				defaultFPS = Integer.parseInt(args[8]);
+				showFPS = bool(args[9]);
+				allowRemote = bool(args[10]);
 				remoteEnabled = allowRemote;
-				user_id = Long.parseLong(args[10]);
 				allowRecording = bool(args[11]);
 				allowPublishing = bool(args[12]);
 
@@ -139,9 +138,25 @@ public class CoreScreenShare implements 
 						log.debug(i + " :: " + textArray[i]);
 					}
 				}
-				log.debug("host: " + host + ", app: "
-						+ app + ", port: " + port + ", publish: "
-						+ publishName);
+				switch (protocol) {
+					case rtmp:
+						instance = new RTMPScreenShare(this);
+						break;
+					case rtmpt:
+						instance = new RTMPTScreenShare(this);
+						break;
+					case rtmps:
+						RTMPSScreenShare client = new RTMPSScreenShare(this);
+						client.setKeystoreBytes(Hex.decodeHex(args[13].toCharArray()));
+						client.setKeyStorePassword(args[14]);
+						instance = client;
+						break;
+					case rtmpe:
+					default:
+						throw new Exception("Unsupported protocol");
+				}
+				instance.setServiceProvider(instance);
+				log.debug(String.format("host: %s, app: %s, port: %s, publish: %s", host, port, app, publishName));
 			} else {
 				System.exit(0);
 			}
@@ -152,6 +167,10 @@ public class CoreScreenShare implements 
 		}
 	}
 
+	public static void main(String[] args) {
+		new CoreScreenShare(args);
+	}
+	
 	// ------------------------------------------------------------------------
 	//
 	// GUI
@@ -217,7 +236,6 @@ public class CoreScreenShare implements 
 			map.put("publishingApp", frame.getPublishApp());
 			map.put("publishingId", frame.getPublishId());
 
-			map.put("organization_id", organization_id);
 			map.put("user_id", user_id);
 
 			instance.invoke("setConnectionAsSharingClient", new Object[] { map }, this);

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/IScreenShare.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/IScreenShare.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/IScreenShare.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/IScreenShare.java Tue Oct  7 18:24:21 2014
@@ -27,6 +27,7 @@ public interface IScreenShare {
 	RTMPConnection getConnection();
 	void invoke(String method, Object[] params, IPendingServiceCallback callback);
 	void connect(String server, int port, String application, IPendingServiceCallback connectCallback);
+	void setServiceProvider(Object serviceProvider);
 	void disconnect();
 	void createStream(IPendingServiceCallback callback);
 	void publish(int streamId, String name, String mode, INetStreamEventHandler handler);

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPClientPublish.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPClientPublish.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPClientPublish.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPClientPublish.java Tue Oct  7 18:24:21 2014
@@ -37,6 +37,10 @@ class RTMPClientPublish extends RTMPClie
 	private String id;
 	private CoreScreenShare core;
 	
+	public void setCore(CoreScreenShare core) {
+		this.core = core;
+	}
+	
 	RTMPClientPublish(CoreScreenShare core, String host, String app, String id) {
 		this.id = id;
 		this.core = core;

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPSScreenShare.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPSScreenShare.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPSScreenShare.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPSScreenShare.java Tue Oct  7 18:24:21 2014
@@ -18,8 +18,6 @@
  */
 package org.apache.openmeetings.screen.webstart;
 
-import org.apache.commons.codec.DecoderException;
-import org.apache.commons.codec.binary.Hex;
 import org.red5.client.net.rtmp.ClientExceptionHandler;
 import org.red5.client.net.rtmps.RTMPSClient;
 import org.red5.server.api.service.IPendingServiceCallback;
@@ -35,19 +33,10 @@ public class RTMPSScreenShare extends RT
 
 	private CoreScreenShare core = null;
 
-	private RTMPSScreenShare(String[] args) {
-		core = new CoreScreenShare(this, args);
+	public RTMPSScreenShare(CoreScreenShare core) {
+		this.core = core;
 	};
 
-	public static void main(String[] args) throws DecoderException {
-		RTMPSScreenShare client = new RTMPSScreenShare(args);
-		if (args.length < 15) {
-			System.exit(0);
-		}
-		client.setKeystoreBytes(Hex.decodeHex(args[13].toCharArray()));
-		client.setKeyStorePassword(args[14]);
-	}
-	
 	@Override
 	public void connect(String server, int port, String application,
 			IPendingServiceCallback connectCallback) {
@@ -85,7 +74,7 @@ public class RTMPSScreenShare extends RT
 		super.onCommand(conn, channel, source, command);
 		core.onCommand(conn, channel, source, command);
 	}
-	
+
 	@Override
 	public void handleException(Throwable throwable) {
 		logger.error("{}", new Object[] { throwable.getCause() });

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPScreenShare.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPScreenShare.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPScreenShare.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPScreenShare.java Tue Oct  7 18:24:21 2014
@@ -32,14 +32,10 @@ public class RTMPScreenShare extends RTM
 
 	private CoreScreenShare core = null;
 
-	private RTMPScreenShare(String[] args) {
-		core = new CoreScreenShare(this, args);
-	};
-
-	public static void main(String[] args) {
-		new RTMPScreenShare(args);
+	public RTMPScreenShare(CoreScreenShare core) {
+		this.core = core;
 	}
-	
+
 	// ------------------------------------------------------------------------
 	//
 	// Override
@@ -67,7 +63,7 @@ public class RTMPScreenShare extends RTM
 		super.onCommand(conn, channel, source, command);
 		core.onCommand(conn, channel, source, command);
 	}
-	
+
 	@Override
 	public void handleException(Throwable throwable) {
 		logger.error("{}", new Object[] { throwable.getCause() });

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPTScreenShare.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPTScreenShare.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPTScreenShare.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/RTMPTScreenShare.java Tue Oct  7 18:24:21 2014
@@ -32,14 +32,10 @@ public class RTMPTScreenShare extends RT
 
 	private CoreScreenShare core = null;
 
-	private RTMPTScreenShare(String[] args) {
-		core = new CoreScreenShare(this, args);
+	public RTMPTScreenShare(CoreScreenShare core) {
+		this.core = core;
 	};
 
-	public static void main(String[] args) {
-		new RTMPTScreenShare(args);
-	}
-	
 	// ------------------------------------------------------------------------
 	//
 	// Override
@@ -67,7 +63,7 @@ public class RTMPTScreenShare extends RT
 		super.onCommand(conn, channel, source, command);
 		core.onCommand(conn, channel, source, command);
 	}
-	
+
 	@Override
 	public void handleException(Throwable throwable) {
 		logger.error("{}", new Object[] { throwable.getCause() });

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/BlankArea.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/BlankArea.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/BlankArea.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/BlankArea.java Tue Oct  7 18:24:21 2014
@@ -23,7 +23,7 @@ import java.awt.Dimension;
 import java.awt.Color;
 
 public class BlankArea extends MouseListenerable {
-	private static final long serialVersionUID = 305723962144665147L;
+	private static final long serialVersionUID = 1L;
 	private Dimension minSize = new Dimension(100, 50);
 
     public BlankArea(Color color) {

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/MouseListenerable.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/MouseListenerable.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/MouseListenerable.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/MouseListenerable.java Tue Oct  7 18:24:21 2014
@@ -23,7 +23,7 @@ import java.awt.event.MouseAdapter;
 import javax.swing.JLabel;
 
 public class MouseListenerable extends JLabel {
-	private static final long serialVersionUID = -6862930681858866872L;
+	private static final long serialVersionUID = 1L;
 
 	public void addListener(MouseAdapter listner) {
 		addMouseListener(listner);

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/NumberSpinner.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/NumberSpinner.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/NumberSpinner.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/NumberSpinner.java Tue Oct  7 18:24:21 2014
@@ -22,7 +22,7 @@ import javax.swing.JSpinner;
 import javax.swing.SpinnerNumberModel;
 
 public class NumberSpinner extends JSpinner {
-	private static final long serialVersionUID = -1964457022937740633L;
+	private static final long serialVersionUID = 1L;
 
 	public NumberSpinner(int value, int min, int max, int step) {
 		super(new SpinnerNumberModel(value, min, max, step));

Modified: openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/ScreenSharerFrame.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/ScreenSharerFrame.java?rev=1629944&r1=1629943&r2=1629944&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/ScreenSharerFrame.java (original)
+++ openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/gui/ScreenSharerFrame.java Tue Oct  7 18:24:21 2014
@@ -137,7 +137,7 @@ public class ScreenSharerFrame extends J
 		}
 	}
 	
-	private class KeyValue<T> {
+	private static class KeyValue<T> {
 		private String key;
 		private T value;
 		
@@ -172,7 +172,7 @@ public class ScreenSharerFrame extends J
 	}
 	
 	//this implementation will not allow to Enable Panel in runtime
-	private class DisabledPanel extends JPanel {
+	private static class DisabledPanel extends JPanel {
 		private static final long serialVersionUID = 1L;
 
 		@Override
@@ -184,7 +184,7 @@ public class ScreenSharerFrame extends J
 		}
 	}
 	
-	private class VerticalSlider extends MouseListenerable {
+	private static class VerticalSlider extends MouseListenerable {
 		private static final long serialVersionUID = 1L;
 
 		public VerticalSlider() {
@@ -200,7 +200,7 @@ public class ScreenSharerFrame extends J
 		}
 	}
 	
-	private class HorizontalSlider extends MouseListenerable {
+	private static class HorizontalSlider extends MouseListenerable {
 		private static final long serialVersionUID = 1L;
 
 		public HorizontalSlider() {