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 2012/04/06 11:38:51 UTC

svn commit: r1310263 - in /incubator/openmeetings/trunk/singlewebapp: WebContent/red5/ src/org/openmeetings/app/ src/org/openmeetings/app/data/conference/ src/org/openmeetings/app/data/user/ src/org/openmeetings/app/installation/ src/org/openmeetings/a...

Author: solomax
Date: Fri Apr  6 09:38:50 2012
New Revision: 1310263

URL: http://svn.apache.org/viewvc?rev=1310263&view=rev
Log:
OPENMEETINGS-111 install functionality is added; code cleanup

Added:
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/InstallationConfig.java
Modified:
    incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.bat
    incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.sh
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/Admin.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/conference/Roommanagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/ImportInitvalues.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/AsteriskSipUsers.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/Extensions.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/MeetMe.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/AsteriskDbSipClient.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/dao/AsteriskDAOImpl.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/VirtualScreen.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/Install.java
    incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/test/AbstractOpenmeetingsSpringTest.java

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.bat
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.bat?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.bat (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.bat Fri Apr  6 09:38:50 2012
@@ -1,6 +1,7 @@
+@echo off
 set RED5_HOME=%~dp0
 
 set CLASSPATH=%RED5_HOME%\*;%RED5_HOME%\conf;%RED5_HOME%\lib\*;%RED5_HOME%\webapps\openmeetings\WEB-INF\lib\*;%RED5_HOME%\webapps\openmeetings\WEB-INF;%RED5_HOME%\webapps\openmeetings\WEB-INF\classes
 
-java -cp "%CLASSPATH%" org.openmeetings.app.Admin %*
+java -cp "%CLASSPATH%" -Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector org.openmeetings.app.Admin %*
 

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.sh
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.sh?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.sh (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/red5/admin.sh Fri Apr  6 09:38:50 2012
@@ -3,5 +3,5 @@ export RED5_HOME=$(cd $(dirname "$0"); p
 
 export CLASSPATH=$RED5_HOME/*:$RED5_HOME/conf:$RED5_HOME/lib/*:$RED5_HOME/webapps/openmeetings/WEB-INF/lib/*:$RED5_HOME/webapps/openmeetings/WEB-INF:$RED5_HOME/webapps/openmeetings/WEB-INF/classes
 
-java -cp "$CLASSPATH" org.openmeetings.app.Admin $*
+java -cp "$CLASSPATH" -Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector org.openmeetings.app.Admin $*
 

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/Admin.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/Admin.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/Admin.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/Admin.java Fri Apr  6 09:38:50 2012
@@ -1,8 +1,21 @@
 package org.openmeetings.app;
 
+import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Date;
+import java.util.Enumeration;
+import java.util.Set;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletException;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.HelpFormatter;
@@ -12,8 +25,11 @@ import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.Parser;
 import org.apache.commons.cli.PosixParser;
+import org.openmeetings.app.installation.ImportInitvalues;
+import org.openmeetings.app.installation.InstallationConfig;
 import org.openmeetings.servlet.outputhandler.BackupExport;
 import org.openmeetings.servlet.outputhandler.BackupImportController;
+import org.openmeetings.utils.OMContextListener;
 import org.openmeetings.utils.math.CalendarPatterns;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
@@ -37,6 +53,13 @@ public class Admin {
 		options.addOption(OptionBuilder.withLongOpt("verbose").withDescription("verbose error messages").create('v'));
 		options.addOption(OptionBuilder.withLongOpt("file").hasArg().withDescription("file used for backup/restore").create('f'));
 		options.addOption(OptionBuilder.withLongOpt("exclude-files").withDescription("should backup exclude files [default: include]").create());
+		//install options
+		options.addOption(OptionBuilder.hasArg().withDescription("Login name of the default user, minimum " + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH + " characters").create("user"));
+		options.addOption(OptionBuilder.hasArg().withDescription("Email of the default user").create("email"));
+		options.addOption(OptionBuilder.hasArg().withDescription("The name of the default user group").create("group"));
+		options.addOption(OptionBuilder.hasArg().withDescription("Default server time zone, and time zone for the selected user [GMT+10, GMT-2]").create("tz"));
+		options.addOption(OptionBuilder.withLongOpt("skip-default-rooms").withDescription("Do not create default rooms [created by default]").create());
+		options.addOption(OptionBuilder.withLongOpt("disable-frontend-register").withDescription("Do not allow front end register [allowed by default]").create());
 		
 		return options;
 	}
@@ -68,7 +91,109 @@ public class Admin {
 		System.exit(1);
 	}
 	
-	private ClassPathXmlApplicationContext getApplicationContext() {
+	private ClassPathXmlApplicationContext getApplicationContext(final String ctxName) {
+		OMContextListener omcl = new OMContextListener();
+		omcl.contextInitialized(new ServletContextEvent(new ServletContext() {
+			public void setAttribute(String arg0, Object arg1) {
+			}
+			
+			public void removeAttribute(String arg0) {
+			}
+			
+			public void log(String arg0, Throwable arg1) {
+			}
+			
+			public void log(Exception arg0, String arg1) {
+			}
+			
+			public void log(String arg0) {
+			}
+			
+			@SuppressWarnings("rawtypes")
+			public Enumeration getServlets() {
+				return null;
+			}
+			
+			@SuppressWarnings("rawtypes")
+			public Enumeration getServletNames() {
+				return null;
+			}
+			
+			public String getServletContextName() {
+				return null;
+			}
+			
+			public Servlet getServlet(String arg0) throws ServletException {
+				return null;
+			}
+			
+			public String getServerInfo() {
+				return null;
+			}
+			
+			@SuppressWarnings("rawtypes")
+			public Set getResourcePaths(String arg0) {
+				return null;
+			}
+			
+			public InputStream getResourceAsStream(String arg0) {
+				return null;
+			}
+			
+			public URL getResource(String arg0) throws MalformedURLException {
+				return null;
+			}
+			
+			public RequestDispatcher getRequestDispatcher(String arg0) {
+				return null;
+			}
+			
+			public String getRealPath(String arg0) {
+				return null;
+			}
+			
+			public RequestDispatcher getNamedDispatcher(String arg0) {
+				return null;
+			}
+			
+			public int getMinorVersion() {
+				return 0;
+			}
+			
+			public String getMimeType(String arg0) {
+				return null;
+			}
+			
+			public int getMajorVersion() {
+				return 0;
+			}
+			
+			@SuppressWarnings("rawtypes")
+			public Enumeration getInitParameterNames() {
+				return null;
+			}
+			
+			public String getInitParameter(String arg0) {
+				return null;
+			}
+			
+			public String getContextPath() {
+				return ctxName;
+			}
+			
+			public ServletContext getContext(String arg0) {
+				return null;
+			}
+			
+			@SuppressWarnings("rawtypes")
+			public Enumeration getAttributeNames() {
+				return null;
+			}
+			
+			public Object getAttribute(String arg0) {
+				return null;
+			}
+		}));
 		ClassPathXmlApplicationContext applicationContext = null;
 		try {
 			applicationContext = new ClassPathXmlApplicationContext("openmeetings-applicationContext.xml");
@@ -79,7 +204,8 @@ public class Admin {
 	}
 	
 	private void process(String[] args) {
-		File omHome = new File(System.getenv("RED5_HOME"), "webapps/openmeetings");
+		String ctxName = System.getProperty("context", "openmeetings");
+		File omHome = new File(new File(System.getenv("RED5_HOME"), "webapps"), ctxName);
 		
 		Parser parser = new PosixParser();
 		CommandLine cmdl = null;
@@ -101,18 +227,42 @@ public class Admin {
 			cmd = Command.restore;
 		}
 
-		ClassPathXmlApplicationContext applicationContext = null;
-		switch(cmd) {
-			case install:
-			case backup:
-			case restore:
-				applicationContext = getApplicationContext();
-			default:
-				//noop
-		};
 		String file = cmdl.getOptionValue('f', "");
 		switch(cmd) {
 			case install:
+				try {
+					InstallationConfig cfg = new InstallationConfig();
+					String login = cmdl.getOptionValue("user");
+					String email = cmdl.getOptionValue("email");
+					String group = cmdl.getOptionValue("group");
+					String tz = cmdl.getOptionValue("tz");
+					if (cmdl.hasOption("skip-default-rooms")) {
+						cfg.createDefaultRooms = "0";
+					}
+					if (cmdl.hasOption("disable-frontend-register")) {
+						cfg.allowFrontendRegister = "0";
+					}
+					if (login == null || login.length() < InstallationConfig.USER_LOGIN_MINIMUM_LENGTH) {
+						System.out.println("User login was not provided, or too short, should be at least " + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH + " character long.");
+						System.exit(1);
+					}
+					if (group == null || login.length() < 1) {
+						System.out.println("User group was not provided, or too short, should be at least 1 character long.");
+						System.exit(1);
+					}
+					System.out.print("Please enter password:");
+					String pass = new BufferedReader(new InputStreamReader(System.in)).readLine();
+					if (pass == null || pass.length() < InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH) {
+						System.out.println("Password was not provided, or too short, should be at least " + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH + " character long.");
+						System.exit(1);
+					}
+					
+					ImportInitvalues importInit = getApplicationContext(ctxName).getBean(ImportInitvalues.class);
+					importInit.loadAll(new File(omHome, ImportInitvalues.languageFolderName).getAbsolutePath()
+							, cfg, login, pass, email, group, tz);
+				} catch(Exception e) {
+					handleError("Install failed", e);
+				}
 				break;
 			case backup:
 				try {
@@ -121,9 +271,10 @@ public class Admin {
 						System.out.println("File name was not specified, '" + file + "' will be used");
 					}
 					boolean includeFiles = Boolean.getBoolean(cmdl.getOptionValue("exclude-files", "true"));
-					BackupExport export = applicationContext.getBean(BackupExport.class);
 					File backup_dir = new File(omHome, "uploadtemp/" + System.currentTimeMillis());
 					backup_dir.mkdirs();
+					
+					BackupExport export = getApplicationContext(ctxName).getBean(BackupExport.class);
 					export.performExport(file, backup_dir, includeFiles, omHome.getAbsolutePath());
 					export.deleteDirectory(backup_dir);
 					backup_dir.delete();
@@ -139,7 +290,8 @@ public class Admin {
 						usage();
 						System.exit(1);
 					}
-					BackupImportController importCtrl = applicationContext.getBean(BackupImportController.class);
+					
+					BackupImportController importCtrl = getApplicationContext(ctxName).getBean(BackupImportController.class);
 					importCtrl.performImport(new FileInputStream(backup), omHome.getAbsolutePath());
 				} catch (Exception e) {
 					handleError("Restore failed", e);
@@ -151,8 +303,7 @@ public class Admin {
 				break;
 		}
 		
-		//Exit the shell process
-		log.info("... Done");
+		System.out.println("... Done");
 		System.exit(0);
 	}
 	

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/conference/Roommanagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/conference/Roommanagement.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/conference/Roommanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/conference/Roommanagement.java Fri Apr  6 09:38:50 2012
@@ -46,12 +46,10 @@ import org.openmeetings.app.persistence.
 import org.openmeetings.app.persistence.beans.rooms.Rooms;
 import org.openmeetings.app.persistence.beans.rooms.Rooms_Organisation;
 import org.openmeetings.app.persistence.beans.sip.OpenXGReturnObject;
-import org.openmeetings.app.persistence.beans.user.UserSipData;
 import org.openmeetings.app.persistence.beans.user.Users;
 import org.openmeetings.app.remote.red5.ClientListManager;
 import org.openmeetings.app.sip.api.impl.asterisk.AsteriskDbSipClient;
 import org.openmeetings.app.sip.api.request.SIPCreateConferenceRequest;
-import org.openmeetings.app.sip.api.result.SIPCreateUserRequestResult;
 import org.openmeetings.app.sip.api.result.SipCreateConferenceRequestResult;
 import org.openmeetings.app.sip.xmlrpc.OpenXGHttpClient;
 import org.red5.logging.Red5LoggerFactory;
@@ -1003,8 +1001,8 @@ public class Roommanagement {
 			if (authLevelManagement.checkAdminLevel(user_level)) {
 				Rooms_Organisation rOrganisation = new Rooms_Organisation();
 				rOrganisation.setRoom(this.getRoomById(rooms_id));
-				log.error("addRoomToOrganisation rooms "
-						+ rOrganisation.getRoom().getName());
+				log.debug("addRoomToOrganisation rooms '"
+						+ rOrganisation.getRoom().getName() + "'");
 				rOrganisation.setStarttime(new Date());
 				rOrganisation.setOrganisation(organisationmanagement
 						.getOrganisationById(organisation_id));

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/data/user/Usermanagement.java Fri Apr  6 09:38:50 2012
@@ -953,7 +953,7 @@ public class Usermanagement {
 					"user.pass.minimum.length", Integer.class, "4");
 
 			if (userLoginMinimumLength == null || userPassMinimumLength == null) {
-				new Exception(
+				throw new Exception(
 						"user.login.minimum.length or user.pass.minimum.length problem");
 			}
 

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/ImportInitvalues.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/ImportInitvalues.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/ImportInitvalues.java Fri Apr  6 09:38:50 2012
@@ -18,6 +18,7 @@
  */
 package org.openmeetings.app.installation;
 
+import java.io.File;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Iterator;
@@ -95,6 +96,7 @@ public class ImportInitvalues {
 		userManagement.addUserLevel("Moderator", 2);
 		userManagement.addUserLevel("Admin", 3);
 		userManagement.addUserLevel("Web-Service (only access via SOAP)", 4);
+		log.debug("UserLevels ADDED");
 
 		/*
 		 * ######################## Dashboard Menu Points
@@ -185,16 +187,17 @@ public class ImportInitvalues {
 
 		navimanagement.addMainStructure("adminModuleBackup", 21, 367, true,
 				false, 3, "Administration of Backups", 6, "false", 1461L);
+		log.debug("MainMenu ADDED");
 
 		errorManagement.addErrorType(new Long(1), new Long(322));
 		errorManagement.addErrorType(new Long(2), new Long(323));
+		log.debug("Error types ADDED");
 	}
 
 	public void loadErrorMappingsFromXML(String filePath) throws Exception {
 
 		SAXReader reader = new SAXReader();
-		Document document = reader.read(filePath
-				+ ImportInitvalues.nameOfErrorFile);
+		Document document = reader.read(new File(filePath, ImportInitvalues.nameOfErrorFile));
 
 		Element root = document.getRootElement();
 
@@ -227,52 +230,34 @@ public class ImportInitvalues {
 			errorManagement.addErrorValues(errorvalues_id, errortype_id,
 					fieldvalues_id);
 		}
-		log.error("ErrorMappings ADDED");
+		log.debug("ErrorMappings ADDED");
 	}
 
 	public void loadSalutations() {
-
 		salutationmanagement.addUserSalutation("Mr", 261);
 		salutationmanagement.addUserSalutation("Ms", 262);
 		salutationmanagement.addUserSalutation("Mrs", 841);
 		salutationmanagement.addUserSalutation("Dr", 842);
-
+		log.debug("Salutations ADDED");
 	}
 
-	public void loadConfiguration(String crypt_ClassName,
-			String allowfrontendRegister, String smtpServer, String smtpPort,
-			String referer, String mailauthname, String mailauthpass,
-			String mailusetls, String default_lang_id, String swf_path,
-			String im_path, String url_feed, String url_feed2,
-			String sendEmailAtRegister, String sendEmailWithVerficationCode,
-			String default_export_font, String screen_viewer,
-			String ffmpeg_path, String sox_path, String sip_enable,
-			String sip_realm, String sip_port, String sip_proxyname,
-			String sip_tunnel, String sip_codebase, String sip_forcetunnel,
-			String sip_openxg_enable, String openxg_wrapper_url,
-			String openxg_client_id, String openxg_client_secret,
-			String openxg_client_domain, String openxg_community_code,
-			String openxg_language_code, String openxg_adminid,
-			String sip_language_phonecode, String sip_phonerange_start,
-			String sip_phonerange, String jodPath,
-            String red5sip_enable, String red5sip_room_prefix,String red5sip_exten_context) {
-
+	public void loadConfiguration(InstallationConfig cfg) {
 		cfgManagement
 				.addConfByKey(
 						3,
 						"crypt_ClassName",
-						crypt_ClassName,
+						cfg.cryptClassName,
 						null,
 						"This Class is used for Authentification-Crypting. "
 								+ "Be carefull what you do here! If you change it while "
 								+ "running previous Pass of users will not be workign anymore! "
 								+ "for more Information see http://code.google.com/p/openmeetings/wiki/CustomCryptMechanism");
 
-		cfgManagement.addConfByKey(3, "screen_viewer", screen_viewer, null,
+		cfgManagement.addConfByKey(3, "screen_viewer", cfg.screenViewer, null,
 				"ScreenViewer Type(0==standard, 1== jrdesktop)");
 
 		cfgManagement.addConfByKey(3, "allow_frontend_register",
-				allowfrontendRegister, null, "");
+				cfg.allowFrontendRegister, null, "");
 
 		cfgManagement.addConfByKey(3, "default_group_id", "1", null, "");
 
@@ -281,22 +266,22 @@ public class ImportInitvalues {
 		cfgManagement.addConfByKey(3, "default_domain_id", "1", null, "");
 
 		// "smtp.xmlcrm.org"
-		cfgManagement.addConfByKey(3, "smtp_server", smtpServer, null,
+		cfgManagement.addConfByKey(3, "smtp_server", cfg.smtpServer, null,
 				"this is the smtp server to send messages");
 		// 25
-		cfgManagement.addConfByKey(3, "smtp_port", smtpPort, null,
+		cfgManagement.addConfByKey(3, "smtp_port", cfg.smtpPort, null,
 				"this is the smtp server port normally 25");
 		// "openmeetings@xmlcrm.org"
-		cfgManagement.addConfByKey(3, "system_email_addr", referer, null,
+		cfgManagement.addConfByKey(3, "system_email_addr", cfg.mailReferer, null,
 				"all send EMails by the system will have this address");
 		// "openmeetings@xmlcrm.org"
-		cfgManagement.addConfByKey(3, "email_username", mailauthname, null,
+		cfgManagement.addConfByKey(3, "email_username", cfg.mailAuthName, null,
 				"System auth email username");
 		//
-		cfgManagement.addConfByKey(3, "email_userpass", mailauthpass, null,
+		cfgManagement.addConfByKey(3, "email_userpass", cfg.mailAuthPass, null,
 				"System auth email password");
 
-		cfgManagement.addConfByKey(3, "mail.smtp.starttls.enable", mailusetls,
+		cfgManagement.addConfByKey(3, "mail.smtp.starttls.enable", cfg.mailUseTls,
 				null, "Enable TLS 1=true, 0=false");
 
 		cfgManagement.addConfByKey(3, "application.name",
@@ -304,28 +289,28 @@ public class ImportInitvalues {
 				"Name of the Browser Title window");
 
 		// "1" == "EN"
-		cfgManagement.addConfByKey(3, "default_lang_id", default_lang_id, null,
+		cfgManagement.addConfByKey(3, "default_lang_id", cfg.defaultLangId, null,
 				"Default System Language ID see language.xml");
 
-		cfgManagement.addConfByKey(3, "swftools_path", swf_path, null,
+		cfgManagement.addConfByKey(3, "swftools_path", cfg.swfPath, null,
 				"Path To SWF-Tools");
 
-		cfgManagement.addConfByKey(3, "imagemagick_path", im_path, null,
+		cfgManagement.addConfByKey(3, "imagemagick_path", cfg.imageMagicPath, null,
 				"Path to ImageMagick tools");
 
-		cfgManagement.addConfByKey(3, "sox_path", sox_path, null,
+		cfgManagement.addConfByKey(3, "sox_path", cfg.soxPath, null,
 				"Path To SoX-Tools");
 
-		cfgManagement.addConfByKey(3, "ffmpeg_path", ffmpeg_path, null,
+		cfgManagement.addConfByKey(3, "ffmpeg_path", cfg.ffmpegPath, null,
 				"Path To FFMPEG");
 
-		cfgManagement.addConfByKey(3, "rss_feed1", url_feed, null, "Feed URL");
+		cfgManagement.addConfByKey(3, "rss_feed1", cfg.urlFeed, null, "Feed URL");
 
-		cfgManagement.addConfByKey(3, "rss_feed2", url_feed2, null,
+		cfgManagement.addConfByKey(3, "rss_feed2", cfg.urlFeed2, null,
 				"Feed URL 2");
 
 		cfgManagement
-				.addConfByKey(3, "sendEmailAtRegister", sendEmailAtRegister,
+				.addConfByKey(3, "sendEmailAtRegister", cfg.sendEmailAtRegister,
 						null,
 						"User get a EMail with their Account data. Values: 0(No) or 1(Yes)");
 
@@ -333,7 +318,7 @@ public class ImportInitvalues {
 				.addConfByKey(
 						3,
 						"sendEmailWithVerficationCode",
-						sendEmailWithVerficationCode,
+						cfg.sendEmailWithVerficationCode,
 						null,
 						"User must activate their account by clicking on the "
 								+ "activation-link in the registering Email. Values: 0(No) or 1(Yes) "
@@ -344,7 +329,7 @@ public class ImportInitvalues {
 				.addConfByKey(
 						3,
 						"default_export_font",
-						default_export_font,
+						cfg.defaultExportFont,
 						null,
 						"The Name of the Font used for exporting/render Images from Whiteboard"
 								+ "The Font has to exist on the Server which runs Red5");
@@ -357,11 +342,11 @@ public class ImportInitvalues {
         // red5SIP Integration Coniguration Values
         // ***************************************
 
-        cfgManagement.addConfByKey(3, "red5sip.enable", red5sip_enable, null,
+        cfgManagement.addConfByKey(3, "red5sip.enable", cfg.red5SipEnable, null,
 				"Enable to enable the red5SIP integration ");
-        cfgManagement.addConfByKey(3, "red5sip.room_prefix", red5sip_room_prefix, null,
+        cfgManagement.addConfByKey(3, "red5sip.room_prefix", cfg.red5SipRoomPrefix, null,
 				"Enable to enable the red5SIP integration ");
-        cfgManagement.addConfByKey(3, "red5sip.exten_context", red5sip_exten_context, null,
+        cfgManagement.addConfByKey(3, "red5sip.exten_context", cfg.red5SipExtenContext, null,
 				"Enable to enable the red5SIP integration ");
 
 		// ***************************************
@@ -369,26 +354,26 @@ public class ImportInitvalues {
 		// SIP Applet Configuration Values
 		// ***************************************
 
-		cfgManagement.addConfByKey(3, "sip.enable", sip_enable, null,
+		cfgManagement.addConfByKey(3, "sip.enable", cfg.sipEnable, null,
 				"Enable to load the SIP Applet in the Client and "
 						+ "call the SIP Applet whenever you enter a Room");
 
-		cfgManagement.addConfByKey(3, "sip.realm", sip_realm, null,
+		cfgManagement.addConfByKey(3, "sip.realm", cfg.sipRealm, null,
 				"So called *Domain of the SIP Provider*");
 
-		cfgManagement.addConfByKey(3, "sip.port", sip_port, null, "SIP Port");
+		cfgManagement.addConfByKey(3, "sip.port", cfg.sipPort, null, "SIP Port");
 
-		cfgManagement.addConfByKey(3, "sip.proxyname", sip_proxyname, null,
+		cfgManagement.addConfByKey(3, "sip.proxyname", cfg.sipProxyName, null,
 				"SIP Proxy name (this is the outbound proxy)");
 
 		cfgManagement
-				.addConfByKey(3, "sip.tunnel", sip_tunnel, null,
+				.addConfByKey(3, "sip.tunnel", cfg.sipTunnel, null,
 						"SIP Tunnel IP + Port, format domain:port, for example 10.0.0.0:443");
 
-		cfgManagement.addConfByKey(3, "sip.codebase", sip_codebase, null,
+		cfgManagement.addConfByKey(3, "sip.codebase", cfg.sipCodebase, null,
 				"The Base-URL to load the Ringtone from");
 
-		cfgManagement.addConfByKey(3, "sip.forcetunnel", sip_forcetunnel, null,
+		cfgManagement.addConfByKey(3, "sip.forcetunnel", cfg.sipForceTunnel, null,
 				"Force usage of the tunnel");
 
 		// ***************************************
@@ -396,7 +381,7 @@ public class ImportInitvalues {
 		// OpenXG Configuration Values
 		// ***************************************
 
-		cfgManagement.addConfByKey(3, "sip.openxg.enable", sip_openxg_enable,
+		cfgManagement.addConfByKey(3, "sip.openxg.enable", cfg.sipOpenxgEnable,
 				null,
 				"Enable the OpenXG XML-RPC Gateway through the Wrapper URL");
 
@@ -404,28 +389,28 @@ public class ImportInitvalues {
 				.addConfByKey(
 						3,
 						"openxg.wrapper.url",
-						openxg_wrapper_url,
+						cfg.openxgWrapperUrl,
 						null,
 						"openxg_wrapper_url, null, OpenXG XML-RPC Wrapper URL, the Wrapper can only "
 								+ "be located on 127.0.01 by default, "
 								+ "for example http://127.0.0.1:5080/rpc_client/rpc_gateway_wrapper.php");
 
-		cfgManagement.addConfByKey(3, "openxg.client.id", openxg_client_id,
+		cfgManagement.addConfByKey(3, "openxg.client.id", cfg.openxgClientId,
 				null, "OpenXG XML-RPC Client ID");
 
 		cfgManagement.addConfByKey(3, "openxg.client.secret",
-				openxg_client_secret, null, "OpenXG XML-RPC Client Secret");
+				cfg.openxgClientSecret, null, "OpenXG XML-RPC Client Secret");
 
 		cfgManagement.addConfByKey(3, "openxg.client.domain",
-				openxg_client_domain, null, "OpenXG Domain");
+				cfg.openxgClientDomain, null, "OpenXG Domain");
 
 		cfgManagement.addConfByKey(3, "openxg.community.code",
-				openxg_community_code, null, "OpenXG Community Code");
+				cfg.openxgCommunityCode, null, "OpenXG Community Code");
 
 		cfgManagement.addConfByKey(3, "openxg.language.code",
-				openxg_language_code, null, "OpenXG Language Code");
+				cfg.openxgLanguageCode, null, "OpenXG Language Code");
 
-		cfgManagement.addConfByKey(3, "openxg.adminid", openxg_adminid, null,
+		cfgManagement.addConfByKey(3, "openxg.adminid", cfg.openxgAdminId, null,
 				"OpenXG Admin ID");
 
 		// ***************************************
@@ -434,14 +419,14 @@ public class ImportInitvalues {
 		// ***************************************
 
 		cfgManagement.addConfByKey(3, "sip.language.phonecode",
-				sip_language_phonecode, null, "For example +358 for Finland");
+				cfg.sipLanguagePhoneCode, null, "For example +358 for Finland");
 
 		cfgManagement
-				.addConfByKey(3, "sip.phonerange.start", sip_phonerange_start,
+				.addConfByKey(3, "sip.phonerange.start", cfg.sipPhoneRangeStart,
 						null,
 						"The first number in the Range of Phone Numbers in national format");
 
-		cfgManagement.addConfByKey(3, "sip.phonerange", sip_phonerange, null,
+		cfgManagement.addConfByKey(3, "sip.phonerange", cfg.sipPhoneRange, null,
 				"Amount of numbers in the Phone Range available");
 
 		cfgManagement.addConfByKey(3, "sip.phonerange.currentindex", "" + 0,
@@ -517,10 +502,10 @@ public class ImportInitvalues {
 						null,
 						"The number of minutes before reminder emails are send. Set to 0 to disable reminder emails");
 
-		cfgManagement.addConfByKey(3, "user.login.minimum.length", "4", null,
+		cfgManagement.addConfByKey(3, "user.login.minimum.length", "" + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH, null,
 				"Number of chars needed in a user login");
 
-		cfgManagement.addConfByKey(3, "user.pass.minimum.length", "4", null,
+		cfgManagement.addConfByKey(3, "user.pass.minimum.length", "" + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH, null,
 				"Number of chars needed in a user login");
 
 		cfgManagement
@@ -549,7 +534,7 @@ public class ImportInitvalues {
 				.addConfByKey(
 						3,
 						"jod.path",
-						jodPath,
+						cfg.jodPath,
 						null,
 						"The path to JOD library (http://code.google.com/p/jodconverter), configure the path to point to the lib directory of JOD that contains also the jodconverter-core-version.jar");
 
@@ -561,6 +546,7 @@ public class ImportInitvalues {
 						null,
 						"Ldap domain selected by default in the login screen");
 		
+		log.debug("Configuration ADDED");
 	}
 
 	public void loadDefaultRooms(boolean createRooms) {
@@ -731,35 +717,29 @@ public class ImportInitvalues {
 	 * @throws Exception
 	 */
 	private void loadCountriesFiles(String filePath) throws Exception {
-
 		SAXReader reader = new SAXReader();
-		Document document = reader.read(filePath
-				+ ImportInitvalues.nameOfCountriesFile);
+		Document document = reader.read(new File(filePath, ImportInitvalues.nameOfCountriesFile));
 
 		Element root = document.getRootElement();
 
 		for (@SuppressWarnings("rawtypes")
 		Iterator it = root.elementIterator("country"); it.hasNext();) {
-
 			Element item = (Element) it.next();
 			String country = item.attributeValue("name");
 
 			statemanagement.addState(country);
-
 		}
+		log.debug("Countries ADDED");
 	}
 
 	private void loadTimeZoneFiles(String filePath) throws Exception {
-
 		SAXReader reader = new SAXReader();
-		Document document = reader.read(filePath
-				+ ImportInitvalues.nameOfTimeZoneFile);
+		Document document = reader.read(new File(filePath, ImportInitvalues.nameOfTimeZoneFile));
 
 		Element root = document.getRootElement();
 
 		for (@SuppressWarnings("rawtypes")
 		Iterator it = root.elementIterator("timezone"); it.hasNext();) {
-
 			Element item = (Element) it.next();
 			String timeZoneName = item.attributeValue("name");
 			String timeZoneLabel = item.attributeValue("label");
@@ -768,12 +748,11 @@ public class ImportInitvalues {
 
 			omTimeZoneDaoImpl.addOmTimeZone(timeZoneName, timeZoneLabel, iCal,
 					orderId);
-
 		}
+		log.debug("TimeZones ADDED");
 	}
 
 	public List<OmTimeZone> getTimeZones(String filePath) throws Exception {
-
 		log.debug(":: getTimeZones ::");
 
 		List<OmTimeZone> omTimeZones = new LinkedList<OmTimeZone>();
@@ -786,7 +765,6 @@ public class ImportInitvalues {
 
 		for (@SuppressWarnings("rawtypes")
 		Iterator it = root.elementIterator("timezone"); it.hasNext();) {
-
 			Element item = (Element) it.next();
 			String timeZoneName = item.attributeValue("name");
 			String timeZoneLabel = item.attributeValue("label");
@@ -798,11 +776,9 @@ public class ImportInitvalues {
 			omTimeZone.setOrderId(orderId);
 
 			omTimeZones.add(omTimeZone);
-
 		}
-
+		
 		return omTimeZones;
-
 	}
 
 	/**
@@ -819,14 +795,12 @@ public class ImportInitvalues {
 		LinkedHashMap<Integer, LinkedHashMap<String, Object>> languages = new LinkedHashMap<Integer, LinkedHashMap<String, Object>>();
 
 		SAXReader reader = new SAXReader();
-		Document document = reader.read(filePath
-				+ ImportInitvalues.nameOfLanguageFile);
+		Document document = reader.read(new File(filePath, ImportInitvalues.nameOfLanguageFile));
 
 		Element root = document.getRootElement();
 
 		for (@SuppressWarnings("unchecked")
 		Iterator<Element> it = root.elementIterator("lang"); it.hasNext();) {
-
 			Element item = it.next();
 			String country = item.getText();
 			Integer id = Integer.valueOf(item.attribute("id").getValue())
@@ -842,11 +816,9 @@ public class ImportInitvalues {
 			lang.put("code", code);
 			// log.error("getLanguageFiles "+country);
 			languages.put(id, lang);
-
 		}
 		log.debug("Languages ADDED ");
 		return languages;
-
 	}
 
 	/**
@@ -898,9 +870,9 @@ public class ImportInitvalues {
 	// ------------------------------------------------------------------------------
 	public void loadInitLanguages(String filePath) throws Exception {
 
-		this.loadCountriesFiles(filePath);
+		loadCountriesFiles(filePath);
 
-		this.loadTimeZoneFiles(filePath);
+		loadTimeZoneFiles(filePath);
 
 		LinkedHashMap<Integer, LinkedHashMap<String, Object>> listlanguages = this
 				.getLanguageFiles(filePath);
@@ -918,7 +890,7 @@ public class ImportInitvalues {
 			String rtl = (String) lang.get("rtl");
 			String code = (String) lang.get("code");
 
-			System.out.println("loadInitLanguages rtl from xml: " + rtl);
+			log.debug("loadInitLanguages rtl from xml: " + rtl);
 
 			Boolean langRtl = false;
 
@@ -929,7 +901,7 @@ public class ImportInitvalues {
 					langRtl, code);
 
 			SAXReader reader = new SAXReader();
-			Document document = reader.read(filePath + langName + ".xml");
+			Document document = reader.read(new File(filePath, langName + ".xml"));
 
 			Element root = document.getRootElement();
 
@@ -978,4 +950,24 @@ public class ImportInitvalues {
 	}
 	// ------------------------------------------------------------------------------
 
+	public void loadAll(String filePath, InstallationConfig cfg, String username,
+			String userpass, String useremail, String groupame, String timeZone) throws Exception {
+		loadMainMenu();
+		loadErrorMappingsFromXML(filePath);
+		loadInitLanguages(filePath);
+		loadSalutations();
+		// AppointMent Categories
+		loadInitAppointmentCategories();
+		// Appointment Remindertypes
+		loadInitAppointmentReminderTypes();
+		// Appointment poll types
+		loadPollTypes();
+
+		loadConfiguration(cfg);
+		
+		loadInitUserAndOrganisation(username,
+				userpass, useremail, groupame, timeZone, cfg.defaultLangId);
+		
+		loadDefaultRooms("1".equals(cfg.createDefaultRooms));
+	}
 }

Added: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/InstallationConfig.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/InstallationConfig.java?rev=1310263&view=auto
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/InstallationConfig.java (added)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/installation/InstallationConfig.java Fri Apr  6 09:38:50 2012
@@ -0,0 +1,88 @@
+package org.openmeetings.app.installation;
+
+import org.openmeetings.utils.crypt.MD5Implementation;
+
+public class InstallationConfig {
+	public static final int USER_LOGIN_MINIMUM_LENGTH = 4;
+	public static final int USER_PASSWORD_MINIMUM_LENGTH = 4;
+	public String allowFrontendRegister = "1";
+	public String createDefaultRooms = "1";
+	
+	public String cryptClassName = MD5Implementation.class.getCanonicalName();
+	//email
+	public String smtpPort = "25";
+	public String smtpServer = "localhost";
+	public String mailAuthName = "xyz";
+	public String mailAuthPass = "qwertz";
+	public String mailReferer = "noreply@openmeetings.apache.org";
+	public String mailUseTls = "0";
+	//paths
+	public String swfPath = "";
+	public String imageMagicPath = "";
+	public String ffmpegPath = "";
+	public String soxPath = "";
+	public String jodPath = "./jod/lib";
+	
+	public String defaultLangId = "1";
+	public String sendEmailAtRegister = "0";
+	public String urlFeed = "http://groups.google.com/group/openmeetings-user/feed/atom_v1_0_msgs.xml";
+	public String urlFeed2 = "http://groups.google.com/group/openmeetings-dev/feed/atom_v1_0_msgs.xml";
+	public String sendEmailWithVerficationCode = "0";
+	public String defaultExportFont = "TimesNewRoman";
+	public String screenViewer = "4";
+	public String sipEnable = "0";
+	public String sipProxyName = "";
+	public String sipPort = "";
+	public String sipTunnel = "";
+	public String sipRealm = "";
+	public String sipOpenxgEnable = "0";
+	public String sipForceTunnel = "";
+	public String sipCodebase = "";
+	public String openxgClientSecret = "";
+	public String openxgWrapperUrl = "";
+	public String openxgClientId = "";
+	public String openxgClientDomain = "";
+	public String openxgCommunityCode = "";
+	public String openxgLanguageCode = "";
+	public String openxgAdminId = "";
+	public String sipLanguagePhoneCode = "";
+	public String sipPhoneRangeStart = "";
+	public String sipPhoneRange = "";
+    public String red5SipEnable = "no";
+    public String red5SipRoomPrefix = "400";
+    public String red5SipExtenContext = "rooms";
+
+    @Override
+	public String toString() {
+		return "InstallationConfig [allowFrontendRegister="
+				+ allowFrontendRegister + ", createDefaultRooms="
+				+ createDefaultRooms + ", cryptClassName=" + cryptClassName
+				+ ", smtpPort=" + smtpPort + ", smtpServer=" + smtpServer
+				+ ", mailAuthName=" + mailAuthName + ", mailAuthPass="
+				+ mailAuthPass + ", mailReferer=" + mailReferer
+				+ ", mailUseTls=" + mailUseTls + ", swfPath=" + swfPath
+				+ ", imageMagicPath=" + imageMagicPath + ", ffmpegPath="
+				+ ffmpegPath + ", soxPath=" + soxPath + ", jodPath=" + jodPath
+				+ ", defaultLangId=" + defaultLangId + ", sendEmailAtRegister="
+				+ sendEmailAtRegister + ", urlFeed=" + urlFeed + ", urlFeed2="
+				+ urlFeed2 + ", sendEmailWithVerficationCode="
+				+ sendEmailWithVerficationCode + ", defaultExportFont="
+				+ defaultExportFont + ", screenViewer=" + screenViewer
+				+ ", sipEnable=" + sipEnable + ", sipProxyName=" + sipProxyName
+				+ ", sipPort=" + sipPort + ", sipTunnel=" + sipTunnel
+				+ ", sipRealm=" + sipRealm + ", sipOpenxgEnable="
+				+ sipOpenxgEnable + ", sipForceTunnel=" + sipForceTunnel
+				+ ", sipCodebase=" + sipCodebase + ", openxgClientSecret="
+				+ openxgClientSecret + ", openxgWrapperUrl=" + openxgWrapperUrl
+				+ ", openxgClientId=" + openxgClientId
+				+ ", openxgClientDomain=" + openxgClientDomain
+				+ ", openxgCommunityCode=" + openxgCommunityCode
+				+ ", openxgLanguageCode=" + openxgLanguageCode
+				+ ", openxgAdminId=" + openxgAdminId
+				+ ", sipLanguagePhoneCode=" + sipLanguagePhoneCode
+				+ ", sipPhoneRangeStart=" + sipPhoneRangeStart
+				+ ", sipPhoneRange=" + sipPhoneRange + ", red5SipEnable="
+				+ red5SipEnable + ", red5SipRoomPrefix=" + red5SipRoomPrefix
+				+ ", red5SipExtenContext=" + red5SipExtenContext + "]";
+	}
+}

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/AsteriskSipUsers.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/AsteriskSipUsers.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/AsteriskSipUsers.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/AsteriskSipUsers.java Fri Apr  6 09:38:50 2012
@@ -18,14 +18,21 @@
  */
 package org.openmeetings.app.persistence.beans.sip.asterisk;
 
-import javax.persistence.*;
 import java.io.Serializable;
 
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
 @Entity
 @Table(name = "sipusers")
 public class AsteriskSipUsers implements Serializable {
+	private static final long serialVersionUID = -565831761546365623L;
 
-    @Id
+	@Id
     @Column(name = "id")
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private int id;

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/Extensions.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/Extensions.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/Extensions.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/Extensions.java Fri Apr  6 09:38:50 2012
@@ -18,13 +18,21 @@
  */
 package org.openmeetings.app.persistence.beans.sip.asterisk;
 
-import javax.persistence.*;
 import java.io.Serializable;
 
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
 @Entity
 @Table(name = "extensions")
 public class Extensions implements Serializable {
-    @Id
+	private static final long serialVersionUID = -2669622904594408644L;
+
+	@Id
     @Column(name = "id")
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     Integer id;

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/MeetMe.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/MeetMe.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/MeetMe.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/persistence/beans/sip/asterisk/MeetMe.java Fri Apr  6 09:38:50 2012
@@ -18,17 +18,18 @@
  */
 package org.openmeetings.app.persistence.beans.sip.asterisk;
 
+import java.io.Serializable;
+
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
 import javax.persistence.Table;
-import java.io.Serializable;
 
 @Entity
 @Table(name = "meetme")
 public class MeetMe implements Serializable {
-
-    @Id
+	private static final long serialVersionUID = 2789529517142208489L;
+	@Id
     @Column(name = "confno", nullable = false)
     String confno = "0";
     @Column(name = "pin")

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java Fri Apr  6 09:38:50 2012
@@ -2989,7 +2989,7 @@ public class ScopeApplicationAdapter ext
         Rooms rooms = roommanagement.getRoomById(currentClient.getRoom_id());
         log.debug("asterisk -rx \"originate Local/" + number + "@rooms extension " + rooms.getSipNumber() + "@rooms\"");
         try {
-            Process proc = Runtime.getRuntime().exec(new String[]{"asterisk", "-rx", "originate Local/" + number + "@rooms extension " + rooms.getSipNumber() + "@rooms"});
+            Runtime.getRuntime().exec(new String[]{"asterisk", "-rx", "originate Local/" + number + "@rooms extension " + rooms.getSipNumber() + "@rooms"});
         } catch (IOException e) {
             log.error("Executing asterisk originate error: ", e);
         }
@@ -3007,7 +3007,6 @@ public class ScopeApplicationAdapter ext
     public synchronized void setSipTransport(Long room_id, String publicSID, String broadCastId) {
         IConnection current = Red5.getConnectionLocal();
         String streamid = current.getClient().getId();
-        Rooms room = roommanagement.getRoomById(room_id);
         // Notify all clients of the same scope (room)
         RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
         currentClient.setRoom_id(room_id);

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/AsteriskDbSipClient.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/AsteriskDbSipClient.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/AsteriskDbSipClient.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/AsteriskDbSipClient.java Fri Apr  6 09:38:50 2012
@@ -18,7 +18,6 @@
  */
 package org.openmeetings.app.sip.api.impl.asterisk;
 
-import org.openmeetings.app.persistence.beans.rooms.Rooms;
 import org.openmeetings.app.persistence.beans.user.UserSipData;
 import org.openmeetings.app.sip.api.ISIPClient;
 import org.openmeetings.app.sip.api.impl.asterisk.dao.AsteriskDAOImpl;

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/dao/AsteriskDAOImpl.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/dao/AsteriskDAOImpl.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/dao/AsteriskDAOImpl.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/sip/api/impl/asterisk/dao/AsteriskDAOImpl.java Fri Apr  6 09:38:50 2012
@@ -18,20 +18,19 @@
  */
 package org.openmeetings.app.sip.api.impl.asterisk.dao;
 
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
 import org.openmeetings.app.OpenmeetingsVariables;
 import org.openmeetings.app.data.basic.Configurationmanagement;
 import org.openmeetings.app.persistence.beans.basic.Configuration;
 import org.openmeetings.app.persistence.beans.sip.asterisk.AsteriskSipUsers;
 import org.openmeetings.app.persistence.beans.sip.asterisk.Extensions;
 import org.openmeetings.app.persistence.beans.sip.asterisk.MeetMe;
-import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.beans.factory.annotation.Autowired;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
+import org.springframework.transaction.annotation.Transactional;
 
 @Transactional
 public class AsteriskDAOImpl {
@@ -62,6 +61,7 @@ public class AsteriskDAOImpl {
         e.setPriority(1);
         em.persist(u);
         em.persist(e);
+        log.debug("addSipUser successfull");
     }
 
     public String addMeetMeConference() {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/VirtualScreen.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/VirtualScreen.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/VirtualScreen.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/VirtualScreen.java Fri Apr  6 09:38:50 2012
@@ -298,9 +298,6 @@ public class VirtualScreen {
 		VirtualScreenBean.vScreenResizeX = css.jVScreenWidthSpin.getValue();
 		VirtualScreenBean.vScreenResizeY = css.jVScreenHeightSpin.getValue();
 		switch (VirtualScreenBean.screenQuality) {
-			case VeryHigh:
-			case High:
-				break;
 			case Medium:
 				VirtualScreenBean.vScreenResizeX = (int)(1.0/2 * VirtualScreenBean.vScreenResizeX);
 				VirtualScreenBean.vScreenResizeY = (int)(1.0/2 * VirtualScreenBean.vScreenResizeY);
@@ -309,6 +306,10 @@ public class VirtualScreen {
 				VirtualScreenBean.vScreenResizeX = (int)(3.0/8 * VirtualScreenBean.vScreenResizeX);
 				VirtualScreenBean.vScreenResizeY = (int)(3.0/8 * VirtualScreenBean.vScreenResizeY);
 				break;
+			case VeryHigh:
+			case High:
+			default:
+				break;
 		}
 		logger.debug("resize: X:" + VirtualScreenBean.vScreenResizeX + " Y: " + VirtualScreenBean.vScreenResizeY);
 		updateVScreenBounds();

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/Install.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/Install.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/Install.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/Install.java Fri Apr  6 09:38:50 2012
@@ -34,6 +34,7 @@ import org.openmeetings.app.Openmeetings
 import org.openmeetings.app.data.basic.Configurationmanagement;
 import org.openmeetings.app.documents.InstallationDocumentHandler;
 import org.openmeetings.app.installation.ImportInitvalues;
+import org.openmeetings.app.installation.InstallationConfig;
 import org.openmeetings.app.persistence.beans.basic.OmTimeZone;
 import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
 import org.red5.logging.Red5LoggerFactory;
@@ -241,159 +242,122 @@ public class Install extends VelocityVie
 					String useremail = httpServletRequest
 							.getParameter("useremail");
 					String orgname = httpServletRequest.getParameter("orgname");
-					String configdefault = httpServletRequest
+					InstallationConfig cfg = new InstallationConfig();
+					cfg.allowFrontendRegister = httpServletRequest
 							.getParameter("configdefault");
 
-					String configreferer = httpServletRequest
+					cfg.mailReferer = httpServletRequest
 							.getParameter("configreferer");
-					String configsmtp = httpServletRequest
+					cfg.smtpServer = httpServletRequest
 							.getParameter("configsmtp");
-					String configsmtpport = httpServletRequest
+					cfg.smtpPort = httpServletRequest
 							.getParameter("configsmtpport");
-					String configmailuser = httpServletRequest
+					cfg.mailAuthName = httpServletRequest
 							.getParameter("configmailuser");
-					String configmailpass = httpServletRequest
+					cfg.mailAuthPass = httpServletRequest
 							.getParameter("configmailpass");
-					String mailusetls = httpServletRequest
+					cfg.mailUseTls = httpServletRequest
 							.getParameter("mailusetls");
 
-					String configdefaultLang = httpServletRequest
+					cfg.defaultLangId = httpServletRequest
 							.getParameter("configdefaultLang");
-					String swf_path = httpServletRequest
+					cfg.swfPath = httpServletRequest
 							.getParameter("swftools_path");
-					String im_path = httpServletRequest
+					cfg.imageMagicPath = httpServletRequest
 							.getParameter("imagemagick_path");
-					String sendEmailAtRegister = httpServletRequest
+					cfg.sendEmailAtRegister = httpServletRequest
 							.getParameter("sendEmailAtRegister");
-					String sendEmailWithVerficationCode = httpServletRequest
+					cfg.sendEmailWithVerficationCode = httpServletRequest
 							.getParameter("sendEmailWithVerficationCode");
-					String createDefaultRooms = httpServletRequest
+					cfg.createDefaultRooms = httpServletRequest
 							.getParameter("createDefaultRooms");
 
-					String default_export_font = httpServletRequest
+					cfg.defaultExportFont = httpServletRequest
 							.getParameter("default_export_font");
 
-					String crypt_ClassName = httpServletRequest
+					cfg.cryptClassName = httpServletRequest
 							.getParameter("crypt_ClassName");
 
-					String ffmpeg_path = httpServletRequest
+					cfg.ffmpegPath = httpServletRequest
 							.getParameter("ffmpeg_path");
 
-					String sox_path = httpServletRequest
+					cfg.soxPath = httpServletRequest
 							.getParameter("sox_path");
 
-					String screen_viewer = httpServletRequest
+					cfg.screenViewer = httpServletRequest
 							.getParameter("screen_viewer");
 
                     // red5sip integration config
-                    String red5sip_enable = httpServletRequest
+                    cfg.red5SipEnable = httpServletRequest
 							.getParameter("red5sip_enable");
-                    String red5sip_room_prefix = httpServletRequest
+                    cfg.red5SipRoomPrefix = httpServletRequest
 							.getParameter("red5sip_room_prefix");
-                    String red5sip_exten_context = httpServletRequest
+                    cfg.red5SipExtenContext = httpServletRequest
 							.getParameter("red5sip_exten_context");
 
 					// SIP Applet Configuration
-					String sip_enable = httpServletRequest
+					cfg.sipEnable = httpServletRequest
 							.getParameter("sip_enable");
-					String sip_realm = httpServletRequest
+					cfg.sipRealm = httpServletRequest
 							.getParameter("sip_realm");
-					String sip_port = httpServletRequest
+					cfg.sipPort = httpServletRequest
 							.getParameter("sip_port");
-					String sip_proxyname = httpServletRequest
+					cfg.sipProxyName = httpServletRequest
 							.getParameter("sip_proxyname");
-					String sip_tunnel = httpServletRequest
+					cfg.sipTunnel = httpServletRequest
 							.getParameter("sip_tunnel");
-					String sip_codebase = httpServletRequest
+					cfg.sipCodebase = httpServletRequest
 							.getParameter("sip_codebase");
-					String sip_forcetunnel = httpServletRequest
+					cfg.sipForceTunnel = httpServletRequest
 							.getParameter("sip_forcetunnel");
 
 					// OpenXG / OpenSIPg Configuration
-					String sip_openxg_enable = httpServletRequest
+					cfg.sipOpenxgEnable = httpServletRequest
 							.getParameter("sip_openxg_enable");
-					String openxg_wrapper_url = httpServletRequest
+					cfg.openxgWrapperUrl = httpServletRequest
 							.getParameter("openxg_wrapper_url");
-					String openxg_client_id = httpServletRequest
+					cfg.openxgClientId = httpServletRequest
 							.getParameter("openxg_client_id");
-					String openxg_client_secret = httpServletRequest
+					cfg.openxgClientSecret = httpServletRequest
 							.getParameter("openxg_client_secret");
-					String openxg_client_domain = httpServletRequest
+					cfg.openxgClientDomain = httpServletRequest
 							.getParameter("openxg_client_domain");
-					String openxg_community_code = httpServletRequest
+					cfg.openxgCommunityCode = httpServletRequest
 							.getParameter("openxg_community_code");
-					String openxg_language_code = httpServletRequest
+					cfg.openxgLanguageCode = httpServletRequest
 							.getParameter("openxg_language_code");
-					String openxg_adminid = httpServletRequest
+					cfg.openxgAdminId = httpServletRequest
 							.getParameter("openxg_adminid");
 
 					// SIP Phone Range Configuration
-					String sip_language_phonecode = httpServletRequest
+					cfg.sipLanguagePhoneCode = httpServletRequest
 							.getParameter("sip_language_phonecode");
-					String sip_phonerange_start = httpServletRequest
+					cfg.sipPhoneRangeStart = httpServletRequest
 							.getParameter("sip_phonerange_start");
-					String sip_phonerange = httpServletRequest
+					cfg.sipPhoneRange = httpServletRequest
 							.getParameter("sip_phonerange");
 
 					String timeZone = httpServletRequest
 							.getParameter("timeZone");
 					
-					String jodPath = httpServletRequest
+					cfg.jodPath = httpServletRequest
 							.getParameter("jod_path");
 
 					log.debug("step 0+ start init with values. " + username
 							+ " ***** " + useremail + " " + orgname + " "
-							+ configdefault + " " + configreferer + " "
-							+ configsmtp + " " + configmailuser + " "
-							+ configmailpass + " " + configdefaultLang + " "
-							+ swf_path + " " + im_path + " " + screen_viewer);
+							+ cfg);
 
 					String filePath = getServletContext().getRealPath("/")
 							+ ImportInitvalues.languageFolderName;
 
-					String url_feed = getServletContext().getInitParameter(
+					cfg.urlFeed = getServletContext().getInitParameter(
 							"url_feed");
-					String url_feed2 = getServletContext().getInitParameter(
+					cfg.urlFeed2 = getServletContext().getInitParameter(
 							"url_feed2");
-					getImportInitvalues().loadInitLanguages(filePath);
-
-					getImportInitvalues().loadMainMenu();
-
-					getImportInitvalues().loadErrorMappingsFromXML(filePath);
-
-					getImportInitvalues().loadSalutations();
-
-					getImportInitvalues().loadConfiguration(crypt_ClassName,
-							configdefault, configsmtp, configsmtpport,
-							configreferer, configmailuser, configmailpass,
-							mailusetls, configdefaultLang, swf_path, im_path,
-							url_feed, url_feed2, sendEmailAtRegister,
-							sendEmailWithVerficationCode, default_export_font,
-							screen_viewer, ffmpeg_path, sox_path, sip_enable,
-							sip_realm, sip_port, sip_proxyname, sip_tunnel,
-							sip_codebase, sip_forcetunnel, sip_openxg_enable,
-							openxg_wrapper_url, openxg_client_id,
-							openxg_client_secret, openxg_client_domain,
-							openxg_community_code, openxg_language_code,
-							openxg_adminid, sip_language_phonecode,
-							sip_phonerange_start, sip_phonerange,
-							jodPath,
-                            red5sip_enable, red5sip_room_prefix, red5sip_exten_context);
-
-					getImportInitvalues().loadInitUserAndOrganisation(username,
-							userpass, useremail, orgname, timeZone, configdefaultLang);
-
-					getImportInitvalues().loadDefaultRooms("1".equals(createDefaultRooms));
-
-					// AppointMent Categories
-					getImportInitvalues().loadInitAppointmentCategories();
-
-					// Appointment Remindertypes
-					getImportInitvalues().loadInitAppointmentReminderTypes();
-
-					// Appointment poll types
-					getImportInitvalues().loadPollTypes();
 					
+					getImportInitvalues().loadAll(filePath, cfg, username,
+							userpass, useremail, orgname, timeZone);
+
 					// update to next step
 					log.debug("add level to install file");
 					InstallationDocumentHandler

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/test/AbstractOpenmeetingsSpringTest.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/test/AbstractOpenmeetingsSpringTest.java?rev=1310263&r1=1310262&r2=1310263&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/test/AbstractOpenmeetingsSpringTest.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/test/AbstractOpenmeetingsSpringTest.java Fri Apr  6 09:38:50 2012
@@ -21,6 +21,7 @@ package org.openmeetings.test;
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertTrue;
 
+import java.io.File;
 import java.util.Date;
 
 import org.junit.Before;
@@ -29,6 +30,7 @@ import org.openmeetings.app.data.calenda
 import org.openmeetings.app.data.user.Usermanagement;
 import org.openmeetings.app.data.user.dao.UsersDaoImpl;
 import org.openmeetings.app.installation.ImportInitvalues;
+import org.openmeetings.app.installation.InstallationConfig;
 import org.openmeetings.app.persistence.beans.calendar.Appointment;
 import org.openmeetings.app.persistence.beans.user.Users;
 import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
@@ -46,53 +48,11 @@ import org.springframework.test.context.
 public abstract class AbstractOpenmeetingsSpringTest extends AbstractJUnit4SpringContextTests {
 	private static final Logger log = Red5LoggerFactory.getLogger(AbstractOpenmeetingsSpringTest.class);
 	
-	private static final String crypt_ClassName = "org.openmeetings.utils.crypt.MD5Implementation";
-	private static final String configsmtpport = "25";
-	private static final String configsmtp = "localhost";
-	private static final String configmailuser = "xyz";
-	private static final String configdefault = "";
-	private static final String configmailpass = "qwertz";
-	private static final String configreferer = "noreply@openmeetings.de";
-	private static final String swf_path = "";
-	private static final String im_path = "";
-	private static final String configdefaultLang = "1";
-	private static final String mailusetls = "0";
-	private static final String sendEmailAtRegister = "0";
-	private static final String url_feed = "http://groups.google.com/group/openmeetings-user/feed/atom_v1_0_msgs.xml";
-	private static final String url_feed2 = "http://groups.google.com/group/openmeetings-dev/feed/atom_v1_0_msgs.xml";
-	private static final String sendEmailWithVerficationCode = "0";
-	private static final String default_export_font = "TimesNewRoman";
-	private static final String screen_viewer = "4";
-	private static final String ffmpeg_path = "";
-	private static final String sip_enable = "0";
-	private static final String sox_path = "";
-	private static final String sip_proxyname = "";
-	private static final String sip_port = "";
-	private static final String sip_tunnel = "";
-	private static final String sip_realm = "";
-	private static final String sip_openxg_enable = "0";
-	private static final String sip_forcetunnel = "";
-	private static final String sip_codebase = "";
-	private static final String openxg_client_secret = "";
-	private static final String openxg_wrapper_url = "";
-	private static final String openxg_client_id = "";
-	private static final String openxg_client_domain = "";
-	private static final String openxg_community_code = "";
-	private static final String openxg_language_code = "";
-	private static final String openxg_adminid = "";
-	private static final String sip_language_phonecode = "";
-	private static final String sip_phonerange_start = "";
-	private static final String sip_phonerange = "";
-	private static final String jodPath = "./jod/lib";
-    private static final String red5sip_enable = "no";
-    private static final String red5sip_room_prefix = "400";
-    private static final String red5sip_exten_context = "rooms";
 	protected static final String username = "junit";
 	protected static final String userpass = "test";
 	private static final String orgname = "smoketest";
 	private static final String timeZone = "";
 	private static final String useremail = "junit@openmeetings.de";
-	private static String filePath = null;
 	
 	@Autowired
 	private AppointmentDaoImpl appointmentDao;
@@ -166,34 +126,11 @@ public abstract class AbstractOpenmeetin
 	}
 
 	private void makeDefaultScheme() throws Exception {
-		filePath = System.getProperty("webapps.root") + "/" + ScopeApplicationAdapter.webAppPath + "/languages/";
+		String filePath = System.getProperty("webapps.root")
+				+ File.separatorChar + ScopeApplicationAdapter.webAppPath
+				+ ImportInitvalues.languageFolderName;
 
-		importInitvalues.loadMainMenu();
-		importInitvalues.loadErrorMappingsFromXML(filePath);
-		importInitvalues.loadInitLanguages(filePath);
-		importInitvalues.loadSalutations();
-
-		importInitvalues.loadConfiguration(crypt_ClassName, configdefault,
-				configsmtp, configsmtpport, configreferer, configmailuser,
-				configmailpass, mailusetls, configdefaultLang, swf_path,
-				im_path, url_feed, url_feed2, sendEmailAtRegister,
-				sendEmailWithVerficationCode, default_export_font,
-				screen_viewer, ffmpeg_path, sox_path, sip_enable, sip_realm,
-				sip_port, sip_proxyname, sip_tunnel, sip_codebase,
-				sip_forcetunnel, sip_openxg_enable, openxg_wrapper_url,
-				openxg_client_id, openxg_client_secret, openxg_client_domain,
-				openxg_community_code, openxg_language_code, openxg_adminid,
-				sip_language_phonecode, sip_phonerange_start, sip_phonerange,
-				jodPath, red5sip_enable, red5sip_room_prefix, red5sip_exten_context);
-
-		importInitvalues.loadInitUserAndOrganisation(username, userpass,
-				useremail, orgname, timeZone, configdefaultLang);
-		importInitvalues.loadDefaultRooms(true);
-
-		// AppointMent Categories
-		importInitvalues.loadInitAppointmentCategories();
-
-		// Appointment Remindertypes
-		importInitvalues.loadInitAppointmentReminderTypes();
+		importInitvalues.loadAll(filePath, new InstallationConfig(), username, userpass,
+				useremail, orgname, timeZone);
 	}
 }