You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by se...@apache.org on 2012/09/29 17:30:09 UTC

svn commit: r1391821 [1/2] - in /incubator/openmeetings/trunk/singlewebapp: WebContent/WEB-INF/ WebContent/src/modules/admin/confadmin/ src/org/apache/openmeetings/axis/services/ src/org/apache/openmeetings/data/basic/ src/org/apache/openmeetings/data/...

Author: sebawagner
Date: Sat Sep 29 15:30:07 2012
New Revision: 1391821

URL: http://svn.apache.org/viewvc?rev=1391821&view=rev
Log:
Modifcations to OPENMEETINGS-434 
+ Refactoring Configurationmanagement to ConfigurationDaoImpl and update all references,
remove auth stuff from ConfigurationDaoImpl(management)

Added:
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDaoImpl.java
      - copied, changed from r1391793, incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Configurationmanagement.java
Removed:
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Configurationmanagement.java
Modified:
    incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
    incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdmin.lzx
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/UserWebService.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDAO.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Fieldmanagment.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDaoImpl.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Feedbackmanagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Invitationmanagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/record/BatikMethods.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GeneratePDF.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateSWF.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/InvitationService.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/LanguageService.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/UserService.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/rss/LoadAtomRssFeed.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/AbstractUploadController.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/ActivateUser.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupExport.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/CalendarServlet.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/DefaultIndex.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/Install.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/ScreenController.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/sip/api/impl/asterisk/dao/AsteriskDAOImpl.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/sip/xmlrpc/OpenXGHttpClient.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/templates/InvitationTemplate.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/calendar/TestSendIcalMessage.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/config/TestConfig.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/ImportHelper.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/mail/MailThread.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/math/TimezoneUtil.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/sms/SMSHandler.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/app/WebSession.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/BasePage.java

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml Sat Sep 29 15:30:07 2012
@@ -190,7 +190,7 @@
 	<bean id="fieldLanguageDaoImpl" class="org.apache.openmeetings.data.basic.FieldLanguageDaoImpl" />
 	<bean id="fieldLanguagesValuesDAO" class="org.apache.openmeetings.data.basic.FieldLanguagesValuesDAO" />
 	<bean id="fieldmanagment" class="org.apache.openmeetings.data.basic.Fieldmanagment" />
