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 2013/04/08 06:17:58 UTC
svn commit: r1465534 - in /openmeetings/trunk/singlewebapp:
WebContent/languages/ WebContent/src/modules/admin/confadmin/ docs/
src/org/apache/openmeetings/data/basic/dao/
src/org/apache/openmeetings/installation/
src/org/apache/openmeetings/persistenc...
Author: solomax
Date: Mon Apr 8 04:17:56 2013
New Revision: 1465534
URL: http://svn.apache.org/r1465534
Log:
[OPENMEETINGS-560] it is impossible to have configurations with duplicate values
Modified:
openmeetings/trunk/singlewebapp/WebContent/languages/arabic.xml
openmeetings/trunk/singlewebapp/WebContent/languages/bulgarian.xml
openmeetings/trunk/singlewebapp/WebContent/languages/catalan.xml
openmeetings/trunk/singlewebapp/WebContent/languages/chinese simplified.xml
openmeetings/trunk/singlewebapp/WebContent/languages/chinese traditional.xml
openmeetings/trunk/singlewebapp/WebContent/languages/czech.xml
openmeetings/trunk/singlewebapp/WebContent/languages/danish.xml
openmeetings/trunk/singlewebapp/WebContent/languages/deutsch (studIP).xml
openmeetings/trunk/singlewebapp/WebContent/languages/deutsch.xml
openmeetings/trunk/singlewebapp/WebContent/languages/dutch.xml
openmeetings/trunk/singlewebapp/WebContent/languages/english.xml
openmeetings/trunk/singlewebapp/WebContent/languages/errorvalues.xml
openmeetings/trunk/singlewebapp/WebContent/languages/finnish.xml
openmeetings/trunk/singlewebapp/WebContent/languages/french.xml
openmeetings/trunk/singlewebapp/WebContent/languages/galician.xml
openmeetings/trunk/singlewebapp/WebContent/languages/greek.xml
openmeetings/trunk/singlewebapp/WebContent/languages/hebrew.xml
openmeetings/trunk/singlewebapp/WebContent/languages/hungarian.xml
openmeetings/trunk/singlewebapp/WebContent/languages/indonesian.xml
openmeetings/trunk/singlewebapp/WebContent/languages/italian.xml
openmeetings/trunk/singlewebapp/WebContent/languages/japanese.xml
openmeetings/trunk/singlewebapp/WebContent/languages/korean.xml
openmeetings/trunk/singlewebapp/WebContent/languages/persian.xml
openmeetings/trunk/singlewebapp/WebContent/languages/polish.xml
openmeetings/trunk/singlewebapp/WebContent/languages/portugues brazil.xml
openmeetings/trunk/singlewebapp/WebContent/languages/portugues.xml
openmeetings/trunk/singlewebapp/WebContent/languages/russian.xml
openmeetings/trunk/singlewebapp/WebContent/languages/slovak.xml
openmeetings/trunk/singlewebapp/WebContent/languages/spanish.xml
openmeetings/trunk/singlewebapp/WebContent/languages/swedish.xml
openmeetings/trunk/singlewebapp/WebContent/languages/thai.xml
openmeetings/trunk/singlewebapp/WebContent/languages/turkish.xml
openmeetings/trunk/singlewebapp/WebContent/languages/ukrainian.xml
openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdminValueForm.lzx
openmeetings/trunk/singlewebapp/docs/ErrorsTable.html
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/config/TestConfig.java
openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/arabic.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/arabic.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/arabic.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/arabic.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/bulgarian.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/bulgarian.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/bulgarian.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/bulgarian.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/catalan.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/catalan.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/catalan.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/catalan.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/chinese simplified.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/chinese%20simplified.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/chinese simplified.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/chinese simplified.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/chinese traditional.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/chinese%20traditional.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/chinese traditional.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/chinese traditional.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/czech.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/czech.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/czech.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/czech.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/danish.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/danish.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/danish.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/danish.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/deutsch (studIP).xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/deutsch%20%28studIP%29.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/deutsch (studIP).xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/deutsch (studIP).xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/deutsch.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/deutsch.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/deutsch.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/deutsch.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/dutch.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/dutch.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/dutch.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/dutch.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/english.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/english.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/english.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/english.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/errorvalues.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/errorvalues.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/errorvalues.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/errorvalues.xml Mon Apr 8 04:17:56 2013
@@ -460,4 +460,12 @@
<field name="fieldvalues_id">1540</field>
<field name="errortype_id">1</field>
</row>
+ <row>
+ <field name="errorvalues_id">56</field>
+ <field name="starttime" />
+ <field name="updatetime" />
+ <field name="deleted">false</field>
+ <field name="fieldvalues_id">1544</field>
+ <field name="errortype_id">1</field>
+ </row>
</ROOT>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/finnish.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/finnish.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/finnish.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/finnish.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/french.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/french.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/french.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/french.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/galician.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/galician.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/galician.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/galician.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/greek.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/greek.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/greek.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/greek.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/hebrew.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/hebrew.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/hebrew.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/hebrew.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/hungarian.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/hungarian.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/hungarian.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/hungarian.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/indonesian.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/indonesian.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/indonesian.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/indonesian.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/italian.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/italian.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/italian.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/italian.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/japanese.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/japanese.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/japanese.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/japanese.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/korean.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/korean.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/korean.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/korean.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/persian.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/persian.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/persian.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/persian.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/polish.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/polish.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/polish.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/polish.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/portugues brazil.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/portugues%20brazil.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/portugues brazil.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/portugues brazil.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/portugues.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/portugues.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/portugues.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/portugues.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/russian.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/russian.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/russian.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/russian.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>инÑеÑвÑÑ (1:1 вÑÑÑеÑа Ñ Ð·Ð°Ð¿Ð¸ÑÑÑ)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/slovak.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/slovak.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/slovak.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/slovak.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/spanish.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/spanish.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/spanish.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/spanish.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/swedish.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/swedish.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/swedish.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/swedish.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/thai.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/thai.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/thai.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/thai.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/turkish.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/turkish.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/turkish.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/turkish.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/languages/ukrainian.xml
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/languages/ukrainian.xml?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/languages/ukrainian.xml (original)
+++ openmeetings/trunk/singlewebapp/WebContent/languages/ukrainian.xml Mon Apr 8 04:17:56 2013
@@ -4655,4 +4655,7 @@ see http://openmeetings.apache.org/Langu
<string id="1543" name="conference_room_type">
<value>interview (1:1 meeting with recording)</value>
</string>
+ <string id="1544" name="duplicate_key_error">
+ <value>Configuration with given key already exists, please specify another key or edit existent configuration</value>
+ </string>
</language>
Modified: openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdminValueForm.lzx
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdminValueForm.lzx?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdminValueForm.lzx (original)
+++ openmeetings/trunk/singlewebapp/WebContent/src/modules/admin/confadmin/confAdminValueForm.lzx Mon Apr 8 04:17:56 2013
@@ -47,8 +47,7 @@
</handler>
<handler name="ondelete" >
- if (this.configuration_id!=0){
- this.deleteConfiguration.prepareCall();
+ if (this.configuration_id != 0){
this.deleteConfiguration.doCall();
}
</handler>
@@ -86,17 +85,8 @@
</netRemoteCallHib>
<netRemoteCallHib name="deleteConfiguration" funcname="configservice.deleteConfiguration" remotecontext="$once{ canvas.thishib }" >
- <attribute name="sendObject" value="null" />
- <method name="prepareCall">
- this.sendObject=new Array();
- this.sendObject["configuration_id"] = this.parent.configuration_id;
- this.sendObject["comment"] = this.parent.comment.getText();
- this.sendObject["conf_key"] = this.parent.conf_key.getText();
- this.sendObject["conf_value"] = this.parent.conf_value.getText();
- //Debug.write("prepareCall: ",this.sendObject);
- </method>
<netparam><method name="getValue">return canvas.sessionId; </method></netparam>
- <netparam><method name="getValue">return parent.sendObject;</method></netparam>
+ <netparam><method name="getValue">return parent.parent.configuration_id;</method></netparam>
<handler name="ondata" args="value">
//Debug.write("deleteConfiguration ",value);
if (value>0){
@@ -106,33 +96,24 @@
</handler>
</netRemoteCallHib>
- <netRemoteCallHib name="saveOrUpdateConfiguration" funcname="configservice.saveOrUpdateConfiguration"
- remotecontext="$once{ canvas.thishib }" registerObject="true" >
- <attribute name="sendObject" value="null" />
- <!-- gets called by Observer -->
- <method name="prepareCall">
- this.sendObject=new Array();
- this.sendObject["configuration_id"] = this.parent.configuration_id;
- this.sendObject["comment"] = this.parent.comment.getText();
- this.sendObject["conf_key"] = this.parent.conf_key.getText();
- this.sendObject["conf_value"] = this.parent.conf_value.getText();
- //Debug.write("prepareCall: ",this.sendObject);
- </method>
- <netparam><method name="getValue">return canvas.sessionId; </method></netparam>
- <netparam><method name="getValue">return parent.sendObject;</method></netparam>
- <handler name="ondata" args="val">
- <![CDATA[
- //Debug.write("saveOrUpdateConfiguration ",val);
- if (val>0){
- //Debug.write("updateConfByConfigurationId val greater 0: ",val);
+ <netRemoteCallHib name="saveOrUpdateConfiguration" funcname="configservice.saveOrUpdateConfiguration"
+ remotecontext="$once{ canvas.thishib }" registerObject="true" >
+ <netparam><method name="getValue">return canvas.sessionId; </method></netparam>
+ <netparam><method name="getValue">return parent.parent.configuration_id;</method></netparam>
+ <netparam><method name="getValue">return parent.parent.conf_key.getText();</method></netparam>
+ <netparam><method name="getValue">return parent.parent.conf_value.getText();</method></netparam>
+ <netparam><method name="getValue">return parent.parent.comment.getText();</method></netparam>
+ <handler name="ondata" args="val">
+ <![CDATA[
+ //if ($debug) Debug.write("saveOrUpdateConfiguration ",val);
+ if (val > 0) {
+ //if ($debug) Debug.write("updateConfByConfigurationId val greater 0: ",val);
this.parent.parent._turnoverlist.oncallnext.sendEvent();
- var obj = new Array();
- obj["configuration_id"] = val;
- this.parent.initValueFieldsByObject(obj);
+ this.parent.initValueFieldsByObject({configuration_id: val});
}
- ]]>
- </handler>
- </netRemoteCallHib>
+ ]]>
+ </handler>
+ </netRemoteCallHib>
<!-- content -->
Modified: openmeetings/trunk/singlewebapp/docs/ErrorsTable.html
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/docs/ErrorsTable.html?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/docs/ErrorsTable.html (original)
+++ openmeetings/trunk/singlewebapp/docs/ErrorsTable.html Mon Apr 8 04:17:56 2013
@@ -1263,6 +1263,17 @@ limitations under the License.
Please specify your timezone
</td>
</tr>
+ <tr>
+ <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left" style="color: black; font-size: small; font-family: arial, helvetica, sanserif;">
+ -56
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left" style="color: black; font-size: small; font-family: arial, helvetica, sanserif;">
+ Error
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left" style="color: black; font-size: small; font-family: arial, helvetica, sanserif;">
+ Configuration with given key already exists, please specify another key or edit existent configuration
+ </td>
+ </tr>
</table>
</blockquote>
</td></tr>
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java Mon Apr 8 04:17:56 2013
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.basic.dao;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.CRYPT_KEY;
+
import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.Date;
@@ -27,7 +29,6 @@ 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 org.apache.openmeetings.OpenmeetingsVariables;
@@ -74,37 +75,26 @@ public class ConfigurationDao implements
private String appName = null;
/**
+ * Retrieves Configuration regardless of its deleted status
+ *
* @param confKey
* @return
*/
- public Configuration get(String confKey) {
+ public Configuration forceGet(String confKey) {
try {
- TypedQuery<Configuration> query = em.createNamedQuery(
- "getConfigurationByKey", Configuration.class);
- query.setParameter("conf_key", confKey);
-
- List<Configuration> configs = query.getResultList();
-
- if (configs != null && configs.size() > 0) {
- return configs.get(0);
- }
- } catch (Exception ex2) {
- log.error("[getConfKey]: ", ex2);
+ List<Configuration> list = em.createNamedQuery("forceGetConfigurationByKey", Configuration.class)
+ .setParameter("conf_key", confKey).getResultList();
+ return list.isEmpty() ? null : list.get(0);
+ } catch (Exception e) {
+ log.error("[getConfKey]: ", e);
}
return null;
}
- public List<Configuration> getConfKeys(String... keys) {
- try {
- TypedQuery<Configuration> query = em.createNamedQuery(
- "getConfigurationsByKeys", Configuration.class);
- query.setParameter("conf_keys", Arrays.asList(keys));
-
- return query.getResultList();
- } catch (Exception ex2) {
- log.error("[getConfKey]: ", ex2);
- }
- return null;
+ public List<Configuration> get(String... keys) {
+ return em.createNamedQuery("getConfigurationsByKeys", Configuration.class)
+ .setParameter("conf_keys", Arrays.asList(keys))
+ .getResultList();
}
/**
@@ -113,39 +103,37 @@ public class ConfigurationDao implements
*
* Example: Integer my_key = getConfValue("my_key", Integer.class, "15");
*
- * @param confKey
- * @param typeObject
+ * @param key
+ * @param type
* @param defaultValue
* @return
*/
- public <T> T getConfValue(String confKey, Class<T> typeObject,
- String defaultValue) {
+ public <T> T getConfValue(String key, Class<T> type, String defaultValue) {
try {
- Configuration conf_reminder = get(confKey);
+ List<Configuration> list = get(key);
- if (conf_reminder == null) {
- log.warn("Could not find key in configuration CONF_KEY: " + confKey);
+ if (list == null || list.isEmpty()) {
+ log.warn("Could not find key in configuration CONF_KEY: " + key);
if (defaultValue == null) {
return null;
}
} else {
// Use the custom value as default value
- defaultValue = conf_reminder.getConf_value();
+ defaultValue = list.get(0).getConf_value();
}
// Either this can be directly assigned or try to find a constructor
// that handles it
- if (typeObject.isAssignableFrom(defaultValue.getClass())) {
- return typeObject.cast(defaultValue);
+ if (type.isAssignableFrom(defaultValue.getClass())) {
+ return type.cast(defaultValue);
}
- Constructor<T> c = typeObject.getConstructor(defaultValue
- .getClass());
+ Constructor<T> c = type.getConstructor(defaultValue.getClass());
return c.newInstance(defaultValue);
} catch (Exception err) {
log.error(
"cannot be cast to return type, you have misconfigured your configuration CONF_KEY: "
- + confKey, err);
+ + key, err);
return null;
}
}
@@ -193,44 +181,30 @@ public class ConfigurationDao implements
/**
*
* @return
+ * @deprecated please use {@link ConfigurationDao#count()}
*/
public Long selectMaxFromConfigurations() {
try {
- 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);
- List<Long> ll = query.getResultList();
- log.debug("selectMaxFromConfigurations" + ll.get(0));
- return ll.get(0);
+ return count();
} catch (Exception ex2) {
log.error("[selectMaxFromConfigurations] ", ex2);
}
return null;
}
- public String addConfByKey(String confKey, String confValue, Long userId,
- String comment) {
- String ret = "Add Configuration";
- 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 Configuration add(String key, String value, Long userId, String comment) {
+ Configuration c = new Configuration();
+ c.setConf_key(key);
+ c.setConf_value(value);
+ c.setComment(comment);
+ return update(c, userId);
}
+ /**
+ * @deprecated please use {@link ConfigurationDao#update(Configuration, Long)}
+ */
public Long saveOrUpdateConfiguration(LinkedHashMap<String, ?> values,
Long userId) {
try {
@@ -259,6 +233,9 @@ public class ConfigurationDao implements
return new Long(-1);
}
+ /**
+ * @deprecated please use {@link ConfigurationDao#update(Configuration, Long)}
+ */
public Long addConfig(Configuration conf) {
try {
conf = em.merge(conf);
@@ -270,6 +247,11 @@ public class ConfigurationDao implements
return new Long(-1);
}
+ /**
+ * @deprecated please use {@link ConfigurationDao#update(Configuration, Long)}
+ * @param conf
+ * @return
+ */
public Long updateConfig(Configuration conf) {
try {
if (conf.getConfiguration_id() == null
@@ -281,7 +263,7 @@ public class ConfigurationDao implements
conf = em.merge(conf);
}
}
- if ("crypt_ClassName".equals(conf.getConf_key())) {
+ if (CRYPT_KEY.equals(conf.getConf_key())) {
ScopeApplicationAdapter.configKeyCryptClassName = conf
.getConf_value();
} else if ("show.whiteboard.draw.status".equals(conf.getConf_key())) {
@@ -295,6 +277,9 @@ public class ConfigurationDao implements
return new Long(-1);
}
+ /**
+ * @deprecated please use {@link ConfigurationDao#delete(Configuration, Long)}
+ */
public Long deleteConfByConfiguration(LinkedHashMap<String, ?> values,
Long users_id) {
try {
@@ -329,26 +314,16 @@ public class ConfigurationDao implements
}
public Configuration get(long id) {
- 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);
+ if (id <= 0) {
+ return null;
}
- return null;
+ return em.createNamedQuery("getConfigurationById", Configuration.class)
+ .setParameter("configuration_id", id).getSingleResult();
}
public List<Configuration> get(int start, int count) {
- TypedQuery<Configuration> q = em.createNamedQuery(
- "getNondeletedConfiguration", Configuration.class);
- q.setFirstResult(start);
- q.setMaxResults(count);
- return q.getResultList();
+ return em.createNamedQuery("getNondeletedConfiguration", Configuration.class)
+ .setFirstResult(start).setMaxResults(count).getResultList();
}
public List<Configuration> get(String search, int start, int count, String sort) {
@@ -359,7 +334,7 @@ public class ConfigurationDao implements
}
public long count() {
- return selectMaxFromConfigurations();
+ return em.createNamedQuery("countConfigurations", Long.class).getSingleResult();
}
public long count(String search) {
@@ -368,22 +343,25 @@ public class ConfigurationDao implements
}
public Configuration update(Configuration entity, Long userId) {
+ return update(entity, userId, false);
+ }
+
+ public Configuration update(Configuration entity, Long userId, boolean deleted) {
String key = entity.getConf_key();
String value = entity.getConf_value();
- 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);
+ entity.setDeleted(deleted);
+ em.persist(entity);
} else {
if (userId != null) {
entity.setUser(usersDao.get(userId));
}
- entity.setDeleted(false);
+ entity.setDeleted(deleted);
entity.setUpdatetime(new Date());
- this.updateConfig(entity);
+ entity = em.merge(entity);
}
- if ("crypt_ClassName".equals(key)) {
+ if (CRYPT_KEY.equals(key)) {
ScopeApplicationAdapter.configKeyCryptClassName = value;
} else if ("show.whiteboard.draw.status".equals(key)) {
ScopeApplicationAdapter.whiteboardDrawStatus = "1".equals(value);
@@ -395,11 +373,7 @@ public class ConfigurationDao implements
}
public void delete(Configuration entity, Long userId) {
- if (userId != null) {
- entity.setUser(usersDao.get(userId));
- }
- entity.setDeleted(true);
entity.setUpdatetime(new Date());
- this.updateConfig(entity);
+ this.update(entity, userId, true);
}
}
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/installation/ImportInitvalues.java Mon Apr 8 04:17:56 2013
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.installation;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.CRYPT_KEY;
+
import java.io.File;
import java.util.Arrays;
import java.util.Date;
@@ -260,8 +262,8 @@ public class ImportInitvalues {
public void loadConfiguration(InstallationConfig cfg) {
configurationDao
- .addConfByKey(
- "crypt_ClassName",
+ .add(
+ CRYPT_KEY,
cfg.cryptClassName,
null,
"This Class is used for Authentification-Crypting. "
@@ -269,86 +271,86 @@ public class ImportInitvalues {
+ "running previous Pass of users will not be workign anymore! "
+ "for more Information see http://openmeetings.apache.org/CustomCryptMechanism.html");
- configurationDao.addConfByKey("allow_frontend_register",
+ configurationDao.add("allow_frontend_register",
cfg.allowFrontendRegister, null, "");
- configurationDao.addConfByKey("default_group_id", "1", null, "");
+ configurationDao.add("default_group_id", "1", null, "");
// this domain_id is the Organisation of users who register through the
// frontend
- configurationDao.addConfByKey("default_domain_id", "1", null, "");
+ configurationDao.add("default_domain_id", "1", null, "");
// "smtp.xmlcrm.org"
- configurationDao.addConfByKey("smtp_server", cfg.smtpServer, null,
+ configurationDao.add("smtp_server", cfg.smtpServer, null,
"this is the smtp server to send messages");
// 25
- configurationDao.addConfByKey("smtp_port", cfg.smtpPort, null,
+ configurationDao.add("smtp_port", cfg.smtpPort, null,
"this is the smtp server port normally 25");
// "openmeetings@xmlcrm.org"
- configurationDao.addConfByKey("system_email_addr", cfg.mailReferer,
+ configurationDao.add("system_email_addr", cfg.mailReferer,
null, "all send EMails by the system will have this address");
// "openmeetings@xmlcrm.org"
- configurationDao.addConfByKey("email_username", cfg.mailAuthName,
+ configurationDao.add("email_username", cfg.mailAuthName,
null, "System auth email username");
//
- configurationDao.addConfByKey("email_userpass", cfg.mailAuthPass,
+ configurationDao.add("email_userpass", cfg.mailAuthPass,
null, "System auth email password");
- configurationDao.addConfByKey("mail.smtp.starttls.enable",
+ configurationDao.add("mail.smtp.starttls.enable",
cfg.mailUseTls, null, "Enable TLS 1=true, 0=false");
- configurationDao.addConfByKey("application.name",
+ configurationDao.add("application.name",
ConfigurationDao.DEFAULT_APP_NAME, null,
"Name of the Browser Title window");
// "1" == "EN"
- configurationDao.addConfByKey("default_lang_id", cfg.defaultLangId,
+ configurationDao.add("default_lang_id", cfg.defaultLangId,
null, "Default System Language ID see language.xml");
- configurationDao.addConfByKey("swftools_zoom", cfg.swfZoom, null,
+ configurationDao.add("swftools_zoom", cfg.swfZoom, null,
"dpi for conversion of PDF to SWF");
- configurationDao.addConfByKey("swftools_jpegquality",
+ configurationDao.add("swftools_jpegquality",
cfg.swfJpegQuality, null,
"compression quality for conversion of PDF to SWF");
- configurationDao.addConfByKey("swftools_path", cfg.swfPath, null,
+ configurationDao.add("swftools_path", cfg.swfPath, null,
"Path To SWF-Tools");
- configurationDao.addConfByKey("imagemagick_path",
+ configurationDao.add("imagemagick_path",
cfg.imageMagicPath, null, "Path to ImageMagick tools");
- configurationDao.addConfByKey("sox_path", cfg.soxPath, null,
+ configurationDao.add("sox_path", cfg.soxPath, null,
"Path To SoX-Tools");
- configurationDao.addConfByKey("ffmpeg_path", cfg.ffmpegPath, null,
+ configurationDao.add("ffmpeg_path", cfg.ffmpegPath, null,
"Path To FFMPEG");
configurationDao
- .addConfByKey(
+ .add(
"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");
configurationDao
- .addConfByKey(
+ .add(
"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");
- configurationDao.addConfByKey("rss_feed1", cfg.urlFeed, null,
+ configurationDao.add("rss_feed1", cfg.urlFeed, null,
"Feed URL");
- configurationDao.addConfByKey("rss_feed2", cfg.urlFeed2, null,
+ configurationDao.add("rss_feed2", cfg.urlFeed2, null,
"Feed URL 2");
configurationDao
- .addConfByKey("sendEmailAtRegister", cfg.sendEmailAtRegister,
+ .add("sendEmailAtRegister", cfg.sendEmailAtRegister,
null,
"User get a EMail with their Account data. Values: 0(No) or 1(Yes)");
configurationDao
- .addConfByKey(
+ .add(
"sendEmailWithVerficationCode",
cfg.sendEmailWithVerficationCode,
null,
@@ -358,14 +360,14 @@ public class ImportInitvalues {
+ "sendEmailAtRegister is 0(No) cause you need"
+ "to send a EMail.");
configurationDao
- .addConfByKey(
+ .add(
"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");
- configurationDao.addConfByKey("default.rpc.userid", "" + 1, null,
+ configurationDao.add("default.rpc.userid", "" + 1, null,
"The User-Id of the Control User in OpenMeetings");
// ***************************************
@@ -373,12 +375,12 @@ public class ImportInitvalues {
// red5SIP Integration Coniguration Values
// ***************************************
- configurationDao.addConfByKey("red5sip.enable", cfg.red5SipEnable,
+ configurationDao.add("red5sip.enable", cfg.red5SipEnable,
null, "Enable to enable the red5SIP integration ");
- configurationDao.addConfByKey("red5sip.room_prefix",
+ configurationDao.add("red5sip.room_prefix",
cfg.red5SipRoomPrefix, null,
"Numerical prefix for OM rooms created inside the SIP");
- configurationDao.addConfByKey("red5sip.exten_context",
+ configurationDao.add("red5sip.exten_context",
cfg.red5SipExtenContext, null,
"Enable to enable the red5SIP integration ");
@@ -387,7 +389,7 @@ public class ImportInitvalues {
// Timezone settings
// ***************************************
- configurationDao.addConfByKey("default.timezone",
+ configurationDao.add("default.timezone",
cfg.ical_timeZone, null,
"This is the default timezone if nothing is specified");
@@ -396,61 +398,61 @@ public class ImportInitvalues {
// additional settings
// ***************************************
- configurationDao.addConfByKey("show.facebook.login", "" + 0, null,
+ configurationDao.add("show.facebook.login", "" + 0, null,
"Show Facebook Login");
configurationDao
- .addConfByKey(
+ .add(
"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");
- configurationDao.addConfByKey("default.dashboard.tab", "0", null,
+ configurationDao.add("default.dashboard.tab", "0", null,
"Default selection in Dashboard tabs as tab-index-id");
- configurationDao.addConfByKey("dashboard.show.myrooms", "1", null,
+ configurationDao.add("dashboard.show.myrooms", "1", null,
"Show My Rooms Tab");
- configurationDao.addConfByKey("dashboard.show.chat", "1", null,
+ configurationDao.add("dashboard.show.chat", "1", null,
"Show Chat Tab");
- configurationDao.addConfByKey("dashboard.show.rssfeed", "0", null,
+ configurationDao.add("dashboard.show.rssfeed", "0", null,
"Show RSS Tab");
configurationDao
- .addConfByKey(
+ .add(
"show.whiteboard.draw.status",
"0",
null,
"Display name of the user who draw the current object (User Name auto-disapper after 3 seconds.");
- configurationDao.addConfByKey("max_upload_size", ""
+ configurationDao.add("max_upload_size", ""
+ ImportHelper.DEFAULT_MAX_UPLOAD_SIZE, null,
"Maximum size of upload file (bytes)"); // defaults to 1GB
configurationDao
- .addConfByKey(
+ .add(
"number.minutes.reminder.send",
"15",
null,
"The number of minutes before reminder emails are send. Set to 0 to disable reminder emails");
- configurationDao.addConfByKey("user.login.minimum.length", ""
+ configurationDao.add("user.login.minimum.length", ""
+ InstallationConfig.USER_LOGIN_MINIMUM_LENGTH, null,
"Number of chars needed in a user login");
- configurationDao.addConfByKey("user.pass.minimum.length", ""
+ configurationDao.add("user.pass.minimum.length", ""
+ InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH, null,
"Number of chars needed in a user login");
configurationDao
- .addConfByKey("calendar.conference.rooms.default.size", "50",
+ .add("calendar.conference.rooms.default.size", "50",
null,
"Default number of participants conference room created via calendar");
configurationDao
- .addConfByKey(
+ .add(
"use.old.style.ffmpeg.map.option",
"0",
null,
@@ -458,33 +460,33 @@ public class ImportInitvalues {
// give exclusive audio key code
configurationDao
- .addConfByKey(
+ .add(
"exclusive.audio.keycode",
"123",
null,
"A hot key code for the 'give exclusive audio' functionality. Keycode 123 is F12");
// mute/unmute audio key code
configurationDao
- .addConfByKey(
+ .add(
"mute.keycode",
"118",
null,
"A hot key code for the 'mute/unmute audio' functionality. Keycode 118 is F7");
// system-wide ldap params
- configurationDao.addConfByKey("ldap_default_id", "0", null,
+ configurationDao.add("ldap_default_id", "0", null,
"Ldap domain selected by default in the login screen");
// set inviter's email address as ReplyTo in email invitations
configurationDao
- .addConfByKey(
+ .add(
"inviter.email.as.replyto",
cfg.replyToOrganizer,
null,
"Set inviter's email address as ReplyTo in email invitations (1 == set, 0 == NOT set)");
configurationDao
- .addConfByKey(
+ .add(
"default.landing.zone",
"dashboard.rooms",
null,
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java Mon Apr 8 04:17:56 2013
@@ -42,27 +42,29 @@ import org.simpleframework.xml.Root;
@Entity
@NamedQueries({
- @NamedQuery(name = "getConfigurationByKey", query = "SELECT c FROM Configuration c "
- + "WHERE c.conf_key LIKE :conf_key and c.deleted = false"),
+ @NamedQuery(name = "forceGetConfigurationByKey", query = "SELECT c FROM Configuration c "
+ + "WHERE c.conf_key LIKE :conf_key"),
@NamedQuery(name = "getConfigurationsByKeys", query = "SELECT c FROM Configuration c "
+ "WHERE c.conf_key IN :conf_keys and c.deleted = false"),
@NamedQuery(name = "getNondeletedConfiguration", query = "SELECT c FROM Configuration c "
+ "LEFT JOIN FETCH c.user WHERE c.deleted = false"),
@NamedQuery(name = "getConfigurationById", query = "SELECT c FROM Configuration c "
+ "LEFT JOIN FETCH c.user "
- + "WHERE c.configuration_id = :configuration_id and c.deleted = false")
+ + "WHERE c.configuration_id = :configuration_id and c.deleted = false"),
+ @NamedQuery(name = "countConfigurations", query = "SELECT COUNT(c) FROM Configuration c WHERE c.deleted = false")
})
@Table(name = "configuration")
@Root(name = "config")
public class Configuration implements Serializable, IDataProviderEntity {
private static final long serialVersionUID = -6129473946508963339L;
+ public static final String CRYPT_KEY = "crypt_ClassName";
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
@Element(name = "id", data = true)
private Long configuration_id;
- @Column(name = "conf_key")
+ @Column(name = "conf_key", unique = true)
@Element(name = "key", data = true, required = false)
private String conf_key;
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/ConfigurationService.java Mon Apr 8 04:17:56 2013
@@ -18,8 +18,6 @@
*/
package org.apache.openmeetings.remote;
-import java.util.LinkedHashMap;
-
import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.AuthLevelUtil;
import org.apache.openmeetings.data.basic.SessiondataDao;
@@ -92,15 +90,23 @@ public class ConfigurationService {
* @param values
* @return - id of configuration being updated, null otherwise
*/
- public Long saveOrUpdateConfiguration(String SID, LinkedHashMap<String, ?> values){
+ public Long saveOrUpdateConfiguration(String SID, Long id, String key, String val, String comment){
Long users_id = sessiondataDao.checkSession(SID);
Long user_level = userManager.getUserLevelByID(users_id);
if (authLevelUtil.checkAdminLevel(user_level)) {
- return configurationDao.saveOrUpdateConfiguration(values,
- users_id);
+ Configuration c = configurationDao.forceGet(key);
+ if (c != null && !c.getConfiguration_id().equals(id)) {
+ return -56L;
+ }
+ if (c == null) {
+ c = new Configuration();
+ c.setConf_key(key);
+ }
+ c.setComment(comment);
+ c.setConf_value(val);
+ return configurationDao.update(c, users_id).getConfiguration_id();
} else {
- log.error("[getConfByConfigurationId] Permission denied "
- + user_level);
+ log.error("[saveOrUpdateConfiguration] Permission denied " + user_level);
}
return null;
}
@@ -112,14 +118,17 @@ public class ConfigurationService {
* @param values
* @return - id of configuration being deleted in case of success, null otherwise
*/
- public Long deleteConfiguration(String SID, LinkedHashMap<String, ?> values){
+ public Long deleteConfiguration(String SID, Long id){
Long users_id = sessiondataDao.checkSession(SID);
Long user_level = userManager.getUserLevelByID(users_id);
if (authLevelUtil.checkAdminLevel(user_level)) {
- return configurationDao.deleteConfByConfiguration(values,
- users_id);
+ Configuration c = configurationDao.get(id);
+ if (c != null) {
+ configurationDao.delete(c, users_id);
+ }
+ return id;
} else {
- log.error("[getConfByConfigurationId] Permission denied "
+ log.error("[deleteConfiguration] Permission denied "
+ user_level);
}
return null;
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/MainService.java Mon Apr 8 04:17:56 2013
@@ -21,7 +21,6 @@ package org.apache.openmeetings.remote;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -710,21 +709,13 @@ public class MainService implements IPen
* @return configuration with key "allow_frontend_register"
*/
public Configuration allowFrontendRegister(String SID) {
- return configurationDao.get("allow_frontend_register");
+ return configurationDao.get("allow_frontend_register").get(0); //FIXME need to be removed
}
public List<Configuration> getGeneralOptions(String SID) {
try {
-
- List<Configuration> cList = new LinkedList<Configuration>();
-
- cList.add(configurationDao.get("exclusive.audio.keycode"));
- cList.add(configurationDao.get("red5sip.enable"));
- cList.add(configurationDao.get("max_upload_size"));
- cList.add(configurationDao.get("mute.keycode"));
-
- return cList;
-
+ return configurationDao.get("exclusive.audio.keycode", "red5sip.enable", "max_upload_size",
+ "mute.keycode");
} catch (Exception err) {
log.error("[getLoginOptions]",err);
}
@@ -733,20 +724,9 @@ public class MainService implements IPen
public List<Configuration> getLoginOptions(String SID) {
try {
-
- List<Configuration> cList = new LinkedList<Configuration>();
- cList.add(configurationDao
- .get("allow_frontend_register"));
- cList.add(configurationDao.get("show.facebook.login"));
- cList.add(configurationDao
- .get("user.login.minimum.length"));
- cList.add(configurationDao
- .get("user.pass.minimum.length"));
- cList.add(configurationDao
- .get("user.pass.minimum.length"));
- cList.add(configurationDao.get("ldap_default_id"));
-
- return cList;
+ return configurationDao.get("allow_frontend_register", "show.facebook.login",
+ "user.login.minimum.length", "user.pass.minimum.length", "user.pass.minimum.length",
+ "ldap_default_id");
} catch (Exception err) {
log.error("[getLoginOptions]", err);
}
@@ -1001,12 +981,12 @@ public class MainService implements IPen
Long users_id = sessiondataDao.checkSession(SID);
Long user_level = userManager.getUserLevelByID(users_id);
if (authLevelUtil.checkUserLevel(user_level)) {
- return configurationDao.getConfKeys(new String[] {
+ return configurationDao.get(
"dashboard.show.chat", //
"dashboard.show.myrooms", //
"dashboard.show.rssfeed", //
"default.dashboard.tab", //
- "default.landing.zone" });
+ "default.landing.zone");
}
} catch (Exception err) {
log.error("[getDashboardConfiguration]", err);
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java Mon Apr 8 04:17:56 2013
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.remote.red5;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.CRYPT_KEY;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
@@ -2644,7 +2646,7 @@ public class ScopeApplicationAdapter ext
try {
if (ScopeApplicationAdapter.configKeyCryptClassName == null) {
- String cryptClass = configurationDao.getConfValue("crypt_ClassName", String.class, null);
+ String cryptClass = configurationDao.getConfValue(CRYPT_KEY, String.class, null);
if (cryptClass != null) {
ScopeApplicationAdapter.configKeyCryptClassName = cryptClass;
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java Mon Apr 8 04:17:56 2013
@@ -19,6 +19,7 @@
package org.apache.openmeetings.servlet.outputhandler;
import static org.apache.commons.transaction.util.FileHelper.copyRec;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.CRYPT_KEY;
import static org.apache.openmeetings.utils.OmFileHelper.getStreamsHibernateDir;
import static org.apache.openmeetings.utils.OmFileHelper.getUploadDir;
import static org.apache.openmeetings.utils.OmFileHelper.getUploadProfilesUserDir;
@@ -579,22 +580,25 @@ public class BackupImportController exte
List<Configuration> list = readList(serializer, f, "configs.xml", "configs", Configuration.class, true);
for (Configuration c : list) {
- if (c.getConf_key() == null) {
+ if (c.getConf_key() == null || c.getDeleted()) {
continue;
}
- Configuration cfg = configurationDao.get(c.getConf_key());
+ Configuration cfg = configurationDao.forceGet(c.getConf_key());
+ if (cfg != null && !cfg.getDeleted()) {
+ log.warn("Non deleted configuration with same key is found! old value: {}, new value: {}", cfg.getConf_value(), c.getConf_value());
+ }
c.setConfiguration_id(cfg == null ? null : cfg.getConfiguration_id());
if (c.getUser() != null && c.getUser().getUser_id() == null) {
c.setUser(null);
}
- if ("crypt_ClassName".equals(c.getConf_key())) {
+ if (CRYPT_KEY.equals(c.getConf_key())) {
try {
Class.forName(c.getConf_value());
} catch (ClassNotFoundException e) {
c.setConf_value(MD5Implementation.class.getCanonicalName());
}
}
- configurationDao.update(c, -1L);
+ configurationDao.update(c, null);
}
}
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/config/TestConfig.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/config/TestConfig.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/config/TestConfig.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/config/TestConfig.java Mon Apr 8 04:17:56 2013
@@ -32,47 +32,34 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
public class TestConfig extends AbstractOpenmeetingsSpringTest {
-
- private static final Logger log = LoggerFactory.getLogger(
- TestAppointmentAddAppointment.class);
-
+
+ private static final Logger log = LoggerFactory.getLogger(TestAppointmentAddAppointment.class);
+
@Autowired
private ConfigurationDao configurationDao;
-
@Test
public void getConfigKey() {
-
- try {
+ System.err.println("THIS");
- System.err.println("THIS");
+ Configuration smtp_server = configurationDao.get("smtp_server").get(0);
- Configuration smtp_server = configurationDao
- .get(
- "smtp_server");
-
- System.err.println("smtp_server " + smtp_server.getUser());
-
- assertEquals(null, smtp_server.getUser());
+ System.err.println("smtp_server " + smtp_server.getUser());
- } catch (Exception err) {
- log.error("[startConversion]", err);
- }
-
+ assertEquals(null, smtp_server.getUser());
}
@Test
public void getConfigs() {
-
+
try {
List<Configuration> list = configurationDao.get(4, 6);
-
+
for (Configuration conf : list) {
System.err.println("conf.getConf_key() " + conf.getConf_key());
System.err.println("conf.getUser() " + conf.getUser());
if (conf.getUser() != null) {
- System.err.println("conf.getUsers() "
- + conf.getUser().getLogin());
+ System.err.println("conf.getUsers() " + conf.getUser().getLogin());
}
}
@@ -81,6 +68,6 @@ public class TestConfig extends Abstract
} catch (Exception err) {
log.error("[startConversion]", err);
}
-
+
}
}
Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java?rev=1465534&r1=1465533&r2=1465534&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java (original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java Mon Apr 8 04:17:56 2013
@@ -33,6 +33,8 @@ import org.apache.wicket.markup.html.for
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.util.time.Duration;
+import org.apache.wicket.validation.IValidatable;
+import org.apache.wicket.validation.IValidator;
/**
* Handle {@link Configuration} items as list and form
@@ -45,11 +47,29 @@ public class ConfigForm extends AdminBas
private static final long serialVersionUID = 1L;
private final WebMarkupContainer listContainer;
+ private ConfigurationDao getConfigDao() {
+ return Application.getBean(ConfigurationDao.class);
+ }
+
+ private void refresh(AjaxRequestTarget target) {
+ target.add(this);
+ target.appendJavaScript("omConfigPanelInit();");
+ }
+
public ConfigForm(String id, WebMarkupContainer listContainer, final Configuration configuration) {
super(id, new CompoundPropertyModel<Configuration>(configuration));
setOutputMarkupId(true);
this.listContainer = listContainer;
- add(new RequiredTextField<String>("conf_key"));
+ add(new RequiredTextField<String>("conf_key").add(new IValidator<String>(){
+ private static final long serialVersionUID = -3371792361118941958L;
+
+ public void validate(IValidatable<String> validatable) {
+ Configuration c = getConfigDao().forceGet(validatable.getValue());
+ if (c != null && !c.getConfiguration_id().equals(configuration.getConfiguration_id())) {
+ error(WebSession.getString(1544L));
+ }
+ }
+ }));
add(new RequiredTextField<String>("conf_value"));
add(DateLabel.forDatePattern("updatetime", "dd.MM.yyyy HH:mm:ss"));
add(new Label("user.login"));
@@ -64,33 +84,28 @@ public class ConfigForm extends AdminBas
@Override
protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(ConfigurationDao.class).update(getModelObject(), WebSession.getUserId());
- Configuration conf = Application.getBean(ConfigurationDao.class).get(getModelObject().getConfiguration_id());
- this.setModelObject(conf);
+ this.setModelObject(getConfigDao().update(getModelObject(), WebSession.getUserId()));
hideNewRecord();
- target.add(this);
target.add(listContainer);
- target.appendJavaScript("omConfigPanelInit();");
+ refresh(target);
}
@Override
protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
this.setModelObject(new Configuration());
- target.add(this);
- target.appendJavaScript("omConfigPanelInit();");
+ refresh(target);
}
@Override
protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
Configuration conf = this.getModelObject();
if (conf.getConfiguration_id() != null) {
- conf = Application.getBean(ConfigurationDao.class).get(conf.getConfiguration_id());
+ conf = getConfigDao().get(conf.getConfiguration_id());
} else {
conf = new Configuration();
}
this.setModelObject(conf);
- target.add(this);
- target.appendJavaScript("omConfigPanelInit();");
+ refresh(target);
}
@Override
@@ -98,8 +113,6 @@ public class ConfigForm extends AdminBas
Application.getBean(ConfigurationDao.class).delete(this.getModelObject(), WebSession.getUserId());
this.setModelObject(new Configuration());
target.add(listContainer);
- target.add(this);
- target.appendJavaScript("omConfigPanelInit();");
+ refresh(target);
}
-
}