-	<bean id="cfgManagement" class="org.apache.openmeetings.data.basic.Configurationmanagement" />
+	<bean id="configurationDaoImpl" class="org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl" />
 	<bean id="appointmentDao"
 		class="org.apache.openmeetings.data.calendar.daos.AppointmentDaoImpl" />
 	<bean id="appointmentLogic"

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdmin.lzx
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdmin.lzx?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdmin.lzx (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdmin.lzx Sat Sep 29 15:30:07 2012
@@ -26,7 +26,7 @@
     <turnOverList name="_turnoverlist" width="410" 
     	height="${ canvas.height - canvas.naviHeight }" x="2" 
     	y="${ 0 - parent.parent.parent.y }" 
-		orderby="configuration_id" step="50" asc="true">
+		orderby="c.configuration_id" step="50" asc="true">
 
 		<handler name="oninit">
 			this.addHeaderItem(264,80);

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/UserWebService.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/UserWebService.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/UserWebService.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/axis/services/UserWebService.java Sat Sep 29 15:30:07 2012
@@ -23,10 +23,10 @@ import java.util.Date;
 import org.apache.axis2.AxisFault;
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.data.basic.AuthLevelmanagement;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.ErrorManagement;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
 import org.apache.openmeetings.data.basic.Sessionmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.basic.dao.SOAPLoginDaoImpl;
 import org.apache.openmeetings.data.beans.basic.ErrorResult;
 import org.apache.openmeetings.data.beans.basic.SearchResult;
@@ -64,7 +64,7 @@ public class UserWebService {
 	@Autowired
 	private Sessionmanagement sessionManagement;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Usermanagement userManagement;
 	@Autowired
@@ -216,8 +216,8 @@ public class UserWebService {
 
 			if (authLevelManagement.checkWebServiceLevel(user_level)) {
 
-				Configuration conf = cfgManagement.getConfKey(3L,
-						"default.timezone");
+				Configuration conf = configurationDaoImpl
+						.getConfKey("default.timezone");
 				String jName_timeZone = "";
 
 				if (conf != null) {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDAO.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDAO.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDAO.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDAO.java Sat Sep 29 15:30:07 2012
@@ -27,6 +27,7 @@ import javax.persistence.PersistenceCont
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.data.OmDAO;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -36,10 +37,10 @@ public class FieldLanguagesValuesDAO imp
 	@PersistenceContext
 	private EntityManager em;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 
 	public List<Fieldlanguagesvalues> get(int first, int count) {
-		return get(cfgManagement.getConfValue("default_lang_id", Long.class, "1"), first, count);
+		return get(configurationDaoImpl.getConfValue("default_lang_id", Long.class, "1"), first, count);
 	}
 	
 	public List<Fieldlanguagesvalues> get(Long language_id, int first, int count) {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Fieldmanagment.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Fieldmanagment.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Fieldmanagment.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Fieldmanagment.java Sat Sep 29 15:30:07 2012
@@ -32,6 +32,7 @@ import javax.persistence.PersistenceCont
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.beans.basic.SearchResult;
 import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
 import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
@@ -62,7 +63,7 @@ public class Fieldmanagment {
 	private FieldLanguagesValuesDAO fieldLanguagesValuesDAO;
 
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	
 	// Reflect the Reverse Order!!
 	public Fieldlanguagesvalues getFieldByIdAndLanguageByNavi(
@@ -203,7 +204,7 @@ public class Fieldmanagment {
 			query.setFirstResult(start);
 			query.setMaxResults(max);
 
-			String appName = cfgManagement.getAppName();
+			String appName = configurationDaoImpl.getAppName();
 			List<Map<String, Object>> returnList = new LinkedList<Map<String, Object>>();
 			for (Object fl : query.getResultList()) {
 				Map<String, Object> map = new HashMap<String, Object>();
@@ -577,7 +578,7 @@ public class Fieldmanagment {
 	}
 	
 	private Fieldlanguagesvalues performReplace(Fieldlanguagesvalues f) {
-		String appName = cfgManagement.getAppName();
+		String appName = configurationDaoImpl.getAppName();
 		return performReplace(f, appName);
 	}
 	
@@ -598,7 +599,7 @@ public class Fieldmanagment {
 	}
 	
 	private <T extends Collection<Fieldlanguagesvalues>> T performReplace(T flv) {
-		String appName = cfgManagement.getAppName();
+		String appName = configurationDaoImpl.getAppName();
 		
 		for (Fieldlanguagesvalues f : flv) {
 			performReplace(f, appName);

Copied: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDaoImpl.java (from r1391793, incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Configurationmanagement.java)
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDaoImpl.java?p2=incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDaoImpl.java&p1=incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Configurationmanagement.java&r1=1391793&r2=1391821&rev=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/Configurationmanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDaoImpl.java Sat Sep 29 15:30:07 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.openmeetings.data.basic;
+package org.apache.openmeetings.data.basic.dao;
 
 import java.lang.reflect.Constructor;
 import java.util.Arrays;
@@ -27,11 +27,8 @@ import java.util.List;
 import javax.annotation.Resource;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceException;
 import javax.persistence.TypedQuery;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.data.OmDAO;
@@ -42,15 +39,13 @@ import org.apache.openmeetings.remote.re
 import org.apache.openmeetings.utils.mappings.CastMapToObject;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
 @Transactional
-public class Configurationmanagement implements OmDAO<Configuration>{
+public class ConfigurationDaoImpl implements OmDAO<Configuration> {
 
 	private static final Logger log = Red5LoggerFactory.getLogger(
-			Configurationmanagement.class,
-			OpenmeetingsVariables.webAppRootKey);
+			ConfigurationDaoImpl.class, OpenmeetingsVariables.webAppRootKey);
 
 	public static final String DEFAULT_APP_NAME = "OpenMeetings";
 
@@ -59,23 +54,18 @@ public class Configurationmanagement imp
 
 	@Resource(name = "usersDao")
 	private UsersDaoImpl usersDao;
-	@Autowired
-	private AuthLevelmanagement authLevelManagement;
 	private String appName = null;
 
-	public Configuration getConfKey(long user_level, String CONF_KEY) {
+	public Configuration getConfKey(String CONF_KEY) {
 		try {
-			if (authLevelManagement.checkUserLevel(user_level)) {
-				TypedQuery<Configuration> query = em.createNamedQuery("getConfigurationByKey", Configuration.class);
-				query.setParameter("conf_key", CONF_KEY);
+			TypedQuery<Configuration> query = em.createNamedQuery(
+					"getConfigurationByKey", Configuration.class);
+			query.setParameter("conf_key", CONF_KEY);
 
-				List<Configuration> configs = query.getResultList();
+			List<Configuration> configs = query.getResultList();
 
-				if (configs != null && configs.size() > 0) {
-					return configs.get(0);
-				}
-			} else {
-				log.error("[getAllConf] Permission denied " + user_level);
+			if (configs != null && configs.size() > 0) {
+				return configs.get(0);
 			}
 		} catch (Exception ex2) {
 			log.error("[getConfKey]: ", ex2);
@@ -83,16 +73,13 @@ public class Configurationmanagement imp
 		return null;
 	}
 
-	public List<Configuration> getConfKeys(long user_level, String... keys) {
+	public List<Configuration> getConfKeys(String... keys) {
 		try {
-			if (authLevelManagement.checkUserLevel(user_level)) {
-				TypedQuery<Configuration> query = em.createNamedQuery("getConfigurationsByKeys", Configuration.class);
-				query.setParameter("conf_keys", Arrays.asList(keys));
+			TypedQuery<Configuration> query = em.createNamedQuery(
+					"getConfigurationsByKeys", Configuration.class);
+			query.setParameter("conf_keys", Arrays.asList(keys));
 
-				return query.getResultList();
-			} else {
-				log.error("[getAllConf] Permission denied " + user_level);
-			}
+			return query.getResultList();
 		} catch (Exception ex2) {
 			log.error("[getConfKey]: ", ex2);
 		}
@@ -100,23 +87,24 @@ public class Configurationmanagement imp
 	}
 
 	/**
-	 * Return a object using a custom type and a default value if the key is not present
+	 * Return a object using a custom type and a default value if the key is not
+	 * present
 	 * 
 	 * Example: Integer my_key = getConfValue("my_key", Integer.class, "15");
 	 * 
-	 * @param CONF_KEY
+	 * @param confKey
 	 * @param typeObject
 	 * @param defaultValue
 	 * @return
 	 */
-	public <T> T getConfValue(String CONF_KEY, Class<T> typeObject,
+	public <T> T getConfValue(String confKey, Class<T> typeObject,
 			String defaultValue) {
 		try {
-			Configuration conf_reminder = getConfKey(3L, CONF_KEY);
+			Configuration conf_reminder = getConfKey(confKey);
 
 			if (conf_reminder == null) {
 				log.warn("Could not find key in configuration CONF_KEY: "
-						+ CONF_KEY);
+						+ confKey);
 			} else {
 				// Use the custom value as default value
 				defaultValue = conf_reminder.getConf_value();
@@ -134,36 +122,19 @@ public class Configurationmanagement imp
 		} catch (Exception err) {
 			log.error(
 					"cannot be cast to return type, you have misconfigured your configuration CONF_KEY: "
-							+ CONF_KEY, err);
+							+ confKey, err);
 			return null;
 		}
 	}
 
-	public Configuration getConfByConfigurationId(long user_level,
-			long configuration_id) {
-			log.debug("getConfByConfigurationId1: user_level " + user_level);
-			if (authLevelManagement.checkAdminLevel(user_level)) {
-			return get(configuration_id);
-			} else {
-				log.error("[getConfByConfigurationId] Permission denied "
-						+ user_level);
-			}
-		return null;
-	}
-
-	public SearchResult<Configuration> getAllConf(long user_level, int start, int max,
+	public SearchResult<Configuration> getAllConf(int start, int max,
 			String orderby, boolean asc) {
 		try {
-			if (authLevelManagement.checkAdminLevel(user_level)) {
-				SearchResult<Configuration> sresult = new SearchResult<Configuration>();
-				sresult.setRecords(this.selectMaxFromConfigurations());
-				sresult.setResult(this.getConfigurations(start, max, orderby,
-						asc));
-				sresult.setObjectName(Configuration.class.getName());
-				return sresult;
-			} else {
-				log.error("[getAllConf] Permission denied " + user_level);
-			}
+			SearchResult<Configuration> sresult = new SearchResult<Configuration>();
+			sresult.setRecords(this.selectMaxFromConfigurations());
+			sresult.setResult(this.getConfigurations(start, max, orderby, asc));
+			sresult.setObjectName(Configuration.class.getName());
+			return sresult;
 		} catch (Exception ex2) {
 			log.error("[getAllConf]: ", ex2);
 		}
@@ -173,21 +144,39 @@ public class Configurationmanagement imp
 	public List<Configuration> getConfigurations(int start, int max,
 			String orderby, boolean asc) {
 		try {
-			CriteriaBuilder cb = em.getCriteriaBuilder();
-			CriteriaQuery<Configuration> cq = cb
-					.createQuery(Configuration.class);
-			Root<Configuration> c = cq.from(Configuration.class);
-			Predicate condition = cb.equal(c.get("deleted"), false);
-			cq.where(condition);
-			cq.distinct(asc);
+			
+			String query = "SELECT c FROM Configuration c " //
+					+ "LEFT JOIN FETCH c.user " //
+					+ "WHERE c.deleted = false " //
+					+ "ORDER BY "+ orderby;
+			
 			if (asc) {
-				cq.orderBy(cb.asc(c.get(orderby)));
+				query += " ASC";
 			} else {
-				cq.orderBy(cb.desc(c.get(orderby)));
+				query += " DESC";
 			}
-			TypedQuery<Configuration> q = em.createQuery(cq);
+
+			TypedQuery<Configuration> q = em.createQuery(query,
+					Configuration.class);
 			q.setFirstResult(start);
 			q.setMaxResults(max);
+
+			// CriteriaBuilder cb = em.getCriteriaBuilder();
+			// CriteriaQuery<Configuration> cq = cb
+			// .createQuery(Configuration.class);
+			// Root<Configuration> c = cq.from(Configuration.class);
+			// Predicate condition = cb.equal(c.get("deleted"), false);
+			// cq.where(condition);
+			// cq.distinct(asc);
+			// if (asc) {
+			// cq.orderBy(cb.asc(c.get(orderby)));
+			// } else {
+			// cq.orderBy(cb.desc(c.get(orderby)));
+			// }
+			// TypedQuery<Configuration> q = em.createQuery(cq);
+			// q.setFirstResult(start);
+			// q.setMaxResults(max);
+
 			List<Configuration> ll = q.getResultList();
 			return ll;
 		} catch (Exception ex2) {
@@ -205,7 +194,9 @@ public class Configurationmanagement imp
 			log.debug("selectMaxFromConfigurations ");
 			// get all users
 			TypedQuery<Long> query = em
-					.createQuery("select count(c.configuration_id) from Configuration c where c.deleted = false", Long.class);
+					.createQuery(
+							"select count(c.configuration_id) from Configuration c where c.deleted = false",
+							Long.class);
 			List<Long> ll = query.getResultList();
 			log.debug("selectMaxFromConfigurations" + ll.get(0));
 			return ll.get(0);
@@ -215,60 +206,47 @@ public class Configurationmanagement imp
 		return null;
 	}
 
-	public String addConfByKey(long user_level, String CONF_KEY,
-			String CONF_VALUE, Long userId, String comment) {
+	public String addConfByKey(String confKey, String confValue, Long userId,
+			String comment) {
 		String ret = "Add Configuration";
-		if (authLevelManagement.checkAdminLevel(user_level)) {
-			Configuration configuration = new Configuration();
-			configuration.setConf_key(CONF_KEY);
-			configuration.setConf_value(CONF_VALUE);
-			configuration.setStarttime(new Date());
-			configuration.setDeleted(false);
-			configuration.setComment(comment);
-			if (userId != null)
-				configuration.setUser(usersDao.get(userId));
-			try {
-				configuration = em.merge(configuration);
-				ret = "Erfolgreich";
-			} catch (Exception ex2) {
-				log.error("[addConfByKey]: ", ex2);
-			}
-		} else {
-			ret = "Error: Permission denied";
+		Configuration configuration = new Configuration();
+		configuration.setConf_key(confKey);
+		configuration.setConf_value(confValue);
+		configuration.setStarttime(new Date());
+		configuration.setDeleted(false);
+		configuration.setComment(comment);
+		if (userId != null)
+			configuration.setUser(usersDao.get(userId));
+		try {
+			configuration = em.merge(configuration);
+			ret = "Erfolgreich";
+		} catch (Exception ex2) {
+			log.error("[addConfByKey]: ", ex2);
 		}
 		return ret;
 	}
 
-	public Long saveOrUpdateConfiguration(long user_level,
-			LinkedHashMap<String, ?> values, Long users_id) {
+	public Long saveOrUpdateConfiguration(
+			LinkedHashMap<String, ?> values, Long userId) {
 		try {
-			if (authLevelManagement.checkAdminLevel(user_level)) {
-				Configuration conf = (Configuration) CastMapToObject
-						.getInstance().castByGivenObject(values,
-								Configuration.class);
-				if (conf.getConfiguration_id().equals(null)
-						|| conf.getConfiguration_id() == 0) {
-					log.info("add new Configuration");
-					conf.setConfiguration_id(null);
-					conf.setStarttime(new Date());
-					conf.setDeleted(false);
-					return this.addConfig(conf);
-				} else {
-					log.info("update Configuration ID: "
-							+ conf.getConfiguration_id());
-					Configuration conf2 = this.getConfByConfigurationId(3L,
-							conf.getConfiguration_id());
-					conf2.setComment(conf.getComment());
-					conf2.setConf_key(conf.getConf_key());
-					conf2.setConf_value(conf.getConf_value());
-					conf2.setUser(usersDao.get(users_id));
-					conf2.setDeleted(false);
-					conf2.setUpdatetime(new Date());
-					return this.updateConfig(conf2);
-				}
+			Configuration conf = (Configuration) CastMapToObject.getInstance()
+					.castByGivenObject(values, Configuration.class);
+			if (conf.getConfiguration_id().equals(null)
+					|| conf.getConfiguration_id() == 0
+					|| conf.getConfiguration_id() == 0L) {
+				conf.setConfiguration_id(null);
+				conf.setStarttime(new Date());
+				conf.setDeleted(false);
+				return this.addConfig(conf);
 			} else {
-				log.error("[saveOrUpdateConfByConfigurationId] Error: Permission denied");
-				return new Long(-100);
+				Configuration conf2 = this.get(conf.getConfiguration_id());
+				conf2.setComment(conf.getComment());
+				conf2.setConf_key(conf.getConf_key());
+				conf2.setConf_value(conf.getConf_value());
+				conf2.setUser(usersDao.get(userId));
+				conf2.setDeleted(false);
+				conf2.setUpdatetime(new Date());
+				return this.updateConfig(conf2);
 			}
 		} catch (Exception ex2) {
 			log.error("[updateConfByUID]: ", ex2);
@@ -289,7 +267,9 @@ public class Configurationmanagement imp
 
 	public Long updateConfig(Configuration conf) {
 		try {
-			if (conf.getConfiguration_id() == null || conf.getConfiguration_id() == 0) {
+			if (conf.getConfiguration_id() == null
+					|| conf.getConfiguration_id() == 0
+					|| conf.getConfiguration_id() == 0L) {
 				em.persist(conf);
 			} else {
 				if (!em.contains(conf)) {
@@ -297,9 +277,11 @@ public class Configurationmanagement imp
 				}
 			}
 			if ("crypt_ClassName".equals(conf.getConf_key())) {
-				ScopeApplicationAdapter.configKeyCryptClassName = conf.getConf_value();
+				ScopeApplicationAdapter.configKeyCryptClassName = conf
+						.getConf_value();
 			} else if ("show.whiteboard.draw.status".equals(conf.getConf_key())) {
-				ScopeApplicationAdapter.whiteboardDrawStatus = "1".equals(conf.getConf_value());
+				ScopeApplicationAdapter.whiteboardDrawStatus = "1".equals(conf
+						.getConf_value());
 			}
 			return conf.getConfiguration_id();
 		} catch (Exception ex2) {
@@ -308,32 +290,25 @@ public class Configurationmanagement imp
 		return new Long(-1);
 	}
 
-	public Long deleteConfByConfiguration(long user_level,
-			LinkedHashMap<String, ?> values, Long users_id) {
+	public Long deleteConfByConfiguration(LinkedHashMap<String, ?> values,
+			Long users_id) {
 		try {
-			if (authLevelManagement.checkAdminLevel(user_level)) {
-				Configuration conf = (Configuration) CastMapToObject
-						.getInstance().castByGivenObject(values,
-								Configuration.class);
-				conf.setUser(usersDao.getUser(users_id));
-				conf.setUpdatetime(new Date());
-				conf.setDeleted(true);
+			Configuration conf = (Configuration) CastMapToObject.getInstance()
+					.castByGivenObject(values, Configuration.class);
+			conf.setUser(usersDao.getUser(users_id));
+			conf.setUpdatetime(new Date());
+			conf.setDeleted(true);
+
+			Configuration conf2 = this.get(conf.getConfiguration_id());
+			conf2.setComment(conf.getComment());
+			conf2.setConf_key(conf.getConf_key());
+			conf2.setConf_value(conf.getConf_value());
+			conf2.setUser(usersDao.getUser(users_id));
+			conf2.setDeleted(true);
+			conf2.setUpdatetime(new Date());
 
-				Configuration conf2 = this.getConfByConfigurationId(3L,
-						conf.getConfiguration_id());
-				conf2.setComment(conf.getComment());
-				conf2.setConf_key(conf.getConf_key());
-				conf2.setConf_value(conf.getConf_value());
-				conf2.setUser(usersDao.get(users_id));
-				conf2.setDeleted(true);
-				conf2.setUpdatetime(new Date());
-
-				this.updateConfig(conf2);
-				return new Long(1);
-			} else {
-				log.error("Error: Permission denied");
-				return new Long(-100);
-			}
+			this.updateConfig(conf2);
+			return new Long(1);
 		} catch (Exception ex2) {
 			log.error("[deleteConfByUID]: ", ex2);
 		}
@@ -342,22 +317,33 @@ public class Configurationmanagement imp
 
 	public String getAppName() {
 		if (appName == null) {
-			appName = getConfValue("application.name", String.class, Configurationmanagement.DEFAULT_APP_NAME);
+			appName = getConfValue("application.name", String.class,
+					ConfigurationDaoImpl.DEFAULT_APP_NAME);
 		}
 		return appName;
 	}
 
 	public List<Configuration> getNondeletedConfiguration(int first, int count) {
-		TypedQuery<Configuration> q = em.createNamedQuery("getNondeletedConfiguration", Configuration.class);
+		TypedQuery<Configuration> q = em.createNamedQuery(
+				"getNondeletedConfiguration", Configuration.class);
 		q.setFirstResult(first);
 		q.setMaxResults(count);
 		return q.getResultList();
 	}
 
 	public Configuration get(long id) {
-		return em.createNamedQuery("getConfigurationById", Configuration.class)
-					.setParameter("configuration_id", id)
-					.getSingleResult();
+		try {
+			if (id == 0) {
+				return null;
+			}
+			return em
+					.createNamedQuery("getConfigurationById",
+							Configuration.class)
+					.setParameter("configuration_id", id).getSingleResult();
+		} catch (PersistenceException ex) {
+			log.error("Could not find id " + id, ex);
+		}
+		return null;
 	}
 
 	public List<Configuration> get(int start, int count) {
@@ -369,12 +355,13 @@ public class Configurationmanagement imp
 	}
 
 	public void update(Configuration entity, long userId) {
-		if (entity.getConfiguration_id() == null || entity.getConfiguration_id() == 0) {
+		if (entity.getConfiguration_id() == null
+				|| entity.getConfiguration_id() == 0) {
 			entity.setStarttime(new Date());
 			entity.setDeleted(false);
 			this.updateConfig(entity);
 		} else {
-			entity.setUser(usersDao.get(userId));
+			entity.setUser(usersDao.getUser(userId));
 			entity.setDeleted(false);
 			entity.setUpdatetime(new Date());
 			this.updateConfig(entity);
@@ -382,7 +369,7 @@ public class Configurationmanagement imp
 	}
 
 	public void delete(Configuration entity, long userId) {
-		entity.setUser(usersDao.get(userId));
+		entity.setUser(usersDao.getUser(userId));
 		entity.setDeleted(true);
 		entity.setUpdatetime(new Date());
 		this.updateConfig(entity);

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDaoImpl.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDaoImpl.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDaoImpl.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDaoImpl.java Sat Sep 29 15:30:07 2012
@@ -27,7 +27,7 @@ import javax.persistence.PersistenceCont
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.user.dao.UsersDaoImpl;
 import org.apache.openmeetings.persistence.beans.calendar.AppointmentCategory;
 import org.red5.logging.Red5LoggerFactory;
@@ -39,7 +39,7 @@ import org.springframework.transaction.a
 public class AppointmentCategoryDaoImpl {
 
 	private static final Logger log = Red5LoggerFactory.getLogger(
-			Configurationmanagement.class,
+			ConfigurationDaoImpl.class,
 			OpenmeetingsVariables.webAppRootKey);
 
 	@PersistenceContext

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java Sat Sep 29 15:30:07 2012
@@ -23,8 +23,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
 
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.basic.dao.OmTimeZoneDaoImpl;
 import org.apache.openmeetings.data.calendar.daos.AppointmentDaoImpl;
 import org.apache.openmeetings.data.calendar.daos.MeetingMemberDaoImpl;
@@ -52,7 +52,7 @@ public class AppointmentLogic {
 	@Autowired
 	private AppointmentDaoImpl appointmentDao;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Usermanagement userManagement;
 	@Autowired
@@ -150,7 +150,7 @@ public class AppointmentLogic {
 		
 		// TODO:Add this user as the default Moderator of the Room
 
-		Long numberOfParticipants = cfgManagement.getConfValue(
+		Long numberOfParticipants = configurationDaoImpl.getConfValue(
 				"calendar.conference.rooms.default.size", Long.class, "50");
 
 		try {
@@ -395,7 +395,7 @@ public class AppointmentLogic {
 	public void doScheduledMeetingReminder() throws Exception {
 		// log.debug("doScheduledMeetingReminder");
 
-		Integer minutesReminderSend = cfgManagement.getConfValue(
+		Integer minutesReminderSend = configurationDaoImpl.getConfValue(
 				"number.minutes.reminder.send", Integer.class, ""
 						+ DEFAULT_MINUTES_REMINDER_SEND);
 		if (minutesReminderSend == null) {
@@ -419,7 +419,8 @@ public class AppointmentLogic {
 		}
 
 		Long language_id = Long.valueOf(
-				cfgManagement.getConfKey(3, "default_lang_id").getConf_value())
+				configurationDaoImpl.getConfKey("default_lang_id")
+						.getConf_value())
 				.longValue();
 
 		// Get the required labels one time for all meeting members. The

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Feedbackmanagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Feedbackmanagement.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Feedbackmanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Feedbackmanagement.java Sat Sep 29 15:30:07 2012
@@ -19,8 +19,8 @@
 package org.apache.openmeetings.data.conference;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.templates.FeedbackTemplate;
 import org.apache.openmeetings.utils.mail.MailHandler;
 import org.red5.logging.Red5LoggerFactory;
@@ -32,7 +32,7 @@ public class Feedbackmanagement {
 			Feedbackmanagement.class, OpenmeetingsVariables.webAppRootKey);
 
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Fieldmanagment fieldmanagment;
 	@Autowired
@@ -42,7 +42,8 @@ public class Feedbackmanagement {
 
 	public String sendFeedback(String username, String email, String message) {
 		try {
-			Long default_lang_id = cfgManagement.getConfValue("default_lang_id", Long.class, "1");
+			Long default_lang_id = configurationDaoImpl.getConfValue(
+					"default_lang_id", Long.class, "1");
 
 			String template = feedbackTemplate.getFeedBackTemplate(username,
 					email, message, default_lang_id);

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Invitationmanagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Invitationmanagement.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Invitationmanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Invitationmanagement.java Sat Sep 29 15:30:07 2012
@@ -32,8 +32,8 @@ import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.data.basic.AuthLevelmanagement;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.calendar.daos.AppointmentDaoImpl;
 import org.apache.openmeetings.data.calendar.management.AppointmentLogic;
 import org.apache.openmeetings.data.user.Usermanagement;
@@ -73,7 +73,7 @@ public class Invitationmanagement {
 	@Autowired
 	private AppointmentLogic appointmentLogic;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Usermanagement userManagement;
 	@Autowired
@@ -934,7 +934,7 @@ public class Invitationmanagement {
 						+ email + "&roomid=" + room_id;
 
 				Long default_lang_id = Long.valueOf(
-						cfgManagement.getConfKey(3, "default_lang_id")
+						configurationDaoImpl.getConfKey("default_lang_id")
 								.getConf_value()).longValue();
 
 				String template = invitationTemplate

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/Roommanagement.java Sat Sep 29 15:30:07 2012
@@ -33,7 +33,7 @@ import javax.persistence.criteria.Predic
 import javax.persistence.criteria.Root;
 
 import org.apache.openmeetings.data.basic.AuthLevelmanagement;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.beans.basic.SearchResult;
 import org.apache.openmeetings.data.conference.dao.RoomModeratorsDaoImpl;
 import org.apache.openmeetings.data.user.Organisationmanagement;
@@ -85,7 +85,7 @@ public class Roommanagement {
 	@Autowired
 	private ClientListManager clientListManager;
     @Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 
 	/**
 	 * add a new Record to the table roomtypes
@@ -111,7 +111,8 @@ public class Roommanagement {
 	public Long addRoom(Rooms room) {
 		try {
             /* Red5SIP integration *******************************************************************************/
-            Configuration conf = cfgManagement.getConfKey(3L, "red5sip.enable");
+			Configuration conf = configurationDaoImpl
+					.getConfKey("red5sip.enable");
             if(conf != null && conf.getConf_value().equals("yes")) {
                 if(room.getSipNumber() != null && !room.getSipNumber().isEmpty()) {
                     asteriskDbSipClient.createSIPConference(new SIPCreateConferenceRequest(room.getSipNumber()));
@@ -714,7 +715,7 @@ public class Roommanagement {
      * @return number of participants
      */
     public Integer getSipConferenceMembersNumber(Long rooms_id) {
-        Configuration conf = cfgManagement.getConfKey(3L, "red5sip.enable");
+		Configuration conf = configurationDaoImpl.getConfKey("red5sip.enable");
         if(conf != null && conf.getConf_value().equals("yes")) {
             Rooms rooms = this.getRoomById(rooms_id);
             if(rooms != null) {
@@ -804,7 +805,8 @@ public class Roommanagement {
 				}
 
                 /* Red5SIP integration *******************************************************************************/
-                Configuration conf = cfgManagement.getConfKey(3L, "red5sip.enable");
+				Configuration conf = configurationDaoImpl
+						.getConfKey("red5sip.enable");
                 if(conf != null && conf.getConf_value().equals("yes")) {
                     SipCreateConferenceRequestResult requestResult = asteriskDbSipClient
                             .createSIPConference(new SIPCreateConferenceRequest(sipNumber));

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java Sat Sep 29 15:30:07 2012
@@ -23,7 +23,7 @@ import java.util.HashMap;
 import java.util.List;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.flvrecord.FlvRecordingMetaDataDaoImpl;
 import org.apache.openmeetings.data.flvrecord.FlvRecordingMetaDeltaDaoImpl;
 import org.apache.openmeetings.documents.GenerateSWF;
@@ -41,14 +41,14 @@ public abstract class BaseConverter {
 			BaseConverter.class, OpenmeetingsVariables.webAppRootKey);
 
 	@Autowired
-	private Configurationmanagement configurationmanagement;
+	private ConfigurationDaoImpl configurationmanagement;
 	@Autowired
 	private FlvRecordingMetaDataDaoImpl flvRecordingMetaDataDaoImpl;
 	@Autowired
 	private FlvRecordingMetaDeltaDaoImpl flvRecordingMetaDeltaDaoImpl;
 
 	protected String getPathToFFMPEG() {
-		String pathToFFMPEG = configurationmanagement.getConfKey(3,
+		String pathToFFMPEG = configurationmanagement.getConfKey(
 				"ffmpeg_path").getConf_value();
 		if (!pathToFFMPEG.equals("") && !pathToFFMPEG.endsWith(File.separator)) {
 			pathToFFMPEG += File.separator;
@@ -58,7 +58,7 @@ public abstract class BaseConverter {
 	}
 
 	protected String getPathToSoX() {
-		String pathToSoX = configurationmanagement.getConfKey(3, "sox_path")
+		String pathToSoX = configurationmanagement.getConfKey("sox_path")
 				.getConf_value();
 		if (!pathToSoX.equals("") && !pathToSoX.endsWith(File.separator)) {
 			pathToSoX += File.separator;
@@ -68,7 +68,7 @@ public abstract class BaseConverter {
 	}
 
 	protected String getPathToImageMagick() {
-		String pathToImageMagick = this.configurationmanagement.getConfKey(3,
+		String pathToImageMagick = this.configurationmanagement.getConfKey(
 				"imagemagick_path").getConf_value();
 		if (!pathToImageMagick.equals("")
 				&& !pathToImageMagick.endsWith(File.separator)) {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/record/BatikMethods.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/record/BatikMethods.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/record/BatikMethods.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/record/BatikMethods.java Sat Sep 29 15:30:07 2012
@@ -35,7 +35,7 @@ import javax.swing.JTextArea;
 import org.apache.batik.dom.svg.SVGDOMImplementation;
 import org.apache.batik.svggen.SVGGraphics2D;
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.utils.geom.ArrowStyle;
 import org.apache.openmeetings.utils.geom.GeomPoint;
 import org.red5.logging.Red5LoggerFactory;
@@ -48,7 +48,7 @@ public class BatikMethods {
 	
 	private static final Logger log = Red5LoggerFactory.getLogger(BatikMethods.class, OpenmeetingsVariables.webAppRootKey);
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 
 	public void paintTextByWidthHeight(SVGGraphics2D g2d, int x1, int y1, int width, int height,
 			String text, int style, int size, Color fontColor) throws Exception {
@@ -62,7 +62,8 @@ public class BatikMethods {
 	public void _paintTextByWidthHeight(SVGGraphics2D g2d, int x1, int y1, int width, int height,
 			String text, int style, int size, Color fontColor) throws Exception {
 
-		String default_export_font = cfgManagement.getConfKey(3,"default_export_font").getConf_value();
+		String default_export_font = configurationDaoImpl.getConfKey(
+				"default_export_font").getConf_value();
 		
 		this.drawTextByString(g2d, x1, y1, width, height, text, default_export_font, style, size, fontColor);
 
@@ -244,7 +245,8 @@ public class BatikMethods {
 	public void paintTextByWidthHeightAndDocument(SVGGraphics2D g2d, int x1, int y1, int width, int height,
 			String text, int style, int size, Color fontColor, Document document) throws Exception {
 
-		//String default_export_font = Configurationmanagement.getInstance().getConfKey(3,"default_export_font").getConf_value();
+		// String default_export_font =
+		// Configurationmanagement.getInstance().getConfKey("default_export_font").getConf_value();
 		
 		this.drawText(g2d, x1, y1, width, height, text, "Verdana", style, size, fontColor, document);
 

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Emailmanagement.java Sat Sep 29 15:30:07 2012
@@ -23,8 +23,8 @@ import javax.persistence.PersistenceCont
 import javax.persistence.TypedQuery;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.persistence.beans.adresses.Adresses;
 import org.apache.openmeetings.templates.RegisterUserTemplate;
 import org.apache.openmeetings.utils.mail.MailHandler;
@@ -43,7 +43,7 @@ public class Emailmanagement {
 	private EntityManager em;
 
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Fieldmanagment fieldmanagment;
 	@Autowired
@@ -65,13 +65,13 @@ public class Emailmanagement {
 		String succ = "valid email";
 
 		Integer sendEmailAtRegister = Integer.valueOf(
-				cfgManagement.getConfKey(3, "sendEmailAtRegister")
+				configurationDaoImpl.getConfKey("sendEmailAtRegister")
 						.getConf_value()).intValue();
 
 		if (sendEmailAtRegister == 1) {
 
 			Long default_lang_id = Long.valueOf(
-					cfgManagement.getConfKey(3, "default_lang_id")
+					configurationDaoImpl.getConfKey("default_lang_id")
 							.getConf_value()).longValue();
 
 			if (sendEmailWithVerficationCode) {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/user/Usermanagement.java Sat Sep 29 15:30:07 2012
@@ -39,9 +39,9 @@ import javax.persistence.criteria.Root;
 import org.apache.commons.lang.StringUtils;
 import org.apache.openmeetings.OpenmeetingsVariables;
 import org.apache.openmeetings.data.basic.AuthLevelmanagement;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
 import org.apache.openmeetings.data.basic.Sessionmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.basic.dao.OmTimeZoneDaoImpl;
 import org.apache.openmeetings.data.basic.dao.ServerDaoImpl;
 import org.apache.openmeetings.data.beans.basic.SearchResult;
@@ -88,7 +88,7 @@ public class Usermanagement {
 	@Autowired
 	private Sessionmanagement sessionManagement;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Fieldmanagment fieldmanagment;
 	@Autowired
@@ -834,7 +834,7 @@ public class Usermanagement {
 		
 		boolean sendConfirmation = baseURL != null
 				&& !baseURL.isEmpty()
-				&& 1 == cfgManagement.getConfValue(
+				&& 1 == configurationDaoImpl.getConfValue(
 						"sendEmailWithVerficationCode", Integer.class, "0");
 		
 		return registerUser(login, Userpass, lastname, firstname, email, age,
@@ -860,14 +860,17 @@ public class Usermanagement {
 			boolean generateSipUserData, String jNameTimeZone, Boolean sendConfirmation, Server server) {
 		try {
 			// Checks if FrontEndUsers can register
-			if ("1".equals(cfgManagement.getConfValue("allow_frontend_register", String.class, "0"))) {
+			if ("1".equals(configurationDaoImpl.getConfValue(
+					"allow_frontend_register", String.class, "0"))) {
 				
 				// TODO: Read and generate SIP-Data via RPC-Interface Issue 1098
 
 				Long user_id = this.registerUserInit(3, 1, 0, 1, login,
 						Userpass, lastname, firstname, email, age, street,
 						additionalname, fax, zip, states_id, town, language_id,
-						true, Arrays.asList(cfgManagement.getConfValue("default_domain_id", Long.class, null)),phone, sendSMS, baseURL,
+						true, Arrays.asList(configurationDaoImpl.getConfValue(
+								"default_domain_id", Long.class, null)), phone,
+						sendSMS, baseURL,
 						sendConfirmation, "", "", "", generateSipUserData,
 						jNameTimeZone, false, "", "", false, true, server);
 
@@ -988,9 +991,9 @@ public class Usermanagement {
 		// their Group
 		if (authLevelManagement.checkModLevel(user_level)) {
 
-			Integer userLoginMinimumLength = cfgManagement.getConfValue(
+			Integer userLoginMinimumLength = configurationDaoImpl.getConfValue(
 					"user.login.minimum.length", Integer.class, "4");
-			Integer userPassMinimumLength = cfgManagement.getConfValue(
+			Integer userPassMinimumLength = configurationDaoImpl.getConfValue(
 					"user.pass.minimum.length", Integer.class, "4");
 
 			if (userLoginMinimumLength == null || userPassMinimumLength == null) {
@@ -1498,7 +1501,8 @@ public class Usermanagement {
 		String email = us.getAdresses().getEmail();
 
 		Long default_lang_id = Long.valueOf(
-				cfgManagement.getConfKey(3, "default_lang_id").getConf_value())
+				configurationDaoImpl.getConfKey("default_lang_id")
+						.getConf_value())
 				.longValue();
 
 		String template = resetPasswordTemplate.getResetPasswordTemplate(

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateImage.java Sat Sep 29 15:30:07 2012
@@ -23,7 +23,7 @@ import java.io.IOException;
 import java.util.HashMap;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.user.dao.UsersDaoImpl;
 import org.apache.openmeetings.persistence.beans.user.Users;
 import org.apache.openmeetings.utils.OmFileHelper;
@@ -38,14 +38,14 @@ public class GenerateImage {
 			GenerateImage.class, OpenmeetingsVariables.webAppRootKey);
 
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private UsersDaoImpl usersDao;
 	@Autowired
 	private GenerateThumbs generateThumbs;
 
 	String getPathToImageMagic() {
-		String pathToImageMagic = cfgManagement.getConfKey(3,
+		String pathToImageMagic = configurationDaoImpl.getConfKey(
 				"imagemagick_path").getConf_value();
 		if (!pathToImageMagic.equals("")
 				&& !pathToImageMagic.endsWith(File.separator)) {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GeneratePDF.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GeneratePDF.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GeneratePDF.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GeneratePDF.java Sat Sep 29 15:30:07 2012
@@ -25,7 +25,7 @@ import java.util.HashMap;
 
 import org.apache.commons.transaction.util.FileHelper;
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.utils.OmFileHelper;
 import org.apache.openmeetings.utils.ProcessHelper;
 import org.red5.logging.Red5LoggerFactory;
@@ -42,7 +42,7 @@ public class GeneratePDF {
 	@Autowired
 	private GenerateSWF generateSWF;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 
 	public HashMap<String, HashMap<String, String>> convertPDF(String fileName,
 			String roomName, boolean fullProcessing, File inFile)
@@ -105,8 +105,10 @@ public class GeneratePDF {
 	public HashMap<String, String> doJodConvert(File fileFullPath, File destinationFolder, String outputfile) {
 		try {
 
-			String jodPath = cfgManagement.getConfValue("jod.path", String.class, "./jod");
-			String officePath = cfgManagement.getConfValue("office.path", String.class, "");
+			String jodPath = configurationDaoImpl.getConfValue("jod.path",
+					String.class, "./jod");
+			String officePath = configurationDaoImpl.getConfValue(
+					"office.path", String.class, "");
 
 			File jodFolder = new File(jodPath);
 			if (!jodFolder.exists() || !jodFolder.isDirectory()) {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateSWF.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateSWF.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateSWF.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/documents/GenerateSWF.java Sat Sep 29 15:30:07 2012
@@ -25,7 +25,7 @@ import java.util.HashMap;
 import java.util.List;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.utils.ProcessHelper;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
@@ -37,7 +37,7 @@ public class GenerateSWF {
 			.getLogger(GenerateSWF.class, OpenmeetingsVariables.webAppRootKey);
 
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 
 	public final static boolean isPosix = System.getProperty("os.name")
 			.toUpperCase().indexOf("WINDOWS") == -1;
@@ -45,7 +45,8 @@ public class GenerateSWF {
 	public final static String execExt = isPosix ? "" : ".exe";
 
 	private String getPathToSwfTools() {
-		String pathToSWFTools = cfgManagement.getConfValue("swftools_path", String.class, "");
+		String pathToSWFTools = configurationDaoImpl.getConfValue(
+				"swftools_path", String.class, "");
 		// If SWFTools Path is not blank a File.separator at the end of the path
 		// is needed
 		if (!pathToSWFTools.equals("")
@@ -56,7 +57,8 @@ public class GenerateSWF {
 	}
 
 	private String getSwfZoom() {
-		String valueForSwfZoom = cfgManagement.getConfValue("swftools_zoom", String.class, "");
+		String valueForSwfZoom = configurationDaoImpl.getConfValue(
+				"swftools_zoom", String.class, "");
 		// WARNING CODE NOT COMPLETE: If SWFTools zoom (dpi) should be an integer between 50 and  600 with a default value of 100 dpi
 		if (valueForSwfZoom.equals("")) {
 			valueForSwfZoom = "72";
@@ -65,7 +67,8 @@ public class GenerateSWF {
 	}
 
 	private String getSwfJpegQuality() {
-		String valueForSwfJpegQuality = cfgManagement.getConfValue("swftools_jpegquality", String.class, "");
+		String valueForSwfJpegQuality = configurationDaoImpl.getConfValue(
+				"swftools_jpegquality", String.class, "");
 		// WARNING CODE NOT COMPLETE: If SWFTools JPEG Quality should be an integer between 1 and 100, with a default value of 85
 		if (valueForSwfJpegQuality.equals("")) {
 			valueForSwfJpegQuality = "85";

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java Sat Sep 29 15:30:07 2012
@@ -29,11 +29,11 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.ErrorManagement;
 import org.apache.openmeetings.data.basic.FieldLanguageDaoImpl;
 import org.apache.openmeetings.data.basic.Fieldmanagment;
 import org.apache.openmeetings.data.basic.Navimanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.basic.dao.OmTimeZoneDaoImpl;
 import org.apache.openmeetings.data.calendar.daos.AppointmentCategoryDaoImpl;
 import org.apache.openmeetings.data.calendar.daos.AppointmentReminderTypDaoImpl;
@@ -63,7 +63,7 @@ public class ImportInitvalues {
 			ImportInitvalues.class, OpenmeetingsVariables.webAppRootKey);
 
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Usermanagement userManagement;
 	@Autowired
@@ -252,9 +252,8 @@ public class ImportInitvalues {
 	}
 
 	public void loadConfiguration(InstallationConfig cfg) {
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"crypt_ClassName",
 						cfg.cryptClassName,
 						null,
@@ -263,83 +262,88 @@ public class ImportInitvalues {
 								+ "running previous Pass of users will not be workign anymore! "
 								+ "for more Information see http://incubator.apache.org/openmeetings/CustomCryptMechanism.html");
 
-		cfgManagement.addConfByKey(3, "allow_frontend_register",
-				cfg.allowFrontendRegister, null, "");
+		configurationDaoImpl.addConfByKey("allow_frontend_register",
+				cfg.allowFrontendRegister,
+				null, "");
 
-		cfgManagement.addConfByKey(3, "default_group_id", "1", null, "");
+		configurationDaoImpl.addConfByKey("default_group_id", "1", null, "");
 
 		// this domain_id is the Organisation of users who register through the
 		// frontend
-		cfgManagement.addConfByKey(3, "default_domain_id", "1", null, "");
+		configurationDaoImpl.addConfByKey("default_domain_id", "1", null, "");
 
 		// "smtp.xmlcrm.org"
-		cfgManagement.addConfByKey(3, "smtp_server", cfg.smtpServer, null,
+		configurationDaoImpl.addConfByKey("smtp_server", cfg.smtpServer, null,
 				"this is the smtp server to send messages");
 		// 25
-		cfgManagement.addConfByKey(3, "smtp_port", cfg.smtpPort, null,
+		configurationDaoImpl.addConfByKey("smtp_port", cfg.smtpPort, null,
 				"this is the smtp server port normally 25");
 		// "openmeetings@xmlcrm.org"
-		cfgManagement.addConfByKey(3, "system_email_addr", cfg.mailReferer, null,
-				"all send EMails by the system will have this address");
+		configurationDaoImpl.addConfByKey("system_email_addr", cfg.mailReferer,
+				null, "all send EMails by the system will have this address");
 		// "openmeetings@xmlcrm.org"
-		cfgManagement.addConfByKey(3, "email_username", cfg.mailAuthName, null,
-				"System auth email username");
+		configurationDaoImpl.addConfByKey("email_username", cfg.mailAuthName,
+				null, "System auth email username");
 		//
-		cfgManagement.addConfByKey(3, "email_userpass", cfg.mailAuthPass, null,
-				"System auth email password");
+		configurationDaoImpl.addConfByKey("email_userpass", cfg.mailAuthPass,
+				null, "System auth email password");
 
-		cfgManagement.addConfByKey(3, "mail.smtp.starttls.enable", cfg.mailUseTls,
-				null, "Enable TLS 1=true, 0=false");
-
-		cfgManagement.addConfByKey(3, "application.name",
-				Configurationmanagement.DEFAULT_APP_NAME, null,
-				"Name of the Browser Title window");
+		configurationDaoImpl.addConfByKey("mail.smtp.starttls.enable",
+				cfg.mailUseTls, null,
+				"Enable TLS 1=true, 0=false");
+
+		configurationDaoImpl.addConfByKey("application.name",
+				ConfigurationDaoImpl.DEFAULT_APP_NAME,
+				null, "Name of the Browser Title window");
 
 		// "1" == "EN"
-		cfgManagement.addConfByKey(3, "default_lang_id", cfg.defaultLangId, null,
-				"Default System Language ID see language.xml");
+		configurationDaoImpl.addConfByKey("default_lang_id", cfg.defaultLangId,
+				null, "Default System Language ID see language.xml");
 
-		cfgManagement.addConfByKey(3, "swftools_zoom", cfg.swfZoom, null,
+		configurationDaoImpl.addConfByKey("swftools_zoom", cfg.swfZoom, null,
 				"dpi for conversion of PDF to SWF");
 
-		cfgManagement.addConfByKey(3, "swftools_jpegquality", cfg.swfJpegQuality, null,
+		configurationDaoImpl.addConfByKey("swftools_jpegquality",
+				cfg.swfJpegQuality, null,
 				"compression quality for conversion of PDF to SWF");
 
-		cfgManagement.addConfByKey(3, "swftools_path", cfg.swfPath, null,
+		configurationDaoImpl.addConfByKey("swftools_path", cfg.swfPath, null,
 				"Path To SWF-Tools");
 
-		cfgManagement.addConfByKey(3, "imagemagick_path", cfg.imageMagicPath, null,
-				"Path to ImageMagick tools");
+		configurationDaoImpl.addConfByKey("imagemagick_path",
+				cfg.imageMagicPath, null, "Path to ImageMagick tools");
 
-		cfgManagement.addConfByKey(3, "sox_path", cfg.soxPath, null,
+		configurationDaoImpl.addConfByKey("sox_path", cfg.soxPath, null,
 				"Path To SoX-Tools");
 
-		cfgManagement.addConfByKey(3, "ffmpeg_path", cfg.ffmpegPath, null,
+		configurationDaoImpl.addConfByKey("ffmpeg_path", cfg.ffmpegPath, null,
 				"Path To FFMPEG");
-		cfgManagement.addConfByKey(3, "office.path", cfg.officePath, null,
-				"The path to OpenOffice/LibreOffice (optional) please set this to the real path in case jodconverter is unable to find OpenOffice/LibreOffice installation automatically");
-		cfgManagement
+		configurationDaoImpl
+				.addConfByKey(
+						"office.path",
+						cfg.officePath,
+						null,
+						"The path to OpenOffice/LibreOffice (optional) please set this to the real path in case jodconverter is unable to find OpenOffice/LibreOffice installation automatically");
+		configurationDaoImpl
 			.addConfByKey(
-					3,
 					"jod.path",
 					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");
 
 		
-		cfgManagement.addConfByKey(3, "rss_feed1", cfg.urlFeed, null, "Feed URL");
+		configurationDaoImpl.addConfByKey("rss_feed1", cfg.urlFeed, null,
+				"Feed URL");
 
-		cfgManagement.addConfByKey(3, "rss_feed2", cfg.urlFeed2, null,
+		configurationDaoImpl.addConfByKey("rss_feed2", cfg.urlFeed2, null,
 				"Feed URL 2");
 
-		cfgManagement
-				.addConfByKey(3, "sendEmailAtRegister", cfg.sendEmailAtRegister,
-						null,
+		configurationDaoImpl
+				.addConfByKey("sendEmailAtRegister", cfg.sendEmailAtRegister, null,
 						"User get a EMail with their Account data. Values: 0(No) or 1(Yes)");
 
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"sendEmailWithVerficationCode",
 						cfg.sendEmailWithVerficationCode,
 						null,
@@ -348,16 +352,15 @@ public class ImportInitvalues {
 								+ "It makes no sense to make this(sendEmailWithVerficationCode) 1(Yes) while "
 								+ "sendEmailAtRegister is 0(No) cause you need"
 								+ "to send a EMail.");
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"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");
 
-		cfgManagement.addConfByKey(3, "default.rpc.userid", "" + 1, null,
+		configurationDaoImpl.addConfByKey("default.rpc.userid", "" + 1, null,
 				"The User-Id of the Control User in OpenMeetings");
 
         // ***************************************
@@ -365,11 +368,13 @@ public class ImportInitvalues {
         // red5SIP Integration Coniguration Values
         // ***************************************
 
-        cfgManagement.addConfByKey(3, "red5sip.enable", cfg.red5SipEnable, null,
-				"Enable to enable the red5SIP integration ");
-        cfgManagement.addConfByKey(3, "red5sip.room_prefix", cfg.red5SipRoomPrefix, null,
+		configurationDaoImpl.addConfByKey("red5sip.enable", cfg.red5SipEnable,
+				null, "Enable to enable the red5SIP integration ");
+		configurationDaoImpl.addConfByKey("red5sip.room_prefix",
+				cfg.red5SipRoomPrefix, null,
 				"Enable to enable the red5SIP integration ");
-        cfgManagement.addConfByKey(3, "red5sip.exten_context", cfg.red5SipExtenContext, null,
+		configurationDaoImpl.addConfByKey("red5sip.exten_context",
+				cfg.red5SipExtenContext, null,
 				"Enable to enable the red5SIP integration ");
 
 		// ***************************************
@@ -377,40 +382,39 @@ public class ImportInitvalues {
 		// SIP Applet Configuration Values
 		// ***************************************
 
-		cfgManagement.addConfByKey(3, "sip.enable", cfg.sipEnable, null,
+		configurationDaoImpl.addConfByKey("sip.enable", cfg.sipEnable, null,
 				"Enable to load the SIP Applet in the Client and "
-						+ "call the SIP Applet whenever you enter a Room");
+				+ "call the SIP Applet whenever you enter a Room");
 
-		cfgManagement.addConfByKey(3, "sip.realm", cfg.sipRealm, null,
+		configurationDaoImpl.addConfByKey("sip.realm", cfg.sipRealm, null,
 				"So called *Domain of the SIP Provider*");
 
-		cfgManagement.addConfByKey(3, "sip.port", cfg.sipPort, null, "SIP Port");
+		configurationDaoImpl.addConfByKey("sip.port", cfg.sipPort, null,
+				"SIP Port");
 
-		cfgManagement.addConfByKey(3, "sip.proxyname", cfg.sipProxyName, null,
-				"SIP Proxy name (this is the outbound proxy)");
+		configurationDaoImpl.addConfByKey("sip.proxyname", cfg.sipProxyName,
+				null, "SIP Proxy name (this is the outbound proxy)");
 
-		cfgManagement
-				.addConfByKey(3, "sip.tunnel", cfg.sipTunnel, null,
-						"SIP Tunnel IP + Port, format domain:port, for example 10.0.0.0:443");
+		configurationDaoImpl
+				.addConfByKey("sip.tunnel", cfg.sipTunnel, null, "SIP Tunnel IP + Port, format domain:port, for example 10.0.0.0:443");
 
-		cfgManagement.addConfByKey(3, "sip.codebase", cfg.sipCodebase, null,
-				"The Base-URL to load the Ringtone from");
+		configurationDaoImpl.addConfByKey("sip.codebase", cfg.sipCodebase,
+				null, "The Base-URL to load the Ringtone from");
 
-		cfgManagement.addConfByKey(3, "sip.forcetunnel", cfg.sipForceTunnel, null,
-				"Force usage of the tunnel");
+		configurationDaoImpl.addConfByKey("sip.forcetunnel",
+				cfg.sipForceTunnel, null, "Force usage of the tunnel");
 
 		// ***************************************
 		// ***************************************
 		// OpenXG Configuration Values
 		// ***************************************
 
-		cfgManagement.addConfByKey(3, "sip.openxg.enable", cfg.sipOpenxgEnable,
-				null,
+		configurationDaoImpl.addConfByKey("sip.openxg.enable",
+				cfg.sipOpenxgEnable, null,
 				"Enable the OpenXG XML-RPC Gateway through the Wrapper URL");
 
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"openxg.wrapper.url",
 						cfg.openxgWrapperUrl,
 						null,
@@ -418,147 +422,155 @@ public class ImportInitvalues {
 								+ "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", cfg.openxgClientId,
-				null, "OpenXG XML-RPC Client ID");
-
-		cfgManagement.addConfByKey(3, "openxg.client.secret",
-				cfg.openxgClientSecret, null, "OpenXG XML-RPC Client Secret");
-
-		cfgManagement.addConfByKey(3, "openxg.client.domain",
-				cfg.openxgClientDomain, null, "OpenXG Domain");
-
-		cfgManagement.addConfByKey(3, "openxg.community.code",
-				cfg.openxgCommunityCode, null, "OpenXG Community Code");
-
-		cfgManagement.addConfByKey(3, "openxg.language.code",
-				cfg.openxgLanguageCode, null, "OpenXG Language Code");
+		configurationDaoImpl.addConfByKey("openxg.client.id",
+				cfg.openxgClientId, null,
+				"OpenXG XML-RPC Client ID");
+
+		configurationDaoImpl.addConfByKey("openxg.client.secret",
+				cfg.openxgClientSecret,
+				null, "OpenXG XML-RPC Client Secret");
+
+		configurationDaoImpl.addConfByKey("openxg.client.domain",
+				cfg.openxgClientDomain,
+				null, "OpenXG Domain");
+
+		configurationDaoImpl.addConfByKey("openxg.community.code",
+				cfg.openxgCommunityCode,
+				null, "OpenXG Community Code");
+
+		configurationDaoImpl.addConfByKey("openxg.language.code",
+				cfg.openxgLanguageCode,
+				null, "OpenXG Language Code");
 
-		cfgManagement.addConfByKey(3, "openxg.adminid", cfg.openxgAdminId, null,
-				"OpenXG Admin ID");
+		configurationDaoImpl.addConfByKey("openxg.adminid", cfg.openxgAdminId,
+				null, "OpenXG Admin ID");
 
 		// ***************************************
 		// ***************************************
 		// Phone Range Configuration Values
 		// ***************************************
 
-		cfgManagement.addConfByKey(3, "sip.language.phonecode",
-				cfg.sipLanguagePhoneCode, null, "For example +358 for Finland");
+		configurationDaoImpl.addConfByKey("sip.language.phonecode",
+				cfg.sipLanguagePhoneCode,
+				null, "For example +358 for Finland");
 
-		cfgManagement
-				.addConfByKey(3, "sip.phonerange.start", cfg.sipPhoneRangeStart,
-						null,
+		configurationDaoImpl
+				.addConfByKey("sip.phonerange.start", cfg.sipPhoneRangeStart, null,
 						"The first number in the Range of Phone Numbers in national format");
 
-		cfgManagement.addConfByKey(3, "sip.phonerange", cfg.sipPhoneRange, null,
-				"Amount of numbers in the Phone Range available");
-
-		cfgManagement.addConfByKey(3, "sip.phonerange.currentindex", "" + 0,
-				null, "Number of used Phone Numbers in the sip.phonerange");
+		configurationDaoImpl.addConfByKey("sip.phonerange", cfg.sipPhoneRange,
+				null, "Amount of numbers in the Phone Range available");
 
-		cfgManagement
-				.addConfByKey(3, "sip.phonerange.conference.currentindex",
-						"" + 0, null,
-						"Number of used Phone Numbers in the sip.phonerange for the conferences");
+		configurationDaoImpl.addConfByKey("sip.phonerange.currentindex",
+				"" + 0, null,
+				"Number of used Phone Numbers in the sip.phonerange");
+
+		configurationDaoImpl
+				.addConfByKey("sip.phonerange.conference.currentindex", "" + 0,
+						null, "Number of used Phone Numbers in the sip.phonerange for the conferences");
 
 		// ***************************************
 		// ***************************************
 		// Timezone settings
 		// ***************************************
 
-		cfgManagement.addConfByKey(3, "default.timezone", cfg.ical_timeZone,
-				null, "This is the default timezone if nothing is specified");
+		configurationDaoImpl.addConfByKey("default.timezone",
+				cfg.ical_timeZone, null,
+				"This is the default timezone if nothing is specified");
 
 		// ***************************************
 		// ***************************************
 		// additional settings
 		// ***************************************
 
-		cfgManagement.addConfByKey(3, "show.facebook.login", "" + 0, null,
+		configurationDaoImpl.addConfByKey("show.facebook.login", "" + 0, null,
 				"Show Facebook Login");
 
-		cfgManagement.addConfByKey(3, "default.quality.screensharing", "1",
+		configurationDaoImpl
+				.addConfByKey(
+						"default.quality.screensharing",
+						"1",
 						null,
 						"Default selection in ScreenSharing Quality:\n 0 - bigger frame rate, no resize\n 1 - no resize\n 2 - size == 1/2 of selected area\n 3 - size == 3/8 of selected area");
 
-		cfgManagement.addConfByKey(3, "default.dashboard.tab", "0", null,
+		configurationDaoImpl.addConfByKey("default.dashboard.tab", "0", null,
 				"Default selection in Dashboard tabs as tab-index-id");
 
-		cfgManagement.addConfByKey(3, "dashboard.show.myrooms", "1", null,
+		configurationDaoImpl.addConfByKey("dashboard.show.myrooms", "1", null,
 				"Show My Rooms Tab");
 
-		cfgManagement.addConfByKey(3, "dashboard.show.chat", "1", null,
+		configurationDaoImpl.addConfByKey("dashboard.show.chat", "1", null,
 				"Show Chat Tab");
 
-		cfgManagement.addConfByKey(3, "dashboard.show.rssfeed", "0", null,
+		configurationDaoImpl.addConfByKey("dashboard.show.rssfeed", "0", null,
 				"Show RSS Tab");
 
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"show.whiteboard.draw.status",
 						"0",
 						null,
 						"Display name of the user who draw the current object (User Name auto-disapper after 3 seconds.");
 
-		cfgManagement.addConfByKey(3, "max_upload_size", new Integer(
-				ImportHelper.DEFAULT_MAX_UPLOAD_SIZE).toString(), null,
-				"Maximum size of upload file (bytes)"); // defaults to 1GB
+		configurationDaoImpl.addConfByKey("max_upload_size", new Integer(
+				ImportHelper.DEFAULT_MAX_UPLOAD_SIZE).toString(), null, "Maximum size of upload file (bytes)"); // defaults to 1GB
 
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"number.minutes.reminder.send",
 						"15",
 						null,
 						"The number of minutes before reminder emails are send. Set to 0 to disable reminder emails");
 
-		cfgManagement.addConfByKey(3, "user.login.minimum.length", "" + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH, null,
+		configurationDaoImpl.addConfByKey("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", "" + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH, null,
+		configurationDaoImpl.addConfByKey("user.pass.minimum.length", ""
+				+ InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH, null,
 				"Number of chars needed in a user login");
 
-		cfgManagement
-				.addConfByKey(3, "calendar.conference.rooms.default.size",
-						"50", null,
-						"Default number of participants conference room created via calendar");
+		configurationDaoImpl
+				.addConfByKey("calendar.conference.rooms.default.size", "50",
+						null, "Default number of participants conference room created via calendar");
 
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"use.old.style.ffmpeg.map.option",
 						"0",
 						null,
 						"specify a 1 if you would like to use old FFMPEG -map option with 0.0 instead of 0:0");
 
 		// give exclusive audio key code
-		cfgManagement
+		configurationDaoImpl
 				.addConfByKey(
-						3,
 						"exclusive.audio.keycode",
 						"123",
 						null,
 						"A hot key code for the 'give exclusive audio' functionality. Keycode 123 is F12");
 
 		// system-wide ldap params
-		cfgManagement.addConfByKey(
-						3, 
+		configurationDaoImpl.addConfByKey(
 						"ldap_default_id", 
 						"0", 
-						null,
+						null, 
 						"Ldap domain selected by default in the login screen");
 		
 		// set inviter's email address as ReplyTo in email invitations
-		cfgManagement.addConfByKey(
-						3, 
+		configurationDaoImpl
+				.addConfByKey(
 						"inviter.email.as.replyto", 
 						cfg.replyToOrganizer, 
-						null,
+						null, 
 						"Set inviter's email address as ReplyTo in email invitations (1 == set, 0 == NOT set)");
 		
-		cfgManagement.addConfByKey(3, "default.landing.zone", "dashboard.rooms", null,
-			"Area to be shown to the user after login. Possible values are: "
-			+ "dashboard.rooms, dashboard.chat, calendar, rooms.public, rooms.private, rooms.user");
+		configurationDaoImpl
+				.addConfByKey(
+						"default.landing.zone",
+						"dashboard.rooms",
+						null,
+						"Area to be shown to the user after login. Possible values are: "
+		+ "dashboard.rooms, dashboard.chat, calendar, rooms.public, rooms.private, rooms.user");
 		
 		log.debug("Configuration ADDED");
 	}

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/ldap/LdapLoginManagement.java Sat Sep 29 15:30:07 2012
@@ -27,8 +27,8 @@ import java.util.Random;
 import java.util.Vector;
 
 import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.Configurationmanagement;
 import org.apache.openmeetings.data.basic.Sessionmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.basic.dao.LdapConfigDaoImpl;
 import org.apache.openmeetings.data.basic.dao.OmTimeZoneDaoImpl;
 import org.apache.openmeetings.data.user.Statemanagement;
@@ -58,7 +58,7 @@ public class LdapLoginManagement {
 	@Autowired
 	private Sessionmanagement sessionManagement;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
 	@Autowired
 	private Usermanagement userManagement;
 	@Autowired
@@ -638,7 +638,8 @@ public class LdapLoginManagement {
 			jName_timeZone = userdata.get(ldapAttrs.get("timezoneAttr"));
 		
 		if (omTimeZoneDaoImpl.getOmTimeZone(jName_timeZone) == null) {
-			jName_timeZone = cfgManagement.getConfValue("default.timezone", String.class, "Europe/Berlin");
+			jName_timeZone = configurationDaoImpl.getConfValue(
+					"default.timezone", String.class, "Europe/Berlin");
 		}
 
 		if (state != null) {
@@ -687,9 +688,12 @@ public class LdapLoginManagement {
 					new java.util.Date(), //age
 					street,
 					additionalname, fax, zip, state_id, town, 
-					cfgManagement.getConfValue("default_lang_id", Long.class,"0"), //language_id
+					configurationDaoImpl.getConfValue("default_lang_id",
+							Long.class, "0"), // language_id
 					false, // sendWelcomeMessage
-					Arrays.asList(cfgManagement.getConfValue("default_domain_id", Long.class, null)), //organozation Ids
+					Arrays.asList(configurationDaoImpl.getConfValue(
+							"default_domain_id", Long.class, null)), // organozation
+																		// Ids
 					phone, 
 					false,
 					"",// BaseURL is empty as we do not send an Email here

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java?rev=1391821&r1=1391820&r2=1391821&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java Sat Sep 29 15:30:07 2012
@@ -20,23 +20,34 @@ package org.apache.openmeetings.remote;
 
 import java.util.LinkedHashMap;
 
-import org.apache.openmeetings.data.basic.Configurationmanagement;
+import org.apache.openmeetings.OpenmeetingsVariables;
+import org.apache.openmeetings.data.basic.AuthLevelmanagement;
 import org.apache.openmeetings.data.basic.Sessionmanagement;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDaoImpl;
 import org.apache.openmeetings.data.beans.basic.SearchResult;
 import org.apache.openmeetings.data.user.Usermanagement;
 import org.apache.openmeetings.persistence.beans.basic.Configuration;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
 /**
+ * Remotely available via RTMP
  * 
  * @author swagner
- *
+ * 
  */
 public class ConfigurationService {
+
+	private static final Logger log = Red5LoggerFactory.getLogger(
+			ConfigurationService.class, OpenmeetingsVariables.webAppRootKey);
+
+	@Autowired
+	private AuthLevelmanagement authLevelManagement;
 	@Autowired
 	private Sessionmanagement sessionManagement;
 	@Autowired
-	private Configurationmanagement cfgManagement;
+	private ConfigurationDaoImpl configurationDaoImpl;
     @Autowired
     private Usermanagement userManagement;
 	
@@ -45,26 +56,73 @@ public class ConfigurationService {
 	 */    
     public SearchResult<Configuration> getAllConf(String SID, int start ,int max, String orderby, boolean asc){
         Long users_id = sessionManagement.checkSession(SID);
-        Long user_level = userManagement.getUserLevelByID(users_id);     	
-        return cfgManagement.getAllConf(user_level, start, max, orderby, asc);
+		Long user_level = userManagement.getUserLevelByID(users_id);
+		if (authLevelManagement.checkAdminLevel(user_level)) {
+			return configurationDaoImpl.getAllConf(start, max, orderby, asc);
+		} else {
+			log.error("[getConfByConfigurationId] Permission denied "
+					+ user_level);
+		}
+		return null;
     }
     
+	/**
+	 * Get a configuration by id, users object is lazy loaded
+	 * 
+	 * @param SID
+	 * @param configuration_id
+	 * @return
+	 */
     public Configuration getConfByConfigurationId(String SID,long configuration_id){
         Long users_id = sessionManagement.checkSession(SID);
         Long user_level = userManagement.getUserLevelByID(users_id);     	
-        return cfgManagement.getConfByConfigurationId(user_level,configuration_id);
+		if (authLevelManagement.checkAdminLevel(user_level)) {
+			return configurationDaoImpl.get(configuration_id);
+		} else {
+			log.error("[getConfByConfigurationId] Permission denied "
+					+ user_level);
+		}
+		return null;
     }
     
+	/**
+	 * Save or update a configuration
+	 * 
+	 * @param SID
+	 * @param values
+	 * @return
+	 */
     public Long saveOrUpdateConfiguration(String SID, LinkedHashMap<String, ?> values){
         Long users_id = sessionManagement.checkSession(SID);
-        Long user_level = userManagement.getUserLevelByID(users_id);     	
-        return cfgManagement.saveOrUpdateConfiguration(user_level, values, users_id);
+		Long user_level = userManagement.getUserLevelByID(users_id);
+		if (authLevelManagement.checkAdminLevel(user_level)) {
+			return configurationDaoImpl.saveOrUpdateConfiguration(values,
+					users_id);
+		} else {
+			log.error("[getConfByConfigurationId] Permission denied "
+					+ user_level);
+		}
+		return null;
     }
     
+	/**
+	 * delete a configuration
+	 * 
+	 * @param SID
+	 * @param values
+	 * @return
+	 */
     public Long deleteConfiguration(String SID, LinkedHashMap<String, ?> values){
         Long users_id = sessionManagement.checkSession(SID);
-        Long user_level = userManagement.getUserLevelByID(users_id);     	
-        return cfgManagement.deleteConfByConfiguration(user_level, values, users_id);
+		Long user_level = userManagement.getUserLevelByID(users_id);
+		if (authLevelManagement.checkAdminLevel(user_level)) {
+			return configurationDaoImpl.deleteConfByConfiguration(values,
+					users_id);
+		} else {
+			log.error("[getConfByConfigurationId] Permission denied "
+					+ user_level);
+		}
+		return null;
     }
 	    
 }