Skip to content

Instantly share code, notes, and snippets.

@leshikus
Created June 6, 2013 10:23
Show Gist options
  • Save leshikus/5720594 to your computer and use it in GitHub Desktop.
Save leshikus/5720594 to your computer and use it in GitHub Desktop.
2.1.1 vs head
Diff between the head and 2.1.1Index: build-red5_ivy.xsl
===================================================================
--- build-red5_ivy.xsl (.../branches/2.1) (revision 1490226)
+++ build-red5_ivy.xsl (.../trunk/singlewebapp) (revision 1490226)
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output omit-xml-declaration="no"/>
- <xsl:template match="node()|@*">
- <xsl:copy>
- <xsl:apply-templates select="node()|@*"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="//*[@name='jaudiotagger']">
- <xsl:text disable-output-escaping="yes">
- &lt;dependency org="org" name="jaudiotagger" rev="2.0.4-SNAPSHOT" &gt;
- &lt;include type="jar" /&gt;
- &lt;/dependency&gt;
- </xsl:text>
- </xsl:template>
- <xsl:template match="//*[@name='bcprov-jdk16']">
- <xsl:text disable-output-escaping="yes">
- &lt;dependency org="org.bouncycastle" name="bcprov-jdk16" rev="1.45" conf="java6-&gt;*" &gt;
- &lt;include type="jar" /&gt;
- &lt;/dependency&gt;
- </xsl:text>
- </xsl:template>
- <xsl:template match="//*[@name='sysout-over-slf4j']">
- <xsl:text disable-output-escaping="yes">
- &lt;dependency org="uk.org.lidalia" name="sysout-over-slf4j" rev="1.0.2" &gt;
- &lt;include type="jar" /&gt;
- &lt;/dependency&gt;
- </xsl:text>
- </xsl:template>
- <xsl:template match="//*[@name='httpcore']">
- <xsl:text disable-output-escaping="yes">
- &lt;dependency org="org.apache.httpcomponents" name="httpcore" rev="4.2.1" &gt;
- &lt;include type="jar" /&gt;
- &lt;/dependency&gt;
- </xsl:text>
- </xsl:template>
- <xsl:template match="//*[@name='httpclient']">
- <xsl:text disable-output-escaping="yes">
- &lt;dependency org="org.apache.httpcomponents" name="httpclient" rev="4.2" &gt;
- &lt;include type="jar" /&gt;
- &lt;/dependency&gt;
- </xsl:text>
- </xsl:template>
-</xsl:stylesheet>
Index: build-red5_ivysettings.xsl
===================================================================
--- build-red5_ivysettings.xsl (.../branches/2.1) (revision 1490226)
+++ build-red5_ivysettings.xsl (.../trunk/singlewebapp) (revision 1490226)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output omit-xml-declaration="no"/>
- <xsl:template match="node()|@*" name="identity">
- <xsl:copy>
- <xsl:apply-templates select="node()|@*"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="url[last()]">
- <xsl:call-template name="identity"/>
- <url name="java_net">
- <artifact pattern="http://download.java.net/maven/2/[organisation]/[artifact]/[revision]/[artifact]-[revision].[ext]" />
- </url>
- </xsl:template>
-</xsl:stylesheet>
Index: xdocs/LdapAndADS.xml
===================================================================
--- xdocs/LdapAndADS.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/LdapAndADS.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -22,11 +22,49 @@
</properties>
<body>
-
+ <section name="Ubuntu Installation">
+ <div>
+ Run the commands
+ <blockquote>
+ <i>
+ sudo apt-get install slapd ldap-utils
+ </i>
+ </blockquote>
+ </div>
+ <div>
+ Modify file <tt>/etc/ldap/ldap.conf</tt> add highlighted attributes:
+ <blockquote>
+ <i>
+ #<br />
+ # LDAP Defaults<br />
+ #<br />
+ # See ldap.conf(5) for details<br />
+ # This file should be world readable but not world writable.<br />
+ <b>BASE dc=unixmen,dc=com<br />
+ URI ldap://192.168.1.200</b><br />
+ #SIZELIMIT 12<br />
+ #TIMELIMIT 15<br />
+ #DEREF never<br />
+ # TLS certificates (needed for GnuTLS)<br />
+ TLS_CACERT /etc/ssl/certs/ca-certificates.crt<br />
+ </i>
+ </blockquote>
+ </div>
+ <div>
+ Run the Configuration assistant: <tt>sudo dpkg-reconfigure slapd</tt>
+ </div>
+ <div>
+ Test LDAP server: <tt>ldapsearch -x</tt>
+ </div>
+ <div>
+ Add/Edit/Delete users: <tt>sudo apt-get install phpldapadmin</tt>
+ </div>
+ <div>
+ Detailed reference: <a href="http://www.unixmen.com/openldap-installation-and-configuration-in-ubuntu-12-10-server-debian-6/">http://www.unixmen.com/openldap-installation-and-configuration-in-ubuntu-12-10-server-debian-6/</a>
+ </div>
+ </section>
<section name="LDAP and Active Directory Integration">
-
<p> In: $RED5_HOME/webapps/openmeetings/conf<br/>
-
you will find sample configurations for LDAP and Active Directory. The
nature of those Directory Servers are that they are individual for
every organization, so you have to modify of course at least the
@@ -55,7 +88,9 @@
<p>
You can configure multiple domains or different user-paths in the Administration of OpenMeetings.
</p>
-
+ <p>
+ <b>NOTE: </b>You should specify file name <i>RELATIVE</i> to <tt>$RED5_HOME/webapps/openmeetings/conf</tt>
+ </p>
</section>
</body>
Index: xdocs/WebappNamePath.xml
===================================================================
--- xdocs/WebappNamePath.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/WebappNamePath.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -28,8 +28,8 @@
<ol>
<li>create your logo image as PNG 40px height</li>
<li>replace <tt>/opt/red5/webapps/openmeetings/public/themes/basic-theme/general/logo.png</tt> with your logo file</li>
- <li>(Advanced optional) you can modify <tt>/opt/red5/webapps/openmeetings/config.xml</tt> and modify <tt>appdisplay</tt> section: set position and display for the logo and/or name</li>
- <li>(Advanced optional) you can modify <tt>/opt/red5/webapps/openmeetings/default-theme.xml</tt> (around line 57) and change image name/path</li>
+ <li>(Advanced optional) you can modify <tt>/opt/red5/webapps/openmeetings/public/config.xml</tt> and modify <tt>appdisplay</tt> section: set position and display for the logo and/or name</li>
+ <li>(Advanced optional) you can modify <tt>/opt/red5/webapps/openmeetings/public/theme.xml</tt> (around line 57) and change image name/path</li>
</ol>
</section>
<section name="Renaming /openmeetings context">
@@ -60,9 +60,9 @@
</li>
<li>
open
- <tt>/opt/red5/webapps/yourmeetings/config.xml</tt>
+ <tt>/opt/red5/webapps/yourmeetings/public/config.xml</tt>
using your favorite text editor (for ex.
- <tt>vim /opt/red5/webapps/yourmeetings/config.xml</tt>
+ <tt>vim /opt/red5/webapps/yourmeetings/public/config.xml</tt>
)
</li>
<li>
@@ -141,7 +141,7 @@
<p>
Please
<i>NOTE</i>
- there are 3 additional properties in the config.xml file which
+ there are 3 additional properties in the public/config.xml file which
should be modified for
<strong>TOTAL</strong>
Openmeetings clean up:
Index: xdocs/CustomRoomTypeHowTo.xml
===================================================================
--- xdocs/CustomRoomTypeHowTo.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/CustomRoomTypeHowTo.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -61,9 +61,9 @@
<tt>src/base/moduleConfiguration.lzx</tt>,
here you need to add a default class name for your room type </li>
- <li>Add your room type in the real configuration: config.xml, add a new entry.
+ <li>Add your room type in the real configuration: public/config.xml, add a new entry.
<br/>
- You should fix also the file <tt>openmeetings-config.xsd</tt> that is the Schema file for the config.xml.
+ You should fix also the file <tt>public/config.xsd</tt> that is the Schema file for the public/config.xml.
</li>
<li>Add a parser entry to modify the room type mapping:
Index: xdocs/WebcamResolutions.xml
===================================================================
--- xdocs/WebcamResolutions.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/WebcamResolutions.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -28,7 +28,7 @@
<p>When you choose the webcam you have different resolutions
available the user can choose from. </p>
<p>You can add/remove resolutions and also change the default
- selection. In the config.xml there is a section: </p>
+ selection. In the public/config.xml there is a section: </p>
<div class="xmlcode">
&lt;availableCameraResolutions&gt;<br/>
<div style="margin-left:20px">
@@ -51,9 +51,9 @@
&lt;/availableCameraResolutions&gt;
</div>
- <p>Tip: You might edit the config.xml with an XML aware editor that correctly
+ <p>Tip: You might edit the public/config.xml with an XML aware editor that correctly
handles the XSD defintion to avoid misconfiguration. The openmeetings-config.xsd
- is in the same folder like the config.xml. </p>
+ is in the same folder like the public/config.xml. </p>
</section>
</body>
Index: xdocs/RTMPSAndHTTPS.xml
===================================================================
--- xdocs/RTMPSAndHTTPS.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/RTMPSAndHTTPS.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -137,7 +137,7 @@
</li>
<li>
- Edit red5/webapps/openmeetings/config.xml and set
+ Edit red5/webapps/openmeetings/public/config.xml and set
<tt>&lt;rtmpsslport&gt;5443&lt;/rtmpsslport&gt;</tt>
,
<tt>&lt;useSSL&gt;yes&lt;/useSSL&gt;</tt>
@@ -167,11 +167,11 @@
file to <tt>red5/conf/jee-container.xml</tt>
</li>
<li>
- Edit red5/webapps/openmeetings/config.xml and set
+ Edit red5/webapps/openmeetings/public/config.xml and set
<tt>&lt;protocol&gt;https&lt;/protocol&gt;</tt>
</li>
<li>
- Edit red5/webapps/openmeetings/config.xml and set
+ Edit red5/webapps/openmeetings/public/config.xml and set
<tt>red5httpport</tt> to <tt>https</tt> port
</li>
<li>In webapps/openmeetings/WEB-INF/conf/axis2.xml add (below the existing http transportReceiver (around line 225))
Index: xdocs/stylesheets/site.vsl
===================================================================
--- xdocs/stylesheets/site.vsl (.../branches/2.1) (revision 1490226)
+++ xdocs/stylesheets/site.vsl (.../trunk/singlewebapp) (revision 1490226)
@@ -124,7 +124,7 @@
#end
#macro ( projectanchor $name $value )
-#if ($value.startsWith("http://"))
+#if ($value.startsWith("http://") || $value.startsWith("https://"))
<a href="$value">$name</a>
#elseif ($value.startsWith("/site"))
<a href="http://jakarta.apache.org$value">$name</a>
Index: xdocs/ReleaseGuide.xml
===================================================================
--- xdocs/ReleaseGuide.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/ReleaseGuide.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -185,6 +185,7 @@
2.1/rc1/bin/apache-openmeetings-2.1.0.tar.gz.md5<br />
2.1/rc1/bin/apache-openmeetings-2.1.0.tar.gz.asc<br />
2.1/rc1/KEYS
+ 2.1/rc1/CHANGELOG
</div>
</subsection>
Index: xdocs/PortSettings.xml
===================================================================
--- xdocs/PortSettings.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/PortSettings.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -44,7 +44,7 @@
need to restart the red5-service so that changes are online.
</li>
<li>Client-Side configuration:
- $RED5_HOME/webapps/openmeetings/config.xml, you need to clear your
+ $RED5_HOME/webapps/openmeetings/public/config.xml, you need to clear your
browser cache after changing the file.
</li>
<li>
@@ -59,7 +59,7 @@
<th style="border: 1px solid rgb(204, 204, 204); padding: 5px;"> Config-Name </th>
<th style="border: 1px solid rgb(204, 204, 204); padding: 5px;"> Default-value </th>
<th style="border: 1px solid rgb(204, 204, 204); padding: 5px;"> Name in red5.properties </th>
- <th style="border: 1px solid rgb(204, 204, 204); padding: 5px;"> Name in config.xml </th>
+ <th style="border: 1px solid rgb(204, 204, 204); padding: 5px;"> Name in public/config.xml </th>
</tr>
<tr>
<td style="border: 1px solid rgb(204, 204, 204); padding: 5px;"> HTTP </td>
Index: xdocs/CalendarAndTimezone.xml
===================================================================
--- xdocs/CalendarAndTimezone.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/CalendarAndTimezone.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -48,7 +48,7 @@
<section
name="Changing first day in week for calendar from Sunday to Monday">
- <p>in the config.xml change the key: </p>
+ <p>in the public/config.xml change the key: </p>
<div class="xmlcode">
&lt;!--
<br />
Index: xdocs/themes-and-branding.xml
===================================================================
--- xdocs/themes-and-branding.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/themes-and-branding.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -29,7 +29,7 @@
Themes are only available starting with Openmeetings 2.x.
<br />
There are also more general client side configuration like port
- configuration. Those configs are stored in the config.xml
+ configuration. Those configs are stored in the public/config.xml
</p>
</section>
@@ -39,14 +39,14 @@
<p>You can find the default theme in the SVN: </p>
<p>
<a
- href="https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/WebContent/openmeetings/default-theme.xml"
- target="_BLANK" rel="nofollow">https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/WebContent/openmeetings/default-theme.xml
+ href="https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/WebContent/openmeetings/public/theme.xml"
+ target="_BLANK" rel="nofollow">https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/WebContent/openmeetings/public/theme.xml
</a>
</p>
<p>
Or if you already installed OpenMeetings on your machine at:
<br />
- <tt>/webapps/openmeetings/default-theme.xml</tt>
+ <tt>/webapps/openmeetings/public/theme.xml</tt>
<br />
The file contains border, background and font color definitions as
well as paths to icons that are loaded at runtime.
Index: xdocs/red5sip-integration_2.1.xml
===================================================================
--- xdocs/red5sip-integration_2.1.xml (.../branches/2.1) (revision 1490226)
+++ xdocs/red5sip-integration_2.1.xml (.../trunk/singlewebapp) (revision 1490226)
@@ -265,7 +265,7 @@
red5.host=127.0.0.1 # red5 server address<br />
om.context=openmeetings # Openmeetings context<br />
red5.codec=asao<br />
- red5.codec.rate=22 # should correlate with mic settings in config.xml<br />
+ red5.codec.rate=22 # should correlate with mic settings in public/config.xml<br />
sip.obproxy=127.0.0.1 # asterisk adderss<br />
sip.phone=red5sip_user # sip phone number<br />
sip.authid=red5sip_user # sip auth id<br />
Index: .project
===================================================================
--- .project (.../branches/2.1) (revision 1490226)
+++ .project (.../trunk/singlewebapp) (revision 1490226)
@@ -13,7 +13,7 @@
limitations under the License.
-->
<projectDescription>
- <name>Openmeetings 2.1</name>
+ <name>Openmeetings</name>
<comment></comment>
<projects>
</projects>
Index: ivysettings.xsd
===================================================================
--- ivysettings.xsd (.../branches/2.1) (revision 1490226)
+++ ivysettings.xsd (.../trunk/singlewebapp) (revision 1490226)
@@ -36,14 +36,14 @@
<xs:element name="resolvers">
<xs:complexType>
<xs:sequence>
- <xs:element ref="chain"/>
+ <xs:element ref="chain" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="chain">
<xs:complexType>
<xs:sequence>
- <xs:element maxOccurs="unbounded" ref="ibiblio"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="ibiblio"/>
<xs:element maxOccurs="unbounded" ref="url"/>
</xs:sequence>
<xs:attribute name="name" use="required" type="xs:NCName"/>
@@ -63,6 +63,7 @@
</xs:sequence>
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attribute name="m2compatible" use="optional" type="xs:NCName"/>
+ <xs:attribute name="checksums" use="optional" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="artifact">
Index: src/install_error_EN.vm
===================================================================
--- src/install_error_EN.vm (.../branches/2.1) (revision 1490226)
+++ src/install_error_EN.vm (.../trunk/singlewebapp) (revision 1490226)
@@ -1,29 +0,0 @@
-## OpenMeetings
-## author swagner
-## 10.05.2007
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
-<!--
-Copyright 1999-2004 The Apache Software Foundation
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
-</head>
-<body>
-<b>OpenMeetings - Installation</b><br />
-<h>Error:</h><br/>
-$error
-$path
-</body>
-</html>
Index: src/install_welcome_EN.vm
===================================================================
--- src/install_welcome_EN.vm (.../branches/2.1) (revision 1490226)
+++ src/install_welcome_EN.vm (.../trunk/singlewebapp) (revision 1490226)
@@ -1,52 +0,0 @@
-## OpenMeetings
-## author swagner
-## 10.04.2007
-## revised H.Kuze(minamotonoason) 2008.Apr.2
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
-<!--
-Copyright 1999-2004 The Apache Software Foundation
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
-</head>
-<body>
-<h3>$APP_NAME - Installation</h3>
-
-<h3><A HREF="?command=step1">Continue with STEP 1</A></h3>
-
-<ol><li>
-<h4><a name="Recommendation_for_production_environment"></a>Recommendation for production environment<a target="_blank" href="#Recommendation_for_production_environment" class="section_anchor"></a></h4>
-</li><blockquote>By default $APP_NAME uses the integrated Apache Derby database. For production environment you should consider using <a target="_blank" href="http://openmeetings.apache.org/MySQLConfig.html">MySQL</a>, <a target="_blank" href="http://openmeetings.apache.org/PostgresConfig.html">Postgres</a> or for example <a target="_blank" href="http://openmeetings.apache.org/IBMDB2Config.html">IBM DB2</a> or <a href="http://openmeetings.apache.org/OracleConfig.html" target="_blank">Oracle</a>
-</blockquote><li><h4><a name="Enabling_Image_Upload_and_import_to_whiteboard"></a>Enabling Image Upload and import to whiteboard<a href="#Enabling_Image_Upload_and_import_to_whiteboard" class="section_anchor"></a></h4></li><ul><li>Install <strong>ImageMagick</strong> on the server, you can get more information on <a target="_blank" href="http://www.imagemagick.org" rel="nofollow">http://www.imagemagick.org</a> regarding installation. The instructions for installation can be found there <a target="_blank" href="http://www.imagemagick.org/script/binary-releases.php" rel="nofollow">http://www.imagemagick.org/script/binary-releases.php</a>, however on most linux systems you can get it via your favorite package managers (apt-get it) </li></ul><li><h4><a name="Enabling_import_of_PDFs_into_whiteboard"></a>Enabling import of PDFs into whiteboard<a href="#Enabling_import_of_PDFs_into_whiteboard" class="section_anchor"></a></h4></li><ul><li>Install <strong>GhostScript</strong> on the server, you can get more information on <a target="_blank" href="http://pages.cs.wisc.edu/%7Eghost/" rel="nofollow">http://pages.cs.wisc.edu/~ghost/</a> regarding installation. The instructions for installation can be found there, however on most linux systems you can get it via your favorite package managers (apt-get it). </li><li>Install <strong>SWFTools</strong> on the server, you can get more information on <a target="_blank" href="http://www.swftools.org/" rel="nofollow">http://www.swftools.org/</a> regarding installation. Some of the Linux distributions already have it in there package manager see <a target="_blank" href="http://packages.debian.org/unstable/utils/swftools" rel="nofollow">http://packages.debian.org/unstable/utils/swftools</a>), the recommended version of <strong>SWFTools</strong> is 0.9 as prior version have a bug that does lead to wrong object dimensions in the Whiteboard </li></ul><li><h4><a name="Enabling_import_of_.doc,_.docx,_.ppt,_.pptx,_..._all_Office_Docu"></a>Enabling import of .doc, .docx, .ppt, .pptx, ... all Office Documents into whitebaord<a href="#Enabling_import_of_.doc,_.docx,_.ppt,_.pptx,_..._all_Office_Docu" class="section_anchor"></a></h4></li><ul><li><strong>OpenOffice-Service</strong> started and listening on port 8100, see <a target="_blank" href="http://openmeetings.apache.org/OpenOfficeConverter.html">OpenOfficeConverter</a> for details </li></ul><li><h4><a name="Enabling_Recording_and_import_of_.avi,_.flv,_.mov_and_.mp4_into"></a>Enabling Recording and import of .avi, .flv, .mov and .mp4 into whiteboard<a href="#Enabling_Recording_and_import_of_.avi,_.flv,_.mov_and_.mp4_into" class="section_anchor"></a></h4></li><ul><li>Install <strong>FFMpeg</strong>. You should get FFMPEG in an up to date copy! For Windows you can download a Build for example from <a target="_blank" href="http://ffmpeg.arrozcru.org/builds/" rel="nofollow">http://ffmpeg.arrozcru.org/builds/</a> Linux or OSx Users should be able to use one of the various Installation Instructions on the Web. You need to enable libmp3lame! </li><li>Install <strong>SoX</strong> <a href="http://sox.sourceforge.net/" target="_BLANK">http://sox.sourceforge.net/</a>. You should install SoX in a up to date copy! SoX 12.xx will NOT work! </li></ul></ol>
-
-<h3><A HREF="?command=step1">Continue with STEP 1</A></h3>
-
-<br/>
-<b> <span style="font-size:1.2em">If you have further questions or need support in installation or hosting:</span></b><br/><br/>
-
-<b> <span style="font-size:1.2em">Commercial-Support:</span></b><br/><br/>
-
-<span style="font-size:1.1em"><b>By phone</b></span><br/>
-<span style="font-size:1.1em">++49 721 467 27327</span><br/>
-<span style="font-size:1.1em"><b>By email</b></span><br/>
-<span style="font-size:1.1em"><a href="mailto:service@openmeetings.de">service@openmeetings.de</a></span> <br/>
-<br/><br/>
-<b><span style="font-size:1.2em">Community-Support:</span></b><br/><br/>
-<span style="font-size:1.1em"><a href="https://groups.google.com/forum/#!forum/openmeetings-user" target="_blank">User-Forums</a></span> <br/>
-<span style="font-size:1.1em"><a href="https://groups.google.com/forum/#!forum/openmeetings-dev" target="_blank">Developer-Forums</a></span><br/>
-
-
-</body>
-</html>
Index: src/install_step1_EN.vm
===================================================================
--- src/install_step1_EN.vm (.../branches/2.1) (revision 1490226)
+++ src/install_step1_EN.vm (.../trunk/singlewebapp) (revision 1490226)
@@ -1,384 +0,0 @@
-## OpenMeetings
-## author swagner
-## 11.05.2007
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
-<!--
-Copyright 1999-2004 The Apache Software Foundation
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
-<style type="text/css">
-
-form, fieldset {
- margin: 0;
- padding: 0;
- }
-
-fieldset { border: 1px solid #000; }
-
-legend {
- padding: 0;
- color: #000;
-}
-
-input:focus, textarea:focus {
- color: #000;
- background: #fff;
- outline: 1px solid black;
-}
-
-
-input, textarea, select {
- margin: 0;
- padding: 1px;
- position:absolute;
- left:440px;
- background: #ddd;
- font-size: 100%;
- font-family: inherit;
-}
-
-select { padding: 0; }
-
-form.cmxform {
- width: 1024px;
- font-size: 1.1em;
- color: #333;
- }
-
-form.cmxform legend { padding-left: 0; }
-
-form.cmxform legend,
-form.cmxform label { color: #333; }
-
-form.cmxform fieldset {
- border: none;
- border-top: 1px solid #C9DCA6;
- }
-
-form.cmxform fieldset fieldset { background: none; }
-
-form.cmxform fieldset li {
- padding: 5px 10px 7px;
- }
-
-form.cmxform fieldset {
- margin-bottom: 10px;
-}
-form.cmxform legend {
- padding: 0 2px;
- font-weight: bold;
-}
-form.cmxform label {
- display: inline-block;
- line-height: 1.8;
- vertical-align: top;
-}
-form.cmxform fieldset ol {
- margin: 0;
- padding: 0;
-}
-form.cmxform fieldset li {
- list-style: none;
- padding: 5px;
- margin: 0;
-}
-form.cmxform fieldset fieldset {
- border: none;
- margin: 3px 0 0;
-}
-form.cmxform fieldset fieldset legend {
- padding: 0 0 5px;
- font-weight: normal;
-}
-form.cmxform fieldset fieldset label {
- display: block;
- width: auto;
-}
-form.cmxform em {
- font-weight: bold;
- font-style: normal;
- color: #f00;
-}
-form.cmxform label {
- width: 420px; /* Width of labels */
-}
-form.cmxform fieldset fieldset label {
- margin-left: 123px; /* Width plus 3 (html space) */
-}
-
-</style>
-</head>
-<body>
-
-<script language="JavaScript">
-
-function checkEmail()
-{
- //alert(document.getElementById("useremail").value);
-
- if (/^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+.)+([a-zA-Z]{1,3})$/.test(document.getElementById("useremail").value))
- {
- document.forms[0].submit();
- }
- else
- {
- alert("Please enter a valid EMail, for example name@mail.com");
- }
-}
-</script>
-
-<h1>$APP_NAME - Installation</h1>
-
-<form name="cmxform" id="form1" class="cmxform" method="post" action="?command=step2">
-
- <fieldset id="userData">
-
- <legend>Userdata</legend>
- <li>
- <label for="username">Username</label>
- <input name="username" id="username" size="27"
- title="Enter a username" type="text" /><br />
- </li><li>
- <label for="userpass">Userpass</label>
- <input name="userpass" id="userpass" size="27"
- title="Enter a password" type="password" /><br />
- </li><li>
- <label for="useremail">EMail</label>
- <input name="useremail" id="useremail" size="27"
- title="Enter a EMail" type="text" /><br/>
- </li><li>
- <label for="timeZone">User Time Zone</label>
- <select name="timeZone" id="timeZone"
- size="1">
- #foreach( $key in $allTimeZones.keySet() )
- <option value="$key">$allTimeZones.get($key)</option>
- #end
- </select><br/>
- </li>
- </fieldset>
-
- <fieldset id="userOrga" >
-
- <legend>Organisation(Domains)</legend>
- <li>
- <label for="orgname">Name</label>
- <input name="orgname" id="orgname" size="27"
- title="Enter a default Organisation" type="text" />
- </li>
- </fieldset>
-
- <fieldset id="userConf">
-
- <legend>Configuration</legend>
- <li>
- <label for="configdefault">Allow self-registering (allow_frontend_register)</label>
- <select name="configdefault" id="configdefault" size="1"
- >
- <option value="1" selected>Yes</option>
- <option value="0">No</option>
- </select><br />
- </li><li>
- <label for="sendEmailAtRegister">Send Email to new registered Users (sendEmailAtRegister)</label>
- <select name="sendEmailAtRegister" id="sendEmailAtRegister" size="1"
- >
- <option value="1" selected>Yes</option>
- <option value="0">No</option>
- </select><br />
- </li><li>
- <label for="sendEmailWithVerficationCode">New Users need to verify their EMail (sendEmailWithVerficationCode)</label>
- <select name="sendEmailWithVerficationCode" id="sendEmailWithVerficationCode"
- size="1">
- <option value="1" selected>Yes</option>
- <option value="0">No</option>
- </select><br />
- </li><li>
- <label for="createDefaultRooms">Default Rooms of all types will be created</label>
- <select name="createDefaultRooms" id="createDefaultRooms"
- size="1">
- <option value="1" selected>Yes</option>
- <option value="0">No</option>
- </select><br />
- </li><li>
- <label for="configreferer">Mail-Referer (system_email_addr)</label>
- <input name="configreferer" id="configreferer" size="27"
- title="Enter a Referer" type="text" value="noreply@localhost" /><br />
- </li><li>
- <label for="configsmtp">SMTP-Server (smtp_server)</label>
- <input name="configsmtp" id="configsmtp" size="27"
- title="Enter a SMTP-Server" type="text" value="localhost" /><br/>
- </li><li>
- <label for="configsmtp">SMTP-Server Port(default Smtp-Server Port is 25) (smtp_port)</label>
- <input name="configsmtpport" id="configsmtpport" size="27"
- title="Enter a SMTP-Server.Port normally 25" type="text" value="25" /><br/>
- </li><li>
- <label for="configmailuser">SMTP-Username (email_userpass)</label>
- <input name="configmailuser" id="configmailuser" size="27"
- title="Enter the mail-username" type="text" /><br />
- </li><li>
- <label for="configmailpass">SMTP-Userpass (email_userpass)</label>
- <input name="configmailpass" id="configmailpass" size="27"
- title="Enter the mail-userpass" type="password" /><br/>
- </li><li>
- <label for="mailusetls">Enable TLS in Mail Server Auth</label>
- <select name="mailusetls" id="mailusetls"
- size="1">
- <option value="1">Yes</option>
- <option value="0" selected>No</option>
- </select><br />
- </li><li>
- <label for="replyToOrganizer">Set inviter's email address as ReplyTo in email invitations (inviter.email.as.replyto)</label>
- <select name="replyToOrganizer" id="replyToOrganizer" size="1"
- >
- <option value="1" selected>Yes</option>
- <option value="0">No</option>
- </select><br />
- </li><li>
- <label for="configdefaultLang">Default Language</label>
- <select name="configdefaultLang" id="configdefaultLang"
- size="1">
- #foreach( $key in $allLanguages.keySet() )
- <option value="$key">$allLanguages.get($key)</option>
- #end
- </select><br/>
- </li>
- <li>
- <label for="default_export_font">Default Font for Export [default_export_font]</label>
- <select name="default_export_font" id="default_export_font"
- size="1">
- #foreach( $key1 in $allFonts.keySet() )
- <option value="$key1">$allFonts.get($key1)</option>
- #end
- </select><br/>
- </li>
- </fieldset>
-
- <fieldset id="userConf1">
- <legend>Converters</legend>
- <li>
- <label for="swftools_zoom">SWFTools Zoom</label>
- <input name="swftools_zoom" id="swftools_zoom" size="4" value="72"
- title="Enter the dpi that swftools will use for PDF to SWF conversion" type="text" />
- <p><i>You can test if swftools is installed into system path by opening a shell or cmd-prompt and type pdf2swf<br/>
- Enter the dpi that swftools will use for PDF to SWF conversion. Default is 72 dpi.<br/>
- see also <a href="http://openmeetings.apache.org/installation.html" target="_blank">Installation</a></i></p>
-
- </li>
- <li>
- <label for="swftools_jpegquality">SWFTools JPEG Quality</label>
- <input name="swftools_jpegquality" id="swftools_jpegquality" size="3" value="85"
- title="Enter the quality of embedded jpeg pictures to quality. 0 is worst (small), 100 is best (big). (default:85)" type="text" />
- <p>
- <i>You can test if swftools is installed into system path by opening a shell or cmd-prompt and type pdf2swf<br/>
- Enter the quality of embedded jpeg pictures to quality. 0 is worst (small), 100 is best (big). (default:85)<br/>
- see also <a href="http://openmeetings.apache.org/installation.html" target="_blank">Installation</a></i>
- </p>
- </li>
-
- <li>
- <label for="swftools_path">SWFTools Path</label>
- <input name="swftools_path" id="swftools_path" size="27" title="Enter the path to swftools for example C:/swftools (Windows) or leave blank if swftools is a known to your system path" type="text" />
- <p><i>You can test if swftools is installed into system path by opening a shell or cmd-prompt and type pdf2swf<br/>
- If this shows a list of options leave this field blank otherwise you have to specify the path to pdf2swf on your system<br/>
- see also <a href="http://openmeetings.apache.org/installation.html" target="_blank">Installation</a></i></p>
- </li>
- <li>
- <label for="imagemagick_path">ImageMagick Path</label>
- <input name="imagemagick_path" id="imagemagick_path" size="27" title="Enter the path to ImageMagick, leave blank if ImageMagick is successfully installed to system-path" type="text" />
- <p><i>see also <a href="http://openmeetings.apache.org/installation.html" target="_blank">Installation</a></i></p>
- </li>
- <li>
- <label for="ffmpeg_path">FFMPEG Path</label>
- <input name="ffmpeg_path" id="ffmpeg_path" size="27" title="Enter the path to FFMPEG, leave blank if FFMPEG is successfully installed to system-path" type="text" />
- <p><i>see also <a href="http://openmeetings.apache.org/installation.html" target="_blank">Installation</a></i></p>
- </li>
- <li>
- <label for="sox_path">SoX Path</label>
- <input name="sox_path" id="sox_path" size="27" title="Enter the path to SoX, leave blank if SoX is successfully installed to system-path" type="text" />
- <p><i>see also <a href="http://openmeetings.apache.org/installation.html" target="_blank">Installation</a></i></p>
- </li>
- <li>
- <label for="jod_path">JOD Path</label>
- <input name="jod_path" id="jod_path" size="27" value="./jodconverter-core-3.0-beta-4/lib"
- title="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" type="text" />
- <p><i>see also <a href="http://openmeetings.apache.org/installation.html" target="_blank">Installation</a></i></p>
- </li>
- <li>
- <label for="office_path">OpenOffice/LibreOffice Path for jodconverter</label>
- <input name="office_path" id="office_path" size="27" value=""
- title="The path to OpenOffice/LibreOffice (optional) please set this to the real path in case jodconverter is unable to find OpenOffice/LibreOffice installation automatically" type="text" />
- <p>The path to OpenOffice/LibreOffice (optional) please set this to the real path in case jodconverter is unable to find OpenOffice/LibreOffice installation</p>
- </li>
- </fieldset>
-
- <fieldset id="userConf2">
-
- <legend>Crypt Type</legend>
- <li>
- <label for="crypt_ClassName">Crypt Class</label>
- <input name="crypt_ClassName" id="crypt_ClassName" size="27"
- type="text"
- title="Enter the Class name of the Encryption Class. DO NOT ALTER THIS IF YOU ARE NOT SURE"
- value="org.apache.openmeetings.utils.crypt.MD5Implementation" />
- </li>
- <p><i>
- You can use this default crypt type which is equal to PHP-MD5 function or BSD-Style<BR/>
- encryption by using:<b>org.apache.openmeetings.utils.crypt.MD5CryptImplementation</b><BR/>
- for more information or to write your own Crypt-Style see:<BR/>
- <a href="http://openmeetings.apache.org/CustomCryptMechanism.html" target="_blank">Custom Crypt Mechanism</a><BR/>
- You can edit this value later BUT previous created Users and Sessions might be not usable anymore<BR/>
- </i></p>
-
- </fieldset>
-
- <fieldset id="red5sip">
- <legend>red5SIP Configuration</legend>
-
- <li>
- <label for="red5sip_enable">Enable SIP</label>
- <select name="red5sip_enable" id="red5sip_enable" size="1">
- <option value="yes">Yes</option>
- <option value="no" selected>No</option>
- </select><br />
- </li>
- <p><i>
- Enable red5SIP integration
- </i></p>
- <br />
-
- <li>
- <label for="red5sip_room_prefix">SIP rooms prefix</label>
- <input name="red5sip_room_prefix" id="red5sip_room_prefix" size="27" title="" type="text" value="400" />
- <p><i>Prefix for phone number of conference rooms</i></p>
- </li>
-
- <li>
- <label for="red5sip_exten_context">SIP extensions context</label>
- <input name="red5sip_exten_context" id="red5sip_exten_context" size="27" title="" type="text" value="rooms" />
- <p><i>Context of Asterisk extensions</i></p>
- </li>
-
- </fieldset>
-
- <fieldset>
- <legend>Submit</legend>
- <input name="Submit" value="INSTALL"
- title="Submit" type="button" onclick="checkEmail();"/>
- </fieldset>
-
-</form>
-
-</body>
-</html>
Index: src/install_step2_EN.vm
===================================================================
--- src/install_step2_EN.vm (.../branches/2.1) (revision 1490226)
+++ src/install_step2_EN.vm (.../trunk/singlewebapp) (revision 1490226)
@@ -1,43 +0,0 @@
-## OpenMeetings
-## author swagner
-## 11.05.2007
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
-<!--
-Copyright 1999-2004 The Apache Software Foundation
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
-</head>
-<body>
-<H1>$APP_NAME - Installation Complete!</h1>
-<h2><a href="/$APP_ROOT/">Enter the Application</a></h2>
-<br/>
-<br/>
-If your Red5-Server runs on a different Port or on a different domain<br/>
-<a href="config.xml">alter the config values of the client</a>
-<br/><br/><br/>
-
-<b> <span style="font-size:1.4em">Mailing list</span></b><br/><br/>
-
-<span style="font-size:1.3em"><a href="http://openmeetings.apache.org/mail-lists.html" target="_blank">http://openmeetings.apache.org/mail-lists.html</a></span><br/><br/>
-
-
-<b> <span style="font-size:1.4em">There are some companies that also offer commercial support for Apache OpenMeetings:</span></b><br/><br/>
-
-<span style="font-size:1.3em"><a href="http://openmeetings.apache.org/commercial-support.html" target="_blank">http://openmeetings.apache.org/commercial-support.html</a></span><br/>
-
-
-</body>
-</html>
Index: src/install_exception_EN.vm
===================================================================
--- src/install_exception_EN.vm (.../branches/2.1) (revision 1490226)
+++ src/install_exception_EN.vm (.../trunk/singlewebapp) (revision 1490226)
@@ -1,29 +0,0 @@
-## OpenMeetings
-## author swagner
-## 11.05.2007
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
-<!--
-Copyright 1999-2004 The Apache Software Foundation
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
-</head>
-<body>
-<b>OpenMeetings - Installation</b><br />
-<h>Error:</h><br/>
-$error
-$path
-</body>
-</html>
Index: src/install_complete_EN.vm
===================================================================
--- src/install_complete_EN.vm (.../branches/2.1) (revision 1490226)
+++ src/install_complete_EN.vm (.../trunk/singlewebapp) (revision 1490226)
@@ -1,30 +0,0 @@
-## OpenMeetings
-## author swagner
-## 10.05.2007
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
-<!--
-Copyright 1999-2004 The Apache Software Foundation
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de' lang='de'>
-<head>
-<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
-</head>
-<body>
-<b>OpenMeetings - Installation</b><br />
-The Installation process is complete.<BR />
-You can login into the application using:<br/>
-User: swagner<BR/>
-Pass: test<BR/>
-</body>
-</html>
Index: src/usual_template.vm
===================================================================
--- src/usual_template.vm (.../branches/2.1) (revision 1490226)
+++ src/usual_template.vm (.../trunk/singlewebapp) (revision 1490226)
@@ -1,115 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<!--
-Copyright 1999-2004 The Apache Software Foundation
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html>
-<head>
-
-<meta http-equiv="cache-control" content="no-cache">
-
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
-<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
-<meta name="viewport" content="width=device-width; initial-scale=1.0;">
-<title>$APP_NAME</title>
-<script type="text/javascript">
- // If loaded bare into a browser, set the browser size to the canvas size
- if (window === top) {
- (function (width, height) {
- // Cf. http://www.quirksmode.org/viewport/compatibility.html
- if (window.innerHeight) {
- // Sadly, innerHeight/Width is not r/w on some browsers, and resizeTo is for outerHeight/Width
- window.resizeTo(width ? (width + window.outerWidth - window.innerWidth) : window.outerWidth,
- height ? (height + window.outerHeight - window.innerHeight) : window.outerHeight);
- } else if (document.documentElement && document.documentElement.clientHeight) {
- if (width) {
- document.documentElement.clientWidth = width;
- }
- if (height) {
- document.documentElement.clientHeight = height;
- }
- } else {
- if (width) {
- document.body.clientWidth = width;
- }
- if (height) {
- document.body.clientHeight = height;
- }
- }
- })(null, null);
- }
-</script>
-
-<script type="text/javascript"
- src="embed-compressed.js"></script>
-<script type="text/javascript"
- src="openmeetings_functions.js"></script>
-<script type="text/javascript">
-
-function getAppletStatus(){
- return false;
-}
-
-</script>
-
-<style type="text/css">
-html,body { /* http://www.quirksmode.org/css/100percheight.html */
- height: 100%;
- /* prevent scrollbars */
- margin: 0;
- padding: 0;
- border: 0 none;
- overflow: hidden;
-}
-
-body {
- background-color: #ffffff;
-}
-
-img {
- border: 0 none;
-}
-</style>
-</head>
-<body>
-
-<script type="text/javascript">
- lz.embed.swf({url: '$SWF_URL&#063;rev=$REVISION&amp;$SWF_PARAMS', allowfullscreen: 'true', bgcolor: '#ffffff', width: '100%', height: '100%', id: 'lzapp', accessible: 'false'});
-
- lz.embed.lzapp.onloadstatus = function loadstatus(p) {
- // called with a percentage (0-100) indicating load progress
- }
-
- lz.embed.lzapp.onload = function loaded() {
- // called when this application is done loading
- }
-</script>
-
-
-<!--
-<div style="width: 100%; height: 100%;" id="lzappContainer"><embed
- src="maindebug.lzx-Dateien/maindebug.lzx" quality="high"
- bgcolor="#ffffff" wmode="window" allowfullscreen="true" id="lzapp"
- name="lzapp"
- flashvars="$SWF_FLASHVARS"
- swliveconnect="true" allowscriptaccess="sameDomain"
- type="application/x-shockwave-flash"
- pluginspage="http://www.macromedia.com/go/getflashplayer"
- align="middle" height="100%" width="100%"></div>
- -->
- <div id="loading" style="z-index: 666666; position: absolute; top: 50%; left: 50%;"><img src="images/ajax-loader.gif"/></div>
-<noscript>Please enable JavaScript in order to use this
-application.</noscript>
-</body>
-</html>
Index: src/org/apache/openmeetings/test/session/TestHashMapSession.java
===================================================================
--- src/org/apache/openmeetings/test/session/TestHashMapSession.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/test/session/TestHashMapSession.java (.../trunk/singlewebapp) (revision 1490226)
@@ -50,6 +50,9 @@
@Test
public void testHashMapSession() {
+ //make sure the cache is empty before starting the test
+ cache.clearCache();
+
for (int i=0;i<20;i++) {
String streamId = ""+i;
Index: src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java
===================================================================
--- src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java (.../trunk/singlewebapp) (revision 1490226)
@@ -54,7 +54,7 @@
protected static final String userpass = "qweqwe";
private static final String orgname = "smoketest";
private static final String timeZone = "Europe/Berlin";
- private static final String useremail = "junit@openmeetings.de";
+ private static final String useremail = "junit@openmeetings.apache.org";
@Autowired
private AppointmentDao appointmentDao;
@@ -135,7 +135,12 @@
}
private void makeDefaultScheme() throws Exception {
- importInitvalues.loadAll(new InstallationConfig(), username, userpass,
- useremail, orgname, timeZone, false);
+ InstallationConfig cfg = new InstallationConfig();
+ cfg.username = username;
+ cfg.password = userpass;
+ cfg.email = useremail;
+ cfg.group = orgname;
+ cfg.ical_timeZone = timeZone;
+ importInitvalues.loadAll(cfg, false);
}
}
Index: src/org/apache/openmeetings/test/xsd/GenerateConfigXsd.java
===================================================================
--- src/org/apache/openmeetings/test/xsd/GenerateConfigXsd.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/test/xsd/GenerateConfigXsd.java (.../trunk/singlewebapp) (revision 1490226)
@@ -32,8 +32,8 @@
try {
String[] args = {
- "WebContent"+File.separatorChar+"openmeetings"+File.separatorChar+"config.xml",
- "WebContent"+File.separatorChar+"openmeetings"+File.separatorChar+"openmeetings-config.xsd"
+ "WebContent"+File.separatorChar+"openmeetings"+File.separatorChar+"public"+File.separatorChar+"config.xml",
+ "WebContent"+File.separatorChar+"openmeetings"+File.separatorChar+"public"+File.separatorChar+"config.xsd"
};
Driver.main(args);
Index: src/org/apache/openmeetings/test/config/TestConfig.java
===================================================================
--- src/org/apache/openmeetings/test/config/TestConfig.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/test/config/TestConfig.java (.../trunk/singlewebapp) (revision 1490226)
@@ -33,8 +33,7 @@
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;
@@ -39,26 +38,15 @@
@Autowired
private ConfigurationDao configurationDao;
-
@Test
public void getConfigKey() {
-
- try {
-
System.err.println("THIS");
- Configuration smtp_server = configurationDao
- .get(
- "smtp_server");
+ Configuration smtp_server = configurationDao.get("smtp_server").get(0);
System.err.println("smtp_server " + smtp_server.getUser());
assertEquals(null, smtp_server.getUser());
-
- } catch (Exception err) {
- log.error("[startConversion]", err);
- }
-
}
@Test
@@ -71,8 +59,7 @@
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());
}
}
Index: src/org/apache/openmeetings/test/calendar/TestDatabaseStructureAppointmentReminderTyp.java
===================================================================
--- src/org/apache/openmeetings/test/calendar/TestDatabaseStructureAppointmentReminderTyp.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/test/calendar/TestDatabaseStructureAppointmentReminderTyp.java (.../trunk/singlewebapp) (revision 1490226)
@@ -49,9 +49,9 @@
cal.getTime();
appointmentReminderTypDaoImpl.addAppointmentReminderTyps(1L,
- "test 5 min");
+ "test 5 min", -1);
List<AppointmentReminderTyps> listAppoints = appointmentReminderTypDaoImpl
- .getAppointmentReminderTypList();
+ .getAppointmentReminderTypList(1);
log.debug("Anzahl: " + listAppoints.size());
Index: src/org/apache/openmeetings/ldap/LdapAuthBase.java
===================================================================
--- src/org/apache/openmeetings/ldap/LdapAuthBase.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/ldap/LdapAuthBase.java (.../trunk/singlewebapp) (revision 1490226)
@@ -109,9 +109,9 @@
ldapAuthenticateProperties.put(Context.SECURITY_CREDENTIALS, passwd);
ldapAuthenticateProperties.put("java.naming.ldap.referral.bind", "true");
-
- if(ldap_admin_dn == null)
+ if(ldap_admin_dn == null) {
ldap_admin_dn = "";
+ }
if(!ldap_auth_type.equals(LDAP_AUTH_TYPE_NONE) && ldap_admin_dn.length() > 0){
log.debug("\n\nAuthentification to LDAP - Server start");
Index: src/org/apache/openmeetings/session/store/DatabaseStore.java
===================================================================
--- src/org/apache/openmeetings/session/store/DatabaseStore.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/session/store/DatabaseStore.java (.../trunk/singlewebapp) (revision 1490226)
@@ -40,7 +40,7 @@
public void clearCache() {
- List<Server> serverList = serverDao.getActiveServers();
+ //List<Server> serverList = serverDao.getActiveServers();
//clientDao.cleanUpClientsWithoutReference();
}
Index: src/org/apache/openmeetings/session/store/HashMapStore.java
===================================================================
--- src/org/apache/openmeetings/session/store/HashMapStore.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/session/store/HashMapStore.java (.../trunk/singlewebapp) (revision 1490226)
@@ -55,7 +55,7 @@
private LinkedHashMap<String, Client> clientsByStreamId = new LinkedHashMap<String, Client>();
public void clearCache() {
- // Nothing todo here
+ clientsByStreamId = new LinkedHashMap<String, Client>();
}
public void put(String streamId, Client rcl) {
Index: src/org/apache/openmeetings/servlet/outputhandler/Install.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/Install.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/Install.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.servlet.outputhandler;
-
-import java.io.File;
-import java.io.StringWriter;
-import java.util.LinkedHashMap;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.documents.InstallationDocumentHandler;
-import org.apache.openmeetings.installation.ImportInitvalues;
-import org.apache.openmeetings.installation.InstallationConfig;
-import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
-import org.apache.openmeetings.servlet.BaseVelocityViewServlet;
-import org.apache.openmeetings.servlet.ServerNotInitializedException;
-import org.apache.openmeetings.utils.ImportHelper;
-import org.apache.openmeetings.utils.OmFileHelper;
-import org.apache.velocity.Template;
-import org.apache.velocity.context.Context;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
-public class Install extends BaseVelocityViewServlet {
-
- private static final long serialVersionUID = 3684381243236013771L;
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- Install.class, OpenmeetingsVariables.webAppRootKey);
-
- private Template getStep2Template(HttpServletRequest httpServletRequest, Context ctx, String lang) throws Exception {
- String header = httpServletRequest.getHeader("Accept-Language");
- String[] headerList = header != null ? header.split(",") : new String[0];
- String headCode = headerList.length > 0 ? headerList[0] : "en";
-
- LinkedHashMap<Integer, LinkedHashMap<String, Object>> allLanguagesAll = getBean(ImportInitvalues.class)
- .getLanguageFiles();
- LinkedHashMap<Integer, String> allLanguages = new LinkedHashMap<Integer, String>();
- //first iteration for preferred language
- Integer prefKey = -1;
- String prefName = null;
- for (Integer key : allLanguagesAll.keySet()) {
- String langName = (String) allLanguagesAll.get(key).get("name");
- String langCode = (String) allLanguagesAll.get(key).get("code");
- if (langCode != null) {
- if (headCode.equals(langCode)) {
- prefKey = key;
- prefName = langName;
- break;
- } else if (headCode.startsWith(langCode)) {
- prefKey = key;
- prefName = langName;
- }
- }
- }
- allLanguages.put(prefKey, prefName);
- for (Integer key : allLanguagesAll.keySet()) {
- String langName = (String) allLanguagesAll.get(key).get("name");
- if (key != prefKey) {
- allLanguages.put(key, langName);
- }
- }
-
- LinkedHashMap<String, String> allFonts = new LinkedHashMap<String, String>();
- allFonts.put("TimesNewRoman", "TimesNewRoman");
- allFonts.put("Verdana", "Verdana");
- allFonts.put("Arial", "Arial");
-
- List<OmTimeZone> omTimeZoneList = getBean(ImportInitvalues.class)
- .getTimeZones();
-
- Template tpl = super.getTemplate("install_step1_"
- + lang + ".vm");
- ctx.put("allLanguages", allLanguages);
- ctx.put("allFonts", allFonts);
- ctx.put("allTimeZones", ImportHelper.getAllTimeZones(omTimeZoneList));
- StringWriter writer = new StringWriter();
- tpl.merge(ctx, writer);
-
- return tpl;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest
- * , javax.servlet.http.HttpServletResponse)
- */
- @Override
- public Template handleRequest(HttpServletRequest request,
- HttpServletResponse response, Context ctx) {
-
- try {
- ctx.put("APP_ROOT", OpenmeetingsVariables.webAppRootKey);
- ctx.put("APP_NAME", getBean(ConfigurationDao.class).getAppName());
- String command = request.getParameter("command");
-
- String lang = request.getParameter("lang");
- if (lang == null)
- lang = "EN";
-
- File installerFile = OmFileHelper.getInstallFile();
-
- if (command == null || !installerFile.exists()) {
- log.debug("command equals null");
-
- if (!installerFile.exists()) {
- File confDir = OmFileHelper.getConfDir();
- boolean b = confDir.canWrite();
-
- if (!b) {
- // File could not be created so throw an error
- ctx.put("error",
- "Could not Create File, Permission set? ");
- ctx.put("path", confDir.getCanonicalPath());
- return getVelocityView().getVelocityEngine()
- .getTemplate("install_error_" + lang + ".vm");
- } else {
- InstallationDocumentHandler.createDocument(0);
- // File has been created so follow first step of
- // Installation
- return getVelocityView().getVelocityEngine()
- .getTemplate("install_welcome_" + lang + ".vm");
- }
-
- } else {
- int i = InstallationDocumentHandler.getCurrentStepNumber();
- if (i == 0) {
- return getStep2Template(request, ctx, lang);
- } else {
- return getVelocityView().getVelocityEngine()
- .getTemplate("install_step2_" + lang + ".vm");
- }
- }
-
- } else if (command.equals("step1")) {
-
- int i = InstallationDocumentHandler.getCurrentStepNumber();
- if (i == 0) {
- return getStep2Template(request, ctx, lang);
- } else {
- ctx.put("error",
- "This Step of the installation has already been done. continue with step 2 <A HREF='?command=step2'>continue with step 2</A>");
- return getVelocityView().getVelocityEngine().getTemplate(
- "install_exception_" + lang + ".vm");
- }
-
- } else if (command.equals("step2")) {
-
- int i = InstallationDocumentHandler.getCurrentStepNumber();
- if (i == 0) {
-
- log.debug("do init installation");
-
- String username = request.getParameter("username");
- String userpass = request.getParameter("userpass");
- String useremail = request.getParameter("useremail");
- String orgname = request.getParameter("orgname");
- InstallationConfig cfg = new InstallationConfig();
- cfg.allowFrontendRegister = request.getParameter("configdefault");
-
- cfg.mailReferer = request.getParameter("configreferer");
- cfg.smtpServer = request.getParameter("configsmtp");
- cfg.smtpPort = request.getParameter("configsmtpport");
- cfg.mailAuthName = request.getParameter("configmailuser");
- cfg.mailAuthPass = request.getParameter("configmailpass");
- cfg.mailUseTls = request.getParameter("mailusetls");
- cfg.replyToOrganizer = request.getParameter("replyToOrganizer");
-
- cfg.defaultLangId = request.getParameter("configdefaultLang");
- cfg.swfZoom = request.getParameter("swftools_zoom");
- cfg.swfJpegQuality = request.getParameter("swftools_jpegquality");
- cfg.swfPath = request.getParameter("swftools_path");
- cfg.imageMagicPath = request.getParameter("imagemagick_path");
- cfg.sendEmailAtRegister = request.getParameter("sendEmailAtRegister");
- cfg.sendEmailWithVerficationCode = request.getParameter("sendEmailWithVerficationCode");
- cfg.createDefaultRooms = request.getParameter("createDefaultRooms");
-
- cfg.defaultExportFont = request.getParameter("default_export_font");
-
- cfg.cryptClassName = request.getParameter("crypt_ClassName");
-
- cfg.ffmpegPath = request.getParameter("ffmpeg_path");
-
- cfg.soxPath = request.getParameter("sox_path");
-
- // red5sip integration config
- cfg.red5SipEnable = request.getParameter("red5sip_enable");
- cfg.red5SipRoomPrefix = request.getParameter("red5sip_room_prefix");
- cfg.red5SipExtenContext = request.getParameter("red5sip_exten_context");
-
- String timeZone = request.getParameter("timeZone");
- cfg.ical_timeZone = timeZone;
-
- cfg.jodPath = request.getParameter("jod_path");
-
- log.debug("step 0+ start init with values. " + username
- + " ***** " + useremail + " " + orgname + " "
- + cfg);
-
- cfg.urlFeed = getServletContext().getInitParameter(
- "url_feed");
- cfg.urlFeed2 = getServletContext().getInitParameter(
- "url_feed2");
-
- getBean(ImportInitvalues.class).loadAll(cfg, username,
- userpass, useremail, orgname, timeZone, false);
-
- // update to next step
- log.debug("add level to install file");
- InstallationDocumentHandler.createDocument(1);
-
- // return
- // getVelocityEngine().getTemplate("install_complete_"+lang+".vm");
- return getVelocityView().getVelocityEngine().getTemplate(
- "install_step2_" + lang + ".vm");
- } else {
- ctx.put("error",
- "This Step of the installation has already been done. continue with step 2 <A HREF='?command=step2'>continue with step 2</A>");
- return getVelocityView().getVelocityEngine().getTemplate(
- "install_exception_" + lang + ".vm");
- }
-
- } else if (command.equals("step")) {
-
- int i = InstallationDocumentHandler.getCurrentStepNumber();
- if (i == 0) {
-
- }
-
- }
- } catch (ServerNotInitializedException err) {
- return getBooting();
- } catch (Exception err2) {
- log.error("Install: ", err2);
- }
-
- return null;
- }
-
-}
Index: src/org/apache/openmeetings/servlet/outputhandler/DefaultIndex.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/DefaultIndex.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/DefaultIndex.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.servlet.outputhandler;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.Version;
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.servlet.BaseVelocityViewServlet;
-import org.apache.openmeetings.servlet.ServerNotInitializedException;
-import org.apache.velocity.Template;
-import org.apache.velocity.context.Context;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
-public class DefaultIndex extends BaseVelocityViewServlet {
-
- private static final long serialVersionUID = 3043617619650666432L;
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- DefaultIndex.class, OpenmeetingsVariables.webAppRootKey);
-
- @Override
- public Template handleRequest(HttpServletRequest httpServletRequest,
- HttpServletResponse httpServletResponse, Context ctx) {
-
- try {
- String template = "usual_template.vm";
- ctx.put("APP_NAME", getBean(ConfigurationDao.class).getAppName());
- ctx.put("REVISION", Version.getRevision());
- // Parse the Param for the SWF URL
- String swf = httpServletRequest.getParameter("swf");
- if (swf == null) {
- ctx.put("SWF_URL", "main.as3.swf11.swf");
- } else {
- ctx.put("SWF_URL", swf);
- }
-
- String SWF_PARAMS = "";
- String SWF_FLASHVARS = "";
-
- // Load params from URL and set into wrapper code
- if (httpServletRequest.getParameterMap() != null) {
- for (Iterator<String> iter = httpServletRequest.getParameterMap()
- .keySet().iterator(); iter.hasNext();) {
- String paramKey = iter.next();
- SWF_FLASHVARS += paramKey
- + "="
- + httpServletRequest.getParameterMap()
- .get(paramKey)[0] + "&amp;";
- SWF_PARAMS += paramKey
- + "="
- + httpServletRequest.getParameterMap()
- .get(paramKey)[0] + "&amp;";
- }
- }
-
- HashMap<String, String> defaultValuesMap = new HashMap<String, String>();
-
- defaultValuesMap.put("lzt", "swf");
- defaultValuesMap.put("lzproxied", "solo");
- defaultValuesMap.put("lzr", "swf8");
- defaultValuesMap.put("bgcolor", "%23ffffff");
- defaultValuesMap.put("width", "100%25");
- defaultValuesMap.put("height", "100%25");
- // defaultValuesMap.put("__lzurl","main.lzx%3Flzt%3Dswf%26lzproxied%3Dsolo%26lzr%3Dswf8");
- defaultValuesMap.put("__lzminimumversion", "8");
- defaultValuesMap.put("id", "lzapp");
-
- for (Iterator<String> iter = defaultValuesMap.keySet().iterator(); iter
- .hasNext();) {
- String paramKey = iter.next();
- SWF_PARAMS += paramKey + "=" + defaultValuesMap.get(paramKey);
- SWF_FLASHVARS += paramKey + "="
- + defaultValuesMap.get(paramKey);
- if (iter.hasNext()) {
- SWF_PARAMS += "&";
- SWF_FLASHVARS += "&amp;";
- }
- }
-
- ctx.put("SWF_PARAMS", SWF_PARAMS);
- ctx.put("SWF_FLASHVARS", SWF_FLASHVARS);
-
- return getVelocityView().getVelocityEngine().getTemplate(template);
-
- } catch (ServerNotInitializedException err) {
- return getBooting();
- } catch (Exception er) {
- log.error("[Calendar :: service]", er);
- }
- return null;
- }
-}
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/servlet/outputhandler/CalendarServlet.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/CalendarServlet.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/CalendarServlet.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,296 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.servlet.outputhandler;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.List;
-import java.util.TimeZone;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.SessiondataDao;
-import org.apache.openmeetings.data.calendar.management.AppointmentLogic;
-import org.apache.openmeetings.data.user.UserManager;
-import org.apache.openmeetings.persistence.beans.calendar.Appointment;
-import org.apache.openmeetings.persistence.beans.calendar.MeetingMember;
-import org.apache.openmeetings.servlet.BaseHttpServlet;
-import org.apache.openmeetings.servlet.ServerNotInitializedException;
-import org.apache.openmeetings.utils.math.TimezoneUtil;
-import org.dom4j.Document;
-import org.dom4j.DocumentHelper;
-import org.dom4j.Element;
-import org.dom4j.io.OutputFormat;
-import org.dom4j.io.XMLWriter;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
-public class CalendarServlet extends BaseHttpServlet {
-
- private static final long serialVersionUID = 2192254610711799347L;
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- Calendar.class, OpenmeetingsVariables.webAppRootKey);
-
- @Override
- protected void service(HttpServletRequest httpServletRequest,
- HttpServletResponse httpServletResponse) throws ServletException,
- IOException {
-
- try {
- String sid = httpServletRequest.getParameter("sid");
-
- if (sid == null) {
- sid = "default";
- }
- log.debug("sid: " + sid);
-
- Long users_id = getBean(SessiondataDao.class).checkSession(sid);
- Long user_level = getBean(UserManager.class).getUserLevelByID(users_id);
-
- if (user_level != null && user_level > 0) {
-
- String timeZoneIdAsStr = httpServletRequest
- .getParameter("timeZoneId");
-
- if (timeZoneIdAsStr == null) {
- log.error("No timeZoneIdAsStr given, using default");
- timeZoneIdAsStr = "";
- }
-
- TimeZone timezone = getBean(TimezoneUtil.class)
- .getTimezoneByOmTimeZoneId(
- Long.valueOf(timeZoneIdAsStr).longValue());
-
- String yearStr = httpServletRequest.getParameter("year");
- String monthStr = httpServletRequest.getParameter("month");
- String userStr = httpServletRequest.getParameter("user");
- String contactUser = httpServletRequest
- .getParameter("contactUser");
-
- Calendar starttime = GregorianCalendar.getInstance(timezone);
- starttime.set(Calendar.DATE, 1);
- starttime.set(Calendar.MONTH, Integer.parseInt(monthStr) - 1);
- starttime.set(Calendar.MINUTE, 0);
- starttime.set(Calendar.SECOND, 0);
- starttime.set(Calendar.YEAR, Integer.parseInt(yearStr));
-
- Calendar endtime = GregorianCalendar.getInstance(timezone);
- endtime.set(Calendar.DATE, 1);
- endtime.set(Calendar.MONTH, Integer.parseInt(monthStr));
- endtime.set(Calendar.MINUTE, 0);
- endtime.set(Calendar.SECOND, 0);
- endtime.set(Calendar.YEAR, Integer.parseInt(yearStr));
-
- Long userToShowId = Long.parseLong(contactUser);
- if (userToShowId == 0) {
- userToShowId = Long.parseLong(userStr);
- }
-
- List<Appointment> appointements = getBean(AppointmentLogic.class)
- .getAppointmentByRange(userToShowId,
- new Date(starttime.getTimeInMillis()),
- new Date(endtime.getTimeInMillis()));
-
- Document document = DocumentHelper.createDocument();
- document.setXMLEncoding("UTF-8");
- document.addComment("###############################################\n"
- + getServletContext().getServletContextName()
- + " Calendar \n"
- + "###############################################");
-
- Element vcalendar = document.addElement("vcalendar");
-
- Element year = vcalendar.addElement("year" + yearStr);
- Element month = year.addElement("month" + monthStr);
-
- int previousDay = 0;
- Element day = null;
-
- for (Appointment appointment : appointements) {
-
- Calendar appStart = Calendar.getInstance(timezone);
- appStart.setTime(appointment.getAppointmentStarttime());
-
- int dayAsInt = appStart.get(Calendar.DATE);
-
- if (previousDay != dayAsInt) {
-
- day = month.addElement("day" + dayAsInt);
-
- previousDay = dayAsInt;
-
- }
-
- if (appStart.get(Calendar.MONTH) + 1 == Integer
- .parseInt(monthStr)) {
-
- Element event = day.addElement("event");
-
- Element appointementId = event
- .addElement("appointementId");
- appointementId.addAttribute("value",
- "" + appointment.getAppointmentId());
-
- Element isConnectedEvent = event
- .addElement("isConnectedEvent");
- isConnectedEvent.addAttribute("value",
- "" + appointment.getIsConnectedEvent());
-
- Element rooms_id = event.addElement("rooms_id");
- Element roomtype = event.addElement("roomtype");
- if (appointment.getRoom() != null) {
- rooms_id.addAttribute("value", ""
- + appointment.getRoom().getRooms_id());
- roomtype.addAttribute("value", ""
- + appointment.getRoom().getRoomtype()
- .getRoomtypes_id());
- } else {
- rooms_id.addAttribute("value", "0");
- roomtype.addAttribute("value", "1");
- }
- Element remindType = event.addElement("remindtype");
- remindType.addAttribute("value", appointment
- .getRemind() != null ? ""
- + appointment.getRemind().getTypId() : "0");
-
- Element summary = event.addElement("summary");
- summary.addAttribute("value",
- appointment.getAppointmentName());
-
- Element comment = event.addElement("comment");
- comment.addAttribute("value",
- appointment.getAppointmentDescription());
-
- Element start = event.addElement("start");
-
- start.addAttribute("year",
- "" + appStart.get(Calendar.YEAR));
- start.addAttribute("month",
- "" + (appStart.get(Calendar.MONTH) + 1));
- start.addAttribute("day",
- "" + appStart.get(Calendar.DATE));
- start.addAttribute("hour",
- "" + appStart.get(Calendar.HOUR_OF_DAY));
- start.addAttribute("minute",
- "" + appStart.get(Calendar.MINUTE));
-
- Calendar appEnd = Calendar.getInstance(timezone);
- appEnd.setTime(appointment.getAppointmentEndtime());
- Element end = event.addElement("end");
- end.addAttribute("year", "" + appEnd.get(Calendar.YEAR));
- end.addAttribute("month",
- "" + (appEnd.get(Calendar.MONTH) + 1));
- end.addAttribute("day", "" + appEnd.get(Calendar.DATE));
- end.addAttribute("hour", "" + appEnd.get(Calendar.HOUR_OF_DAY));
- end.addAttribute("minute",
- "" + appEnd.get(Calendar.MINUTE));
-
- Element category = event.addElement("category");
- category.addAttribute("value", ""
- + appointment.getAppointmentCategory()
- .getCategoryId());
-
- Element uid = event.addElement("uid");
- uid.addAttribute("value",
- "" + appointment.getAppointmentId());
-
- Element attendees = event.addElement("attendees");
-
- for (MeetingMember meetingMember : appointment
- .getMeetingMember()) {
-
- Element attendee = attendees.addElement("attendee");
-
- Element email = attendee.addElement("email");
- email.addAttribute("value",
- meetingMember.getEmail());
-
- Element userId = attendee.addElement("userId");
- if (meetingMember.getUserid() != null) {
- userId.addAttribute("value", ""
- + meetingMember.getUserid()
- .getUser_id());
- } else {
- userId.addAttribute("value", "");
- }
-
- Element memberId = attendee.addElement("memberId");
- memberId.addAttribute("value",
- "" + meetingMember.getMeetingMemberId());
-
- Element firstname = attendee
- .addElement("firstname");
- memberId.addAttribute("value",
- "" + meetingMember.getMeetingMemberId());
- firstname.addAttribute("value",
- meetingMember.getFirstname());
-
- Element lastname = attendee.addElement("lastname");
- lastname.addAttribute("value",
- meetingMember.getLastname());
-
- Element jNameTimeZoneMember = attendee
- .addElement("jNameTimeZone");
- if (meetingMember.getOmTimeZone() != null) {
- jNameTimeZoneMember.addAttribute("value",
- meetingMember.getOmTimeZone()
- .getJname());
- } else {
- jNameTimeZoneMember.addAttribute("value", "");
- }
-
- }
-
- }
-
- }
-
- httpServletResponse.reset();
- httpServletResponse.resetBuffer();
- OutputStream out = httpServletResponse.getOutputStream();
- httpServletResponse.setContentType("text/xml");
-
- // httpServletResponse.setHeader("Content-Length", ""+
- // rf.length());
-
- OutputFormat outformat = OutputFormat.createPrettyPrint();
- outformat.setEncoding("UTF-8");
- XMLWriter writer = new XMLWriter(out, outformat);
- writer.write(document);
- writer.flush();
-
- out.flush();
- out.close();
-
- }
- } catch (ServerNotInitializedException e) {
- return;
- } catch (Exception er) {
- log.error("[Calendar :: service]", er);
- }
- }
-
-}
Index: src/org/apache/openmeetings/servlet/outputhandler/BackupExportFacade.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/BackupExportFacade.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/BackupExportFacade.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.servlet.outputhandler;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.servlet.BaseHttpServlet;
-import org.apache.openmeetings.servlet.ServerNotInitializedException;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
-/**
- *
- * @author sebastianwagner
- *
- */
-public class BackupExportFacade extends BaseHttpServlet {
-
- private static final long serialVersionUID = -928315730609302260L;
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- BackupExportFacade.class, OpenmeetingsVariables.webAppRootKey);
-
- /*
- * (non-Javadoc)
- *
- * @see
- * javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest
- * , javax.servlet.http.HttpServletResponse)
- */
- @Override
- protected void service(HttpServletRequest httpServletRequest,
- HttpServletResponse httpServletResponse) throws ServletException,
- IOException {
-
- try {
- getBean(BackupExport.class).service(httpServletRequest, httpServletResponse,
- getServletContext());
- } catch (ServerNotInitializedException e) {
- handleNotBooted(httpServletResponse);
- } catch (Exception er) {
- log.error("Error exporting ", er);
- }
- }
-
-}
Index: src/org/apache/openmeetings/servlet/outputhandler/ActivateUser.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/ActivateUser.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/ActivateUser.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.servlet.outputhandler;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
@@ -52,7 +54,7 @@
String loginURL = OpenmeetingsVariables.webAppRootPath;
Long default_lang_id = getBean(ConfigurationDao.class)
- .getConfValue("default_lang_id", Long.class, "1");
+ .getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
ctx.put("APP_NAME", getBean(ConfigurationDao.class).getAppName());
if (hash == null) {
// No hash
@@ -136,6 +138,7 @@
return getBooting();
} catch (Exception err) {
log.error("[ActivateUser]", err);
+ err.printStackTrace();
}
return null;
}
Index: src/org/apache/openmeetings/servlet/outputhandler/Export.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/Export.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/Export.java (.../trunk/singlewebapp) (revision 1490226)
@@ -139,6 +139,8 @@
}
} catch (Exception er) {
log.error("ERROR ", er);
+ System.out.println("Error exporting: " + er);
+ er.printStackTrace();
}
}
}
Index: src/org/apache/openmeetings/servlet/outputhandler/LangExport.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/LangExport.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/LangExport.java (.../trunk/singlewebapp) (revision 1490226)
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.io.OutputStream;
+import java.io.Writer;
import java.util.Date;
import java.util.List;
@@ -156,6 +157,8 @@
} catch (Exception er) {
log.error("ERROR ", er);
+ System.out.println("Error exporting: " + er);
+ er.printStackTrace();
}
}
@@ -174,7 +177,7 @@
return root;
}
- public Document createDocument(List<Fieldlanguagesvalues> flvList, List<Fieldlanguagesvalues> untranslatedList) throws Exception {
+ public static Document createDocument(List<Fieldlanguagesvalues> flvList, List<Fieldlanguagesvalues> untranslatedList) throws Exception {
Document document = createDocument();
Element root = createRoot(document);
@@ -201,8 +204,15 @@
return document;
}
- public static void serializetoXML(OutputStream out, String aEncodingScheme,
- Document doc) throws Exception {
+ public static void serializetoXML(Writer out, String aEncodingScheme, Document doc) throws Exception {
+ OutputFormat outformat = OutputFormat.createPrettyPrint();
+ outformat.setEncoding(aEncodingScheme);
+ XMLWriter writer = new XMLWriter(out, outformat);
+ writer.write(doc);
+ writer.flush();
+ }
+
+ public static void serializetoXML(OutputStream out, String aEncodingScheme, Document doc) throws Exception {
OutputFormat outformat = OutputFormat.createPrettyPrint();
outformat.setEncoding(aEncodingScheme);
XMLWriter writer = new XMLWriter(out, outformat);
Index: src/org/apache/openmeetings/servlet/outputhandler/ScreenController.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/ScreenController.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/ScreenController.java (.../trunk/singlewebapp) (revision 1490226)
@@ -40,6 +40,7 @@
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.context.Context;
import org.apache.velocity.runtime.RuntimeConstants;
+import org.apache.velocity.runtime.log.Log4JLogChute;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
@@ -211,6 +212,7 @@
VelocityEngine ve = new VelocityEngine();
ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
+ ve.setProperty(Log4JLogChute.RUNTIME_LOG_LOG4J_LOGGER, Log4JLogChute.class.getName());
ve.mergeTemplate(
"screenshare.vm"
Index: src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/BackupImportController.java (.../trunk/singlewebapp) (revision 1490226)
@@ -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;
@@ -431,8 +432,7 @@
, "privatemessagefolders", PrivateMessageFolder.class, true);
for (PrivateMessageFolder p : list) {
Long folderId = p.getPrivateMessageFolderId();
- PrivateMessageFolder storedFolder = privateMessageFolderDao
- .getPrivateMessageFolderById(folderId);
+ PrivateMessageFolder storedFolder = privateMessageFolderDao.get(folderId);
if (storedFolder == null) {
p.setPrivateMessageFolderId(0);
Long newFolderId = privateMessageFolderDao
@@ -579,22 +579,25 @@
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);
}
}
@@ -631,7 +634,10 @@
uploadCompleteMessage, info.publicSID);
} catch (Exception e) {
+
log.error("[ImportExport]", e);
+
+ e.printStackTrace();
throw new ServletException(e);
}
Index: src/org/apache/openmeetings/servlet/outputhandler/DownloadHandler.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/DownloadHandler.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/DownloadHandler.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,11 @@
*/
package org.apache.openmeetings.servlet.outputhandler;
+import static org.apache.openmeetings.utils.OmFileHelper.bigImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.chatImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.defaultProfileImageName;
+import static org.apache.openmeetings.utils.OmFileHelper.profileImagePrefix;
+
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
@@ -46,9 +51,8 @@
DownloadHandler.class, OpenmeetingsVariables.webAppRootKey);
private static final String defaultImageName = "deleted.jpg";
- private static final String defaultProfileImageName = "profile_pic.jpg";
- private static final String defaultProfileImageNameBig = "_big_profile_pic.jpg";
- private static final String defaultChatImageName = "_chat_profile_pic.jpg";
+ private static final String defaultProfileImageNameBig = profileImagePrefix + defaultProfileImageName;
+ private static final String defaultChatImageName = chatImagePrefix + defaultProfileImageName;
private static final String defaultSWFName = "deleted.swf";
private void logNonExistentFolder(File f) {
@@ -193,20 +197,20 @@
log.debug("LOG moduleName: " + moduleName);
- requestedFile = DownloadHandler.defaultImageName;
+ requestedFile = defaultImageName;
if (moduleName.equals("remoteuserprofile")) {
- requestedFile = DownloadHandler.defaultProfileImageName;
+ requestedFile = defaultProfileImageName;
} else if (moduleName.equals("remoteuserprofilebig")) {
- requestedFile = DownloadHandler.defaultProfileImageNameBig;
+ requestedFile = defaultProfileImageNameBig;
} else if (moduleName.equals("userprofile")) {
- requestedFile = DownloadHandler.defaultProfileImageName;
+ requestedFile = defaultProfileImageName;
} else if (moduleName.equals("chat")) {
- requestedFile = DownloadHandler.defaultChatImageName;
+ requestedFile = defaultChatImageName;
}
} else if (requestedFile.endsWith(".swf")) {
- requestedFile = DownloadHandler.defaultSWFName;
+ requestedFile = defaultSWFName;
} else {
- requestedFile = DownloadHandler.defaultImageName;
+ requestedFile = defaultImageName;
}
full_path = new File(OmFileHelper.getDefaultDir(), requestedFile);
}
@@ -312,7 +316,7 @@
String filesString[] = f.list();
for (int i = 0; i < filesString.length; i++) {
String fileName = filesString[i];
- if (fileName.startsWith("_chat_"))
+ if (fileName.startsWith(chatImagePrefix))
return fileName;
}
}
@@ -324,7 +328,7 @@
String filesString[] = f.list();
for (int i = 0; i < filesString.length; i++) {
String fileName = filesString[i];
- if (fileName.startsWith("_big_"))
+ if (fileName.startsWith(bigImagePrefix))
return fileName;
}
}
Index: src/org/apache/openmeetings/servlet/outputhandler/BackupExport.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/BackupExport.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/BackupExport.java (.../trunk/singlewebapp) (revision 1490226)
@@ -235,7 +235,7 @@
* ##################### Private Messages
*/
{
- List<PrivateMessage> list = privateMessagesDao.getPrivateMessages();
+ List<PrivateMessage> list = privateMessagesDao.get(0, Integer.MAX_VALUE);
Registry registry = new Registry();
Strategy strategy = new RegistryStrategy(registry);
Serializer serializer = new Persister(strategy);
@@ -254,7 +254,7 @@
* ##################### Private Message Folders
*/
writeList(simpleSerializer, backup_dir, "privateMessageFolder.xml",
- "privatemessagefolders", privateMessageFolderDao.getPrivateMessageFolders());
+ "privatemessagefolders", privateMessageFolderDao.get(0, Integer.MAX_VALUE));
/*
* ##################### User Contacts
@@ -406,7 +406,7 @@
try {
ser.write(t, listNode);
} catch (Exception e) {
- log.error("Exception While writing node of type: " + t.getClass(), e);
+ log.debug("Exception While writing node of type: " + t.getClass(), e);
}
}
}
@@ -531,14 +531,14 @@
try {
zos.close();
} catch (IOException e) {
- log.error("Enexpected error while closing ZipOutputStream", e);
+ log.debug("Enexpected error while closing ZipOutputStream", e);
}
}
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
- log.error("Enexpected error while closing FileOutputStream", e);
+ log.debug("Enexpected error while closing FileOutputStream", e);
}
}
}
Index: src/org/apache/openmeetings/servlet/outputhandler/UploadController.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/UploadController.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/UploadController.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,11 @@
*/
package org.apache.openmeetings.servlet.outputhandler;
+import static org.apache.openmeetings.utils.OmFileHelper.bigImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.chatImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.profileImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.thumbImagePrefix;
+
import java.io.File;
import java.io.InputStream;
@@ -281,11 +286,8 @@
log.debug("##### isImage! userProfilePic: " + userProfile);
if (userProfile) {
- // User Profile Update
- this.deleteUserProfileFiles(userId);
// convert it to JPG
- returnError = generateImage.convertImageUserProfile(
- newFileName, newFileExtDot, userId, newFileName, false);
+ returnError = generateImage.convertImageUserProfile(completeName, userId, true);
} else {
// convert it to JPG
log.debug("##### convert it to JPG: " + userProfile);
@@ -298,11 +300,11 @@
this.deleteUserProfileFiles(userId);
// is UserProfile Picture
returnError.addItem("processThumb1", generateThumbs
- .generateThumb("_chat_", completeName, 40));
+ .generateThumb(chatImagePrefix, completeName, 40));
returnError.addItem("processThumb2", generateThumbs
- .generateThumb("_profile_", completeName, 126));
+ .generateThumb(profileImagePrefix, completeName, 126));
returnError.addItem("processThumb3", generateThumbs
- .generateThumb("_big_", completeName, 240));
+ .generateThumb(bigImagePrefix, completeName, 240));
String pictureuri = completeName.getName();
User us = usersDao.get(userId);
@@ -313,7 +315,7 @@
//FIXME: After updating the picture url all other users should refresh
} else {
returnError.addItem("processThumb", generateThumbs
- .generateThumb("_thumb_", completeName, 50));
+ .generateThumb(thumbImagePrefix, completeName, 50));
}
}
Index: src/org/apache/openmeetings/servlet/outputhandler/ImportController.java
===================================================================
--- src/org/apache/openmeetings/servlet/outputhandler/ImportController.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/servlet/outputhandler/ImportController.java (.../trunk/singlewebapp) (revision 1490226)
@@ -101,4 +101,15 @@
}
}
+ public void importLanguage(Long language_id, InputStream is) {
+ try {
+ languageImport.addLanguageByDocument(
+ language_id, is);
+
+ } catch (Exception er) {
+ log.error("ERROR importing:", er);
+ }
+
+ }
+
}
Index: src/org/apache/openmeetings/persistence/beans/chat/ChatMessage.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/chat/ChatMessage.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/chat/ChatMessage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -42,8 +42,8 @@
@Entity
@NamedQueries({
@NamedQuery(name = "getChatMessageById", query = "SELECT c FROM ChatMessage c WHERE c.id = :id")
- , @NamedQuery(name = "getChatMessagesByUser", query = "SELECT DISTINCT c FROM ChatMessage c WHERE c.fromUser.user_id = :userId OR c.toUser.user_id = :userId ORDER BY c.sent DESC")
- , @NamedQuery(name = "getGlobalChatMessages", query = "SELECT DISTINCT c FROM ChatMessage c WHERE c.toUser IS NULL ORDER BY c.sent DESC")
+ , @NamedQuery(name = "getChatMessagesByUser", query = "SELECT DISTINCT c FROM ChatMessage c WHERE c.fromUser.user_id = :userId OR c.toUser.user_id = :userId ORDER BY c.sent ASC")
+ , @NamedQuery(name = "getGlobalChatMessages", query = "SELECT DISTINCT c FROM ChatMessage c WHERE c.toUser IS NULL ORDER BY c.sent ASC")
})@Table(name = "chat")
@Root(name = "ChatMessage")
public class ChatMessage implements Serializable, IDataProviderEntity {
Index: src/org/apache/openmeetings/persistence/beans/basic/LdapConfig.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/basic/LdapConfig.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/basic/LdapConfig.java (.../trunk/singlewebapp) (revision 1490226)
@@ -63,7 +63,7 @@
@Column(name="add_domain_to_user_name")
@Element(data=true)
- public Boolean addDomainToUserName;
+ public boolean addDomainToUserName;
@Column(name="domain")
@Element(data=true)
@@ -71,7 +71,7 @@
@Column(name="is_active")
@Element(data=true)
- public Boolean isActive;
+ public boolean isActive;
@Column(name="inserted")
public Date inserted;
@@ -118,10 +118,10 @@
this.configFileName = configFileName;
}
- public Boolean getAddDomainToUserName() {
+ public boolean getAddDomainToUserName() {
return addDomainToUserName;
}
- public void setAddDomainToUserName(Boolean addDomainToUserName) {
+ public void setAddDomainToUserName(boolean addDomainToUserName) {
this.addDomainToUserName = addDomainToUserName;
}
@@ -132,10 +132,10 @@
this.domain = domain;
}
- public Boolean getIsActive() {
+ public boolean getIsActive() {
return isActive;
}
- public void setIsActive(Boolean isActive) {
+ public void setIsActive(boolean isActive) {
this.isActive = isActive;
}
Index: src/org/apache/openmeetings/persistence/beans/basic/Configuration.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/basic/Configuration.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/basic/Configuration.java (.../trunk/singlewebapp) (revision 1490226)
@@ -42,28 +42,39 @@
@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";
public static final String DEFAUT_LANG_KEY = "default_lang_id";
+ public static final String MAX_UPLOAD_SIZE_KEY = "max_upload_size";
+ public static final String DASHBOARD_SHOW_MYROOMS_KEY = "dashboard.show.myrooms";
+ public static final String DASHBOARD_SHOW_RSS_KEY = "dashboard.show.rssfeed";
+ public static final String RSS_FEED1_KEY = "rss_feed1";
+ public static final String RSS_FEED2_KEY = "rss_feed2";
+ public static final String FRONTEND_REGISTER_KEY = "allow_frontend_register";
+ public static final String PASS_MIN_LENGTH_KEY = "user.pass.minimum.length";
+ public static final String LOGIN_MIN_LENGTH_KEY = "user.login.minimum.length";
+
@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;
Index: src/org/apache/openmeetings/persistence/beans/calendar/AppointmentReminderTyps.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/calendar/AppointmentReminderTyps.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/calendar/AppointmentReminderTyps.java (.../trunk/singlewebapp) (revision 1490226)
@@ -30,9 +30,12 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
+import javax.persistence.Transient;
import org.apache.openjpa.persistence.jdbc.ForeignKey;
+import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
import org.apache.openmeetings.persistence.beans.user.User;
+import org.simpleframework.xml.Element;
@Entity
@@ -61,6 +64,13 @@
@Column(name="deleted")
private boolean deleted;
+ @Column(name="fieldvalues_id")
+ @Element(data=true, required=false)
+ private Long fieldvalues_id;
+
+ @Transient
+ private Fieldlanguagesvalues label;
+
public Long getTypId() {
return typId;
}
@@ -103,4 +113,18 @@
this.deleted = deleted;
}
+ public Long getFieldvalues_id() {
+ return fieldvalues_id;
+ }
+ public void setFieldvalues_id(Long fieldvalues_id) {
+ this.fieldvalues_id = fieldvalues_id;
+ }
+
+ public Fieldlanguagesvalues getLabel() {
+ return label;
+ }
+
+ public void setLabel(Fieldlanguagesvalues label) {
+ this.label = label;
+ }
}
Index: src/org/apache/openmeetings/persistence/beans/calendar/Appointment.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/calendar/Appointment.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/calendar/Appointment.java (.../trunk/singlewebapp) (revision 1490226)
@@ -68,6 +68,26 @@
+ " OR (a.appointmentStarttime < :starttime AND a.appointmentEndtime > :endtime) "
+ " )"
)
+ //TODO this query returns duplicates if the user books an appointment with
+ //his own user as second meeting-member, swagner 19.02.2012
+ , @NamedQuery(name="appointmentsInRangeByUser",
+ query="SELECT a FROM MeetingMember mm, IN(mm.appointment) a "
+ + "WHERE mm.deleted <> true AND mm.invitor <> true AND mm.userid.user_id = :userId "
+ + " AND ( "
+ + " (a.appointmentStarttime BETWEEN :starttime AND :endtime) "
+ + " OR (a.appointmentEndtime BETWEEN :starttime AND :endtime) "
+ + " OR (a.appointmentStarttime < :starttime AND a.appointmentEndtime > :endtime) "
+ + " )"
+ )
+ , @NamedQuery(name="appointedRoomsInRangeByUser",
+ query="SELECT a.room FROM MeetingMember mm, IN(mm.appointment) a "
+ + "WHERE mm.deleted <> true AND mm.invitor <> true AND mm.userid.user_id = :userId "
+ + " AND ( "
+ + " (a.appointmentStarttime BETWEEN :starttime AND :endtime) "
+ + " OR (a.appointmentEndtime BETWEEN :starttime AND :endtime) "
+ + " OR (a.appointmentStarttime < :starttime AND a.appointmentEndtime > :endtime) "
+ + " )"
+ )
})
@Root(name="appointment")
public class Appointment implements Serializable {
@@ -111,6 +131,7 @@
@Element(name="users_id", data=true, required=false)
private User userId;
+ // FIXME need to be renamed => inserted
@Column(name = "starttime")
private Date starttime;
Index: src/org/apache/openmeetings/persistence/beans/room/Room.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/room/Room.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/room/Room.java (.../trunk/singlewebapp) (revision 1490226)
@@ -74,6 +74,9 @@
@NamedQuery(name = "countRooms", query = "SELECT COUNT(r) FROM Room r WHERE r.deleted = false"),
@NamedQuery(name = "getBackupRooms", query = "SELECT r FROM Room r LEFT JOIN FETCH r.moderators WHERE r.deleted = false "),
@NamedQuery(name = "getRoomsCapacityByIds", query = "SELECT SUM(r.numberOfPartizipants) FROM Room r WHERE r.deleted = false AND r.rooms_id IN :ids")
+ , @NamedQuery(name = "getOrganisationRooms", query = "SELECT DISTINCT c.room FROM RoomOrganisation c LEFT JOIN FETCH c.room "
+ + "WHERE c.organisation.organisation_id = :orgId AND c.deleted = false AND c.room.deleted = false AND c.room.appointment = false "
+ + "AND c.organisation.deleted = false ORDER BY c.room.name ASC")
})
@Table(name = "room")
@Root(name = "room")
Index: src/org/apache/openmeetings/persistence/beans/room/Client.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/room/Client.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/room/Client.java (.../trunk/singlewebapp) (revision 1490226)
@@ -33,6 +33,7 @@
import javax.persistence.NamedQuery;
import javax.persistence.Table;
+import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
import org.apache.openmeetings.persistence.beans.basic.Server;
import org.apache.openmeetings.utils.math.CalendarPatterns;
@@ -61,7 +62,7 @@
@NamedQuery(name = "getRoomsIdsByServer", query = "SELECT c.room_id FROM Client c WHERE c.server = :server GROUP BY c.room_id")
})
@Table(name = "client")
-public class Client implements Serializable {
+public class Client implements IDataProviderEntity, Serializable {
/**
*
Index: src/org/apache/openmeetings/persistence/beans/room/RoomType.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/room/RoomType.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/room/RoomType.java (.../trunk/singlewebapp) (revision 1490226)
@@ -29,6 +29,10 @@
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
+import org.simpleframework.xml.Element;
@Entity
@NamedQueries({
@@ -56,6 +60,13 @@
@Column(name = "deleted")
private boolean deleted;
+ @Column(name="fieldvalues_id")
+ @Element(data=true, required=false)
+ private Long fieldvalues_id;
+
+ @Transient
+ private Fieldlanguagesvalues label;
+
public String getName() {
return name;
@@ -92,4 +103,19 @@
this.deleted = deleted;
}
+ public Long getFieldvalues_id() {
+ return fieldvalues_id;
+ }
+ public void setFieldvalues_id(Long fieldvalues_id) {
+ this.fieldvalues_id = fieldvalues_id;
+ }
+
+ public Fieldlanguagesvalues getLabel() {
+ return label;
+ }
+
+ public void setLabel(Fieldlanguagesvalues label) {
+ this.label = label;
+ }
+
}
Index: src/org/apache/openmeetings/persistence/beans/user/PrivateMessage.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/user/PrivateMessage.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/user/PrivateMessage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -35,6 +35,7 @@
import javax.persistence.Table;
import org.apache.openjpa.persistence.jdbc.ForeignKey;
+import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
import org.apache.openmeetings.persistence.beans.room.Room;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@@ -48,8 +49,8 @@
"where c.to.user_id = :toUserId " +
"AND c.isTrash = :isTrash " +
"AND c.owner.user_id = :toUserId " +
- "AND c.isRead = :isRead " +
- "AND c.privateMessageFolderId = :privateMessageFolderId "),
+ "AND (:isRead IS NULL OR c.isRead = :isRead) " +
+ "AND (:folderId IS NULL OR c.privateMessageFolderId = :folderId) "),
@NamedQuery(name = "updatePrivateMessagesToTrash", query = "UPDATE PrivateMessage c " +
"SET c.isTrash = :isTrash,c.privateMessageFolderId = :privateMessageFolderId " +
"where c.privateMessageId IN (:privateMessageIds) "),
@@ -66,7 +67,7 @@
})
@Table(name = "private_message")
@Root(name="privatemessage")
-public class PrivateMessage implements Serializable {
+public class PrivateMessage implements Serializable, IDataProviderEntity {
private static final long serialVersionUID = 7541117437029707792L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -121,11 +122,11 @@
@Column(name="is_read")
@Element(data=true)
- private Boolean isRead;
+ private boolean isRead;
@Column(name="is_trash")
@Element(data=true)
- private Boolean isTrash;
+ private boolean isTrash;
@Column(name="parent_message_id")
@Element(data=true)
@@ -137,7 +138,7 @@
@Column(name="is_contact_request")
@Element(data=true)
- private Boolean isContactRequest;
+ private boolean isContactRequest;
@Column(name="user_contact_id")
@Element(data=true)
Index: src/org/apache/openmeetings/persistence/beans/user/Salutation.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/user/Salutation.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/user/Salutation.java (.../trunk/singlewebapp) (revision 1490226)
@@ -26,6 +26,8 @@
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
@@ -35,6 +37,10 @@
@Entity
@Table(name = "salutation")
+@NamedQueries({
+ @NamedQuery(name = "getSalutationById", query = "SELECT s FROM Salutation AS s WHERE s.salutations_id = :id")
+ , @NamedQuery(name = "getSalutations", query = "SELECT s FROM Salutation AS s")
+})
@Root
public class Salutation implements Serializable {
private static final long serialVersionUID = -5806449519074435223L;
Index: src/org/apache/openmeetings/persistence/beans/user/PrivateMessageFolder.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/user/PrivateMessageFolder.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/user/PrivateMessageFolder.java (.../trunk/singlewebapp) (revision 1490226)
@@ -29,13 +28,14 @@
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@Entity
@Table(name = "private_messages_folder")
@Root(name="privatemessagefolder")
-public class PrivateMessageFolder implements Serializable {
+public class PrivateMessageFolder implements Serializable, IDataProviderEntity {
private static final long serialVersionUID = 3689814412815025816L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Index: src/org/apache/openmeetings/persistence/beans/user/User.java
===================================================================
--- src/org/apache/openmeetings/persistence/beans/user/User.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/persistence/beans/user/User.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.persistence.beans.user;
+import static org.apache.openmeetings.utils.UserHelper.invalidPassword;
+
import java.io.Serializable;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
@@ -68,14 +70,13 @@
*
*/
@Entity
-@FetchGroups({
- @FetchGroup(name = "backupexport",
- attributes = { @FetchAttribute(name = "password")
- })
-})
+@FetchGroups({ @FetchGroup(name = "backupexport", attributes = { @FetchAttribute(name = "password") }) })
@NamedQueries({
@NamedQuery(name = "getUserById", query = "select c from User as c where c.user_id = :user_id"),
- @NamedQuery(name = "checkUserLogin", query = "select c from User as c where c.login = :DataValue AND c.deleted <> :deleted"),
+ @NamedQuery(name = "checkUserLogin", query = "SELECT COUNT(u) FROM User AS u WHERE ((:id > 0 AND u.user_id <> :id) OR (:id = 0)) "
+ + "AND u.login = :login AND u.deleted = false"),
+ @NamedQuery(name = "checkUserEmail", query = "SELECT COUNT(u) FROM User u WHERE ((:id > 0 AND u.user_id <> :id) OR (:id = 0)) "
+ + "AND u.adresses.email = :email AND u.deleted = false"),
@NamedQuery(name = "getUserByName", query = "SELECT u FROM User as u "
+ " where u.login = :login" + " AND u.deleted <> :deleted"),
@NamedQuery(name = "getUserByEmail", query = "SELECT u FROM User as u "
@@ -94,9 +95,7 @@
+ "where c.deleted = false " //
+ "AND c.user_id = :userId " //
+ "AND c.password LIKE :password"), //
- @NamedQuery(name = "updatePassword", query = "UPDATE User u " //
- + "SET u.password = :password " //
- + "WHERE u.user_id = :userId"), //
+ @NamedQuery(name = "updatePassword", query = "UPDATE User u SET u.password = :password WHERE u.user_id = :userId"), //
@NamedQuery(name = "getNondeletedUsers", query = "SELECT u FROM User u WHERE u.deleted = false"),
@NamedQuery(name = "countNondeletedUsers", query = "SELECT COUNT(u) FROM User u WHERE u.deleted = false"),
@NamedQuery(name = "getUsersByOrganisationId", query = "SELECT u FROM User u WHERE u.deleted = false AND u.organisation_users.organisation.organisation_id = :organisation_id")
@@ -104,9 +103,15 @@
@Table(name = "om_user")
@Root(name = "user")
public class User implements Serializable, IDataProviderEntity {
-
private static final long serialVersionUID = -2265479712596674065L;
+ public enum Type {
+ user
+ , ldap //should we add it???
+ , external
+ , contact
+ }
+
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
@@ -256,6 +261,10 @@
@Element(data = true, required = false)
private Boolean showContactDataToContacts;
+ @Column(name = "type")
+ @Element(data = true, required = false)
+ private Type type = Type.user;
+
public Long getUser_id() {
return user_id;
}
@@ -369,12 +378,7 @@
public void updatePassword(ManageCryptStyle crypt, ConfigurationDao configDao, String pass, boolean empty) throws NoSuchAlgorithmException {
if (!empty) {
- Integer userPassMinimumLength = configDao.getConfValue("user.pass.minimum.length", Integer.class, "4");
-
- if (userPassMinimumLength == null) {
- throw new RuntimeException("user.pass.minimum.length problem");
- }
- if (pass == null || pass.length() < userPassMinimumLength) {
+ if (invalidPassword(pass, configDao)) {
throw new RuntimeException("Password of invalid length is provided");
}
}
@@ -604,4 +608,11 @@
return getSendSMS() ? getAdresses().getPhone() : "";
}
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(Type type) {
+ this.type = type;
+ }
}
Index: src/org/apache/openmeetings/xmlimport/UserImport.java
===================================================================
--- src/org/apache/openmeetings/xmlimport/UserImport.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/xmlimport/UserImport.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,10 +18,10 @@
*/
package org.apache.openmeetings.xmlimport;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
import java.io.InputStream;
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.user.EmailManager;
import org.apache.openmeetings.data.user.UserManager;
import org.apache.openmeetings.data.user.dao.UsersDao;
import org.apache.openmeetings.persistence.beans.user.User;
@@ -31,14 +31,10 @@
import org.springframework.beans.factory.annotation.Autowired;
public class UserImport {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- UserImport.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(UserImport.class, webAppRootKey);
@Autowired
private UserManager userManager;
@Autowired
- private EmailManager emailManagement;
- @Autowired
private UsersDao usersDao;
@Autowired
private BackupImportController backupController;
@@ -48,13 +44,13 @@
boolean mailCheck = true;
- if (!emailManagement.checkUserEMail(us.getAdresses().getEmail())) {
+ if (!usersDao.checkUserEMail(us.getAdresses().getEmail(), us.getUser_id())) {
mailCheck = false;
log.info("mailCheck = " + mailCheck);
}
// check for duplicate Login or mail:
- if (usersDao.checkUserLogin(us.getLogin()) && mailCheck) {
+ if (usersDao.checkUserLogin(us.getLogin(), us.getUser_id()) && mailCheck) {
userManager.addUser(us);
}
}
Index: src/org/apache/openmeetings/xmlimport/LanguageImport.java
===================================================================
--- src/org/apache/openmeetings/xmlimport/LanguageImport.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/xmlimport/LanguageImport.java (.../trunk/singlewebapp) (revision 1490226)
@@ -62,7 +62,7 @@
itemObject.attribute("id").getText()).longValue();
String fieldName = itemObject.attribute("name").getText();
String value = itemObject.element("value").getText();
- log.error("CHECK " + language_id + "," + fieldvalues_id + ","
+ log.info("CHECK " + language_id + "," + fieldvalues_id + ","
+ fieldName + "," + value);
this.addFieldValueById(language_id, fieldvalues_id, fieldName,
value);
Index: src/org/apache/openmeetings/remote/UserService.java
===================================================================
--- src/org/apache/openmeetings/remote/UserService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/UserService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.remote;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -670,7 +672,7 @@
Long language_id = userToAdd.getLanguage_id();
if (language_id == null) {
- language_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ language_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
}
String message = "";
@@ -898,7 +900,7 @@
Long language_id = user.getLanguage_id();
if (language_id == null) {
- language_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ language_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
}
String message = "";
@@ -1063,7 +1065,7 @@
Long language_id = from.getLanguage_id();
if (language_id == null) {
- language_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ language_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
}
String invitation_link = null;
User to = userManager.getUserByEmail(email);
@@ -1246,8 +1248,7 @@
SearchResult<PrivateMessage> searchResult = new SearchResult<PrivateMessage>();
searchResult.setObjectName(User.class.getName());
- return privateMessagesDao
- .getNumberMessages(users_id, 0L, false);
+ return privateMessagesDao.count(users_id, null, false, false);
}
} catch (Exception err) {
@@ -1460,8 +1461,7 @@
return -1;
}
- public Integer deletePrivateMessages(String SID,
- @SuppressWarnings("rawtypes") List privateMessageIntsIds) {
+ public Integer deletePrivateMessages(String SID, List<?> privateMessageIntsIds) {
try {
Long users_id = sessiondataDao.checkSession(SID);
Long user_level = userManager.getUserLevelByID(users_id);
@@ -1471,12 +1471,10 @@
List<Long> privateMessageIds = new LinkedList<Long>();
for (Object pMessageId : privateMessageIntsIds) {
- privateMessageIds.add(Long.valueOf(pMessageId.toString())
- .longValue());
+ privateMessageIds.add(Long.valueOf(pMessageId.toString()));
}
- return privateMessagesDao
- .deletePrivateMessages(privateMessageIds);
+ return privateMessagesDao.deletePrivateMessages(privateMessageIds);
}
} catch (Exception err) {
@@ -1636,14 +1634,12 @@
// users only
if (authLevelUtil.checkUserLevel(user_level)) {
- PrivateMessageFolder privateMessageFolder = privateMessageFolderDao
- .getPrivateMessageFolderById(privateMessageFolderId);
+ PrivateMessageFolder privateMessageFolder = privateMessageFolderDao.get(privateMessageFolderId);
privateMessageFolder.setFolderName(folderName);
privateMessageFolder.setUpdated(new Date());
- privateMessageFolderDao
- .updatePrivateMessages(privateMessageFolder);
+ privateMessageFolderDao.update(privateMessageFolder, users_id);
return privateMessageFolderId;
@@ -1663,11 +1659,9 @@
// users only
if (authLevelUtil.checkUserLevel(user_level)) {
- PrivateMessageFolder privateMessageFolder = privateMessageFolderDao
- .getPrivateMessageFolderById(privateMessageFolderId);
+ PrivateMessageFolder privateMessageFolder = privateMessageFolderDao.get(privateMessageFolderId);
- privateMessageFolderDao
- .deletePrivateMessages(privateMessageFolder);
+ privateMessageFolderDao.delete(privateMessageFolder, users_id);
}
Index: src/org/apache/openmeetings/remote/ChatService.java
===================================================================
--- src/org/apache/openmeetings/remote/ChatService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/ChatService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -20,14 +20,12 @@
import java.util.ArrayList;
import java.util.Calendar;
-import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.conference.RoomManager;
@@ -163,9 +161,7 @@
log.debug("SET CHATROOM: " + room_id);
//broadcast to everybody in the room/domain
- Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
@@ -187,7 +183,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[ChatService sendMessageWithClient] ",err);
return -1;
@@ -224,9 +219,7 @@
hsm.put("message", newMessage);
// broadcast to everybody in the room/domain
- Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -247,7 +240,6 @@
}
}
}
- }
}
} catch (Exception err) {
log.error("[ChatService sendMessageWithClient] ", err);
Index: src/org/apache/openmeetings/remote/LanguageService.java
===================================================================
--- src/org/apache/openmeetings/remote/LanguageService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/LanguageService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.remote;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -81,7 +83,7 @@
}
public Integer getDefaultLanguage() {
- return configurationDao.getConfValue("default_lang_id", Integer.class, "1");
+ return configurationDao.getConfValue(DEFAUT_LANG_KEY, Integer.class, "1");
}
/**
Index: src/org/apache/openmeetings/remote/MainService.java
===================================================================
--- src/org/apache/openmeetings/remote/MainService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/MainService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,14 +18,18 @@
*/
package org.apache.openmeetings.remote;
-import java.util.Collection;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DASHBOARD_SHOW_MYROOMS_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DASHBOARD_SHOW_RSS_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.FRONTEND_REGISTER_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.LOGIN_MIN_LENGTH_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.MAX_UPLOAD_SIZE_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.PASS_MIN_LENGTH_KEY;
+
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.AuthLevelUtil;
@@ -133,7 +137,7 @@
Long user_level = userManager.getUserLevelByIdAndOrg(user_id,
organisation_id);
// log.error("getNavi 2: "+user_level);
- return navimanagement.getMainMenu(user_level, user_id, language_id);
+ return navimanagement.getMainMenu(1, user_id, language_id); //Hardcoded to user level to disable admin menu in flash version
} catch (Exception err) {
log.error("[getNavi] ", err);
}
@@ -216,6 +220,29 @@
return -1L;
}
+ public User loginWicket(String SID, String wicketSID) {
+ Long userId = sessiondataDao.checkSession(wicketSID);
+ User u = userId == null ? null : usersDao.get(userId);
+ if (u != null) {
+ IConnection current = Red5.getConnectionLocal();
+ Client currentClient = sessionManager.getClientByStreamId(current.getClient().getId(), null);
+
+ if (!u.getOrganisation_users().isEmpty()) {
+ u.setSessionData(sessiondataDao.getSessionByHash(wicketSID));
+ currentClient.setUser_id(u.getUser_id());
+ SessionVariablesUtil.setUserId(current.getClient(), u.getUser_id());
+
+ currentClient.setFirstname(u.getFirstname());
+ currentClient.setLastname(u.getLastname());
+
+ scopeApplicationAdapter.syncMessageToCurrentScope("roomConnect", currentClient, false);
+
+ return u;
+ }
+ }
+ return null;
+ }
+
public User loginByRemember(String SID, String remoteHashId) {
try {
@@ -325,8 +352,7 @@
LdapConfig ldapConfig = ldapConfigDao.get(ldapConfigId);
String ldapLogin = usernameOrEmail;
- if (ldapConfig.getAddDomainToUserName() != null
- && ldapConfig.getAddDomainToUserName()) {
+ if (ldapConfig.getAddDomainToUserName()) {
ldapLogin = usernameOrEmail + "@" + ldapConfig.getDomain();
}
@@ -354,10 +380,7 @@
currentClient.setFirstname(u.getFirstname());
currentClient.setLastname(u.getLastname());
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection cons : conset) {
+ for (IConnection cons : current.getScope().getClientConnections()) {
if (cons != null) {
Client rcl = this.sessionManager
.getClientByStreamId(cons.getClient()
@@ -385,7 +408,6 @@
}
}
}
- }
return o;
@@ -394,30 +416,6 @@
}
return null;
-
- /*
- * try { log.debug("loginUser 111: "+SID+" "+Username); IConnection
- * current = Red5.getConnectionLocal(); RoomClient currentClient =
- * Application.getClientList().get(current.getClient().getId()); Object
- * obj = userManagement.loginUser(SID,Username,Userpass, currentClient);
- *
- * if (currentClient.getUser_id()!=null && currentClient.getUser_id()>0)
- * { Users us = (Users) obj;
- * currentClient.setFirstname(us.getFirstname());
- * currentClient.setLastname(us.getLastname()); Iterator<IConnection> it
- * = current.getScope().getConnections(); while (it.hasNext()) {
- * //log.error("hasNext == true"); IConnection cons = it.next();
- * //log.error("cons Host: "+cons); if (cons instanceof
- * IServiceCapableConnection) { if (!cons.equals(current)){
- * //log.error("sending roomDisconnect to " + cons); RoomClient rcl =
- * Application.getClientList().get(cons.getClient().getId()); //Send to
- * all connected users ((IServiceCapableConnection)
- * cons).invoke("roomConnect",new Object[] { currentClient }, this);
- * //log.error("sending roomDisconnect to " + cons); } } } }
- *
- * return obj; } catch (Exception err) { log.error("loginUser",err); }
- * return null;
- */
}
public Object secureLoginByRemote(String SID, String secureHash) {
@@ -740,21 +738,13 @@
* @return configuration with key "allow_frontend_register"
*/
public Configuration allowFrontendRegister(String SID) {
- return configurationDao.get("allow_frontend_register");
+ return configurationDao.get(FRONTEND_REGISTER_KEY).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_KEY,
+ "mute.keycode");
} catch (Exception err) {
log.error("[getLoginOptions]",err);
}
@@ -763,20 +753,9 @@
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(FRONTEND_REGISTER_KEY, "show.facebook.login",
+ LOGIN_MIN_LENGTH_KEY, PASS_MIN_LENGTH_KEY, PASS_MIN_LENGTH_KEY,
+ "ldap_default_id");
} catch (Exception err) {
log.error("[getLoginOptions]", err);
}
@@ -1031,12 +1010,12 @@
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", //
+ DASHBOARD_SHOW_MYROOMS_KEY, //
+ DASHBOARD_SHOW_RSS_KEY, //
"default.dashboard.tab", //
- "default.landing.zone" });
+ "default.landing.zone");
}
} catch (Exception err) {
log.error("[getDashboardConfiguration]", err);
Index: src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
===================================================================
--- src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,9 +18,10 @@
*/
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.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -416,9 +417,7 @@
HashSet<Integer> broadcastList = new HashSet<Integer>();
IConnection current = Red5.getConnectionLocal();
String streamid = current.getClient().getId();
- Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
Client rcl = this.sessionManager
.getClientByStreamId(conn
@@ -444,7 +443,6 @@
}
}
}
- }
return new ArrayList<Integer>(broadcastList);
}
@@ -599,12 +597,9 @@
// and room except the current disconnected cause it could throw an exception
log.debug("currentScope " + currentScope);
- if (currentScope != null && currentScope.getConnections() != null) {
+ if (currentScope != null && currentScope.getClientConnections() != null) {
// Notify Users of the current Scope
- Collection<Set<IConnection>> conCollection = currentScope
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection cons : conset) {
+ for (IConnection cons : currentScope.getClientConnections()) {
if (cons != null && cons instanceof IServiceCapableConnection) {
log.debug("sending roomDisconnect to " + cons
@@ -670,7 +665,6 @@
}
}
}
- }
if (removeUserFromSessionList) {
this.sessionManager.removeClient(currentClient.getStreamid(), null);
@@ -724,10 +718,7 @@
// Notify all users of the same Scope
// We need to iterate through the streams to catch if anybody is recording
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
@@ -777,7 +768,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[streamPublishStart]", err);
@@ -851,10 +841,7 @@
+ " " + currentClient.getStreamid());
// Notify all clients of the same scope (room)
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
if (conn.equals(current)) {
@@ -912,7 +899,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[sendClientBroadcastNotifications]", err);
}
@@ -969,10 +955,7 @@
currentClient.getStreamPublishName());
// Notify all users of the same Scope
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -993,7 +976,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[setNewCursorPosition]", err);
@@ -1024,10 +1006,7 @@
.getCurrentModeratorByRoom(room_id);
// Notify all clients of the same scope (room)
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -1044,7 +1023,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[addModerator]", err);
@@ -1075,10 +1053,7 @@
currentClient.getStreamid(), currentClient, false, null);
// Notify all clients of the same scope (room)
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -1096,7 +1071,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[setBroadCastingFlag]", err);
@@ -1124,10 +1098,7 @@
currentClient.getStreamid(), currentClient, false, null);
// Notify all clients of the same scope (room)
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
Client rcl = this.sessionManager
.getClientByStreamId(conn.getClient().getId(), null);
@@ -1154,7 +1125,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[giveExclusiveAudio]", err);
@@ -1302,9 +1272,7 @@
hsm.put("client", currentClient);
hsm.put("message", newMessage);
- Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -1320,7 +1288,6 @@
}
}
}
- }
return currentClient;
} catch (Exception err) {
@@ -1817,9 +1784,7 @@
if (scopeHibernate != null) {
- Collection<Set<IConnection>> conCollection = webAppKeyScope
- .getScope(room_id.toString()).getConnections();
- for (Set<IConnection> conset : conCollection) {
+ Set<IConnection> conset = webAppKeyScope.getScope(room_id.toString()).getClientConnections();
for (IConnection conn : conset) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
@@ -1837,7 +1802,6 @@
}
}
}
- }
} else {
log.debug("sendMessageByRoomAndDomain servlet not yet started - roomID : '"
@@ -1944,10 +1908,7 @@
boolean showDrawStatus = getWhiteboardDrawStatus();
// Notify all Clients of that Scope (Room)
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -1969,7 +1930,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[sendVarsByWhiteboardId]", err);
@@ -1991,10 +1951,7 @@
if (ismod) {
log.debug("CurrentScope :" + current.getScope().getName());
// Send to all Clients of the same Scope
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -2015,7 +1972,6 @@
}
}
}
- }
return 1;
} else {
// log.debug("*..*you are not allowed to send: "+ismod);
@@ -2149,10 +2105,7 @@
IConnection current = Red5.getConnectionLocal();
// Send to all Clients of that Scope(Room)
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
IClient client = conn.getClient();
@@ -2173,7 +2126,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[syncMessageToCurrentScope]", err);
}
@@ -2238,10 +2190,7 @@
hsm.put("message", newMessage);
// broadcast Message to specific user with id inside the same Scope
- Collection<Set<IConnection>> conCollection = scope.getConnections();
-
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : scope.getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
if (conn.getClient().getId().equals(clientId)) {
@@ -2252,7 +2201,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[sendMessageWithClient] ", err);
return -1;
@@ -2279,17 +2227,13 @@
hsm.put("message", newMessage);
// broadcast Message to specific user with id inside the same Scope
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn.getClient().getId().equals(clientId)) {
((IServiceCapableConnection) conn).invoke(
"sendVarsToMessageWithClient",
new Object[] { hsm }, this);
}
}
- }
} catch (Exception err) {
log.error("[sendMessageWithClient] ", err);
return -1;
@@ -2350,9 +2294,7 @@
if (scopeHibernate != null) {
// Notify the clients of the same scope (room) with user_id
- Collection<Set<IConnection>> conCollection = webAppKeyScope
- .getScope(scopeName).getConnections();
- for (Set<IConnection> conset : conCollection) {
+ Set<IConnection> conset = webAppKeyScope.getScope(scopeName).getClientConnections();
for (IConnection conn : conset) {
IClient client = conn.getClient();
if (SessionVariablesUtil.isScreenClient(client)) {
@@ -2370,7 +2312,6 @@
new Object[] { message }, this);
}
}
- }
} else {
// Scope not yet started
@@ -2400,14 +2341,14 @@
currentClient = sessionManager.getClientByUserId(user_id);
}
- Collection<Set<IConnection>> conCollection = null;
+ Set<IConnection> conset = null;
if (currentClient == null) {
// Must be from a previous session, search for user in current
// scope
IConnection current = Red5.getConnectionLocal();
// Notify all Clients of that Scope (Room)
- conCollection = current.getScope().getConnections();
+ conset = current.getScope().getClientConnections();
} else {
// default Scope Name
String scopeName = "hibernate";
@@ -2418,8 +2359,7 @@
IScope scopeHibernate = webAppKeyScope.getScope(scopeName);
if (scopeHibernate != null) {
- conCollection = webAppKeyScope.getScope(scopeName)
- .getConnections();
+ conset = webAppKeyScope.getScope(scopeName).getClientConnections();
}
}
@@ -2427,7 +2367,6 @@
// Notify the clients of the same scope (room) with user_id
- for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
@@ -2457,7 +2396,6 @@
}
}
}
- }
} catch (Exception err) {
log.error("[sendMessageWithClient] ", err);
@@ -2475,10 +2413,7 @@
IConnection current = Red5.getConnectionLocal();
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
Client rcl = this.sessionManager
@@ -2492,7 +2427,6 @@
}
}
- }
return false;
} catch (Exception err) {
@@ -2511,9 +2445,7 @@
log.debug("----------- startInterviewRecording");
IConnection current = Red5.getConnectionLocal();
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
+ Set<IConnection> conset = current.getScope().getClientConnections();
for (IConnection conn : conset) {
if (conn != null) {
@@ -2527,7 +2459,6 @@
}
}
- }
Client current_rcl = this.sessionManager
.getClientByStreamId(current.getClient().getId(), null);
@@ -2541,7 +2472,6 @@
Map<String, String> interviewStatus = new HashMap<String, String>();
interviewStatus.put("action", "start");
- for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
@@ -2561,7 +2491,6 @@
}
}
- }
String recordingName = "Interview "
+ CalendarPatterns.getDateWithTimeByMiliSeconds(new Date());
@@ -2572,7 +2501,7 @@
return true;
} catch (Exception err) {
- log.error("[startInterviewRecording]", err);
+ log.debug("[startInterviewRecording]", err);
}
return null;
}
@@ -2584,10 +2513,7 @@
IConnection current = Red5.getConnectionLocal();
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
IClient client = conn.getClient();
if (SessionVariablesUtil.isScreenClient(client)) {
@@ -2599,9 +2525,8 @@
}
}
}
- }
} catch (Exception err) {
- log.error("[sendRemoteCursorEvent]", err);
+ log.debug("[sendRemoteCursorEvent]", err);
}
return null;
}
@@ -2619,9 +2544,7 @@
boolean found = false;
Long flvRecordingId = null;
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
+ Set<IConnection> conset = current.getScope().getClientConnections();
for (IConnection conn : conset) {
if (conn != null) {
@@ -2647,7 +2570,6 @@
}
}
- }
if (!found) {
return false;
@@ -2662,7 +2584,6 @@
Map<String, String> interviewStatus = new HashMap<String, String>();
interviewStatus.put("action", "stop");
- for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
IClient client = conn.getClient();
@@ -2678,12 +2599,11 @@
new Object[] { interviewStatus }, this);
}
}
- }
return true;
} catch (Exception err) {
- log.error("[stopInterviewRecording]", err);
+ log.debug("[stopInterviewRecording]", err);
}
return null;
}
@@ -2703,7 +2623,7 @@
return sessionManager.getClientListByRoom(currentClient.getRoom_id());
} catch (Exception err) {
- log.error("[getClientListScope]", err);
+ log.debug("[getClientListScope]", err);
}
return new ArrayList<Client>();
}
@@ -2721,7 +2641,7 @@
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;
@@ -2859,9 +2779,7 @@
sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
SessionVariablesUtil.initClient(c, false, publicSID);
- Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
IClient client = conn.getClient();
if (SessionVariablesUtil.isScreenClient(client)) {
@@ -2881,7 +2799,6 @@
}
}
}
- }
}
}
}
Index: src/org/apache/openmeetings/remote/PollService.java
===================================================================
--- src/org/apache/openmeetings/remote/PollService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/PollService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,10 +18,8 @@
*/
package org.apache.openmeetings.remote;
-import java.util.Collection;
import java.util.Date;
import java.util.List;
-import java.util.Set;
import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.conference.PollManager;
@@ -29,8 +27,8 @@
import org.apache.openmeetings.persistence.beans.poll.PollType;
import org.apache.openmeetings.persistence.beans.poll.RoomPoll;
import org.apache.openmeetings.persistence.beans.poll.RoomPollAnswers;
-import org.apache.openmeetings.remote.red5.ScopeApplicationAdapter;
import org.apache.openmeetings.persistence.beans.room.Client;
+import org.apache.openmeetings.remote.red5.ScopeApplicationAdapter;
import org.apache.openmeetings.session.ISessionManager;
import org.red5.logging.Red5LoggerFactory;
import org.red5.server.api.IConnection;
@@ -140,10 +138,7 @@
// Notify all clients of the same scope (room)
Client rc = this.sessionManager.getClientByStreamId(current
.getClient().getId(), null);
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
Client rcl = this.sessionManager
@@ -152,7 +147,8 @@
&& rcl.getIsScreenClient()) {
// continue;
} else {
- if (rcl.getRoom_id() != null && rcl.getRoom_id().equals(rc.getRoom_id())) {
+ if (rcl.getRoom_id() != null && rcl.getRoom_id().equals(rc.getRoom_id())
+ && userManager.getUserById(rcl.getUser_id())!=null) {
((IServiceCapableConnection) conn).invoke(
clientFunction, obj,
scopeApplicationAdapter);
@@ -164,7 +160,6 @@
}
}
}
- }
public List<PollType> getPollTypeList() {
return pollManager.getPollTypes();
@@ -188,6 +183,11 @@
log.error("POLL IS NULL for RoomId: " + rc.getRoom_id());
return -1;
}
+
+ if(userManager.getUserById(rc.getUser_id())==null){
+ log.debug("vote: Invited users can not vote");
+ return -1;
+ }
if (pollManager.hasVoted(roomId, rc.getUser_id())) {
log.debug("hasVoted: true");
return -1;
@@ -246,6 +246,10 @@
.getClientByStreamId(streamid, null);
long roomId = rc.getRoom_id();
+ if(userManager.getUserById(rc.getUser_id())==null){
+ log.debug("checkHasVoted: Invited users can not vote");
+ return -1;
+ }
if (pollManager.hasPoll(roomId)) {
return pollManager.hasVoted(roomId, rc.getUser_id()) ? -1 : 1;
} else {
Index: src/org/apache/openmeetings/remote/LdapConfigService.java
===================================================================
--- src/org/apache/openmeetings/remote/LdapConfigService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/LdapConfigService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,8 +18,8 @@
*/
package org.apache.openmeetings.remote;
+import java.util.ArrayList;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import org.apache.openmeetings.OpenmeetingsVariables;
@@ -80,15 +80,11 @@
ldapConfig.setName("local DB [internal]");
ldapConfig.setLdapConfigId(-1);
- List<LdapConfig> returnldapConfigs = new LinkedList<LdapConfig>();
+ List<LdapConfig> returnldapConfigs = new ArrayList<LdapConfig>();
returnldapConfigs.add(ldapConfig);
-
- for (LdapConfig ldapConfigStored : ldapConfigs) {
- returnldapConfigs.add(ldapConfigStored);
- }
+ returnldapConfigs.addAll(ldapConfigs);
return returnldapConfigs;
-
} catch (Exception err) {
log.error("[getActiveLdapConfigs]",err);
}
Index: src/org/apache/openmeetings/remote/ConfigurationService.java
===================================================================
--- src/org/apache/openmeetings/remote/ConfigurationService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/ConfigurationService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,9 +18,8 @@
*/
package org.apache.openmeetings.remote;
-import java.util.LinkedHashMap;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
-import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.AuthLevelUtil;
import org.apache.openmeetings.data.basic.SessiondataDao;
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
@@ -38,9 +37,7 @@
*
*/
public class ConfigurationService {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- ConfigurationService.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(ConfigurationService.class, webAppRootKey);
@Autowired
private AuthLevelUtil authLevelUtil;
@@ -89,18 +86,29 @@
* Save or update a configuration
*
* @param SID
- * @param values
+ * @param id
+ * @param key
+ * @param val
+ * @param comment
* @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;
}
@@ -109,17 +117,20 @@
* delete a configuration
*
* @param SID
- * @param values
+ * @param id
* @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;
Index: src/org/apache/openmeetings/remote/ConferenceService.java
===================================================================
--- src/org/apache/openmeetings/remote/ConferenceService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/ConferenceService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.remote;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@@ -31,6 +33,7 @@
import org.apache.openmeetings.cluster.beans.ServerDTO;
import org.apache.openmeetings.data.basic.AuthLevelUtil;
import org.apache.openmeetings.data.basic.SessiondataDao;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.data.basic.dao.ServerDao;
import org.apache.openmeetings.data.beans.basic.SearchResult;
import org.apache.openmeetings.data.calendar.management.AppointmentLogic;
@@ -85,6 +88,8 @@
private ISessionManager sessionManager = null;
@Autowired
private ServerDao serverDao;
+ @Autowired
+ private ConfigurationDao cfgDao;
/**
* ( get a List of all available Rooms of this organization
@@ -270,7 +275,7 @@
return ment;
} catch (Exception e) {
- log.error("getAppointMentDataForRoom ", e);
+ log.error("getAppointMentDataForRoom " + e.getMessage());
return null;
}
@@ -412,7 +417,9 @@
Long users_id = sessiondataDao.checkSession(SID);
Long user_level = userManager.getUserLevelByID(users_id);
if (authLevelUtil.checkUserLevel(user_level)) {
- return roomManager.getAllRoomTypes();
+ User user = userManager.getUserById(users_id);
+ return roomManager.getAllRoomTypes(user == null
+ ? cfgDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1") : user.getLanguage_id());
}
return null;
}
@@ -631,6 +638,7 @@
} catch (Exception err) {
log.error("[getRoomModeratorsByRoomId]", err);
+ err.printStackTrace();
}
return null;
Index: src/org/apache/openmeetings/remote/CalendarService.java
===================================================================
--- src/org/apache/openmeetings/remote/CalendarService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/CalendarService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -215,6 +215,7 @@
}
} catch (Exception err) {
log.error("[updateAppointment]", err);
+ err.printStackTrace();
}
return null;
@@ -284,6 +285,7 @@
}
} catch (Exception err) {
log.error("[updateAppointment]", err);
+ err.printStackTrace();
}
return null;
@@ -386,8 +388,10 @@
Long user_level = userManager.getUserLevelByID(users_id);
if (authLevelUtil.checkUserLevel(user_level)) {
+ User user = userManager.getUserById(users_id);
+ long language_id = (user == null) ? 1 : user.getLanguage_id();
List<AppointmentReminderTyps> res = appointmentReminderTypDaoImpl
- .getAppointmentReminderTypList();
+ .getAppointmentReminderTypList(language_id);
if (res == null || res.size() < 1) {
log.debug("no remindertyps found!");
Index: src/org/apache/openmeetings/remote/ConferenceLibrary.java
===================================================================
--- src/org/apache/openmeetings/remote/ConferenceLibrary.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/ConferenceLibrary.java (.../trunk/singlewebapp) (revision 1490226)
@@ -20,11 +20,9 @@
import java.io.File;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
-import java.util.Set;
import org.apache.commons.transaction.util.FileHelper;
import org.apache.openmeetings.OpenmeetingsVariables;
@@ -219,10 +217,7 @@
sendObject.put("roomitems", roomItems);
// Notify all Clients of that Scope (Room)
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
Client rcl = this.sessionManager
@@ -239,7 +234,6 @@
}
}
}
- }
}
}
Index: src/org/apache/openmeetings/remote/FLVRecorderService.java
===================================================================
--- src/org/apache/openmeetings/remote/FLVRecorderService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/remote/FLVRecorderService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -19,12 +19,10 @@
package org.apache.openmeetings.remote;
import java.io.File;
-import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.AuthLevelUtil;
@@ -133,6 +131,7 @@
return null;
} catch (Exception err) {
+ err.printStackTrace();
log.error("[checkForRecording]", err);
}
return null;
@@ -174,10 +173,7 @@
.getId(), currentClient, false, null);
// get all stream and start recording them
- Collection<Set<IConnection>> conCollection = current.getScope()
- .getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
Client rcl = this.sessionManager
@@ -279,7 +275,6 @@
}
}
}
- }
return roomRecordingName;
@@ -428,9 +423,7 @@
+ currentClient.getUserip());
// get all stream and stop recording them
- Collection<Set<IConnection>> conCollection = scope.getConnections();
- for (Set<IConnection> conset : conCollection) {
- for (IConnection conn : conset) {
+ for (IConnection conn : scope.getClientConnections()) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
@@ -485,7 +478,6 @@
}
}
}
- }
// Store to database
Long flvRecordingId = currentClient.getFlvRecordingId();
@@ -727,6 +719,7 @@
}
} catch (Exception err) {
log.error("[getFlvRecordingWithMetaData] ", err);
+ err.printStackTrace();
}
return null;
}
@@ -744,6 +737,7 @@
}
} catch (Exception err) {
log.error("[getFlvRecordingLog] ", err);
+ err.printStackTrace();
}
return null;
}
Index: src/org/apache/openmeetings/utils/StoredFile.java
===================================================================
--- src/org/apache/openmeetings/utils/StoredFile.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/StoredFile.java (.../trunk/singlewebapp) (revision 1490226)
@@ -56,9 +56,15 @@
private final String name;
private final String ext;
+ public StoredFile(String fullname) {
+ int idx = fullname.lastIndexOf('.');
+ name = idx < 0 ? fullname : fullname.substring(0, idx);
+ ext = idx < 0 ? "" : fullname.substring(idx + 1).toLowerCase();
+ }
+
public StoredFile(String name, String ext) {
this.name = name;
- this.ext = ext;
+ this.ext = ext != null ? ext.toLowerCase() : "";
}
public static String[] getExtensions(){
Index: src/org/apache/openmeetings/utils/image/ImageUtility.java
===================================================================
--- src/org/apache/openmeetings/utils/image/ImageUtility.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/image/ImageUtility.java (.../trunk/singlewebapp) (revision 1490226)
@@ -25,15 +25,10 @@
import javax.imageio.ImageIO;
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
public class ImageUtility {
- private static final Logger log = Red5LoggerFactory.getLogger(ImageUtility.class, OpenmeetingsVariables.webAppRootKey);
static {ImageIO.setUseCache(false);}
public static java.awt.image.BufferedImage read(java.io.InputStream in) throws IOException {
@@ -48,7 +43,7 @@
try {
return read(new ByteArrayInputStream(bytes));
} catch (IOException e) {
- log.error("[read]", e);
+ e.getStackTrace();
return null;
}
}
Index: src/org/apache/openmeetings/utils/mail/ByteArrayDataSource.java
===================================================================
--- src/org/apache/openmeetings/utils/mail/ByteArrayDataSource.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/mail/ByteArrayDataSource.java (.../trunk/singlewebapp) (revision 1490226)
@@ -21,14 +21,7 @@
import java.io.*;
import javax.activation.*;
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
public class ByteArrayDataSource implements DataSource {
-
- private static final Logger log = Red5LoggerFactory.getLogger(ByteArrayDataSource.class, OpenmeetingsVariables.webAppRootKey);
-
private byte[] data; // data
private String type; // content-type
@@ -45,7 +38,6 @@
data = os.toByteArray();
os.close();
} catch (IOException ioex) {
- log.error("[ByteArrayDataSource]", ioex);
}
}
Index: src/org/apache/openmeetings/utils/DaoHelper.java
===================================================================
Index: src/org/apache/openmeetings/utils/ImportHelper.java
===================================================================
--- src/org/apache/openmeetings/utils/ImportHelper.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/ImportHelper.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,11 +18,13 @@
*/
package org.apache.openmeetings.utils;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.MAX_UPLOAD_SIZE_KEY;
+
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
import org.red5.logging.Red5LoggerFactory;
@@ -36,8 +38,7 @@
*
*/
public class ImportHelper {
- private static final Logger log = Red5LoggerFactory.getLogger(
- ImportHelper.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(ImportHelper.class, webAppRootKey);
public static final long DEFAULT_MAX_UPLOAD_SIZE = 1024 * 1024 * 1024; // 1GB
/**
@@ -46,10 +47,9 @@
* @param configurationDao
* @return
*/
- public static final long getMaxUploadSize(
- ConfigurationDao configurationDao) {
+ public static final long getMaxUploadSize(ConfigurationDao configurationDao) {
try {
- return configurationDao.getConfValue("max_upload_size",
+ return configurationDao.getConfValue(MAX_UPLOAD_SIZE_KEY,
Long.class, "" + DEFAULT_MAX_UPLOAD_SIZE);
} catch (Exception e) {
log.error("Invalid value saved for max_upload_size conf key: ", e);
Index: src/org/apache/openmeetings/utils/OmFileHelper.java
===================================================================
--- src/org/apache/openmeetings/utils/OmFileHelper.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/OmFileHelper.java (.../trunk/singlewebapp) (revision 1490226)
@@ -61,6 +61,16 @@
public static final String nameOfTimeZoneFile = "timezones.xml";
public static final String nameOfErrorFile = "errorvalues.xml";
public static final String libraryFileName = "library.xml";
+ public static final String defaultProfileImageName = "profile_pic.jpg";
+ public static final String profileFileName = "profile";
+ public static final String profileFileExt = ".jpg";
+ public static final String profileImagePrefix = "_profile_";
+ public static final String chatImagePrefix = "_chat_";
+ public static final String bigImagePrefix = "_big_";
+ public static final String thumbImagePrefix = "_thumb_";
+ public static final String dashboardFile = "dashboard.xml";
+ public static final String MP4_EXTENSION = ".mp4";
+ public static final String OGG_EXTENSION = ".ogg";
public static void setOmHome(File omHome) {
OmFileHelper.OM_HOME = omHome;
@@ -99,12 +109,28 @@
return getDir(getUploadDir(), PROFILES_DIR);
}
- public static File getUploadProfilesUserDir(Long users_id) {
- return getDir(getUploadProfilesDir(), OmFileHelper.profilesPrefix + users_id);
+ public static File getUploadProfilesUserDir(Long userId) {
+ return getDir(getUploadProfilesDir(), profilesPrefix + userId);
}
public static File getUploadProfilesUserDir(String users_id) {
- return getDir(getUploadProfilesDir(), OmFileHelper.profilesPrefix + users_id);
+ return getDir(getUploadProfilesDir(), profilesPrefix + users_id);
+ }
+
+ public static File getDefaultProfilePicture() {
+ return new File(getDefaultDir(), profileImagePrefix + defaultProfileImageName);
+ }
+
+ public static File getUserProfilePicture(Long userId, String uri) {
+ File img = new File(getUploadProfilesUserDir(userId), profileImagePrefix + uri);
+ if (!img.exists()) {
+ img = getDefaultProfilePicture();
+ }
+ return img;
+ }
+
+ public static File getUserDashboard(Long userId) {
+ return new File(getUploadProfilesUserDir(userId), dashboardFile);
}
public static File getUploadImportDir() {
@@ -151,6 +177,18 @@
return getDir(getStreamsDir(), HIBERNATE_DIR);
}
+ public static File getRecording(String name) {
+ return new File(getDir(getStreamsDir(), HIBERNATE_DIR), name);
+ }
+
+ public static File getMp4Recording(String name) {
+ return new File(getDir(getStreamsDir(), HIBERNATE_DIR), name + MP4_EXTENSION);
+ }
+
+ public static File getOggRecording(String name) {
+ return new File(getDir(getStreamsDir(), HIBERNATE_DIR), name + OGG_EXTENSION);
+ }
+
public static File getStreamsSubDir(Long id) {
return getDir(getStreamsDir(), id.toString());
}
Index: src/org/apache/openmeetings/utils/ProcessHelper.java
===================================================================
--- src/org/apache/openmeetings/utils/ProcessHelper.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/ProcessHelper.java (.../trunk/singlewebapp) (revision 1490226)
@@ -74,7 +74,6 @@
line = br.readLine();
}
} catch (IOException ioexception) {
- log.error("[run]", ioexception);
return;
}
}
Index: src/org/apache/openmeetings/utils/UserHelper.java
===================================================================
--- src/org/apache/openmeetings/utils/UserHelper.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/utils/UserHelper.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.utils;
+
+import static org.apache.openmeetings.installation.InstallationConfig.USER_LOGIN_MINIMUM_LENGTH;
+import static org.apache.openmeetings.installation.InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.LOGIN_MIN_LENGTH_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.PASS_MIN_LENGTH_KEY;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+
+public class UserHelper {
+ public static int getMinLoginLength(ConfigurationDao cfgDao) {
+ return cfgDao.getConfValue(LOGIN_MIN_LENGTH_KEY, Integer.class, "" + USER_LOGIN_MINIMUM_LENGTH);
+ }
+
+ public static int getMinPasswdLength(ConfigurationDao cfgDao) {
+ return cfgDao.getConfValue(PASS_MIN_LENGTH_KEY, Integer.class, "" + USER_PASSWORD_MINIMUM_LENGTH);
+ }
+
+ public static boolean invalidPassword(String pass, ConfigurationDao cfgDao) {
+ return (pass == null || pass.length() < getMinPasswdLength(cfgDao));
+ }
+}
Index: src/org/apache/openmeetings/utils/crypt/MD5Implementation.java
===================================================================
--- src/org/apache/openmeetings/utils/crypt/MD5Implementation.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/crypt/MD5Implementation.java (.../trunk/singlewebapp) (revision 1490226)
@@ -20,14 +20,8 @@
import java.security.NoSuchAlgorithmException;
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
public class MD5Implementation implements ICryptString {
- private static final Logger log = Red5LoggerFactory.getLogger(MD5Implementation.class, OpenmeetingsVariables.webAppRootKey);
-
/*
* (non-Javadoc)
* @see org.apache.openmeetings.utils.crypt.ICryptString#createPassPhrase(java.lang.String)
@@ -37,7 +31,7 @@
try {
passPhrase = MD5.do_checksum(userGivenPass);
} catch (NoSuchAlgorithmException e) {
- log.error("[createPassPhrase]", e);
+ e.printStackTrace();
}
return passPhrase;
}
Index: src/org/apache/openmeetings/utils/crypt/MD5CryptImplementation.java
===================================================================
--- src/org/apache/openmeetings/utils/crypt/MD5CryptImplementation.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/utils/crypt/MD5CryptImplementation.java (.../trunk/singlewebapp) (revision 1490226)
@@ -20,14 +20,8 @@
import java.security.NoSuchAlgorithmException;
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
public class MD5CryptImplementation implements ICryptString {
- private static final Logger log = Red5LoggerFactory.getLogger(MD5CryptImplementation.class, OpenmeetingsVariables.webAppRootKey);
-
/*
* (non-Javadoc)
* @see org.apache.openmeetings.utils.crypt.ICryptString#createPassPhrase(java.lang.String)
@@ -37,7 +31,7 @@
try {
passPhrase = MD5Crypt.crypt(userGivenPass);
} catch (NoSuchAlgorithmException e) {
- log.error("[createPassPhrase]", e);
+ e.printStackTrace();
}
return passPhrase;
}
@@ -53,7 +47,7 @@
try {
validPassword = passwdFromDb.equals(MD5Crypt.crypt(passGiven, salt));
} catch (NoSuchAlgorithmException e) {
- log.error("[verifyPassword]", e);
+ e.printStackTrace();
}
return validPassword;
}
Index: src/org/apache/openmeetings/documents/CreateLibraryPresentation.java
===================================================================
--- src/org/apache/openmeetings/documents/CreateLibraryPresentation.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/documents/CreateLibraryPresentation.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,26 +18,21 @@
*/
package org.apache.openmeetings.documents;
+import static org.apache.openmeetings.utils.OmFileHelper.thumbImagePrefix;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.util.Arrays;
-import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.documents.beans.ConverterProcessResult;
import org.apache.openmeetings.utils.OmFileHelper;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.XMLWriter;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
public class CreateLibraryPresentation {
-
- private static final Logger log = Red5LoggerFactory.
- getLogger(CreateLibraryPresentation.class, OpenmeetingsVariables.webAppRootKey);
-
public static ConverterProcessResult generateXMLDocument(File targetDirectory, String originalDocument,
String pdfDocument, String swfDocument){
ConverterProcessResult returnMap = new ConverterProcessResult();
@@ -84,7 +79,7 @@
Arrays.sort(allfiles);
for(int i=0; i<allfiles.length; i++){
File thumbfile = new File(targetDirectory, allfiles[i]);
- if (allfiles[i].startsWith("_thumb_")){
+ if (allfiles[i].startsWith(thumbImagePrefix)){
thumbs.addElement( "thumb" )
.addAttribute("lastmod", (new Long(thumbfile.lastModified())).toString())
.addAttribute("size", (new Long(thumbfile.length())).toString())
@@ -104,7 +99,7 @@
return returnMap;
} catch (Exception err) {
- log.error("[generateXMLDocument]", err);
+ err.printStackTrace();
returnMap.setError(err.getMessage());
returnMap.setExitValue("-1");
return returnMap;
Index: src/org/apache/openmeetings/documents/GenerateImage.java
===================================================================
--- src/org/apache/openmeetings/documents/GenerateImage.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/documents/GenerateImage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,10 +18,20 @@
*/
package org.apache.openmeetings.documents;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.utils.OmFileHelper.bigImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.chatImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.getUploadProfilesUserDir;
+import static org.apache.openmeetings.utils.OmFileHelper.profileFileExt;
+import static org.apache.openmeetings.utils.OmFileHelper.profileFileName;
+import static org.apache.openmeetings.utils.OmFileHelper.profileImagePrefix;
+import static org.apache.openmeetings.utils.OmFileHelper.thumbImagePrefix;
+
import java.io.File;
+import java.io.FileFilter;
import java.io.IOException;
-import org.apache.openmeetings.OpenmeetingsVariables;
+import org.apache.commons.transaction.util.FileHelper;
import org.apache.openmeetings.data.flvrecord.converter.BaseConverter;
import org.apache.openmeetings.data.user.dao.UsersDao;
import org.apache.openmeetings.documents.beans.ConverterProcessResult;
@@ -35,8 +45,7 @@
public class GenerateImage extends BaseConverter {
- private static final Logger log = Red5LoggerFactory.getLogger(
- GenerateImage.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(GenerateImage.class, webAppRootKey);
@Autowired
private UsersDao usersDao;
@@ -58,7 +67,7 @@
ConverterProcessResult processJPG = this.convertSingleJpg(
fileFullPath.getCanonicalPath(), destinationFile);
ConverterProcessResult processThumb = generateThumbs.generateThumb(
- "_thumb_", destinationFile, 50);
+ thumbImagePrefix, destinationFile, 50);
returnMap.addItem("processJPG", processJPG);
returnMap.addItem("processThumb", processThumb);
@@ -69,34 +78,32 @@
return returnMap;
}
- public ConverterProcessResultList convertImageUserProfile(String fileName, String fileExt, Long users_id,
- String fileNameShort, boolean fullProcessing) throws Exception {
-
+ public ConverterProcessResultList convertImageUserProfile(File file, Long users_id, boolean skipConvertion) throws Exception {
ConverterProcessResultList returnMap = new ConverterProcessResultList();
- File working_pptdir = OmFileHelper.getUploadTempProfilesUserDir(users_id);
-
- String fileFullPath = new File(working_pptdir, fileName + fileExt).getCanonicalPath();
-
- File destinationFile = OmFileHelper.getNewFile(OmFileHelper.getUploadProfilesUserDir(users_id), fileName, ".jpg");
- ConverterProcessResult processJPG = this.convertSingleJpg(
- fileFullPath, destinationFile);
-
- ConverterProcessResult processThumb1 = generateThumbs.generateThumb(
- "_chat_", destinationFile, 40);
- ConverterProcessResult processThumb2 = generateThumbs.generateThumb(
- "_profile_", destinationFile, 126);
- ConverterProcessResult processThumb3 = generateThumbs.generateThumb(
- "_big_", destinationFile, 240);
+ // User Profile Update
+ for (File f : getUploadProfilesUserDir(users_id).listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname.getName().endsWith(profileFileExt);
+ }
+ })) {
+ FileHelper.removeRec(f);
+ }
- returnMap.addItem("processJPG", processJPG);
- returnMap.addItem("processThumb1", processThumb1);
- returnMap.addItem("processThumb2", processThumb2);
- returnMap.addItem("processThumb3", processThumb3);
+ File destinationFile = OmFileHelper.getNewFile(getUploadProfilesUserDir(users_id), profileFileName, profileFileExt);
+ if (!skipConvertion) {
+ returnMap.addItem("processJPG", convertSingleJpg(file.getCanonicalPath(), destinationFile));
+ } else {
+ FileHelper.copy(file, destinationFile);
+ }
+ returnMap.addItem("processThumb1", generateThumbs.generateThumb(chatImagePrefix, destinationFile, 40));
+ returnMap.addItem("processThumb2", generateThumbs.generateThumb(profileImagePrefix, destinationFile, 126));
+ returnMap.addItem("processThumb3", generateThumbs.generateThumb(bigImagePrefix, destinationFile, 240));
+ if (!skipConvertion) {
// Delete old one
- File fToDelete = new File(fileFullPath);
- fToDelete.delete();
+ file.delete();
+ }
String pictureuri = destinationFile.getName();
User us = usersDao.get(users_id);
Index: src/org/apache/openmeetings/installation/InstallationConfig.java
===================================================================
--- src/org/apache/openmeetings/installation/InstallationConfig.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/installation/InstallationConfig.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,11 +18,19 @@
*/
package org.apache.openmeetings.installation;
+import java.io.Serializable;
+
import org.apache.openmeetings.utils.crypt.MD5Implementation;
-public class InstallationConfig {
+public class InstallationConfig implements Serializable {
+ private static final long serialVersionUID = 8833208340193880562L;
public static final int USER_LOGIN_MINIMUM_LENGTH = 4;
public static final int USER_PASSWORD_MINIMUM_LENGTH = 4;
+ public String appName = "Openmeetings";
+ public String username;
+ public String password;
+ public String email;
+ public String group;
public String allowFrontendRegister = "1";
public String createDefaultRooms = "1";
public String ical_timeZone = "Europe/Berlin";
@@ -42,7 +50,7 @@
public String imageMagicPath = "";
public String ffmpegPath = "";
public String soxPath = "";
- public String jodPath = "./jod/lib";
+ public String jodPath = "/opt/jod/lib";
public String officePath = "";
public String defaultLangId = "1";
Index: src/org/apache/openmeetings/installation/ImportInitvalues.java
===================================================================
--- src/org/apache/openmeetings/installation/ImportInitvalues.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/installation/ImportInitvalues.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,19 @@
*/
package org.apache.openmeetings.installation;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.installation.InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.CRYPT_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DASHBOARD_SHOW_MYROOMS_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DASHBOARD_SHOW_RSS_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.FRONTEND_REGISTER_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.LOGIN_MIN_LENGTH_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.MAX_UPLOAD_SIZE_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.PASS_MIN_LENGTH_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.RSS_FEED1_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.RSS_FEED2_KEY;
+
import java.io.File;
import java.util.Arrays;
import java.util.Date;
@@ -28,7 +41,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.FieldLanguageDao;
import org.apache.openmeetings.data.basic.FieldManager;
import org.apache.openmeetings.data.basic.NaviBuilder;
@@ -59,9 +71,7 @@
import org.springframework.beans.factory.annotation.Autowired;
public class ImportInitvalues {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- ImportInitvalues.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(ImportInitvalues.class, webAppRootKey);
@Autowired
private ConfigurationDao configurationDao;
@@ -95,15 +105,21 @@
private PollManager pollManager;
@Autowired
private SipDao sipDao;
+ private int progress = 0;
- public void loadMainMenu() {
+ public int getProgress() {
+ return progress;
+ }
+ public void loadUserLevels() {
userManager.addUserLevel("User", 1);
userManager.addUserLevel("Moderator", 2);
userManager.addUserLevel("Admin", 3);
userManager.addUserLevel("Web-Service (only access via SOAP)", 4);
log.debug("UserLevels ADDED");
+ }
+ public void loadMainMenu() {
/*
* ######################## Dashboard Menu Points
*/
@@ -203,7 +219,9 @@
navimanagement.addMainStructure("adminModuleServers", null, 22, 1498,
true, false, 3, "Administration of Servers", 6, false, 1499L);
log.debug("MainMenu ADDED");
+ }
+ public void loadErrorTypes() {
errorManagement.addErrorType(new Long(1), new Long(322));
errorManagement.addErrorType(new Long(2), new Long(323));
log.debug("Error types ADDED");
@@ -260,8 +277,8 @@
public void loadConfiguration(InstallationConfig cfg) {
configurationDao
- .addConfByKey(
- "crypt_ClassName",
+ .add(
+ CRYPT_KEY,
cfg.cryptClassName,
null,
"This Class is used for Authentification-Crypting. "
@@ -269,86 +286,86 @@
+ "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(FRONTEND_REGISTER_KEY,
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(DEFAUT_LANG_KEY, cfg.defaultLangId,
null, "Default System Language ID see languages.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_KEY, cfg.urlFeed, null,
"Feed URL");
- configurationDao.addConfByKey("rss_feed2", cfg.urlFeed2, null,
+ configurationDao.add(RSS_FEED2_KEY, 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 +375,14 @@
+ "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 +390,12 @@
// 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 +404,7 @@
// 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 +413,58 @@
// 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,
- "Show My Rooms Tab");
+ configurationDao.add(DASHBOARD_SHOW_MYROOMS_KEY, "1", null, "Show My Rooms Tab");
- configurationDao.addConfByKey("dashboard.show.chat", "1", null,
- "Show Chat Tab");
+ configurationDao.add("dashboard.show.chat", "1", null, "Show Chat Tab");
- configurationDao.addConfByKey("dashboard.show.rssfeed", "0", null,
- "Show RSS Tab");
+ configurationDao.add(DASHBOARD_SHOW_RSS_KEY, "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_KEY, ""
+ 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(LOGIN_MIN_LENGTH_KEY, ""
+ InstallationConfig.USER_LOGIN_MINIMUM_LENGTH, null,
"Number of chars needed in a user login");
- configurationDao.addConfByKey("user.pass.minimum.length", ""
- + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH, null,
+ configurationDao.add(PASS_MIN_LENGTH_KEY, ""
+ + 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,61 +472,60 @@
// 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,
"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");
+ log.debug("Configurations ADDED");
}
public void loadRoomTypes() {
long conference_Id = roomManager.addRoomType(
- "conference (1-25 users)", false);
+ "conference", 1541, false);
log.debug("conference_Id: " + conference_Id);
// Audience room type is not in use anymore
- roomManager.addRoomType("audience (1-50 users)", true);
+ roomManager.addRoomType("audience", -1, true);
long restricted_Id = roomManager.addRoomType(
- "restricted (1-150 users)", false);
+ "restricted", 1542, false);
log.debug("restricted_Id: " + restricted_Id);
long interview_Id = roomManager.addRoomType(
- "interview (1:1 meeting with recording)", false);
+ "interview", 1543, false);
log.debug("interview_Id: " + interview_Id);
// Custom room type is not in use anymore
- roomManager.addRoomType("custom (extension point for your plugin)",
- true);
+ roomManager.addRoomType("custom", -2, true);
log.debug("RoomTypes ADDED");
}
@@ -672,27 +685,22 @@
}
}
- public void loadInitUserAndOrganisation(String username, String userpass,
- String email, String defaultOrganisationName, String ical_timeZone,
- String configdefaultLang) {
- // Add user
- try {
-
- Long default_lang_id = Long.parseLong(configdefaultLang);
- if (default_lang_id == null)
+ public void loadInitUserAndOrganisation(InstallationConfig cfg) throws Exception {
+ Long default_lang_id = Long.parseLong(cfg.defaultLangId);
+ if (default_lang_id == null) {
default_lang_id = 1L;
+ }
// Add default group
- Long organisation_id = organisationManager.addOrganisation(
- defaultOrganisationName, 1);
+ Long organisation_id = organisationManager.addOrganisation(cfg.group, 1);
// BaseUrl as param is empty as we do not send an EMAIL here
Long user_id = userManager.registerUserInit(new Long(3), 3, 1,
- 1, username, userpass, "lastname", "firstname", email,
+ 1, cfg.username, cfg.password, "lastname", "firstname", cfg.email,
new java.util.Date(), "street", "no", "fax", "zip", 1,
"town", default_lang_id, false,
Arrays.asList(organisation_id), "phone", false, "", false,
- omTimeZoneDaoImpl.getOmTimeZoneByIcal(ical_timeZone),
+ omTimeZoneDaoImpl.getOmTimeZoneByIcal(cfg.ical_timeZone),
false, "", "", false, true);
log.debug("Installation - User Added user-Id " + user_id);
@@ -702,9 +710,6 @@
"Could not add user user returns a negative error message: "
+ user_id);
}
- } catch (Exception e) {
- log.error("[loadInitUserAndOrganisation] ", e);
- }
}
/**
@@ -754,7 +759,7 @@
log.debug("TimeZones ADDED");
}
- public List<OmTimeZone> getTimeZones() throws Exception {
+ public static List<OmTimeZone> getTimeZones() throws Exception {
log.debug(":: getTimeZones ::");
List<OmTimeZone> omTimeZones = new LinkedList<OmTimeZone>();
@@ -794,7 +799,7 @@
* @return
* @throws Exception
*/
- public LinkedHashMap<Integer, LinkedHashMap<String, Object>> getLanguageFiles()
+ public static LinkedHashMap<Integer, LinkedHashMap<String, Object>> getLanguageFiles()
throws Exception {
LinkedHashMap<Integer, LinkedHashMap<String, Object>> languages = new LinkedHashMap<Integer, LinkedHashMap<String, Object>>();
@@ -835,14 +840,8 @@
public void loadInitAppointmentCategories() {
log.debug("ImportInitValues.loadInitAppointmentCategories");
- try {
appointmentCategoryDaoImpl.addAppointmentCategory(new Long(-1),
"default", "default");
- } catch (Exception e) {
- log.error("Could not create AppointMentcategories", e);
- return;
- }
-
}
// ------------------------------------------------------------------------------
@@ -852,21 +851,14 @@
*/
// ------------------------------------------------------------------------------
public void loadInitAppointmentReminderTypes() {
-
log.debug("ImportInitValues.loadInitAppointmentReminderTypes");
- try {
appointmentReminderTypDaoImpl.addAppointmentReminderTyps(-1L,
- "do not send notification");
+ "do not send notification", 1568);
appointmentReminderTypDaoImpl.addAppointmentReminderTyps(-1L,
- "simple email");
+ "simple email", 1569);
appointmentReminderTypDaoImpl.addAppointmentReminderTyps(-1L,
- "iCal email");
-
- } catch (Exception e) {
- log.error("Could not create ReminderType", e);
- return;
- }
+ "iCal email", 1570);
}
public void loadLanguagesFile(int langId) throws Exception {
@@ -979,18 +971,6 @@
* Loading initial Language from xml Files into database
*/
// ------------------------------------------------------------------------------
- public void loadInitLanguages() throws Exception {
- loadCountriesFiles();
- loadTimeZoneFiles();
- loadLanguagesFiles();
- }
-
- // ------------------------------------------------------------------------------
-
- /**
- * Loading initial Language from xml Files into database
- */
- // ------------------------------------------------------------------------------
public void loadPollTypes() {
pollManager.addPollType(26L, false);
pollManager.addPollType(27L, true);
@@ -998,40 +978,56 @@
// ------------------------------------------------------------------------------
- public void loadSystem(InstallationConfig cfg, boolean force)
- throws Exception {
+ public void loadSystem(InstallationConfig cfg, boolean force) throws Exception {
// FIXME dummy check if installation was performed before
- if (!force && usersDao.getAllUsers().size() > 0) {
+ if (!force && usersDao.count() > 0) {
log.debug("System contains users, no need to install data one more time.");
}
sipDao.delete();
+ progress = 6;
+ loadUserLevels();
+ progress = 13;
loadMainMenu();
+ progress = 19;
+ loadErrorTypes();
+ progress = 25;
loadErrorMappingsFromXML();
- loadInitLanguages();
+ progress = 31;
+ loadCountriesFiles();
+ progress = 38;
+ loadTimeZoneFiles();
+ progress = 44;
+ loadLanguagesFiles();
+ progress = 50;
loadSalutations();
+ progress = 56;
// AppointMent Categories
loadInitAppointmentCategories();
+ progress = 63;
// Appointment Reminder types
loadInitAppointmentReminderTypes();
+ progress = 69;
// Appointment poll types
loadPollTypes();
+ progress = 75;
loadRoomTypes();
+ progress = 81;
loadConfiguration(cfg);
+ progress = 88;
}
- public void loadAll(InstallationConfig cfg, String username,
- String userpass, String useremail, String groupame,
- String timeZone, boolean force) throws Exception {
+ public void loadAll(InstallationConfig cfg, boolean force) throws Exception {
// FIXME dummy check if installation was performed before
- if (!force && usersDao.getAllUsers().size() > 0) {
+ if (!force && usersDao.count() > 0) {
log.debug("System contains users, no need to install data one more time.");
return;
}
loadSystem(cfg, force);
- loadInitUserAndOrganisation(username, userpass, useremail, groupame,
- timeZone, cfg.defaultLangId);
+ loadInitUserAndOrganisation(cfg);
+ progress = 94;
loadDefaultRooms("1".equals(cfg.createDefaultRooms));
+ progress = 100;
}
}
Index: src/org/apache/openmeetings/axis/services/CalendarWebService.java
===================================================================
--- src/org/apache/openmeetings/axis/services/CalendarWebService.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/axis/services/CalendarWebService.java (.../trunk/singlewebapp) (revision 1490226)
@@ -44,10 +44,10 @@
import org.apache.openmeetings.persistence.beans.calendar.Appointment;
import org.apache.openmeetings.persistence.beans.calendar.AppointmentCategory;
import org.apache.openmeetings.persistence.beans.calendar.AppointmentReminderTyps;
-import org.apache.openmeetings.persistence.beans.room.RoomType;
import org.apache.openmeetings.persistence.beans.room.Room;
-import org.apache.openmeetings.persistence.beans.user.UserContact;
+import org.apache.openmeetings.persistence.beans.room.RoomType;
import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.openmeetings.persistence.beans.user.UserContact;
import org.apache.openmeetings.utils.math.TimezoneUtil;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
@@ -370,6 +370,7 @@
}
} catch (Exception err) {
log.error("[updateAppointment]", err);
+ err.printStackTrace();
}
return null;
@@ -645,8 +646,10 @@
Long user_level = userManager.getUserLevelByID(users_id);
if (authLevelUtil.checkUserLevel(user_level)) {
+ User user = userManager.getUserById(users_id);
+ long language_id = (user == null) ? 1 : user.getLanguage_id();
List<AppointmentReminderTyps> res = appointmentReminderTypDaoImpl
- .getAppointmentReminderTypList();
+ .getAppointmentReminderTypList(language_id);
if (res == null || res.size() < 1) {
log.debug("no remindertyps found!");
Index: src/org/apache/openmeetings/doc/WebServiceDoclet.java
===================================================================
--- src/org/apache/openmeetings/doc/WebServiceDoclet.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/doc/WebServiceDoclet.java (.../trunk/singlewebapp) (revision 1490226)
@@ -26,19 +26,12 @@
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.RootDoc;
import com.sun.javadoc.Tag;
public class WebServiceDoclet {
-
- private static final Logger log = Red5LoggerFactory.
- getLogger(WebServiceDoclet.class, OpenmeetingsVariables.webAppRootKey);
-
static final String baseTemplatePath = "xdocs";
static final String basePath = "docs";
static final String templateName = "ApiMethodsTemplate.vm";
@@ -104,7 +97,7 @@
} catch (Exception err) {
- log.error("[start]", err);
+ err.printStackTrace();
}
// No error processing done, simply return true.
Index: src/org/apache/openmeetings/Version.java
===================================================================
--- src/org/apache/openmeetings/Version.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/Version.java (.../trunk/singlewebapp) (revision 1490226)
@@ -44,7 +44,7 @@
try {
version = getAttributes().getValue("Product-Version");
} catch (Exception e) {
- log.error("[getVersion]", e);
+ e.printStackTrace();
}
}
return version;
@@ -55,7 +55,7 @@
try {
revision = getAttributes().getValue("Svn-Revision");
} catch (Exception e) {
- log.error("[getRevision]", e);
+ e.printStackTrace();
}
}
return revision;
@@ -66,14 +66,14 @@
try {
buildDate = getAttributes().getValue("Built-On");
} catch (Exception e) {
- log.error("[getBuildDate]", e);
+ e.printStackTrace();
}
}
return buildDate;
}
private static void getLine(StringBuilder sb, String text, char fill) {
- sb.append('#');
+ sb.append("\t#");
int l = text.length();
int headLength = (startedStringLength - l) / 2;
for (int i = 0; i < headLength; ++i) {
Index: src/org/apache/openmeetings/rss/LoadAtomRssFeed.java
===================================================================
--- src/org/apache/openmeetings/rss/LoadAtomRssFeed.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/rss/LoadAtomRssFeed.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,10 @@
*/
package org.apache.openmeetings.rss;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.RSS_FEED1_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.RSS_FEED2_KEY;
+
+import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Iterator;
@@ -49,10 +53,10 @@
if (authLevelmanagement.checkUserLevel(user_level)) {
LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, Object>>>> returnMap = new LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, Object>>>>();
- String url1 = configurationDao.getConfValue("rss_feed1", String.class, "");
+ String url1 = configurationDao.getConfValue(RSS_FEED1_KEY, String.class, "");
returnMap.put("feed1", this.parseRssFeed(url1));
- String url2 = configurationDao.getConfValue("rss_feed2", String.class, "");
+ String url2 = configurationDao.getConfValue(RSS_FEED2_KEY, String.class, "");
returnMap.put("feed2", this.parseRssFeed(url2));
return returnMap;
@@ -66,6 +70,18 @@
return null;
}
+ public static HttpURLConnection getFeedConnection(String _url) throws IOException {
+ URL url = new URL(_url);
+
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+
+ conn.setDoOutput(true);
+ conn.setDoInput(true);
+ conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)");
+ conn.setRequestProperty("Referer", "http://openmeetings.apache.org/");
+ return conn;
+ }
+
public LinkedHashMap<String, LinkedHashMap<String, LinkedHashMap<String, Object>>> parseRssFeed(
String urlEndPoint) {
try {
Index: src/org/apache/openmeetings/cli/Admin.java
===================================================================
--- src/org/apache/openmeetings/cli/Admin.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/cli/Admin.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,9 @@
*/
package org.apache.openmeetings.cli;
+import static org.apache.openmeetings.utils.UserHelper.getMinPasswdLength;
+import static org.apache.openmeetings.utils.UserHelper.invalidPassword;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
@@ -37,6 +40,7 @@
import org.apache.commons.cli.PosixParser;
import org.apache.commons.transaction.util.FileHelper;
import org.apache.openjpa.jdbc.meta.MappingTool;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.data.file.dao.FileExplorerItemDao;
import org.apache.openmeetings.data.flvrecord.FlvRecordingDao;
import org.apache.openmeetings.data.user.dao.UsersDao;
@@ -94,7 +98,7 @@
options.addOption(new OmOption("i", "email", null, true, "Email of the default user (mutually exclusive with 'file')"));
options.addOption(new OmOption("i", "group", null, true, "The name of the default user group (mutually exclusive with 'file')"));
options.addOption(new OmOption("i", "tz", null, true, "Default server time zone, and time zone for the selected user (mutually exclusive with 'file')"));
- options.addOption(new OmOption("i", null, "password", true, "Password of the default user, minimum " + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH + " characters (will be prompted if not set)", true));
+ options.addOption(new OmOption("i", null, "password", true, "Password of the default user, minimum " + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH + " characters (will be prompted if not set)", true));
options.addOption(new OmOption("i", null, "system-email-address", true, "System e-mail address [default: " + cfg.mailReferer + "]", true));
options.addOption(new OmOption("i", null, "smtp-server", true, "SMTP server for outgoing e-mails [default: " + cfg.smtpServer + "]", true));
options.addOption(new OmOption("i", null, "smtp-port", true, "SMTP server for outgoing e-mails [default: " + cfg.smtpPort + "]", true));
@@ -261,11 +265,11 @@
importInit.loadSystem(cfg, force);
restoreOm(ctxName, backup);
} else {
- AdminUserDetails admin = checkAdminDetails(ctxName);
+ checkAdminDetails(ctxName);
dropDB(connectionProperties);
ImportInitvalues importInit = getApplicationContext(ctxName).getBean(ImportInitvalues.class);
- importInit.loadAll(cfg, admin.login, admin.pass, admin.email, admin.group, admin.tz, force);
+ importInit.loadAll(cfg, force);
}
InstallationDocumentHandler.createDocument(3);
@@ -513,54 +517,46 @@
return result;
}
- private class AdminUserDetails {
- String login = null;
- String email = null;
- String group = null;
- String pass = null;
- String tz = null;
- }
-
- private AdminUserDetails checkAdminDetails(String ctxName) throws Exception {
- AdminUserDetails admin = new AdminUserDetails();
- admin.login = cmdl.getOptionValue("user");
- admin.email = cmdl.getOptionValue("email");
- admin.group = cmdl.getOptionValue("group");
- if (admin.login == null || admin.login.length() < InstallationConfig.USER_LOGIN_MINIMUM_LENGTH) {
+ private void checkAdminDetails(String ctxName) throws Exception {
+ cfg.username = cmdl.getOptionValue("user");
+ cfg.email = cmdl.getOptionValue("email");
+ cfg.group = cmdl.getOptionValue("group");
+ if (cfg.username == null || cfg.username.length() < InstallationConfig.USER_LOGIN_MINIMUM_LENGTH) {
System.out.println("User login was not provided, or too short, should be at least " + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH + " character long.");
System.exit(1);
}
try {
- if (!MailUtil.matches(admin.email)) {
+ if (!MailUtil.matches(cfg.email)) {
throw new AddressException("Invalid address");
}
- new InternetAddress(admin.email, true);
+ new InternetAddress(cfg.email, true);
} catch (AddressException ae) {
- System.out.println("Please provide non-empty valid email: '" + admin.email + "' is not valid.");
+ System.out.println("Please provide non-empty valid email: '" + cfg.email + "' is not valid.");
System.exit(1);
}
- if (admin.group == null || admin.group.length() < 1) {
- System.out.println("User group was not provided, or too short, should be at least 1 character long: " + admin.group);
+ if (cfg.group == null || cfg.group.length() < 1) {
+ System.out.println("User group was not provided, or too short, should be at least 1 character long: " + cfg.group);
System.exit(1);
}
- admin.pass = cmdl.getOptionValue("password");
- if (checkPassword(admin.pass)) {
- System.out.print("Please enter password for the user '" + admin.login + "':");
- admin.pass = new BufferedReader(new InputStreamReader(System.in)).readLine();
- if (checkPassword(admin.pass)) {
- System.out.println("Password was not provided, or too short, should be at least " + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH + " character long.");
+ cfg.password = cmdl.getOptionValue("password");
+ ConfigurationDao cfgDao = getApplicationContext(ctxName).getBean(ConfigurationDao.class);
+ if (invalidPassword(cfg.password, cfgDao)) {
+ System.out.print("Please enter password for the user '" + cfg.username + "':");
+ cfg.password = new BufferedReader(new InputStreamReader(System.in)).readLine();
+ if (invalidPassword(cfg.password, cfgDao)) {
+ System.out.println("Password was not provided, or too short, should be at least " + getMinPasswdLength(cfgDao) + " character long.");
System.exit(1);
}
}
ImportInitvalues importInit = getApplicationContext(ctxName).getBean(ImportInitvalues.class);
Map<String, String> tzMap = ImportHelper.getAllTimeZones(importInit.getTimeZones());
- admin.tz = null;
+ cfg.ical_timeZone = null;
if (cmdl.hasOption("tz")) {
- admin.tz = cmdl.getOptionValue("tz");
- admin.tz = tzMap.containsKey(admin.tz) ? admin.tz : null;
+ cfg.ical_timeZone = cmdl.getOptionValue("tz");
+ cfg.ical_timeZone = tzMap.containsKey(cfg.ical_timeZone) ? cfg.ical_timeZone : null;
}
- if (admin.tz == null) {
+ if (cfg.ical_timeZone == null) {
System.out.println("Please enter timezone, Possible timezones are:");
for (String tzIcal : tzMap.keySet()) {
@@ -568,11 +564,6 @@
}
System.exit(1);
}
- return admin;
- }
-
- private boolean checkPassword(String pass) {
- return (pass == null || pass.length() < InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH);
}
public static void dropDB() throws Exception {
Index: src/org/apache/openmeetings/data/file/FileProcessor.java
===================================================================
--- src/org/apache/openmeetings/data/file/FileProcessor.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/file/FileProcessor.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.file;
+import static org.apache.openmeetings.utils.OmFileHelper.thumbImagePrefix;
+
import java.io.File;
import java.io.InputStream;
import java.util.Date;
@@ -156,7 +158,7 @@
returnError = generateImage.convertImage(newFileSystemName, newFileExtDot, "files",
newFileSystemName, false);
} else if (isAsIs) {
- ConverterProcessResult processThumb = generateThumbs.generateThumb("_thumb_", completeName, 50);
+ ConverterProcessResult processThumb = generateThumbs.generateThumb(thumbImagePrefix, completeName, 50);
returnError.addItem("processThumb", processThumb);
} else if (isVideo) {
List<ConverterProcessResult> returnList = flvExplorerConverter.startConversion(fileExplorerItemId, completeName.getCanonicalPath());
Index: src/org/apache/openmeetings/data/file/FileUtils.java
===================================================================
--- src/org/apache/openmeetings/data/file/FileUtils.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/file/FileUtils.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.file;
+import static org.apache.openmeetings.utils.OmFileHelper.thumbImagePrefix;
+
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -51,8 +53,7 @@
fileSize += tFile.length();
}
- File thumbFile = new File(base, "_thumb_"
- + fileExplorerItem.getFileHash());
+ File thumbFile = new File(base, thumbImagePrefix + fileExplorerItem.getFileHash());
if (thumbFile.exists()) {
fileSize += thumbFile.length();
}
Index: src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java
===================================================================
--- src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/basic/dao/LdapConfigDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -242,7 +242,6 @@
}
public List<LdapConfig> getActiveLdapConfigs() {
- try {
log.debug("selectMaxFromConfigurations ");
String hql = "select c from LdapConfig c "
@@ -253,13 +252,8 @@
TypedQuery<LdapConfig> query = em
.createQuery(hql, LdapConfig.class);
query.setParameter("isActive", true);
- List<LdapConfig> ll = query.getResultList();
- return ll;
- } catch (Exception ex2) {
- log.error("[getActiveLdapConfigs] ", ex2);
- }
- return null;
+ return query.getResultList();
}
public List<LdapConfig> getLdapConfigs() {
Index: src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java
===================================================================
--- src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/basic/dao/ConfigurationDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -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 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 @@
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 @@
*
* 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 @@
/**
*
* @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 @@
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 @@
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 @@
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 @@
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 Configuration get(long id) {
- try {
if (id <= 0) {
return null;
}
- return em
- .createNamedQuery("getConfigurationById",
- Configuration.class)
+ 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) {
- 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 long count() {
- return selectMaxFromConfigurations();
+ return em.createNamedQuery("countConfigurations", Long.class).getSingleResult();
}
public long count(String search) {
@@ -368,22 +343,25 @@
}
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 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);
}
}
Index: src/org/apache/openmeetings/data/basic/FieldValueDao.java
===================================================================
--- src/org/apache/openmeetings/data/basic/FieldValueDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/basic/FieldValueDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.basic;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -46,7 +48,7 @@
private FieldLanguagesValuesDao flvDaoImpl;
private Long getDefaultLanguage() {
- return configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ return configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
}
public Fieldvalues get(long id) {
Index: src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDao.java
===================================================================
--- src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/basic/FieldLanguagesValuesDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.basic;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.Date;
import java.util.List;
@@ -52,8 +54,7 @@
* @see org.apache.openmeetings.data.OmDAO#get(int, int)
*/
public List<Fieldlanguagesvalues> get(int first, int count) {
- return get(configurationDao.getConfValue("default_lang_id",
- Long.class, "1"), first, count);
+ return get(configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1"), first, count);
}
public List<Fieldlanguagesvalues> get(String search, int start, int count, String sort) {
Index: src/org/apache/openmeetings/data/basic/FieldManager.java
===================================================================
--- src/org/apache/openmeetings/data/basic/FieldManager.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/basic/FieldManager.java (.../trunk/singlewebapp) (revision 1490226)
@@ -187,7 +187,7 @@
return returnList;
} catch (Exception ex2) {
- log.error("[getConfKey]: ", ex2);
+ log.error("[getConfKey]: " + ex2);
}
return null;
}
@@ -257,6 +257,7 @@
} catch (Exception ex2) {
log.error("[getLabelsByLanguage]: ", ex2);
+ ex2.printStackTrace();
}
return null;
}
Index: src/org/apache/openmeetings/data/flvrecord/listener/async/StreamAudioWriter.java
===================================================================
--- src/org/apache/openmeetings/data/flvrecord/listener/async/StreamAudioWriter.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/flvrecord/listener/async/StreamAudioWriter.java (.../trunk/singlewebapp) (revision 1490226)
@@ -220,6 +220,9 @@
writer.writeTag(tag);
}
+
+ } catch (IOException e) {
+ log.error("[packetReceived]", e);
} catch (Exception e) {
log.error("[packetReceived]", e);
}
Index: src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java
===================================================================
--- src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/flvrecord/converter/BaseConverter.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,7 +18,11 @@
*/
package org.apache.openmeetings.data.flvrecord.converter;
+import static org.apache.openmeetings.utils.OmFileHelper.MP4_EXTENSION;
+import static org.apache.openmeetings.utils.OmFileHelper.OGG_EXTENSION;
+
import java.io.File;
+import java.io.IOException;
import java.util.List;
import org.apache.openmeetings.OpenmeetingsVariables;
@@ -56,7 +60,7 @@
return path;
}
- protected String getPathToFFMPEG() {
+ public String getPathToFFMPEG() {
return getPath("ffmpeg_path", "ffmpeg");
}
@@ -300,4 +304,59 @@
log.error("[stripAudioFromFLVs]", err);
}
}
+
+ public void convertToMp4(FlvRecording r, List<ConverterProcessResult> returnLog) throws IOException {
+ //TODO add faststart, move filepaths to helpers
+ File file = OmFileHelper.getRecording(r.getFileHash());
+ if (!file.exists()) {
+ return;
+ }
+ String path = file.getCanonicalPath();
+ String mp4path = path + MP4_EXTENSION;
+ // ffmpeg -i video_source_file.ext -vcodec libx264 -b 250k -bt 50k -acodec libfaac -ab 56k -ac 2 -s 480x320 video_out_file.mp4
+ String[] argv = new String[] {
+ getPathToFFMPEG(), //
+ "-i", path,
+ "-c:v", "libx264",
+ "-crf", "24",
+ "-pix_fmt", "yuv420p",
+ "-preset", "medium",
+ "-profile:v", "baseline",
+ "-c:a", "libfaac",
+ "-s", r.getFlvWidth() + "x" + r.getFlvHeight(), //
+ mp4path
+ };
+
+ if (log.isDebugEnabled()) {
+ log.debug("START generate MP4 ################# ");
+ String tString = "";
+ for (int i = 0; i < argv.length; i++) {
+ tString += argv[i] + " ";
+ // log.debug(" i " + i + " argv-i " + argv_fullFLV[i]);
+ }
+ log.debug(tString);
+ log.debug("END generate MP4 ################# ");
+ }
+ returnLog.add(ProcessHelper.executeScript("generate MP4", argv));
+
+ argv = new String[] {
+ getPathToFFMPEG(), //
+ "-i", mp4path,
+ "-vcodec", "libtheora",
+ "-acodec", "libvorbis",
+ path + OGG_EXTENSION
+ };
+
+ if (log.isDebugEnabled()) {
+ log.debug("START generate MP4 ################# ");
+ String tString = "";
+ for (int i = 0; i < argv.length; i++) {
+ tString += argv[i] + " ";
+ // log.debug(" i " + i + " argv-i " + argv_fullFLV[i]);
+ }
+ log.debug(tString);
+ log.debug("END generate MP4 ################# ");
+ }
+ returnLog.add(ProcessHelper.executeScript("generate MP4", argv));
+ }
}
Index: src/org/apache/openmeetings/data/flvrecord/converter/FlvRecorderConverter.java
===================================================================
--- src/org/apache/openmeetings/data/flvrecord/converter/FlvRecorderConverter.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/flvrecord/converter/FlvRecorderConverter.java (.../trunk/singlewebapp) (revision 1490226)
@@ -294,6 +294,7 @@
flvRecording.setAlternateDownload(alternateDownloadName);
this.flvRecordingDaoImpl.updateFlvRecording(flvRecording);
+ convertToMp4(flvRecording, returnLog);
for (ConverterProcessResult returnMap : returnLog) {
this.flvRecordingLogDaoImpl.addFLVRecordingLog(
Index: src/org/apache/openmeetings/data/flvrecord/converter/FlvInterviewConverter.java
===================================================================
--- src/org/apache/openmeetings/data/flvrecord/converter/FlvInterviewConverter.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/flvrecord/converter/FlvInterviewConverter.java (.../trunk/singlewebapp) (revision 1490226)
@@ -452,7 +452,7 @@
flvRecording.setFlvHeight(flvHeight);
String[] argv_fullFLV = new String[] {
- this.getPathToFFMPEG(), //
+ getPathToFFMPEG(), //
"-i", inputScreenFullFlv, "-i", outputFullWav,
"-ar",
"22050", //
@@ -535,6 +535,7 @@
flvRecording.setAlternateDownload(alternateDownloadName);
flvRecordingDaoImpl.updateFlvRecording(flvRecording);
+ convertToMp4(flvRecording, returnLog);
flvRecordingLogDaoImpl
.deleteFLVRecordingLogByRecordingId(flvRecording
Index: src/org/apache/openmeetings/data/flvrecord/FlvRecordingDao.java
===================================================================
--- src/org/apache/openmeetings/data/flvrecord/FlvRecordingDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/flvrecord/FlvRecordingDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -228,7 +228,7 @@
return flvRecordingList;
} catch (Exception ex2) {
- log.error("[getFlvRecordingByOwner]: ",ex2);
+ log.error("[getFlvRecordingRootByPublic]: ",ex2);
}
return null;
}
Index: src/org/apache/openmeetings/data/conference/FeedbackManager.java
===================================================================
--- src/org/apache/openmeetings/data/conference/FeedbackManager.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/conference/FeedbackManager.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.conference;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.FieldManager;
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
@@ -42,8 +44,7 @@
public String sendFeedback(String username, String email, String message) {
try {
- Long default_lang_id = configurationDao.getConfValue(
- "default_lang_id", Long.class, "1");
+ Long default_lang_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
String template = feedbackTemplate.getFeedBackTemplate(username,
email, message, default_lang_id);
Index: src/org/apache/openmeetings/data/conference/InvitationManager.java
===================================================================
--- src/org/apache/openmeetings/data/conference/InvitationManager.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/conference/InvitationManager.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.conference;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
@@ -226,7 +228,7 @@
try {
user = userManager.getUserById(canceling_user_id);
} catch (Exception e) {
- log.error("cancelInvitation Cancelling user cant be retrieved", e);
+ log.error("cancelInvitation Cancelling user cant be retrieved");
return;
}
@@ -271,7 +273,6 @@
} catch (Exception e) {
log.error("Error sending IcalCancelMail for User "
+ member.getEmail() + " : " + e.getMessage());
- log.error("[cancelInvitation]", e);
}
}
@@ -300,7 +301,7 @@
return message;
} catch (Exception err) {
- log.error("Could not format cancel message", err);
+ log.error("Could not format cancel message");
return "Error formatCancelMessage";
}
}
@@ -347,7 +348,7 @@
return message;
} catch (Exception err) {
- log.error("Could not format cancel message", err);
+ log.error("Could not format cancel message");
return "Error formatCancelMessage";
}
}
@@ -414,7 +415,6 @@
} catch (Exception e) {
log.error("Error sending IcalUpdateMail for User "
+ member.getEmail() + " : " + e.getMessage());
- log.error("[updateInvitation]", e);
}
}
}
@@ -447,7 +447,7 @@
return message;
} catch (Exception err) {
- log.error("Could not format update subject", err);
+ log.error("Could not format update subject");
return "Error formatUpdateSubject";
}
}
@@ -494,7 +494,7 @@
return message;
} catch (Exception err) {
- log.error("Could not format update message", err);
+ log.error("Could not format update message");
return "Error formatUpdateMessage";
}
}
@@ -626,9 +626,6 @@
invitation_link += "&language=" + language_id.toString();
}
- // Long default_lang_id = Long.valueOf(cfgManagement.
- // getConfKey(3,"default_lang_id").getConf_value()).longValue();
-
String template = invitationTemplate.getRegisterInvitationTemplate(
fromUserField, message, invitation_link, language_id, dStart,
dEnd);
@@ -711,7 +708,6 @@
return "success";
} catch (Exception e) {
log.error("sendInvitationCancelmail : " + e.getMessage());
- log.error("[sendInvitationCancelmail]", e);
}
return null;
@@ -737,7 +733,6 @@
return "success";
} catch (Exception e) {
log.error("sendInvitationUpdateMail : " + e.getMessage());
- log.error("[sendInvitationUpdateMail]", e);
}
return null;
@@ -870,8 +865,6 @@
invitation_link += "&language=" + language_id.toString();
}
- // Long default_lang_id = Long.valueOf(cfgManagement.
- // getConfKey(3,"default_lang_id").getConf_value()).longValue();
String template = invitationTemplate.getRegisterInvitationTemplate(
fromUserField, message, invitation_link, language_id, starttime,
endtime);
@@ -950,7 +943,7 @@
+ "&room=" + room + "&roomtype=" + roomtype + "&email="
+ email + "&roomid=" + room_id;
- Long default_lang_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ Long default_lang_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
String template = invitationTemplate
.getRegisterInvitationTemplate(username, message,
@@ -1190,7 +1183,7 @@
}
} catch (Exception err) {
- log.error("[updateInvitationByAppointment]", err);
+
}
}
}
Index: src/org/apache/openmeetings/data/conference/dao/RoomDao.java
===================================================================
--- src/org/apache/openmeetings/data/conference/dao/RoomDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/conference/dao/RoomDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,8 +18,12 @@
*/
package org.apache.openmeetings.data.conference.dao;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
+import java.util.Calendar;
import java.util.Date;
import java.util.List;
+import java.util.TimeZone;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@@ -27,13 +31,18 @@
import org.apache.openmeetings.data.IDataProviderDao;
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.data.user.dao.UsersDao;
import org.apache.openmeetings.persistence.beans.room.Room;
import org.apache.openmeetings.utils.DaoHelper;
+import org.apache.openmeetings.utils.math.TimezoneUtil;
+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 RoomDao implements IDataProviderDao<Room> {
+ private static final Logger log = Red5LoggerFactory.getLogger(RoomDao.class, webAppRootKey);
public final static String[] searchFields = {"name"};
@PersistenceContext
@@ -42,6 +51,10 @@
private ConfigurationDao cfgDao;
@Autowired
private SipDao sipDao;
+ @Autowired
+ private UsersDao usersDao;
+ @Autowired
+ private TimezoneUtil timezoneUtil;
public Room get(long id) {
TypedQuery<Room> q = em.createNamedQuery("getRoomById", Room.class);
@@ -85,16 +98,34 @@
}
public List<Room> getOrganisationRooms(long orgId) {
- TypedQuery<Room> q = em.createQuery(
- "SELECT DISTINCT c.room FROM RoomOrganisation c LEFT JOIN FETCH c.room "
- + "WHERE c.organisation.organisation_id = :orgId "
- + "AND c.deleted = false AND c.room.deleted = false AND c.room.appointment = false "
- + "AND c.organisation.deleted = false "
- + "ORDER BY c.room.name ASC", Room.class);
+ TypedQuery<Room> q = em.createNamedQuery("getOrganisationRooms", Room.class);
q.setParameter("orgId", orgId);
return q.getResultList();
}
+ public List<Room> getAppointedRoomsByUser(long userId) {
+ //TODO generalize with AppointmentDao
+ log.debug("getAppointedRoomsByUser : UserID - " + userId);
+
+ TimeZone timeZone = timezoneUtil.getTimezoneByUser(usersDao.get(userId));
+
+ Calendar startCal = Calendar.getInstance(timeZone);
+ startCal.set(Calendar.MINUTE, 0);
+ startCal.set(Calendar.HOUR, 0);
+ startCal.set(Calendar.SECOND, 1);
+
+ Calendar endCal = Calendar.getInstance(timeZone);
+ endCal.set(Calendar.MINUTE, 23);
+ endCal.set(Calendar.HOUR, 59);
+ endCal.set(Calendar.SECOND, 59);
+
+ return em.createNamedQuery("appointedRoomsInRangeByUser", Room.class)
+ .setParameter("userId", userId)
+ .setParameter("starttime", startCal.getTime())
+ .setParameter("endtime", endCal.getTime())
+ .getResultList();
+ }
+
public Long getRoomsCapacityByIds(List<Long> ids) {
return ids == null || ids.isEmpty() ? 0
: em.createNamedQuery("getRoomsCapacityByIds", Long.class).setParameter("ids", ids).getSingleResult();
Index: src/org/apache/openmeetings/data/conference/dao/RoomModeratorsDao.java
===================================================================
--- src/org/apache/openmeetings/data/conference/dao/RoomModeratorsDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/conference/dao/RoomModeratorsDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -113,6 +113,7 @@
return query.getResultList();
} catch (Exception ex2) {
log.error("[getRoomModeratorByRoomId] ", ex2);
+ ex2.printStackTrace();
}
return null;
}
@@ -127,6 +128,7 @@
return query.getResultList();
} catch (Exception ex2) {
log.error("[getRoomModeratorByUserAndRoomId] ", ex2);
+ ex2.printStackTrace();
}
return null;
}
@@ -209,6 +211,7 @@
} catch (Exception ex2) {
log.error("[addRoomModeratorByUserList] ", ex2);
+ ex2.printStackTrace();
}
}
@@ -289,6 +292,7 @@
} catch (Exception ex2) {
log.error("[updateRoomModeratorByUserList] ", ex2);
+ ex2.printStackTrace();
}
}
Index: src/org/apache/openmeetings/data/conference/RoomManager.java
===================================================================
--- src/org/apache/openmeetings/data/conference/RoomManager.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/conference/RoomManager.java (.../trunk/singlewebapp) (revision 1490226)
@@ -33,6 +33,7 @@
import javax.persistence.criteria.Root;
import org.apache.openmeetings.data.basic.AuthLevelUtil;
+import org.apache.openmeetings.data.basic.FieldManager;
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.data.beans.basic.SearchResult;
import org.apache.openmeetings.data.conference.dao.RoomDao;
@@ -78,6 +79,8 @@
@Autowired
private ConfigurationDao configurationDao;
@Autowired
+ private FieldManager fieldManager;
+ @Autowired
private RoomDao roomDao;
@Autowired
private SipDao sipDao;
@@ -88,12 +91,13 @@
* @param name
* @return ID of new created roomtype or null
*/
- public Long addRoomType(String name, boolean deleted) {
+ public Long addRoomType(String name, long fieldvalues_id, boolean deleted) {
try {
RoomType rtype = new RoomType();
rtype.setName(name);
rtype.setStarttime(new Date());
rtype.setDeleted(deleted);
+ rtype.setFieldvalues_id(fieldvalues_id);
rtype = em.merge(rtype);
long returnId = rtype.getRoomtypes_id();
return returnId;
@@ -108,12 +112,17 @@
*
* @return List of RoomTypes
*/
- public List<RoomType> getAllRoomTypes() {
+ public List<RoomType> getAllRoomTypes(long language_id) {
try {
TypedQuery<RoomType> query = em
.createNamedQuery("getAllRoomTypes", RoomType.class);
query.setParameter("deleted", true);
- return query.getResultList();
+ List<RoomType> ll = query.getResultList();
+ for (RoomType ti : ll) {
+ ti.setLabel(fieldManager.getFieldByIdAndLanguage(
+ ti.getFieldvalues_id(), language_id));
+ }
+ return ll;
} catch (Exception ex2) {
log.error("[getAllRoomTypes] ", ex2);
}
@@ -544,6 +553,7 @@
}
} catch (Exception ex2) {
log.error("[getPublicRoomsWithoutType] ", ex2);
+ ex2.printStackTrace();
}
return null;
}
@@ -916,6 +926,7 @@
}
} catch (Exception ex2) {
log.error("[getPublicRoomsWithoutType] ", ex2);
+ ex2.printStackTrace();
}
return null;
}
@@ -1487,8 +1498,7 @@
* @param rooms_id
* @return Rooms-Object or NULL
*/
- public Room getRoomByOwnerAndTypeId(Long ownerId, Long roomtypesId,
- String roomName) {
+ public Room getRoomByOwnerAndTypeId(Long ownerId, Long roomtypesId, String roomName) {
try {
if (roomtypesId == null || roomtypesId == 0) {
@@ -1509,8 +1519,7 @@
if (room != null) {
return room;
} else {
- log.debug("Could not find room " + ownerId + " || "
- + roomtypesId);
+ log.debug("Could not find room " + ownerId + " || " + roomtypesId);
Long rooms_id = this.addRoom(3L, roomName, roomtypesId,
"My Rooms of ownerId " + ownerId,
Index: src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDao.java
===================================================================
--- src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/calendar/daos/AppointmentCategoryDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.calendar.daos;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
import java.util.Date;
import java.util.List;
@@ -26,8 +28,6 @@
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.data.user.dao.UsersDao;
import org.apache.openmeetings.persistence.beans.calendar.AppointmentCategory;
import org.red5.logging.Red5LoggerFactory;
@@ -37,10 +37,7 @@
@Transactional
public class AppointmentCategoryDao {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- ConfigurationDao.class,
- OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(AppointmentCategoryDao.class, webAppRootKey);
@PersistenceContext
private EntityManager em;
@@ -67,7 +64,7 @@
return appointCategory;
} catch (Exception ex2) {
- log.error("[getAppointmentCategoryById]: ", ex2);
+ log.error("[getAppointmentCategoryById]: " + ex2);
}
return null;
}
@@ -140,7 +137,7 @@
}
return categoryId;
} catch (Exception ex2) {
- log.error("[deleteAppointmentCategory]: ", ex2);
+ log.error("[deleteAppointmentCategory]: " + ex2);
}
return null;
}
@@ -159,7 +156,7 @@
return listAppointmentCategory;
} catch (Exception ex2) {
- log.error("[AppointmentCategory]: ", ex2);
+ log.error("[AppointmentCategory]: " + ex2);
}
return null;
}
Index: src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java
===================================================================
--- src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.calendar.daos;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
@@ -35,10 +37,11 @@
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
-import org.apache.openmeetings.OpenmeetingsVariables;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.data.basic.dao.OmTimeZoneDao;
import org.apache.openmeetings.data.calendar.management.MeetingMemberLogic;
import org.apache.openmeetings.data.conference.InvitationManager;
+import org.apache.openmeetings.data.conference.dao.RoomDao;
import org.apache.openmeetings.data.user.UserManager;
import org.apache.openmeetings.data.user.dao.UsersDao;
import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
@@ -57,9 +60,7 @@
@Transactional
public class AppointmentDao {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- AppointmentDao.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(AppointmentDao.class, webAppRootKey);
@PersistenceContext
private EntityManager em;
@Autowired
@@ -75,6 +76,10 @@
@Autowired
private UsersDao usersDao;
@Autowired
+ private RoomDao roomDao;
+ @Autowired
+ private ConfigurationDao cfgDao;
+ @Autowired
private InvitationManager invitationManager;
@Autowired
private MeetingMemberLogic meetingMemberLogic;
@@ -253,6 +258,25 @@
return null;
}
+ public Appointment update(Appointment a, Long userId) {
+ a.setUserId(usersDao.get(userId));
+ Room r = a.getRoom();
+ if (r.getRooms_id() == null) {
+ r.setName(a.getAppointmentName());
+ r.setNumberOfPartizipants(cfgDao.getConfValue("calendar.conference.rooms.default.size", Long.class, "50"));
+ }
+ roomDao.update(r, userId);
+ //FIXME meeting members
+ if (a.getAppointmentId() == null) {
+ a.setStarttime(new Date());
+ em.persist(a);
+ } else {
+ a.setUpdatetime(new Date());
+ a = em.merge(a);
+ }
+ return a;
+ }
+
// ----------------------------------------------------------------------------------------------------------------------------
public Long updateAppointment(Appointment appointment) {
@@ -698,7 +722,7 @@
}
return appointmentId;
} catch (Exception ex2) {
- log.error("[deleteAppointement]: ", ex2);
+ log.error("[deleteAppointement]: " + ex2);
}
return null;
}
@@ -843,17 +867,6 @@
public List<Appointment> getTodaysAppointmentsbyRangeAndMember(Long userId) {
log.debug("getAppoitmentbyRangeAndMember : UserID - " + userId);
- //this query returns duplicates if the user books an appointment with
- //his own user as second meeting-member, swagner 19.02.2012
-
- String hql = "SELECT app from MeetingMember mm "
- + "JOIN mm.appointment as app "
- + "WHERE mm.userid.user_id= :userId "
- + "AND mm.deleted <> :mm_deleted "
- + "AND app.deleted <> :app_deleted " + "AND "
- + "app.appointmentStarttime between :starttime " + "AND "
- + " :endtime";
-
TimeZone timeZone = timezoneUtil.getTimezoneByUser(usersDao.get(userId));
Calendar startCal = Calendar.getInstance(timeZone);
@@ -866,12 +879,8 @@
endCal.set(Calendar.HOUR, 59);
endCal.set(Calendar.SECOND, 59);
- try {
- TypedQuery<Appointment> query = em.createQuery(hql,
- Appointment.class);
+ TypedQuery<Appointment> query = em.createNamedQuery("appointmentsInRangeByUser", Appointment.class);
- query.setParameter("mm_deleted", true);
- query.setParameter("app_deleted", true);
query.setParameter("userId", userId);
query.setParameter("starttime", startCal.getTime());
@@ -879,10 +888,6 @@
List<Appointment> listAppoints = query.getResultList();
return listAppoints;
- } catch (Exception e) {
- log.error("Error in getTodaysAppoitmentsbyRangeAndMember : ", e);
- return null;
- }
}
/**
Index: src/org/apache/openmeetings/data/calendar/daos/AppointmentReminderTypDao.java
===================================================================
--- src/org/apache/openmeetings/data/calendar/daos/AppointmentReminderTypDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/calendar/daos/AppointmentReminderTypDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -27,6 +27,7 @@
import javax.persistence.TypedQuery;
import org.apache.openmeetings.OpenmeetingsVariables;
+import org.apache.openmeetings.data.basic.FieldLanguagesValuesDao;
import org.apache.openmeetings.data.user.dao.UsersDao;
import org.apache.openmeetings.persistence.beans.calendar.AppointmentReminderTyps;
import org.red5.logging.Red5LoggerFactory;
@@ -45,6 +46,8 @@
private EntityManager em;
@Autowired
private UsersDao usersDao;
+ @Autowired
+ private FieldLanguagesValuesDao fieldLanguagesValuesDao;
public AppointmentReminderTyps getAppointmentReminderTypById(Long typId) {
try {
@@ -95,7 +98,7 @@
return null;
}
- public Long addAppointmentReminderTyps(Long user_id, String name) {
+ public Long addAppointmentReminderTyps(Long user_id, String name, long fieldvalues_id) {
try {
AppointmentReminderTyps ac = new AppointmentReminderTyps();
@@ -104,6 +107,7 @@
ac.setStarttime(new Date());
ac.setDeleted(false);
ac.setUser(usersDao.get(user_id));
+ ac.setFieldvalues_id(fieldvalues_id);
ac = em.merge(ac);
Long category_id = ac.getTypId();
@@ -140,12 +144,12 @@
return typId;
} catch (Exception ex2) {
- log.error("[deleteAppointmentReminderTyp]: ", ex2);
+ log.error("[deleteAppointmentReminderTyp]: " + ex2);
}
return null;
}
- public List<AppointmentReminderTyps> getAppointmentReminderTypList() {
+ public List<AppointmentReminderTyps> getAppointmentReminderTypList(long language_id) {
log.debug("getAppointmenetReminderTypList");
try {
@@ -158,6 +162,10 @@
List<AppointmentReminderTyps> listAppointmentReminderTyp = query
.getResultList();
+ for (AppointmentReminderTyps ti : listAppointmentReminderTyp) {
+ ti.setLabel(fieldLanguagesValuesDao.get(
+ ti.getFieldvalues_id(), language_id));
+ }
return listAppointmentReminderTyp;
} catch (Exception ex2) {
Index: src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java
===================================================================
--- src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/calendar/management/AppointmentLogic.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.calendar.management;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -87,15 +89,15 @@
}
public List<Appointment> getTodaysAppointmentsForUser(Long userId) {
+ try {
log.debug("getTodaysAppointmentsForUser");
-
- List<Appointment> points = appointmentDao
- .getTodaysAppointmentsbyRangeAndMember(userId);
-
+ List<Appointment> points = appointmentDao.getTodaysAppointmentsbyRangeAndMember(userId);
log.debug("Count Appointments for Today : " + points.size());
-
return points;
-
+ } catch (Exception err) {
+ log.error("[getTodaysAppointmentsForUser]", err);
+ }
+ return null;
}
/**
@@ -424,7 +426,7 @@
return;
}
- Long language_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ Long language_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
// Get the required labels one time for all meeting members. The
// Language of the email will be the system default language
Index: src/org/apache/openmeetings/data/user/EmailManager.java
===================================================================
--- src/org/apache/openmeetings/data/user/EmailManager.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/user/EmailManager.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,14 +18,14 @@
*/
package org.apache.openmeetings.data.user;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-import javax.persistence.TypedQuery;
-import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.FieldManager;
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.persistence.beans.user.Address;
import org.apache.openmeetings.templates.RegisterUserTemplate;
import org.apache.openmeetings.utils.mail.MailHandler;
import org.red5.logging.Red5LoggerFactory;
@@ -41,9 +41,7 @@
*/
@Transactional
public class EmailManager {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- EmailManager.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(EmailManager.class, webAppRootKey);
@PersistenceContext
private EntityManager em;
@@ -68,12 +66,12 @@
*/
public String sendMail(String Username, String Userpass, String EMail,
String link, Boolean sendEmailWithVerficationCode) {
-
+ log.debug("sendMail:: username = {}, email = {}", Username, EMail);
Integer sendEmailAtRegister = configurationDao.getConfValue("sendEmailAtRegister", Integer.class, "0");
if (sendEmailAtRegister == 1) {
- Long default_lang_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ Long default_lang_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
String template = null;
if (sendEmailWithVerficationCode) {
@@ -97,31 +95,4 @@
String succ = "invalid email";
return succ;
}
-
- /**
- * Checks if a mail is already taken by someone else
- *
- * @param email
- * @return
- */
- public boolean checkUserEMail(String email) {
- try {
- if (email.length() == 0)
- return true;
- log.debug("checkUserMail: " + email);
- TypedQuery<Address> query = em
- .createQuery("select c from Address as c where c.email LIKE :email AND c.deleted <> :deleted", Address.class);
- query.setParameter("email", email);
- query.setParameter("deleted", true);
- int count = query.getResultList().size();
- log.debug("size: " + count);
-
- if (count > 0) {
- return false;
- }
- } catch (Exception ex2) {
- log.error("checkUserEMail: ", ex2);
- }
- return true;
- }
}
Index: src/org/apache/openmeetings/data/user/dao/PrivateMessageFolderDao.java
===================================================================
--- src/org/apache/openmeetings/data/user/dao/PrivateMessageFolderDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/user/dao/PrivateMessageFolderDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.user.dao;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
import java.util.Date;
import java.util.List;
@@ -26,16 +28,15 @@
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
-import org.apache.openmeetings.OpenmeetingsVariables;
+import org.apache.openmeetings.data.IDataProviderDao;
import org.apache.openmeetings.persistence.beans.user.PrivateMessageFolder;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
import org.springframework.transaction.annotation.Transactional;
@Transactional
-public class PrivateMessageFolderDao {
-
- private static final Logger log = Red5LoggerFactory.getLogger(PrivateMessageFolderDao.class, OpenmeetingsVariables.webAppRootKey);
+public class PrivateMessageFolderDao implements IDataProviderDao<PrivateMessageFolder> {
+ private static final Logger log = Red5LoggerFactory.getLogger(PrivateMessageFolderDao.class, webAppRootKey);
@PersistenceContext
private EntityManager em;
@@ -70,7 +71,7 @@
return null;
}
- public PrivateMessageFolder getPrivateMessageFolderById(Long privateMessageFolderId) {
+ public PrivateMessageFolder get(long privateMessageFolderId) {
try {
String hql = "select c from PrivateMessageFolder c " +
"where c.privateMessageFolderId = :privateMessageFolderId ";
@@ -91,35 +92,22 @@
return null;
}
- public List<PrivateMessageFolder> getPrivateMessageFolders() {
- try {
+ public List<PrivateMessageFolder> get(int start, int count) {
String hql = "select c from PrivateMessageFolder c ";
-
- TypedQuery<PrivateMessageFolder> query = em.createQuery(hql, PrivateMessageFolder.class);
-
- List<PrivateMessageFolder> privateMessageFolders = query.getResultList();
-
- return privateMessageFolders;
- } catch (Exception e) {
- log.error("[getPrivateMessageFolderById]",e);
+ return em.createQuery(hql, PrivateMessageFolder.class)
+ .setFirstResult(start).setMaxResults(count)
+ .getResultList();
}
- return null;
- }
-
- public void updatePrivateMessages(PrivateMessageFolder privateMessageFolder) {
- try {
+ public PrivateMessageFolder update(PrivateMessageFolder privateMessageFolder, Long userId) {
if (privateMessageFolder.getPrivateMessageFolderId() == 0) {
em.persist(privateMessageFolder);
} else {
if (!em.contains(privateMessageFolder)) {
- em.merge(privateMessageFolder);
+ privateMessageFolder = em.merge(privateMessageFolder);
}
}
-
- } catch (Exception e) {
- log.error("[updatePrivateMessages]",e);
- }
+ return privateMessageFolder;
}
public List<PrivateMessageFolder> getPrivateMessageFolderByUserId(Long userId) {
@@ -139,15 +127,24 @@
return null;
}
- public void deletePrivateMessages(PrivateMessageFolder privateMessageFolder) {
- try {
-
+ public void delete(PrivateMessageFolder privateMessageFolder, Long userId) {
privateMessageFolder = em.find(PrivateMessageFolder.class, privateMessageFolder.getPrivateMessageFolderId());
em.remove(privateMessageFolder);
+ }
- } catch (Exception e) {
- log.error("[deletePrivateMessages]",e);
+ public List<PrivateMessageFolder> get(String search, int start, int count, String order) {
+ // TODO Auto-generated method stub
+ return null;
}
+
+ public long count() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public long count(String search) {
+ // TODO Auto-generated method stub
+ return 0;
}
}
Index: src/org/apache/openmeetings/data/user/dao/UsersDao.java
===================================================================
--- src/org/apache/openmeetings/data/user/dao/UsersDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/user/dao/UsersDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,9 @@
*/
package org.apache.openmeetings.data.user.dao;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+
import java.util.Date;
import java.util.List;
@@ -29,7 +32,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.persistence.OpenJPAPersistence;
import org.apache.openjpa.persistence.OpenJPAQuery;
-import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.IDataProviderDao;
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.data.basic.dao.OmTimeZoneDao;
@@ -50,11 +52,9 @@
*/
@Transactional
public class UsersDao implements IDataProviderDao<User> {
+ private static final Logger log = Red5LoggerFactory.getLogger(UsersDao.class, webAppRootKey);
- private static final Logger log = Red5LoggerFactory.getLogger(
- UsersDao.class, OpenmeetingsVariables.webAppRootKey);
-
- public final static String[] searchFields = {"lastname", "firstname", "login", "adresses.email"};
+ public final static String[] searchFields = {"lastname", "firstname", "login", "adresses.email", "adresses.town"};
@PersistenceContext
private EntityManager em;
@@ -82,8 +82,7 @@
user.setSalutations_id(1L); // TODO: Fix default selection to be
// configurable
user.setLevel_id(1L);
- user.setLanguage_id(configurationDao.getConfValue(
- "default_lang_id", Long.class, "1"));
+ user.setLanguage_id(configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1"));
user.setOmTimeZone(omTimeZoneDaoImpl.getDefaultOmTimeZone(currentUser));
user.setForceTimeZoneCheck(false);
user.setSendSMS(false);
@@ -222,22 +221,34 @@
* @param DataValue
* @return
*/
- public boolean checkUserLogin(String DataValue) {
- try {
- TypedQuery<User> query = em
- .createNamedQuery("checkUserLogin", User.class);
- query.setParameter("DataValue", DataValue);
- query.setParameter("deleted", true);
- int count = query.getResultList().size();
-
- if (count != 0) {
- return false;
- }
- } catch (Exception ex2) {
- log.error("[checkUserData]", ex2);
+ public boolean checkUserLogin(String login, Long id) {
+ log.debug("checkUserLogin: email = {}, id = {}", login, id);
+ long count = em.createNamedQuery("checkUserLogin", Long.class)
+ .setParameter("login", login)
+ .setParameter("id", id == null ? 0 : id)
+ .getSingleResult();
+ return count == 0;
}
+
+ /**
+ * Checks if a mail is already taken by someone else
+ *
+ * @param email
+ * @return
+ */
+ public boolean checkUserEMail(String email, Long id) {
+ log.debug("checkUserMail: email = {}, id = {}", email, id);
+ if (email == null || email.length() == 0) {
return true;
}
+ long count = em.createNamedQuery("checkUserEmail", Long.class)
+ .setParameter("email", email)
+ .setParameter("id", id == null ? 0 : id)
+ .getSingleResult();
+ log.debug("size: " + count);
+
+ return count == 0;
+ }
public User getUserByName(String login) {
try {
Index: src/org/apache/openmeetings/data/user/dao/PrivateMessagesDao.java
===================================================================
--- src/org/apache/openmeetings/data/user/dao/PrivateMessagesDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/user/dao/PrivateMessagesDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,8 @@
*/
package org.apache.openmeetings.data.user.dao;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
import java.util.Date;
import java.util.List;
@@ -28,7 +30,7 @@
import javax.persistence.TypedQuery;
import org.apache.commons.lang.StringUtils;
-import org.apache.openmeetings.OpenmeetingsVariables;
+import org.apache.openmeetings.data.IDataProviderDao;
import org.apache.openmeetings.persistence.beans.room.Room;
import org.apache.openmeetings.persistence.beans.user.PrivateMessage;
import org.apache.openmeetings.persistence.beans.user.User;
@@ -37,9 +39,8 @@
import org.springframework.transaction.annotation.Transactional;
@Transactional
-public class PrivateMessagesDao {
-
- private static final Logger log = Red5LoggerFactory.getLogger(PrivateMessagesDao.class, OpenmeetingsVariables.webAppRootKey);
+public class PrivateMessagesDao implements IDataProviderDao<PrivateMessage> {
+ private static final Logger log = Red5LoggerFactory.getLogger(PrivateMessagesDao.class, webAppRootKey);
@PersistenceContext
private EntityManager em;
@@ -87,18 +88,13 @@
return null;
}
- public List<PrivateMessage> getPrivateMessages() {
- try {
- TypedQuery<PrivateMessage> query = em.createNamedQuery("getPrivateMessages", PrivateMessage.class);
- return query.getResultList();
- } catch (Exception e) {
- log.error("[getPrivateMessages]",e);
- }
- return null;
+ public List<PrivateMessage> get(int first, int count) {
+ return em.createNamedQuery("getPrivateMessages", PrivateMessage.class)
+ .setFirstResult(first).setMaxResults(count)
+ .getResultList();
}
- public PrivateMessage getPrivateMessagesById(Long privateMessageId) {
- try {
+ public PrivateMessage get(long privateMessageId) {
TypedQuery<PrivateMessage> query = em.createNamedQuery("getPrivateMessagesById", PrivateMessage.class);
query.setParameter("privateMessageId", privateMessageId);
PrivateMessage privateMessage = null;
@@ -107,26 +103,17 @@
} catch (NoResultException ex) {
}
return privateMessage;
- } catch (Exception e) {
- log.error("[countPrivateMessagesByUser]",e);
}
- return null;
- }
-
- public void updatePrivateMessages(PrivateMessage privateMessage) {
- try {
+ public PrivateMessage update(PrivateMessage privateMessage, Long userId) {
if (privateMessage.getPrivateMessageFolderId() == null) {
em.persist(privateMessage);
} else {
if (!em.contains(privateMessage)) {
- em.merge(privateMessage);
- }
+ privateMessage = em.merge(privateMessage);
}
-
- } catch (Exception e) {
- log.error("[updatePrivateMessages]",e);
}
+ return privateMessage;
}
public Long countPrivateMessagesByUser(Long toUserId, String search, Long privateMessageFolderId) {
@@ -165,18 +152,13 @@
return null;
}
- public Long getNumberMessages(Long toUserId, Long privateMessageFolderId, boolean isRead) {
- try {
+ public long count(Long toUserId, Long folderId, Boolean isRead, boolean isTrash) {
TypedQuery<Long> query = em.createNamedQuery("getNumberMessages", Long.class);
query.setParameter("toUserId", toUserId);
- query.setParameter("isTrash", false);
- query.setParameter("isRead", false);
- query.setParameter("privateMessageFolderId", privateMessageFolderId);
+ query.setParameter("isTrash", isTrash);
+ query.setParameter("isRead", isRead);
+ query.setParameter("folderId", folderId);
return query.getSingleResult();
- } catch (Exception e) {
- log.error("[getNumberMessages]",e);
- }
- return null;
}
public List<PrivateMessage> getPrivateMessagesByUser(Long toUserId, String search,
@@ -200,6 +182,7 @@
hql += " ) ";
}
+ if (orderBy != null && orderBy.length() > 0) {
hql += "ORDER BY "+orderBy;
if (asc) {
@@ -207,6 +190,7 @@
} else {
hql += " DESC";
}
+ }
TypedQuery<PrivateMessage> query = em.createQuery(hql, PrivateMessage.class);
query.setParameter("toUserId", toUserId);
@@ -264,6 +248,7 @@
return null;
}
+ //FIXME need to be rewritten
public List<PrivateMessage> getTrashPrivateMessagesByUser(Long user_id, String search,
String orderBy, int start, Boolean asc, int max) {
try {
@@ -283,6 +268,7 @@
hql += " ) ";
}
+ if (orderBy != null && orderBy.length() > 0) {
hql += "ORDER BY "+orderBy;
if (asc) {
@@ -290,6 +276,7 @@
} else {
hql += " DESC";
}
+ }
TypedQuery<PrivateMessage> query = em.createQuery(hql, PrivateMessage.class);
if (search.length() != 0) {
@@ -340,6 +327,7 @@
return null;
}
+ //FIXME need to be rewritten
public List<PrivateMessage> getSendPrivateMessagesByUser(Long toUserId, String search,
String orderBy, int start, Boolean asc, Long privateMessageFolderId, int max) {
try {
@@ -361,6 +349,7 @@
hql += " ) ";
}
+ if (orderBy != null && orderBy.length() > 0) {
hql += "ORDER BY "+orderBy;
if (asc) {
@@ -368,7 +357,7 @@
} else {
hql += " DESC";
}
-
+ }
TypedQuery<PrivateMessage> query = em.createQuery(hql, PrivateMessage.class);
query.setParameter("toUserId", toUserId);
query.setParameter("privateMessageFolderId", privateMessageFolderId);
@@ -422,6 +411,7 @@
return null;
}
+ //FIXME need to be rewritten
public List<PrivateMessage> getFolderPrivateMessagesByUser(Long toUserId, String search, String orderBy,
int start, Boolean asc, Long privateMessageFolderId, int max) {
try {
@@ -442,6 +432,7 @@
hql += " ) ";
}
+ if (orderBy != null && orderBy.length() > 0) {
hql += "ORDER BY "+orderBy;
if (asc) {
@@ -449,6 +440,7 @@
} else {
hql += " DESC";
}
+ }
log.debug("HQL "+hql);
@@ -569,4 +561,23 @@
return null;
}
+ public List<PrivateMessage> get(String search, int start, int count, String order) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public long count() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public long count(String search) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public void delete(PrivateMessage entity, Long userId) {
+ // TODO Auto-generated method stub
+
+ }
}
Index: src/org/apache/openmeetings/data/user/dao/SalutationDao.java
===================================================================
--- src/org/apache/openmeetings/data/user/dao/SalutationDao.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/user/dao/SalutationDao.java (.../trunk/singlewebapp) (revision 1490226)
@@ -23,10 +23,6 @@
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-import javax.persistence.TypedQuery;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Root;
import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.FieldManager;
@@ -58,6 +54,8 @@
* Adds a new Salutation to the table Titles
*
* @param titelname
+ * @param fieldvalues_id
+ * @return
*/
public Long addUserSalutation(String titelname, long fieldvalues_id) {
try {
@@ -76,29 +74,32 @@
}
/**
+ * get a Salutation by given id
+ *
+ * @param id
+ * @param language_id
+ * @return
+ */
+ public Salutation get(long id, long language_id) {
+ List<Salutation> ll = em.createNamedQuery("getSalutationById", Salutation.class)
+ .setParameter("id", id).getResultList();
+ for (Salutation ti : ll) {
+ ti.setLabel(fieldManager.getFieldByIdAndLanguage(ti.getFieldvalues_id(), language_id));
+ }
+ return ll.get(0);
+ }
+
+ /**
* get a list of all availible Salutations
*
- * @param user_level
+ * @param language_id
* @return
*/
public List<Salutation> getUserSalutations(long language_id) {
- try {
- CriteriaBuilder cb = em.getCriteriaBuilder();
- CriteriaQuery<Salutation> cq = cb.createQuery(Salutation.class);
- Root<Salutation> from = cq.from(Salutation.class);
- CriteriaQuery<Salutation> select = cq.select(from);
- TypedQuery<Salutation> q = em.createQuery(select);
- List<Salutation> ll = q.getResultList();
+ List<Salutation> ll = em.createNamedQuery("getSalutations", Salutation.class).getResultList();
for (Salutation ti : ll) {
- ti.setLabel(fieldManager.getFieldByIdAndLanguage(
- ti.getFieldvalues_id(), language_id));
+ ti.setLabel(fieldManager.getFieldByIdAndLanguage(ti.getFieldvalues_id(), language_id));
}
-
return ll;
- } catch (Exception ex2) {
- log.error("[addUserSalutation]", ex2);
- }
- return null;
}
-
}
Index: src/org/apache/openmeetings/data/user/UserManager.java
===================================================================
--- src/org/apache/openmeetings/data/user/UserManager.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/data/user/UserManager.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,11 @@
*/
package org.apache.openmeetings.data.user;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.FRONTEND_REGISTER_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.LOGIN_MIN_LENGTH_KEY;
+
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
@@ -37,7 +42,6 @@
import javax.persistence.criteria.Root;
import org.apache.commons.lang.StringUtils;
-import org.apache.openmeetings.OpenmeetingsVariables;
import org.apache.openmeetings.data.basic.AuthLevelUtil;
import org.apache.openmeetings.data.basic.FieldManager;
import org.apache.openmeetings.data.basic.SessiondataDao;
@@ -77,9 +81,7 @@
*/
@Transactional
public class UserManager {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- UserManager.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(UserManager.class, webAppRootKey);
@PersistenceContext
private EntityManager em;
@@ -151,7 +153,7 @@
return sresult;
}
} catch (Exception ex2) {
- log.error("[getUsersList] ", ex2);
+ log.error("[getUsersList] " + ex2);
}
return null;
}
@@ -192,6 +194,7 @@
} catch (Exception ex2) {
log.error("[getAllUserByRange] ", ex2);
+ ex2.printStackTrace();
}
return null;
}
@@ -443,7 +446,7 @@
boolean checkName = true;
if (!login.equals(us.getLogin())) {
- checkName = usersDao.checkUserLogin(login);
+ checkName = usersDao.checkUserLogin(login, user_id);
}
boolean checkEmail = true;
@@ -452,7 +455,7 @@
// Its a new one - check, whether another user already uses
// that one...
- checkEmail = emailManagement.checkUserEMail(email);
+ checkEmail = usersDao.checkUserEMail(email, user_id);
}
if (checkName && checkEmail) {
@@ -745,7 +748,7 @@
try {
// Checks if FrontEndUsers can register
if ("1".equals(configurationDao.getConfValue(
- "allow_frontend_register", String.class, "0"))) {
+ FRONTEND_REGISTER_KEY, String.class, "0"))) {
// TODO: Read and generate SIP-Data via RPC-Interface Issue 1098
@@ -867,7 +870,7 @@
if (authLevelUtil.checkModLevel(user_level)) {
Integer userLoginMinimumLength = configurationDao.getConfValue(
- "user.login.minimum.length", Integer.class, "4");
+ LOGIN_MIN_LENGTH_KEY, Integer.class, "4");
if (userLoginMinimumLength == null) {
throw new Exception(
"user.login.minimum.length problem");
@@ -876,8 +879,8 @@
// Check for required data
if (login.length() >= userLoginMinimumLength.intValue()) {
// Check for duplicates
- boolean checkName = usersDao.checkUserLogin(login);
- boolean checkEmail = emailManagement.checkUserEMail(email);
+ boolean checkName = usersDao.checkUserLogin(login, null);
+ boolean checkEmail = usersDao.checkUserEMail(email, null);
if (checkName && checkEmail) {
String hash = cryptManager
@@ -1179,8 +1182,7 @@
String email = values.get("email").toString();
if (!email.equals(savedUser.getAdresses().getEmail())) {
- boolean checkEmail = emailManagement
- .checkUserEMail(email);
+ boolean checkEmail = usersDao.checkUserEMail(email, user_id);
if (!checkEmail) {
// mail already used by another user!
returnLong = new Long(-11);
@@ -1292,7 +1294,7 @@
String email = us.getAdresses().getEmail();
- Long default_lang_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
+ Long default_lang_id = configurationDao.getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
String template = resetPasswordTemplate.getResetPasswordTemplate(
reset_link, default_lang_id);
@@ -1608,342 +1610,60 @@
return null;
}
- public List<User> searchUserProfile(String searchTxt, String userOffers,
- String userSearchs, String orderBy, int start, int max, boolean asc) {
- try {
-
- String hql = "select c from User c "
- + "where c.deleted = false ";
-
- if (searchTxt.length() != 0 && userOffers.length() != 0
- && userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")"
- + "AND" + "(" + "lower(c.userOffers) LIKE :userOffers "
- + ")" + "AND" + "("
- + "lower(c.userSearchs) LIKE :userSearchs " + ")" + ")";
-
- } else if (searchTxt.length() != 0 && userOffers.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")"
- + "AND" + "(" + "lower(c.userOffers) LIKE :userOffers "
- + ")" + ")";
-
- } else if (searchTxt.length() != 0 && userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")"
- + "AND" + "("
- + "lower(c.userSearchs) LIKE :userSearchs " + ")" + ")";
-
- } else if (userOffers.length() != 0 && userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "("
- + "lower(c.userOffers) LIKE :userOffers " + ")" + "AND"
- + "(" + "lower(c.userSearchs) LIKE :userSearchs " + ")"
- + ")";
-
- } else if (searchTxt.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")" + ")";
-
- } else if (userOffers.length() != 0) {
-
- hql += "AND " + "(" + "("
- + "lower(c.userOffers) LIKE :userOffers " + ")" + ")";
-
- } else if (userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "("
- + "lower(c.userSearchs) LIKE :userSearchs " + ")" + ")";
-
- }
-
- hql += " ORDER BY " + orderBy;
-
- if (asc) {
- hql += " ASC";
- } else {
- hql += " DESC";
- }
-
- if (searchTxt.length() != 0) {
- searchTxt = "%" + searchTxt + "%";
+ private StringBuilder getUserProfileQuery(boolean count, String text, String offers, String search) {
+ StringBuilder sb = new StringBuilder("SELECT ");
+ sb.append(count ? "COUNT(" : "").append("u").append(count ? ") " : " ")
+ .append("FROM User u WHERE u.deleted = false ");
+ if (offers != null && offers.length() != 0) {
+ sb.append("AND (LOWER(u.userOffers) LIKE :userOffers) ");
}
-
- if (userOffers.length() != 0) {
- userOffers = "%" + userOffers + "%";
+ if (search != null && search.length() != 0) {
+ sb.append("AND (LOWER(u.userSearchs) LIKE :userSearchs) ");
}
-
- if (userSearchs.length() != 0) {
- userSearchs = "%" + userSearchs + "%";
- }
-
- log.debug("hql :: " + hql);
-
- // get all users
- TypedQuery<User> query = em.createQuery(hql, User.class);
-
- if (searchTxt.length() != 0 && userOffers.length() != 0
- && userSearchs.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- } else if (searchTxt.length() != 0 && userOffers.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
-
- } else if (searchTxt.length() != 0 && userSearchs.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- } else if (userOffers.length() != 0 && userSearchs.length() != 0) {
-
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- } else if (searchTxt.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
-
- } else if (userOffers.length() != 0) {
-
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
-
- } else if (userSearchs.length() != 0) {
-
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- }
-
- query.setMaxResults(max);
- query.setFirstResult(start);
-
- List<User> userList = query.getResultList();
-
- return userList;
-
- } catch (Exception ex2) {
- log.error("[getUsersList] ", ex2);
- }
-
- return null;
+ if (text != null && text.length() != 0) {
+ sb.append("AND (LOWER(u.login) LIKE :search ")
+ .append("OR LOWER(u.firstname) LIKE :search ")
+ .append("OR LOWER(u.lastname) LIKE :search ")
+ .append("OR LOWER(u.adresses.email) LIKE :search ")
+ .append("OR LOWER(u.adresses.town) LIKE :search " + ") ");
}
-
- public Long searchCountUserProfile(String searchTxt, String userOffers,
- String userSearchs) {
- try {
-
- String hql = "select count(c.user_id) from User c "
- + "where c.deleted = false ";
-
- if (searchTxt.length() != 0 && userOffers.length() != 0
- && userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")"
- + "AND" + "(" + "lower(c.userOffers) LIKE :userOffers "
- + ")" + "AND" + "("
- + "lower(c.userSearchs) LIKE :userSearchs " + ")" + ")";
-
- } else if (searchTxt.length() != 0 && userOffers.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search) "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")"
- + "AND" + "(" + "lower(c.userOffers) LIKE :userOffers "
- + ")" + ")";
-
- } else if (searchTxt.length() != 0 && userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")"
- + "AND" + "("
- + "lower(c.userSearchs) LIKE :userSearchs " + ")" + ")";
-
- } else if (userOffers.length() != 0 && userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "("
- + "lower(c.userOffers) LIKE :userOffers " + ")" + "AND"
- + "(" + "lower(c.userSearchs) LIKE :userSearchs " + ")"
- + ")";
-
- } else if (searchTxt.length() != 0) {
-
- hql += "AND " + "(" + "(" + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")" + ")";
-
- } else if (userOffers.length() != 0) {
-
- hql += "AND " + "(" + "("
- + "lower(c.userOffers) LIKE :userOffers " + ")" + ")";
-
- } else if (userSearchs.length() != 0) {
-
- hql += "AND " + "(" + "("
- + "lower(c.userSearchs) LIKE :userSearchs " + ")" + ")";
-
+ return sb;
}
- if (searchTxt.length() != 0) {
- searchTxt = "%" + searchTxt + "%";
- }
+ public List<User> searchUserProfile(String text, String offers, String search, String orderBy, int start, int max, boolean asc) {
+ StringBuilder sb = getUserProfileQuery(false, text, offers, search);
+ sb.append(" ORDER BY ").append(orderBy).append(asc ? " ASC" : " DESC");
- if (userOffers.length() != 0) {
- userOffers = "%" + userOffers + "%";
- }
+ log.debug("hql :: " + sb.toString());
+ TypedQuery<User> query = em.createQuery(sb.toString(), User.class);
- if (userSearchs.length() != 0) {
- userSearchs = "%" + userSearchs + "%";
+ if (text != null && text.length() != 0) {
+ query.setParameter("search", StringUtils.lowerCase("%" + text + "%"));
}
-
- log.debug("hql :: " + hql);
-
- // get all users
- TypedQuery<Long> query = em.createQuery(hql, Long.class);
-
- if (searchTxt.length() != 0 && userOffers.length() != 0
- && userSearchs.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- } else if (searchTxt.length() != 0 && userOffers.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
-
- } else if (searchTxt.length() != 0 && userSearchs.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- } else if (userOffers.length() != 0 && userSearchs.length() != 0) {
-
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- } else if (searchTxt.length() != 0) {
-
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
-
- } else if (userOffers.length() != 0) {
-
- query.setParameter("userOffers",
- StringUtils.lowerCase(userOffers));
-
- } else if (userSearchs.length() != 0) {
-
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
+ if (offers != null && offers.length() != 0) {
+ query.setParameter("userOffers", StringUtils.lowerCase("%" + offers + "%"));
}
-
- List<Long> userList = query.getResultList();
-
- return userList.get(0);
-
- } catch (Exception ex2) {
- log.error("[getUsersList] ", ex2);
+ if (search != null && search.length() != 0) {
+ query.setParameter("userSearchs", StringUtils.lowerCase("%" + search + "%"));
}
-
- return null;
+ return query.setFirstResult(start).setMaxResults(max).getResultList();
}
- public Long searchMaxUserProfile(String searchTxt, String userOffers,
- String userSearchs) {
- try {
-
- String hql = "select count(c.user_id) from User c "
- + "where c.deleted = false " + "AND " + "(" + "("
- + "lower(c.login) LIKE :search "
- + "OR lower(c.firstname) LIKE :search "
- + "OR lower(c.lastname) LIKE :search "
- + "OR lower(c.adresses.email) LIKE :search "
- + "OR lower(c.adresses.town) LIKE :search " + ")" + "OR"
- + "(" + "lower(c.userOffers) LIKE :userOffers " + ")"
- + "OR" + "(" + "lower(c.userSearchs) LIKE :userSearchs "
- + ")" + ")";
+ public Long searchCountUserProfile(String text, String offers, String search) {
+ StringBuilder sb = getUserProfileQuery(true, text, offers, search);
- if (searchTxt.length() == 0) {
- searchTxt = "%";
- } else {
- searchTxt = "%" + searchTxt + "%";
- }
+ log.debug("hql :: " + sb.toString());
+ TypedQuery<Long> query = em.createQuery(sb.toString(), Long.class);
- if (userOffers.length() == 0) {
- userOffers = "%";
- } else {
- userOffers = "%" + userOffers + "%";
+ if (text != null && text.length() != 0) {
+ query.setParameter("search", StringUtils.lowerCase("%" + text + "%"));
}
-
- if (userSearchs.length() == 0) {
- userSearchs = "%";
- } else {
- userSearchs = "%" + userSearchs + "%";
+ if (offers != null && offers.length() != 0) {
+ query.setParameter("userOffers", StringUtils.lowerCase("%" + offers + "%"));
}
-
- // get all users
- TypedQuery<Long> query = em.createQuery(hql, Long.class);
- query.setParameter("search", StringUtils.lowerCase(searchTxt));
- query.setParameter("userOffers", StringUtils.lowerCase(userOffers));
- query.setParameter("userSearchs",
- StringUtils.lowerCase(userSearchs));
-
- List<Long> ll = query.getResultList();
-
- return ll.get(0);
-
- } catch (Exception ex2) {
- log.error("[searchMaxUserProfile] " + ex2);
+ if (search != null && search.length() != 0) {
+ query.setParameter("userSearchs", StringUtils.lowerCase("%" + search + "%"));
}
-
- return null;
+ return query.getSingleResult();
}
-
}
Index: src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java
===================================================================
--- src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components;
-
-import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-
-public abstract class ConfirmableAjaxLink extends AjaxLink<Void> {
- private static final long serialVersionUID = 7301747891668537168L;
- private long confirmId;
-
- public ConfirmableAjaxLink(String id, long confirmId) {
- super(id);
- this.confirmId = confirmId;
- }
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.getAjaxCallListeners().add(new ConfirmCallListener(confirmId, "hideBusyIndicator();"));
- }
-}
Index: src/org/apache/openmeetings/web/components/MenuPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/MenuPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/MenuPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,253 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components;
-
-import org.apache.openmeetings.data.basic.NaviBuilder;
-import org.apache.openmeetings.persistence.beans.basic.Naviglobal;
-import org.apache.openmeetings.persistence.beans.basic.Navimain;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.backup.BackupPanel;
-import org.apache.openmeetings.web.components.admin.configurations.ConfigsPanel;
-import org.apache.openmeetings.web.components.admin.groups.GroupsPanel;
-import org.apache.openmeetings.web.components.admin.labels.LangPanel;
-import org.apache.openmeetings.web.components.admin.ldaps.LdapsPanel;
-import org.apache.openmeetings.web.components.admin.rooms.RoomsPanel;
-import org.apache.openmeetings.web.components.admin.servers.ServersPanel;
-import org.apache.openmeetings.web.components.admin.users.UsersPanel;
-import org.apache.openmeetings.web.components.user.calendar.CalendarPanel;
-import org.apache.openmeetings.web.components.user.rooms.UserRoomsPanel;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.behavior.Behavior;
-import org.apache.wicket.core.util.string.JavaScriptUtils;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.list.ListView;
-
-/**
- * Loads the menu items into the main area
- *
- * @author sebawagner
- *
- */
-public class MenuPanel extends BasePanel {
- private static final long serialVersionUID = 6626039612808753514L;
-
- private enum MenuActions {
- dashboardModuleStartScreen
- , dashboardModuleCalendar
- , recordModule
- , conferenceModuleRoomList
- , eventModuleRoomList
- , moderatorModuleUser
- , moderatorModuleRoom
- , adminModuleUser
- , adminModuleConnections
- , adminModuleOrg
- , adminModuleRoom
- , adminModuleConfiguration
- , adminModuleLanguages
- , adminModuleLDAP
- , adminModuleBackup
- , adminModuleServers
- }
-
- public enum MenuParams {
- publicTabButton
- , privateTabButton
- , myTabButton
- }
-
- public MenuPanel(String id, final MarkupContainer contents) {
- super(id);
- setMarkupId(id);
-
- final NaviBuilder man = Application.getBean(NaviBuilder.class);
- add(new ListView<Naviglobal>("mainItem", man.getMainMenu(WebSession.getUserLevel(), WebSession.getUserId(), WebSession.getLanguage())) {
- private static final long serialVersionUID = 2173926553418745231L;
-
- @Override
- protected void populateItem(ListItem<Naviglobal> item) {
- Naviglobal gl = item.getModelObject();
- item.add(new Label("label", gl.getLabel().getValue()).setRenderBodyOnly(true));
-
- item.add(new ListView<Navimain>("childItem", gl.getMainnavi()) {
- private static final long serialVersionUID = 3609635268338379087L;
-
- @Override
- protected void populateItem(ListItem<Navimain> item) {
- Navimain m = item.getModelObject();
- final String name = m.getLabel().getValue();
- final String desc = m.getTooltip().getValue();
- final MenuActions action = MenuActions.valueOf(m.getAction());
- final MenuParams params = m.getParams() != null ? MenuParams.valueOf(m.getParams()) : MenuParams.publicTabButton;
- final String hash = getHash(action, params);
- item.add(new AjaxLink<Void>("link") {
- private static final long serialVersionUID = 5632618935550133709L;
- {
- add(new Label("name", name));
- add(new Label("description", desc));
- }
-
- public void onClick(AjaxRequestTarget target) {
-
- BasePanel basePanel = null;
-
- switch(action) {
- case dashboardModuleStartScreen:
- break;
- case dashboardModuleCalendar:
- basePanel = new CalendarPanel("child");
- break;
- case recordModule:
- break;
- case conferenceModuleRoomList:
- basePanel = new UserRoomsPanel("child", params);
- break;
- case eventModuleRoomList:
- break;
- case moderatorModuleUser:
- break;
- case moderatorModuleRoom:
- break;
- case adminModuleUser:
- basePanel = new UsersPanel("child");
- break;
- case adminModuleConnections:
- break;
- case adminModuleOrg:
- basePanel = new GroupsPanel("child");
- break;
- case adminModuleRoom:
- basePanel = new RoomsPanel("child");
- break;
- case adminModuleConfiguration:
- basePanel = new ConfigsPanel("child");
- break;
- case adminModuleLanguages:
- basePanel = new LangPanel("child");
- break;
- case adminModuleLDAP:
- basePanel = new LdapsPanel("child");
- break;
- case adminModuleBackup:
- basePanel = new BackupPanel("child");
- break;
- case adminModuleServers:
- basePanel = new ServersPanel("child");
- break;
- }
-
- if (basePanel != null) {
- target.add(contents.replace(basePanel));
- basePanel.onMenuPanelLoad(target);
- }
-
- target.appendJavaScript("location.hash = '" + JavaScriptUtils.escapeQuotes(hash) + "';");
- };
- }.add(AttributeModifier.replace("href", hash)));
- }
- }.setReuseItems(true));
- }
- }.setReuseItems(true));
-
- add(new Behavior() {
- private static final long serialVersionUID = 9067610794087880297L;
-
- @Override
- public void renderHead(Component component, IHeaderResponse response) {
- String area = WebSession.get().getArea();
- if (area != null) { //hash passed from signin
- response.render(OnDomReadyHeaderItem.forScript("$(\"a[href='" + JavaScriptUtils.escapeQuotes(area) + "']\").click();"));
- WebSession.get().setArea(null);
- } else {
- response.render(OnDomReadyHeaderItem.forScript("$(\"a[href='\" + location.hash + \"']\").click();"));
- }
- super.renderHead(component, response);
- }
- });
- }
-
- private String getHash(MenuActions action, MenuParams params) {
- String hash = "#";
- switch(action) {
- case dashboardModuleStartScreen:
- break;
- case dashboardModuleCalendar:
- hash = "#calendar";
- break;
- case recordModule:
- break;
- case conferenceModuleRoomList:
- String zone = "public";
- switch (params) {
- case myTabButton:
- zone = "my";
- break;
- case privateTabButton:
- zone = "group";
- break;
- case publicTabButton:
- default:
- break;
- }
- hash = "#rooms/" + zone;
- break;
- case eventModuleRoomList:
- break;
- case moderatorModuleUser:
- break;
- case moderatorModuleRoom:
- break;
- case adminModuleUser:
- hash = "#admin/users";
- break;
- case adminModuleConnections:
- break;
- case adminModuleOrg:
- hash = "#admin/groups";
- break;
- case adminModuleRoom:
- hash = "#admin/rooms";
- break;
- case adminModuleConfiguration:
- hash = "#admin/configs";
- break;
- case adminModuleLanguages:
- hash = "#admin/lang";
- break;
- case adminModuleLDAP:
- hash = "#admin/ldaps";
- break;
- case adminModuleBackup:
- hash = "#admin/backup";
- break;
- case adminModuleServers:
- hash = "#admin/servers";
- break;
- }
- return hash;
- }
-}
Index: src/org/apache/openmeetings/web/components/MenuPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/MenuPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/MenuPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <link media="screen" type="text/css" rel="stylesheet" href="css/jquery.ui.menubar.css"/>
- </wicket:head>
- <wicket:panel>
- <script type="text/javascript" src="js/jquery.ui.menubar.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#jMenu").menubar({
- autoExpand: true
- , menuIcon: true
- , buttons: true
- , position: {
- within: $("#menu").add(window).first()
- }
- //, select: select
- });
- });
- </script>
- <ul id="jMenu">
- <li wicket:id="mainItem">
- <a class="fNiv" href="#" onclick="return false;"><span wicket:id="label"></span></a>
- <ul wicket:enclosure="childItem">
- <li wicket:id="childItem">
- <a wicket:id="link" href="#">
- <span class="menuName" wicket:id="name"></span><br />
- <span class="menuDesc" wicket:id="description"></span>
- </a>
- </li>
- </ul>
- </li>
- </ul>
- </wicket:panel>
-</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/components/HeaderPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/HeaderPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/HeaderPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components;
-
-import org.apache.wicket.markup.html.basic.Label;
-
-public class HeaderPanel extends BasePanel {
- private static final long serialVersionUID = 9020842845946685193L;
-
- public HeaderPanel(String id, String appName) {
- super(id);
- add(new Label("appName", appName));
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/AdminBaseForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/AdminBaseForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/AdminBaseForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin;
-
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.model.IModel;
-
-/**
- * provides basic functionality to insert, update, remove, refresh record in
- * admin section
- *
- * @author swagner
- *
- * @param <T>
- */
-public class AdminBaseForm<T> extends Form<T> {
- private static final long serialVersionUID = 1L;
- private AdminBaseFormPanel<T> basePanel;
-
- public AdminBaseForm(String id, IModel<T> object) {
- super(id, object);
- basePanel = new AdminBaseFormPanel<T>("buttons", this) {
- private static final long serialVersionUID = -5833647470067891270L;
-
- @Override
- protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onSaveSubmit(target, form);
- }
-
- @Override
- protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onSaveError(target, form);
- }
-
- @Override
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onNewSubmit(target, form);
- }
-
- @Override
- protected void onNewError(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onNewError(target, form);
- }
-
- @Override
- protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onRefreshSubmit(target, form);
- }
-
- @Override
- protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onRefreshError(target, form);
- }
-
- @Override
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onDeleteSubmit(target, form);
- }
-
- @Override
- protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
- AdminBaseForm.this.onDeleteError(target, form);
- }
-
- };
- add(basePanel);
-
-
- }
-
- /**
- * @see AdminBaseForm#hideNewRecord()
- */
- public void hideNewRecord() {
- basePanel.hideNewRecord();
- }
-
- /**
- * @see AdminBaseForm#showNewRecord()
- */
- public void showNewRecord() {
- basePanel.showNewRecord();
- }
-
- /**
- * invoked when user press save button
- *
- * @param target
- * @param form
- */
- protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- }
-
- /**
- * invoked when save has error
- *
- * @param target
- * @param form
- */
- protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
- }
-
- /**
- * invoked when new button is pressed
- *
- * @param target
- * @param form
- */
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
- }
-
- /**
- * invoked if new has error
- *
- * @param target
- * @param form
- */
- protected void onNewError(AjaxRequestTarget target, Form<?> form) {
- }
-
- /**
- * invoked when refresh button is pressed
- *
- * @param target
- * @param form
- */
- protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
- }
-
- /**
- * invoked when refresh has error
- *
- * @param target
- * @param form
- */
- protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
- }
-
- /**
- * invoked when delete button is pressed
- *
- * @param target
- * @param form
- */
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- }
-
- /**
- * invoked when delete has error
- *
- * @param target
- * @param form
- */
- protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
- }
-
-}
Index: src/org/apache/openmeetings/web/components/admin/AdminPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/AdminPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/AdminPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin;
-
-import org.apache.openmeetings.web.components.BasePanel;
-import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
-
-@AuthorizeInstantiation("ADMIN")
-public abstract class AdminPanel extends BasePanel {
- private static final long serialVersionUID = 6811243474361803279L;
-
- public AdminPanel(String id) {
- super(id);
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/servers/ServersPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/servers/ServersPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/servers/ServersPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.servers;
-
-import org.apache.openmeetings.data.basic.dao.ServerDao;
-import org.apache.openmeetings.persistence.beans.basic.Server;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.DataViewContainer;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.openmeetings.web.data.OrderByBorder;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.Item;
-
-/**
- * Form component with list and form to manipulate {@link Server}
- *
- * @author swagner
- *
- */
-public class ServersPanel extends AdminPanel {
- private static final long serialVersionUID = -2197334608577346569L;
- private ServerForm form;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("omServerPanelInit();");
- }
-
- @SuppressWarnings("unchecked")
- public ServersPanel(String id) {
- super(id);
- SearchableDataView<Server> dataView = new SearchableDataView<Server>("serverList",
- new SearchableDataProvider<Server>(ServerDao.class)) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(final Item<Server> item) {
- final Server Server = item.getModelObject();
- item.add(new Label("id", "" + Server.getId()));
- item.add(new Label("name", "" + Server.getName()));
- item.add(new Label("address", "" + Server.getAddress()));
- item.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = -8069413566800571061L;
-
- protected void onEvent(AjaxRequestTarget target) {
- form.setModelObject(Server);
- form.hideNewRecord();
- target.add(form);
- target.appendJavaScript("omServerPanelInit();");
- }
- });
- item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
- }
- };
-
- final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
- add(listContainer.add(dataView).setOutputMarkupId(true));
- DataViewContainer<Server> container = new DataViewContainer<Server>(listContainer, dataView);
- container.setLinks(new OrderByBorder<Server>("orderById", "id", container)
- , new OrderByBorder<Server>("orderByName", "name", container)
- , new OrderByBorder<Server>("orderByAddress", "address", container));
- add(container.orderLinks);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = 5097048616003411362L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- target.add(listContainer);
- }
- });
-
- form = new ServerForm("form", listContainer, new Server());
- form.showNewRecord();
- add(form);
-
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/servers/ServerForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/servers/ServerForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/servers/ServerForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.servers;
-
-import org.apache.openmeetings.data.basic.dao.ServerDao;
-import org.apache.openmeetings.persistence.beans.basic.Server;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminBaseForm;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
-import org.apache.wicket.datetime.markup.html.basic.DateLabel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.CheckBox;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.util.time.Duration;
-
-/**
- * Form component to insert/update/delete {@link Server}
- *
- * @author swagner
- *
- */
-public class ServerForm extends AdminBaseForm<Server> {
-
- private final WebMarkupContainer listContainer;
- private static final long serialVersionUID = 1L;
-
- public ServerForm(String id, WebMarkupContainer listContainer,
- final Server server) {
- super(id, new CompoundPropertyModel<Server>(server));
- setOutputMarkupId(true);
- this.listContainer = listContainer;
-
- add(new RequiredTextField<String>("name"));
- add(new CheckBox("active"));
- add(new RequiredTextField<String>("address"));
- add(new TextField<Integer>("port"));
- add(new TextField<String>("user"));
- add(new TextField<String>("pass"));
- add(new TextField<String>("webapp"));
- add(new TextField<String>("protocol"));
- add(DateLabel.forDatePattern("lastPing", "dd.MM.yyyy HH:mm:ss"));
- //add(new Label("pingRunning"));
- add(DateLabel.forDatePattern("inserted", "dd.MM.yyyy HH:mm:ss"));
- add(new Label("insertedby.login"));
- add(DateLabel.forDatePattern("updated", "dd.MM.yyyy HH:mm:ss"));
- add(new Label("updatedby.login"));
- add(new TextArea<String>("comment"));
-
- // attach an ajax validation behavior to all form component's keydown
- // event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown",
- Duration.ONE_SECOND);
- }
-
- @Override
- protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(ServerDao.class).update(getModelObject(),
- WebSession.getUserId());
- Server server = Application.getBean(ServerDao.class).get(
- getModelObject().getId());
- setModelObject(server);
- hideNewRecord();
- target.add(this);
- target.add(listContainer);
- target.appendJavaScript("omServerPanelInit();");
- }
-
- @Override
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
- Server s = new Server();
- s.setWebapp("openmeetings");
- s.setProtocol("http");
- setModelObject(s);
- target.add(this);
- target.appendJavaScript("omServerPanelInit();");
- }
-
- @Override
- protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
- Server server = getModelObject();
- if (server.getId() <= 0) {
- server = Application.getBean(ServerDao.class).get(
- server.getId());
- } else {
- server = new Server();
- }
- setModelObject(server);
- target.add(this);
- target.appendJavaScript("omServerPanelInit();");
- }
-
- @Override
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(ServerDao.class).delete(getModelObject(),
- WebSession.getUserId());
- this.setModelObject(new Server());
- target.add(listContainer);
- target.add(this);
- target.appendJavaScript("omServerPanelInit();");
- }
-
-}
Index: src/org/apache/openmeetings/web/components/admin/servers/ServersPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/servers/ServersPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/servers/ServersPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- function omServerPanelInit() {
- var documentHeight = $(document).height();
- $('#adminForm').height(documentHeight-114);
- $('#adminTable').height(documentHeight-144);
- }
- </script>
- </wicket:head>
- <wicket:panel>
- <div class="adminPanel">
- <div class="adminPanelColumnTable">
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable">
- <thead>
- <tr>
- <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="188" /></th>
- <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="1500" /></th>
- <th class="three_column_layout_column3"><span wicket:id="orderByAddress"></span><wicket:ommessage key="1501" /></th>
- </tr>
- </thead>
- </table>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="listContainer">
- <tr wicket:id="serverList">
- <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="id"></span></div></td>
- <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
- <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="address"></span></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="adminPanelColumnForm">
- <form wicket:id="form" class="adminForm">
- <div wicket:id="buttons"></div>
- <div class="scrollcontent" id="adminForm">
- <fieldset>
- <legend><wicket:ommessage key="1502" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="1500" /></label><input type="text" wicket:id="name"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1525" /></label><input type="checkbox" class="formcheckbox" wicket:id="active" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1501" /></label><input type="text" wicket:id="address"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1519" /></label><input type="text" wicket:id="port"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1520" /></label><input type="text" wicket:id="user"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1521" /></label><input type="text" wicket:id="pass"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1522" /></label><input type="text" wicket:id="webapp"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1523" /></label><input type="text" wicket:id="protocol"/>
- </div>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1518" /></span>
- <br/>
- <label><wicket:ommessage key="1517" /></label><span wicket:id="lastPing"/>
- <!-- br/>
- <label><wicket:ommessage key="1524" /></label><span wicket:id="pingRunning"/-->
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1110" /></label><span wicket:id="inserted"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1111" /></label><span wicket:id="insertedby.login"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1112" /></label><span wicket:id="updated"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1113" /></label><span wicket:id="updatedby.login"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="270" /></label><textarea wicket:id="comment"/>
- </div>
- </fieldset>
- </div>
- </form>
- </div>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div class="formSaveBar">
- <div class="formSaveButton">
- <input type="submit" value="" wicket:id="ajax-save-button" wicket:ommessage="title:144" />
- </div>
- <div class="formNewButton">
- <input type="submit" value="" wicket:id="ajax-new-button" wicket:ommessage="title:155" />
- </div>
- <div class="formRefreshButton">
- <input type="submit" value="" wicket:id="ajax-refresh-button" wicket:ommessage="title:156" />
- </div>
- <div class="formCancelButton">
- <input type="submit" value="" wicket:id="ajax-cancel-button" wicket:ommessage="title:157" />
- </div>
- <span wicket:id="newRecord"></span>
- </div>
- <div wicket:id="feedback" class="adminFormsFeedbackPanel">[[ feedback ]]</div>
- <wicket:child />
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.configurations;
-
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.persistence.beans.basic.Configuration;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.DataViewContainer;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.openmeetings.web.data.OrderByBorder;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.Item;
-
-/**
- * add/update/delete {@link Configuration}
- *
- * @author swagner
- *
- */
-public class ConfigsPanel extends AdminPanel {
-
- private static final long serialVersionUID = -1L;
- private ConfigForm form;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("omConfigPanelInit();");
- }
-
- @SuppressWarnings("unchecked")
- public ConfigsPanel(String id) {
- super(id);
-
- SearchableDataView<Configuration> dataView = new SearchableDataView<Configuration>("configList"
- , new SearchableDataProvider<Configuration>(ConfigurationDao.class)) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(final Item<Configuration> item) {
- final Configuration configuration = item.getModelObject();
- item.add(new Label("configuration_id", "" + configuration.getConfiguration_id()));
- item.add(new Label("conf_key", "" + configuration.getConf_key()));
- item.add(new Label("conf_value", "" + configuration.getConf_value()));
- item.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = -8069413566800571061L;
-
- protected void onEvent(AjaxRequestTarget target) {
- form.hideNewRecord();
- form.setModelObject(configuration);
- target.add(form);
- target.appendJavaScript("omConfigPanelInit();");
- }
- });
- item.add(AttributeModifier.replace("class", "clickable "
- + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
- }
- };
- final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
- add(listContainer.add(dataView).setOutputMarkupId(true));
- DataViewContainer<Configuration> container = new DataViewContainer<Configuration>(listContainer, dataView);
- container.setLinks(new OrderByBorder<Configuration>("orderById", "configuration_id", container)
- , new OrderByBorder<Configuration>("orderByKey", "conf_key", container)
- , new OrderByBorder<Configuration>("orderByValue", "conf_value", container));
- add(container.orderLinks);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = 5097048616003411362L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- target.add(listContainer);
- }
- });
-
- form = new ConfigForm("form", listContainer, new Configuration());
- form.showNewRecord();
- add(form);
-
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/configurations/ConfigForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.configurations;
-
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.persistence.beans.basic.Configuration;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminBaseForm;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
-import org.apache.wicket.datetime.markup.html.basic.DateLabel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.util.time.Duration;
-
-/**
- * Handle {@link Configuration} items as list and form
- *
- * @author swagner
- *
- */
-public class ConfigForm extends AdminBaseForm<Configuration> {
-
- private static final long serialVersionUID = 1L;
- private final WebMarkupContainer listContainer;
-
- 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_value"));
- add(DateLabel.forDatePattern("updatetime", "dd.MM.yyyy HH:mm:ss"));
- add(new Label("user.login"));
- add(new TextArea<String>("comment"));
-
- // attach an ajax validation behavior to all form component's keydown
- // event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown",
- Duration.ONE_SECOND);
-
- }
-
- @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);
- hideNewRecord();
- target.add(this);
- target.add(listContainer);
- target.appendJavaScript("omConfigPanelInit();");
- }
-
- @Override
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
- this.setModelObject(new Configuration());
- target.add(this);
- target.appendJavaScript("omConfigPanelInit();");
- }
-
- @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());
- } else {
- conf = new Configuration();
- }
- this.setModelObject(conf);
- target.add(this);
- target.appendJavaScript("omConfigPanelInit();");
- }
-
- @Override
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(ConfigurationDao.class).delete(this.getModelObject(), WebSession.getUserId());
- this.setModelObject(new Configuration());
- target.add(listContainer);
- target.add(this);
- target.appendJavaScript("omConfigPanelInit();");
- }
-
-}
Index: src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- function omConfigPanelInit() {
- var documentHeight = $(document).height();
- $('#adminForm').height(documentHeight-114);
- $('#adminTable').height(documentHeight-144);
- }
- </script>
- </wicket:head>
- <wicket:panel>
- <div class="adminPanel">
- <div class="adminPanelColumnTable">
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable">
- <thead>
- <tr>
- <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="264" /></th>
- <th class="three_column_layout_column2"><span wicket:id="orderByKey"></span><wicket:ommessage key="265" /></th>
- <th class="three_column_layout_column3"><span wicket:id="orderByValue"></span><wicket:ommessage key="598" /></th>
- </tr>
- </thead>
- </table>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="listContainer" >
- <tr wicket:id="configList">
- <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="configuration_id"></span></div></td>
- <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="conf_key"></span></div></td>
- <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="conf_value"></span></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="adminPanelColumnForm">
- <form wicket:id="form" class="adminForm">
- <div wicket:id="buttons"></div>
- <div class="scrollcontent" id="adminForm">
- <fieldset>
- <legend><wicket:ommessage key="266" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="267" /></label><input type="text" wicket:id="conf_key"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="271" /></label><input type="text" wicket:id="conf_value"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="268" /></label><span wicket:id="updatetime"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="269" /></label><span wicket:id="user.login"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="270" /></label><textarea wicket:id="comment"/>
- </div>
- </fieldset>
- </div>
- </form>
- </div>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/AdminPagingNavigator.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/AdminPagingNavigator.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/AdminPagingNavigator.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <a wicket:id="first" class="first"></a>
- <a wicket:id="prev" class="prev"></a>
- <span wicket:id="navigation" class="goto">
- <a wicket:id="pageLink" href="#"><span wicket:id="pageNumber">5</span></a>
- </span>
- <a wicket:id="next" class="next"></a>
- <a wicket:id="last" class="last"></a>
- </wicket:panel>
-</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/components/admin/PagedEntityListPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/PagedEntityListPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/PagedEntityListPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <form wicket:id="pagingForm" class="pagedEntityListPanel">
- <select wicket:id="entitiesPerPage"></select>
- <span wicket:id="navigator">[dataview navigator]</span>
- </form>
- <form wicket:id="searchForm" class="searchForm">
- <input type="text" wicket:id="searchText" wicket:ommessage="title:714"/>
- <input type="submit" wicket:id="search" wicket:ommessage="value:715"/>
- </form>
- </wicket:panel>
-</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/components/admin/SearchableDataView.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/SearchableDataView.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/SearchableDataView.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin;
-
-import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.wicket.markup.repeater.data.DataView;
-
-/**
- * Provides {@link SearchableDataProvider}
- *
- * @author swagner
- *
- * @param <T>
- */
-public abstract class SearchableDataView<T extends IDataProviderEntity> extends DataView<T> {
- private static final long serialVersionUID = -6251644410385789409L;
- private SearchableDataProvider<T> dp;
-
- public SearchableDataView(String id, SearchableDataProvider<T> dp) {
- super(id, dp);
- this.dp = dp;
- }
-
- @Override
- public SearchableDataProvider<T> getDataProvider() {
- return dp;
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.rooms;
-
-import org.apache.openmeetings.data.conference.dao.RoomDao;
-import org.apache.openmeetings.persistence.beans.room.Room;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.DataViewContainer;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.openmeetings.web.data.OrderByBorder;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.Item;
-
-public class RoomsPanel extends AdminPanel {
-
- private static final long serialVersionUID = -1L;
- private RoomForm form;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("omRoomPanelInit();");
- }
-
- @SuppressWarnings("unchecked")
- public RoomsPanel(String id) {
- super(id);
- SearchableDataView<Room> dataView = new SearchableDataView<Room>("roomList", new SearchableDataProvider<Room>(RoomDao.class)) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(final Item<Room> item) {
- final Room room = item.getModelObject();
- item.add(new Label("rooms_id", "" + room.getRooms_id()));
- item.add(new Label("name", "" + room.getName()));
- item.add(new Label("ispublic", ""+room.getIspublic()));
- item.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = -8069413566800571061L;
-
- protected void onEvent(AjaxRequestTarget target) {
- form.setModelObject(room);
- form.hideNewRecord();
- target.add(form);
- target.appendJavaScript("omRoomPanelInit();");
- }
- });
- item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
- }
- };
-
- final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
- add(listContainer.add(dataView).setOutputMarkupId(true));
- DataViewContainer<Room> container = new DataViewContainer<Room>(listContainer, dataView);
- container.setLinks(new OrderByBorder<Room>("orderById", "rooms_id", container)
- , new OrderByBorder<Room>("orderByName", "name", container)
- , new OrderByBorder<Room>("orderByPublic", "ispublic", container));
- add(container.orderLinks);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = -1L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- target.add(listContainer);
- }
- });
-
- form = new RoomForm("form", new Room());
- form.showNewRecord();
- add(form);
-
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/rooms/RoomForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/rooms/RoomForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/rooms/RoomForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.rooms;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.openmeetings.data.conference.RoomManager;
-import org.apache.openmeetings.data.user.OrganisationManager;
-import org.apache.openmeetings.persistence.beans.domain.Organisation;
-import org.apache.openmeetings.persistence.beans.room.RoomType;
-import org.apache.openmeetings.persistence.beans.room.Room;
-import org.apache.openmeetings.persistence.beans.room.RoomOrganisation;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminBaseForm;
-import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
-import org.apache.wicket.markup.html.form.CheckBox;
-import org.apache.wicket.markup.html.form.ChoiceRenderer;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.IChoiceRenderer;
-import org.apache.wicket.markup.html.form.ListMultipleChoice;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.util.time.Duration;
-
-import edu.emory.mathcs.backport.java.util.Arrays;
-
-public class RoomForm extends AdminBaseForm<Room> {
-
- private static final long serialVersionUID = 1L;
-
- Object[] array = { 2L, 4L, 6L, 8L, 10L, 12L, 14L, 16L, 20L, 25L, 32L, 50L,
- 100L, 150L, 200L, 500L, 1000L };
- @SuppressWarnings("unchecked")
- List<Long> DROPDOWN_NUMBER_OF_PARTICIPANTS = Arrays.asList(array);
-
- public RoomForm(String id, final Room room) {
- super(id, new CompoundPropertyModel<Room>(room));
- setOutputMarkupId(true);
- RequiredTextField<String> name = new RequiredTextField<String>("name");
- name.setLabel(new Model<String>(WebSession.getString(193)));
- add(name);
-
- add(new DropDownChoice<Long>("numberOfPartizipants", //
- DROPDOWN_NUMBER_OF_PARTICIPANTS, //
- new IChoiceRenderer<Long>() {
- private static final long serialVersionUID = 1L;
- public Object getDisplayValue(Long id) {
- return id;
- }
- public String getIdValue(Long id, int index) {
- return "" + id;
- }
- }));
-
- add(new DropDownChoice<RoomType>("roomtype", Application.getBean(
- RoomManager.class).getAllRoomTypes(),
- new ChoiceRenderer<RoomType>("name", "roomtypes_id")));
-
- add(new TextArea<String>("comment"));
-
- add(new CheckBox("appointment"));
- add(new CheckBox("ispublic"));
-
- List<Organisation> orgList = Application.getBean(
- OrganisationManager.class).getOrganisations(3L);
- List<RoomOrganisation> orgRooms = new ArrayList<RoomOrganisation>(
- orgList.size());
- for (Organisation org : orgList) {
- orgRooms.add(new RoomOrganisation(org));
- }
- ListMultipleChoice<RoomOrganisation> orgChoiceList = new ListMultipleChoice<RoomOrganisation>(
- "roomOrganisations", orgRooms,
- new ChoiceRenderer<RoomOrganisation>("organisation.name",
- "organisation.organisation_id"));
- orgChoiceList.setMaxRows(6);
- add(orgChoiceList);
-
- add(new CheckBox("isDemoRoom"));
- TextField<Integer> demoTime = new TextField<Integer>("demoTime");
- demoTime.setLabel(new Model<String>(WebSession.getString(637)));
- add(demoTime);
- add(new CheckBox("allowUserQuestions"));
- add(new CheckBox("isAudioOnly"));
- add(new CheckBox("isClosed"));
- add(new TextField<String>("redirectURL"));
- add(new CheckBox("waitForRecording"));
- add(new CheckBox("allowRecording"));
-
- add(new CheckBox("hideTopBar"));
- add(new CheckBox("hideChat"));
- add(new CheckBox("hideActivitiesAndActions"));
- add(new CheckBox("hideFilesExplorer"));
- add(new CheckBox("hideActionsMenu"));
- add(new CheckBox("hideScreenSharing"));
- add(new CheckBox("hideWhiteboard"));
- add(new CheckBox("showMicrophoneStatus"));
- add(new CheckBox("chatModerated"));
- add(new CheckBox("chatOpened"));
- add(new CheckBox("filesOpened"));
- add(new CheckBox("autoVideoSelect"));
-
- // FIXME: Room user moderator list
-
- add(new CheckBox("isModeratedRoom"));
-
-
- // attach an ajax validation behavior to all form component's keydown
- // event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown",
- Duration.ONE_SECOND);
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- function omRoomPanelInit() {
- var documentHeight = $(document).height();
- $('#adminForm').height(documentHeight-114);
- $('#adminTable').height(documentHeight-144);
- }
- </script>
- </wicket:head>
- <wicket:panel>
- <div class="adminPanel">
- <div class="adminPanelColumnTable">
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable">
- <thead>
- <tr>
- <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="188" /></th>
- <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="189" /></th>
- <th class="three_column_layout_column3"><span wicket:id="orderByPublic"></span><wicket:ommessage key="190" /></th>
- </tr>
- </thead>
- </table>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="listContainer">
- <tr wicket:id="roomList">
- <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="rooms_id"></span></div></td>
- <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
- <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="ispublic"></span></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="adminPanelColumnForm">
- <form wicket:id="form" class="adminForm">
- <div wicket:id="buttons"></div>
- <div class="scrollcontent" id="adminForm">
-
- <!-- General -->
- <fieldset>
- <legend><wicket:ommessage key="187" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="193" /></label><input type="text" wicket:id="name" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="482" /></label><select wicket:id="numberOfPartizipants"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="194" /></label><select wicket:id="roomtype"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="196" /></label><textarea style="width: 200px; height: 100px;" wicket:id="comment"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="620" /></label><input type="checkbox" class="formcheckbox" wicket:id="appointment" />
- </div>
- </fieldset>
-
- <!-- Organisations -->
- <fieldset>
- <legend><wicket:ommessage key="191" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="195" /></label><input type="checkbox" class="formcheckbox" wicket:id="ispublic" />
- </div>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="828" /></span>
- <br/>
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="191" /></span>
- <br/>
- <label><wicket:ommessage key="191" /></label><select wicket:id="roomOrganisations" style="height: 80px"/>
- </div>
- </fieldset>
-
- <!-- Limitations -->
- <fieldset>
- <legend><wicket:ommessage key="830" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="636" /></label><input type="checkbox" class="formcheckbox" wicket:id="isDemoRoom" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="637" /></label><input type="text" wicket:id="demoTime" />
- </div>
- </fieldset>
-
- <!-- Rights -->
- <fieldset>
- <legend><wicket:ommessage key="881" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="879" /></label><input type="checkbox" class="formcheckbox" wicket:id="allowUserQuestions" />
- </div>
- <div class="formelement">
- <wicket:ommessage key="880" />
- <br/>
- <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="isAudioOnly" />
- </div>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1077" /></span>
- <br/>
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1101" /></span>
- <br/>
- <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="isClosed" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1100" /></label><input type="text" wicket:id="redirectURL" />
- </div>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1102" /></span>
- <br/>
- <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="waitForRecording" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="allowRecording" />
- </div>
- </fieldset>
-
- <!-- Room Layout options -->
- <fieldset>
- <legend><wicket:ommessage key="1443" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="1357" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideTopBar" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1436" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideChat" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1437" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideActivitiesAndActions" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1438" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideFilesExplorer" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1439" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideActionsMenu" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1440" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideScreenSharing" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1441" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideWhiteboard" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1442" /></label><input type="checkbox" class="formcheckbox" wicket:id="showMicrophoneStatus" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1513" /></label><input type="checkbox" class="formcheckbox" wicket:id="chatModerated" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1515" /></label><input type="checkbox" class="formcheckbox" wicket:id="chatOpened" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1516" /></label><input type="checkbox" class="formcheckbox" wicket:id="filesOpened" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1526" /></label><input type="checkbox" class="formcheckbox" wicket:id="autoVideoSelect" />
- </div>
- <div class="formelement">
- <!--
- FIXME: add user moderator list
- <wicket:ommessage key="587" /> <select wicket:id="moderators"/>
- <br/>
- -->
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="823" /></span>
- <br/>
- <label><wicket:ommessage key="640" /></label><input type="checkbox" class="formcheckbox" wicket:id="isModeratedRoom" />
- </div>
- <div class="formelement">
- <wicket:ommessage key="816" />
- </div>
- </fieldset>
- </div>
- </form>
- </div>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/users/UsersPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/users/UsersPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/users/UsersPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.users;
-
-import org.apache.openmeetings.data.user.dao.UsersDao;
-import org.apache.openmeetings.persistence.beans.user.User;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.DataViewContainer;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.openmeetings.web.data.OrderByBorder;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.Item;
-
-public class UsersPanel extends AdminPanel {
-
- private static final long serialVersionUID = -4463107742579790120L;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("omUserPanelInit();");
- }
-
- private UserForm form;
-
- @SuppressWarnings("unchecked")
- public UsersPanel(String id) {
- super(id);
-
- final SearchableDataView<User> dataView = new SearchableDataView<User>("userList"
- , new SearchableDataProvider<User>(UsersDao.class)) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(Item<User> item) {
- final User u = item.getModelObject();
- item.add(new Label("userId", "" + u.getUser_id()));
- item.add(new Label("login", u.getLogin()));
- item.add(new Label("firstName", u.getFirstname()));
- item.add(new Label("lastName", u.getLastname()));
- item.add(AttributeModifier.append("class", "clickable "
- + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
- item.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = -8069413566800571061L;
-
- protected void onEvent(AjaxRequestTarget target) {
- form.setModelObject(u);
- form.hideNewRecord();
- target.add(form);
- //re-initialize height
- target.appendJavaScript("omUserPanelInit();");
- }
- });
- }
- };
- final WebMarkupContainer listContainer = new WebMarkupContainer(
- "listContainer");
- add(listContainer.add(dataView).setOutputMarkupId(true));
- DataViewContainer<User> container = new DataViewContainer<User>(listContainer, dataView);
- container.setLinks(new OrderByBorder<User>("orderById", "user_id", container)
- , new OrderByBorder<User>("orderByLogin", "login", container)
- , new OrderByBorder<User>("orderByFirstName", "firstname", container)
- , new OrderByBorder<User>("orderByLastName", "lastname", container));
- add(container.orderLinks);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = 5097048616003411362L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- target.add(listContainer);
- }
- });
-
- UsersDao usersDaoImpl = Application.getBean(UsersDao.class);
- form = new UserForm("form", listContainer,
- usersDaoImpl.getNewUserInstance(usersDaoImpl.get(WebSession
- .getUserId())));
- form.showNewRecord();
- add(form);
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/users/UserForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/users/UserForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/users/UserForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,428 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.users;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.openmeetings.data.basic.FieldLanguageDao;
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.data.basic.dao.OmTimeZoneDao;
-import org.apache.openmeetings.data.user.OrganisationManager;
-import org.apache.openmeetings.data.user.dao.SalutationDao;
-import org.apache.openmeetings.data.user.dao.StateDao;
-import org.apache.openmeetings.data.user.dao.UsersDao;
-import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
-import org.apache.openmeetings.persistence.beans.domain.Organisation;
-import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
-import org.apache.openmeetings.persistence.beans.user.Salutation;
-import org.apache.openmeetings.persistence.beans.user.State;
-import org.apache.openmeetings.persistence.beans.user.User;
-import org.apache.openmeetings.utils.crypt.ManageCryptStyle;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminBaseForm;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
-import org.apache.wicket.datetime.markup.html.basic.DateLabel;
-import org.apache.wicket.extensions.markup.html.form.DateTextField;
-import org.apache.wicket.extensions.yui.calendar.DatePicker;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.CheckBox;
-import org.apache.wicket.markup.html.form.ChoiceRenderer;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.IChoiceRenderer;
-import org.apache.wicket.markup.html.form.ListMultipleChoice;
-import org.apache.wicket.markup.html.form.PasswordTextField;
-import org.apache.wicket.markup.html.form.RadioChoice;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.util.time.Duration;
-import org.apache.wicket.validation.validator.EmailAddressValidator;
-import org.apache.wicket.validation.validator.StringValidator;
-
-/**
- * CRUD operations in form for {@link User}
- *
- * @author swagner
- *
- */
-public class UserForm extends AdminBaseForm<User> {
-
- private static final long serialVersionUID = 1L;
-
- private WebMarkupContainer listContainer;
-
- private User user;
-
- private final List<Salutation> saluationList = Application.getBean(
- SalutationDao.class).getUserSalutations(
- WebSession.getLanguage());
- private final List<FieldLanguage> languageList = Application.getBean(
- FieldLanguageDao.class).getLanguages();
-
- private PasswordTextField passwordField;
-
- /**
- * Get id list of {@link Salutation}
- *
- * @return
- */
- private List<Long> getSalutationsIds() {
- ArrayList<Long> saluationIdList = new ArrayList<Long>(
- saluationList.size());
- for (Salutation saluation : saluationList) {
- saluationIdList.add(saluation.getSalutations_id());
- }
- return saluationIdList;
- }
-
- /**
- * Get a name for a given id of {@link Salutation}
- *
- * @param id
- * @return
- */
- private String getSaluationLabelById(Long id) {
- for (Salutation saluation : saluationList) {
- if (id.equals(saluation.getSalutations_id())) {
- return saluation.getLabel().getValue();
- }
- }
- throw new RuntimeException("Could not find Salutations for id " + id);
- }
-
- /**
- * Id list of {@link FieldLanguage}
- *
- * @return
- */
- private List<Long> getFieldLanguageIds() {
- ArrayList<Long> languageIdList = new ArrayList<Long>(
- languageList.size());
- for (FieldLanguage language : languageList) {
- languageIdList.add(language.getLanguage_id());
- }
- return languageIdList;
- }
-
- /**
- * Get name of {@link FieldLanguage} by its id
- *
- * @param id
- * @return
- */
- private String getFieldLanguageLabelById(Long id) {
- for (FieldLanguage language : languageList) {
- if (id.equals(language.getLanguage_id())) {
- return language.getName();
- }
- }
- throw new RuntimeException("Could not find FieldLanguage for id " + id);
- }
-
- public UserForm(String id, WebMarkupContainer listContainer,
- final User user) {
- super(id, new CompoundPropertyModel<User>(user));
- setOutputMarkupId(true);
- this.listContainer = listContainer;
- this.user = user;
-
- // Add form fields
- addFormFields();
-
- // attach an ajax validation behavior to all form component's keydown
- // event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown",
- Duration.ONE_SECOND);
-
- }
-
- @Override
- protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- User u = getModelObject();
- // TODO: Why the password field is not set via the Model is because its
- // FetchType is Lazy, this extra hook here might be not needed with a
- // different mechanism to protect the password from being read
- // sebawagner, 01.10.2012
- try {
- String pass = passwordField.getConvertedInput();
- if (pass != null&& !pass.isEmpty()) {
- u.updatePassword(
- Application.getBean(ManageCryptStyle.class)
- , Application.getBean(ConfigurationDao.class)
- , passwordField.getConvertedInput());
- }
- Application.getBean(UsersDao.class).update(u, WebSession.getUserId());
- } catch (Exception e) {
- //FIXME update feedback with the error details
- }
- setModelObject(u);
- hideNewRecord();
- target.add(this);
- target.add(listContainer);
- target.appendJavaScript("omUserPanelInit();");
- }
-
- @Override
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
- UsersDao usersDaoImpl = Application.getBean(UsersDao.class);
- setModelObject(usersDaoImpl.getNewUserInstance(usersDaoImpl
- .get(WebSession.getUserId())));
- target.add(this);
- target.appendJavaScript("omUserPanelInit();");
- }
-
- @Override
- protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
- User user = getModelObject();
- if (user.getUser_id() <= 0) {
- user = Application.getBean(UsersDao.class).get(
- user.getUser_id());
- } else {
- user = new User();
- }
- setModelObject(user);
- target.add(this);
- target.appendJavaScript("omUserPanelInit();");
- }
-
- @Override
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- UsersDao usersDaoImpl = Application.getBean(UsersDao.class);
- usersDaoImpl.delete(this.getModelObject(),
- WebSession.getUserId());
- this.setModelObject(usersDaoImpl.getNewUserInstance(usersDaoImpl
- .get(WebSession.getUserId())));
- target.add(listContainer);
- target.add(this);
- target.appendJavaScript("omUserPanelInit();");
- }
-
- /**
- * Add the fields to the form
- */
- private void addFormFields() {
-
- RequiredTextField<String> login = new RequiredTextField<String>("login");
- login.add(new StringValidator(4, null));
- // login.setLabel(new Model<String>("testname"));
- add(login);
-
- passwordField = new PasswordTextField("password");
- add(passwordField);
- passwordField.setRequired(false);
-
- add(new DropDownChoice<Long>("salutations_id", getSalutationsIds(),
- new IChoiceRenderer<Long>() {
- private static final long serialVersionUID = 1L;
-
- public Object getDisplayValue(Long id) {
- return getSaluationLabelById(id);
- }
-
- public String getIdValue(Long id, int index) {
- return "" + id;
- }
-
- }));
-
- add(new TextField<String>("firstname"));
- add(new TextField<String>("lastname"));
-
- add(new DropDownChoice<OmTimeZone>("omTimeZone", Application.getBean(
- OmTimeZoneDao.class).getOmTimeZones(),
- new ChoiceRenderer<OmTimeZone>("frontEndLabel", "jname")));
-
- add(new DropDownChoice<Long>("language_id", getFieldLanguageIds(),
- new IChoiceRenderer<Long>() {
- private static final long serialVersionUID = 1L;
-
- public Object getDisplayValue(Long id) {
- return getFieldLanguageLabelById(id);
- }
-
- public String getIdValue(Long id, int index) {
- return "" + id;
- }
-
- }));
-
- add(DateLabel.forDatePattern("starttime", "dd.MM.yyyy HH:mm:ss"));
- add(DateLabel.forDatePattern("updatetime", "dd.MM.yyyy HH:mm:ss"));
-
- add(new CheckBox("forceTimeZoneCheck"));
- RequiredTextField<String> email = new RequiredTextField<String>(
- "adresses.email");
- // email.setLabel(new Model<String>("testemail"));
- email.add(EmailAddressValidator.getInstance());
- add(email);
- add(new TextField<String>("adresses.phone"));
- add(new CheckBox("sendSMS"));
- DateTextField age = new DateTextField("age");
- DatePicker datePicker = new DatePicker() {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected String getAdditionalJavaScript() {
- return "${calendar}.cfg.setProperty(\"navigator\",true,false); ${calendar}.render();";
- }
- };
- datePicker.setShowOnFieldClick(true);
- datePicker.setAutoHide(true);
- age.add(datePicker);
- add(age);
- add(new TextField<String>("adresses.street"));
- add(new TextField<String>("adresses.additionalname"));
- add(new TextField<String>("adresses.zip"));
- add(new TextField<String>("adresses.town"));
- add(new DropDownChoice<State>("adresses.states", Application.getBean(
- StateDao.class).getStates(), new ChoiceRenderer<State>(
- "name", "state_id")));
-
- final String field159 = WebSession.getString(159);
- final String field160 = WebSession.getString(160);
-
- add(new DropDownChoice<Integer>("status", Arrays.asList(0, 1),
- new IChoiceRenderer<Integer>() {
-
- private static final long serialVersionUID = 1L;
-
- public Object getDisplayValue(Integer id) {
- if (id.equals(0)) {
- return field159;
- } else if (id.equals(1)) {
- return field160;
- }
- return null;
- }
-
- public String getIdValue(Integer id, int index) {
- return "" + id;
- }
-
- }));
-
- final String field166 = WebSession.getString(166);
- final String field167 = WebSession.getString(167);
- final String field168 = WebSession.getString(168);
- final String field1311 = WebSession.getString(1311);
-
- add(new DropDownChoice<Long>("level_id", Arrays.asList(1L, 2L, 3L, 4L),
- new IChoiceRenderer<Long>() {
-
- private static final long serialVersionUID = 1L;
-
- public Object getDisplayValue(Long id) {
- if (id.equals(1L)) {
- return field166;
- } else if (id.equals(2L)) {
- return field167;
- } else if (id.equals(3L)) {
- return field168;
- } else if (id.equals(4L)) {
- return field1311;
- }
- return null;
- }
-
- public String getIdValue(Long id, int index) {
- return "" + id;
- }
-
- }));
-
- add(new TextArea<String>("adresses.comment"));
-
- List<Organisation> orgList = Application.getBean(
- OrganisationManager.class).getOrganisations(3L);
- List<Organisation_Users> orgUsers = new ArrayList<Organisation_Users>(
- orgList.size());
- for (Organisation org : orgList) {
- orgUsers.add(new Organisation_Users(org));
- }
- ListMultipleChoice<Organisation_Users> orgChoiceList = new ListMultipleChoice<Organisation_Users>(
- "organisation_users", orgUsers,
- new ChoiceRenderer<Organisation_Users>("organisation.name",
- "organisation.organisation_id"));
- add(orgChoiceList);
-
- final String field1160 = WebSession.getString(1160); // 1160 everybody
- final String field1168 = WebSession.getString(1168); // 1168 contact
- final String field1169 = WebSession.getString(1169); // 1169 nobody
-
- add(new RadioChoice<Long>("community_settings", new IModel<Long>() {
- private static final long serialVersionUID = 1L;
-
- public Long getObject() {
- if (user.getShowContactData() != null
- && user.getShowContactData()) {
- return 1L;
- } else if (user.getShowContactDataToContacts() != null
- && user.getShowContactDataToContacts()) {
- return 2L;
- }
- return 3L;
- }
-
- public void setObject(Long choice) {
- if (choice.equals(1L)) {
- user.setShowContactData(true);
- user.setShowContactDataToContacts(false);
- } else if (choice.equals(2L)) {
- user.setShowContactData(false);
- user.setShowContactDataToContacts(true);
- } else {
- user.setShowContactData(false);
- user.setShowContactDataToContacts(false);
- }
- }
-
- public void detach() {
- }
- }, Arrays.asList(1L, 2L, 3L), new IChoiceRenderer<Long>() {
- private static final long serialVersionUID = 1L;
-
- public Object getDisplayValue(Long id) {
- if (id.equals(1L)) {
- return field1160;
- } else if (id.equals(2L)) {
- return field1168;
- } else {
- return field1169;
- }
- }
-
- public String getIdValue(Long id, int index) {
- return "" + id;
- }
-
- }));
-
- add(new TextArea<String>("userOffers"));
- add(new TextArea<String>("userSearchs"));
- }
-
-}
Index: src/org/apache/openmeetings/web/components/admin/users/UsersPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/users/UsersPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/users/UsersPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- function omUserPanelInit() {
- var documentHeight = $(document).height();
- $('#adminForm').height(documentHeight-114);
- $('#adminTable').height(documentHeight-144);
- }
- </script>
- </wicket:head>
- <wicket:panel>
- <div class="adminPanel">
- <div class="adminPanelColumnTable">
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable">
- <thead>
- <tr>
- <th class="four_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="146" /></th>
- <th class="four_column_layout_column2"><span wicket:id="orderByLogin"></span><wicket:ommessage key="147" /></th>
- <th class="four_column_layout_column3"><span wicket:id="orderByFirstName"></span><wicket:ommessage key="148" /></th>
- <th class="four_column_layout_column4"><span wicket:id="orderByLastName"></span><wicket:ommessage key="149" /></th>
- </tr>
- </thead>
- </table>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="listContainer">
- <tr wicket:id="userList">
- <td class="four_column_layout_column1"><div class="four_column_layout_divcolumn1"><span wicket:id="userId"></span></div></td>
- <td class="four_column_layout_column2"><div class="four_column_layout_divcolumn2"><span wicket:id="login"></span></div></td>
- <td class="four_column_layout_column3"><div class="four_column_layout_divcolumn3"><span wicket:id="firstName"></span></div></td>
- <td class="four_column_layout_column4"><div class="four_column_layout_divcolumn4"><span wicket:id="lastName"></span></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="adminPanelColumnForm">
- <form wicket:id="form" class="adminForm" >
- <div wicket:id="buttons"></div>
- <div class="scrollcontent" id="adminForm">
- <fieldset>
- <legend><wicket:ommessage key="143" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="132" /></label><input type="text" wicket:id="login"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="133" /></label><input type="password" wicket:id="password"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="135" /></label><select wicket:id="salutations_id" style="width: 60px;"/><input type="text" wicket:id="firstname" style="width: 216px;"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="136" /></label><input type="text" wicket:id="lastname"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1143" /></label><select wicket:id="omTimeZone"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="111" /></label><select wicket:id="language_id"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1110" /></label><span wicket:id="starttime"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1112" /></label><span wicket:id="updatetime"/>
- </div>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1149" /></span>
- <br/>
- <label><wicket:ommessage key="1148" /></label><input class="formcheckbox" type="checkbox" wicket:id="forceTimeZoneCheck" />
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="137" /></label><input type="text" wicket:id="adresses.email"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="607" /></label><input type="text" wicket:id="adresses.phone"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1503" /></label><input class="formcheckbox" type="checkbox" wicket:id="sendSMS"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="138" /></label><input type="text" wicket:id="age" style="width: 258px;"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="139" /></label><input type="text" wicket:id="adresses.street" style="width: 244px;"/> <input type="text" wicket:id="adresses.additionalname" style="width: 30px;"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="140" /></label><input type="text" wicket:id="adresses.zip" style="width: 60px;"/> <input type="text" wicket:id="adresses.town" style="width: 214px;"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="141" /></label><select wicket:id="adresses.states"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="158" /></label><select wicket:id="status"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="169" /></label><select wicket:id="level_id"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="142" /></label><textarea wicket:id="adresses.comment"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="161" /></label><select wicket:id="organisation_users" style="height: 80px"/>
- </div>
- </fieldset>
- <fieldset>
- <legend><wicket:ommessage key="1159" /></legend>
- <div class="formelementradiobox">
- <span wicket:id="community_settings" >
- <input type="radio"/>
- <input type="radio"/>
- <input type="radio"/>
- </span>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1162" /></label><textarea wicket:id="userOffers"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1163" /></label><textarea wicket:id="userSearchs"/>
- </div>
- </fieldset>
- </div>
- </form>
- </div>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/labels/AddLanguageForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/labels/AddLanguageForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/labels/AddLanguageForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.labels;
-
-import java.util.Date;
-
-import org.apache.openmeetings.data.basic.FieldLanguageDao;
-import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
-
-/**
- *
- * @author solomax, swagner
- *
- */
-public class AddLanguageForm extends Form<Void> {
- private static final long serialVersionUID = 8743289610974962636L;
- private String newLanguageName;
- private String newLanguageISO;
-
- public AddLanguageForm(String id, final LangPanel langPanel) {
- super(id);
-
- add(new RequiredTextField<String>("name", new PropertyModel<String>(this, "newLanguageName")));
- add(new RequiredTextField<String>("iso", new PropertyModel<String>(this, "newLanguageISO")));
-
- add(new AjaxButton("add", Model.of(WebSession.getString(366L)), this) {
- private static final long serialVersionUID = -552597041751688740L;
-
- @Override
- public void onSubmit(AjaxRequestTarget target, Form<?> form) {
- FieldLanguageDao langDao = Application.getBean(FieldLanguageDao.class);
-
- FieldLanguage fl = new FieldLanguage();
- fl.setLanguage_id(langDao.getNextAvailableId());
- fl.setStarttime(new Date());
- fl.setDeleted(false);
- fl.setName(newLanguageName);
- fl.setRtl(false); //FIXME
- fl.setCode(newLanguageISO);
-
- try {
- langDao.updateLanguage(fl);
- } catch (Exception e) {
- // TODO add feedback message
- e.printStackTrace();
- }
-
- langPanel.getLangForm().updateLanguages(target);
- /* FIXME
- languages.setChoices(langDao.getLanguages());
- target.add(languages);
- */
- target.appendJavaScript("$('#addLanguage').dialog('close');");
- }
- });
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.labels;
-
-import java.util.Iterator;
-
-import org.apache.openmeetings.data.basic.FieldLanguageDao;
-import org.apache.openmeetings.data.basic.FieldValueDao;
-import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
-import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
-import org.apache.openmeetings.persistence.beans.lang.Fieldvalues;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.DataViewContainer;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.openmeetings.web.data.OrderByBorder;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.Item;
-
-/**
- * Language Editor, add/insert/update {@link Fieldlanguagesvalues} and
- * add/delete {@link FieldLanguage} contains several Forms and one list
- *
- * @author solomax, swagner
- *
- */
-public class LangPanel extends AdminPanel {
- private static final long serialVersionUID = 5904180813198016592L;
-
- FieldLanguage language;
- final WebMarkupContainer listContainer;
- private LangForm langForm;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("labelsInit();");
- }
-
- @SuppressWarnings("unchecked")
- public LangPanel(String id) {
- super(id);
- FieldLanguageDao langDao = Application
- .getBean(FieldLanguageDao.class);
- language = langDao.getFieldLanguageById(1L);
-
- Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
- flv.setLanguage_id(language.getLanguage_id());
- final LabelsForm form = new LabelsForm("form", this, flv);
- form.showNewRecord();
- add(form);
-
- final SearchableDataView<Fieldvalues> dataView = new SearchableDataView<Fieldvalues>(
- "langList"
- , new SearchableDataProvider<Fieldvalues>(FieldValueDao.class) {
- private static final long serialVersionUID = -6822789354860988626L;
-
- @Override
- public long size() {
- return search == null
- ? Application.getBean(FieldValueDao.class).count()
- : Application.getBean(FieldValueDao.class).count(language.getLanguage_id(), search);
- }
-
- public Iterator<? extends Fieldvalues> iterator(long first, long count) {
- return (search == null && getSort() == null
- ? Application.getBean(FieldValueDao.class).get(language.getLanguage_id(), (int)first, (int)count)
- : Application.getBean(FieldValueDao.class).get(language.getLanguage_id(), search, (int)first, (int)count, getSortStr())).iterator();
- }
- }) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(final Item<Fieldvalues> item) {
- final Fieldvalues fv = item.getModelObject();
- item.add(new Label("lblId", "" + fv.getFieldvalues_id()));
- item.add(new Label("name", fv.getName()));
- item.add(new Label("value", fv.getFieldlanguagesvalue() != null ? fv.getFieldlanguagesvalue().getValue() : null));
- item.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = -8069413566800571061L;
-
- protected void onEvent(AjaxRequestTarget target) {
- form.setModelObject(fv.getFieldlanguagesvalue());
- form.hideNewRecord();
- target.add(form);
- target.appendJavaScript("labelsInit();");
- }
- });
- item.add(AttributeModifier.append("class", "clickable "
- + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
- }
- };
-
- listContainer = new WebMarkupContainer("listContainer");
- add(listContainer.add(dataView).setOutputMarkupId(true));
- DataViewContainer<Fieldvalues> container = new DataViewContainer<Fieldvalues>(listContainer, dataView);
- container.setLinks(new OrderByBorder<Fieldvalues>("orderById", "fieldvalues.fieldvalues_id", container)
- , new OrderByBorder<Fieldvalues>("orderByName", "fieldvalues.name", container)
- , new OrderByBorder<Fieldvalues>("orderByValue", "value", container));
- add(container.orderLinks);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = 5097048616003411362L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- dataView.modelChanging();
- target.add(listContainer);
- }
- });
- langForm = new LangForm("langForm", listContainer, this);
- add(langForm);
- add(new AddLanguageForm("addLangForm", this));
- }
-
- public LangForm getLangForm() {
- return langForm;
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/labels/LangPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/labels/LangPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/labels/LangPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <script type="text/javascript">
- function labelsInit() {
- $('#addLanguage').dialog({
- closeOnEscape: true
- , autoOpen: false
- , resizable: false
- });
- var documentHeight = $(document).height();
- $('#adminForm').height(documentHeight-114);
- $('#adminTable').height(documentHeight-164);
- };
- </script>
- <div class="adminPanel">
- <div class="adminPanelColumnTable">
- <form wicket:id="langForm" class="addLanguagePanel">
- <div class="formNewButton" wicket:ommessage="title:362"
- onclick="$('#addLanguage :text').val(''); $('#addLanguage').dialog('open');"><input type="button" title=""/></div>
- <div wicket:id="deleteLangBtn" class="formCancelButton" wicket:ommessage="title:363"><input type="button" title=""/></div>
- <select wicket:id="language"></select>
- </form>
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable">
- <thead>
- <tr>
- <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="350" /></th>
- <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="351" /></th>
- <th class="three_column_layout_column3"><span wicket:id="orderByValue"></span><wicket:ommessage key="352" /></th>
- </tr>
- </thead>
- </table>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="listContainer" >
- <tr wicket:id="langList">
- <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="lblId"></span></div></td>
- <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
- <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="value"></span></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="adminPanelColumnForm">
- <form wicket:id="form" class="adminForm">
- <div wicket:id="buttons"></div>
- <div class="scrollcontent" id="adminForm">
- <fieldset>
- <legend><wicket:ommessage key="353" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="356" /></label><span wicket:id="fieldvalues.fieldvalues_id"></span>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="354" /></label><input type="text" wicket:id="fieldvalues.name"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="355" /></label><textarea wicket:id="value"></textarea>
- </div>
- </fieldset>
- </div>
- </form>
- </div>
- </div>
- <div id="addLanguage" wicket:ommessage="title:364" style="display: none;">
- <form wicket:id="addLangForm">
- <table>
- <tr>
- <td><wicket:ommessage key="365" /></td>
- <td><input type="text" wicket:id="name"/></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="1422" /></td>
- <td><input type="text" wicket:id="iso"/></td>
- </tr>
- <tr>
- <td align="right" colspan="2"><input type="submit" wicket:id="add"/></td>
- </tr>
- </table>
- </form>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/labels/LangForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/labels/LangForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/labels/LangForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.labels;
-
-import org.apache.openmeetings.data.basic.FieldLanguageDao;
-import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.components.ConfirmCallListener;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
-import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
-import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.ChoiceRenderer;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.util.time.Duration;
-
-/**
- * Modify the language selection, add/delete {@link FieldLanguage}
- *
- * @author swagner
- *
- */
-public class LangForm extends Form<Void> {
-
- private static final long serialVersionUID = 2837702941211636609L;
- private DropDownChoice<FieldLanguage> languages;
-
- public void updateLanguages(AjaxRequestTarget target) {
- FieldLanguageDao langDao = Application
- .getBean(FieldLanguageDao.class);
- languages.setChoices(langDao.getLanguages());
- // add(languages);
- target.add(languages);
- }
-
- /**
- * Render Main
- *
- * @param id
- * @param listContainer
- * @param language
- * @param langPanel
- */
- public LangForm(String id, final WebMarkupContainer listContainer,
- final LangPanel langPanel) {
- super(id);
- setOutputMarkupId(true);
-
- FieldLanguageDao langDao = Application
- .getBean(FieldLanguageDao.class);
-
- languages = new DropDownChoice<FieldLanguage>("language"
- , new PropertyModel<FieldLanguage>(langPanel, "language")
- , langDao.getLanguages()
- , new ChoiceRenderer<FieldLanguage>("name", "language_id"));
-
- languages.add(new AjaxFormComponentUpdatingBehavior("onchange") {
- private static final long serialVersionUID = -2055912815073387536L;
-
- @Override
- protected void onUpdate(AjaxRequestTarget target) {
- target.add(listContainer);
- }
- });
- add(languages);
-
- add(new WebMarkupContainer("deleteLangBtn").add(new AjaxEventBehavior("onclick"){
- private static final long serialVersionUID = -1650946343073068686L;
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
- }
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- langPanel.language.setDeleted(true);
- FieldLanguageDao langDao = Application.getBean(FieldLanguageDao.class);
- try {
- langDao.updateLanguage(langPanel.language);
- } catch (Exception e) {
- // TODO add feedback message
- e.printStackTrace();
- }
- languages.setChoices(langDao.getLanguages());
- target.add(languages);
- // FIXME need to force update list container
- target.add(listContainer);
- }
- }));
-
- // attach an ajax validation behavior to all form component's keydown
- // event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown",
- Duration.ONE_SECOND);
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/labels/LabelsForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/labels/LabelsForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/labels/LabelsForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.labels;
-
-import org.apache.openmeetings.data.basic.FieldLanguagesValuesDao;
-import org.apache.openmeetings.data.basic.FieldValueDao;
-import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
-import org.apache.openmeetings.persistence.beans.lang.Fieldvalues;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminBaseForm;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.CompoundPropertyModel;
-
-/**
- * Add/edit/delete {@link Fieldlanguagesvalues}
- *
- * @author swagner
- *
- */
-public class LabelsForm extends AdminBaseForm<Fieldlanguagesvalues> {
- private static final long serialVersionUID = -1309878909524329047L;
- private LangPanel panel;
-
- public LabelsForm(String id, LangPanel panel, Fieldlanguagesvalues fieldlanguagesvalues) {
- super(id, new CompoundPropertyModel<Fieldlanguagesvalues>(fieldlanguagesvalues));
- this.panel = panel;
-
- add(new Label("fieldvalues.fieldvalues_id"));
- add(new TextField<String>("fieldvalues.name"));
- add(new TextArea<String>("value"));
- }
-
- @Override
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> f) {
- Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
- flv.setLanguage_id(panel.language.getLanguage_id());
- this.setModelObject(flv);
- target.add(this);
- target.appendJavaScript("labelsInit();");
- }
-
- @Override
- protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
- Fieldlanguagesvalues flv = getModelObject();
- if (flv.getFieldlanguagesvalues_id() != null) {
- flv = Application.getBean(FieldLanguagesValuesDao.class)
- .get(getModelObject().getFieldlanguagesvalues_id());
- } else {
- flv = new Fieldlanguagesvalues();
- }
- this.setModelObject(flv);
- target.add(this);
- target.appendJavaScript("labelsInit();");
- }
-
- @Override
- protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- Fieldlanguagesvalues flv = getModelObject();
- Fieldvalues fv = flv.getFieldvalues();
- Application.getBean(FieldValueDao.class).update(fv, WebSession.getUserId());
-
- flv.setFieldvalues(fv);
- Application.getBean(FieldLanguagesValuesDao.class)
- .update(flv, WebSession.getUserId());
- hideNewRecord();
- target.add(panel.listContainer);
- target.appendJavaScript("labelsInit();");
- }
-
- @Override
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(FieldLanguagesValuesDao.class)
- .delete(getModelObject(), WebSession.getUserId());
- target.add(panel.listContainer);
- target.appendJavaScript("labelsInit();");
- }
-
-}
Index: src/org/apache/openmeetings/web/components/admin/ldaps/LdapsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/ldaps/LdapsPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/ldaps/LdapsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.ldaps;
-
-import org.apache.openmeetings.data.basic.dao.LdapConfigDao;
-import org.apache.openmeetings.persistence.beans.basic.LdapConfig;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.DataViewContainer;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.openmeetings.web.data.OrderByBorder;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.Item;
-
-/**
- * {@link AdminPanel} to list and modify {@link LdapConfig}
- *
- * @author swagner
- *
- */
-public class LdapsPanel extends AdminPanel {
- private static final long serialVersionUID = -1L;
- private LdapForm form;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("omLdapPanelInit();");
- }
-
- @SuppressWarnings("unchecked")
- public LdapsPanel(String id) {
- super(id);
- SearchableDataView<LdapConfig> dataView = new SearchableDataView<LdapConfig>("ldapList"
- , new SearchableDataProvider<LdapConfig>(LdapConfigDao.class)) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(final Item<LdapConfig> item) {
- final LdapConfig ldapConfig = item.getModelObject();
- item.add(new Label("ldapConfigId", "" + ldapConfig.getLdapConfigId()));
- item.add(new Label("name", "" + ldapConfig.getName()));
- item.add(new Label("configFileName", "" + ldapConfig.getConfigFileName()));
- item.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = -8069413566800571061L;
-
- protected void onEvent(AjaxRequestTarget target) {
- form.setModelObject(ldapConfig);
- form.hideNewRecord();
- target.add(form);
- target.appendJavaScript("omLdapPanelInit();");
- }
- });
- item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
- }
- };
- final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
- add(listContainer.add(dataView).setOutputMarkupId(true));
- DataViewContainer<LdapConfig> container = new DataViewContainer<LdapConfig>(listContainer, dataView);
- container.setLinks(new OrderByBorder<LdapConfig>("orderById", "ldapConfigId", container)
- , new OrderByBorder<LdapConfig>("orderByName", "name", container)
- , new OrderByBorder<LdapConfig>("orderByFile", "configFileName", container));
- add(container.orderLinks);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = -1L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- target.add(listContainer);
- }
- });
-
- form = new LdapForm("form", listContainer, new LdapConfig());
- form.showNewRecord();
- add(form);
-
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/ldaps/LdapForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/ldaps/LdapForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/ldaps/LdapForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.ldaps;
-
-import org.apache.openmeetings.data.basic.dao.LdapConfigDao;
-import org.apache.openmeetings.persistence.beans.basic.LdapConfig;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminBaseForm;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
-import org.apache.wicket.datetime.markup.html.basic.DateLabel;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.CheckBox;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.util.time.Duration;
-
-/**
- * Form components to insert/update/delete {@link LdapConfig}
- *
- * @author swagner
- *
- */
-public class LdapForm extends AdminBaseForm<LdapConfig> {
-
- private static final long serialVersionUID = 1L;
- private final WebMarkupContainer listContainer;
-
- public LdapForm(String id, WebMarkupContainer listContainer,
- final LdapConfig ldapConfig) {
- super(id, new CompoundPropertyModel<LdapConfig>(ldapConfig));
- setOutputMarkupId(true);
- this.listContainer = listContainer;
-
- add(new RequiredTextField<String>("name"));
- add(new CheckBox("isActive"));
- add(DateLabel.forDatePattern("inserted", "dd.MM.yyyy HH:mm:ss"));
- add(new Label("insertedby.login"));
- add(DateLabel.forDatePattern("updated", "dd.MM.yyyy HH:mm:ss"));
- add(new Label("updatedby.login"));
- add(new RequiredTextField<String>("configFileName"));
- add(new CheckBox("addDomainToUserName"));
- add(new TextField<String>("domain"));
- add(new TextArea<String>("comment"));
-
- // attach an ajax validation behavior to all form component's keydown
- // event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown",
- Duration.ONE_SECOND);
- }
-
- @Override
- protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(LdapConfigDao.class).update(getModelObject(),
- WebSession.getUserId());
- LdapConfig ldapConfig = Application.getBean(LdapConfigDao.class)
- .get(getModelObject().getLdapConfigId());
- this.setModelObject(ldapConfig);
- hideNewRecord();
- target.add(this);
- target.add(listContainer);
- target.appendJavaScript("omLdapPanelInit();");
- }
-
- @Override
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
- this.setModelObject(new LdapConfig());
- target.add(this);
- target.appendJavaScript("omLdapPanelInit();");
- }
-
- @Override
- protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
- LdapConfig ldapConfig = this.getModelObject();
- if (ldapConfig.getLdapConfigId() <= 0) {
- ldapConfig = Application.getBean(LdapConfigDao.class).get(
- ldapConfig.getLdapConfigId());
- } else {
- ldapConfig = new LdapConfig();
- }
- this.setModelObject(ldapConfig);
- target.add(this);
- target.appendJavaScript("omLdapPanelInit();");
- }
-
- @Override
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(LdapConfigDao.class).delete(
- this.getModelObject(), WebSession.getUserId());
- this.setModelObject(new LdapConfig());
- target.add(listContainer);
- target.add(this);
- target.appendJavaScript("omLdapPanelInit();");
- }
-
-}
Index: src/org/apache/openmeetings/web/components/admin/ldaps/LdapsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/ldaps/LdapsPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/ldaps/LdapsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- function omLdapPanelInit() {
- var documentHeight = $(document).height();
- $('#adminForm').height(documentHeight-114);
- $('#adminTable').height(documentHeight-144);
- }
- </script>
- </wicket:head>
- <wicket:panel>
- <div class="adminPanel">
- <div class="adminPanelColumnTable">
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable">
- <thead>
- <tr>
- <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="1104" /></th>
- <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="1105" /></th>
- <th class="three_column_layout_column3"><span wicket:id="orderByFile"></span><wicket:ommessage key="1106" /></th>
- </tr>
- </thead>
- </table>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="listContainer">
- <tr wicket:id="ldapList">
- <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="ldapConfigId"></span></div></td>
- <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
- <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="configFileName"></span></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="adminPanelColumnForm">
- <form wicket:id="form" class="adminForm">
- <div wicket:id="buttons"></div>
- <div class="scrollcontent" id="adminForm">
- <fieldset>
- <legend><wicket:ommessage key="1107" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="1108" /></label><input type="text" wicket:id="name"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1109" /></label><input type="checkbox" class="formcheckbox" wicket:id="isActive"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1110" /></label><span wicket:id="inserted"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1111" /></label><span wicket:id="insertedby.login"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1112" /></label><span wicket:id="updated"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1113" /></label><span wicket:id="updatedby.login"/>
- </div>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1114" /></span>
- <br/>
- <label><wicket:ommessage key="1115" /></label><input type="text" wicket:id="configFileName"/>
- </div>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1116" /></span>
- <br/>
- <label><wicket:ommessage key="1117" /></label><input type="checkbox" class="formcheckbox" wicket:id="addDomainToUserName"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1115" /></label><input type="text" wicket:id="domain"/>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="270" /></label><textarea wicket:id="comment"/>
- </div>
- </fieldset>
- </div>
- </form>
- </div>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/backup/BackupPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/backup/BackupPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/backup/BackupPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,204 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.backup;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.DecimalFormat;
-import java.util.Date;
-
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.servlet.outputhandler.BackupExport;
-import org.apache.openmeetings.servlet.outputhandler.BackupImportController;
-import org.apache.openmeetings.utils.ImportHelper;
-import org.apache.openmeetings.utils.OmFileHelper;
-import org.apache.openmeetings.utils.math.CalendarPatterns;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.util.AjaxDownload;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.CheckBox;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.upload.FileUpload;
-import org.apache.wicket.markup.html.form.upload.FileUploadField;
-import org.apache.wicket.markup.html.panel.FeedbackPanel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.util.lang.Bytes;
-import org.apache.wicket.util.resource.FileResourceStream;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
-/**
- * Panel component to manage Backup Import/Export
- *
- * @author swagner
- *
- */
-public class BackupPanel extends AdminPanel {
-
- private static final Logger log = Red5LoggerFactory.getLogger(
- BackupPanel.class, OpenmeetingsVariables.webAppRootKey);
-
- private static final long serialVersionUID = -1L;
-
- // Create feedback panels
- final FeedbackPanel uploadFeedback;
-
- /**
- * Form to handle upload files
- *
- * @author swagner
- *
- */
- private class BackupForm extends Form<Void> {
-
- private static final long serialVersionUID = 1L;
-
- FileUploadField fileUploadField;
- CheckBox includeFilesInBackup;
-
- public BackupForm(String id) {
- super(id);
-
- // set this form to multipart mode (allways needed for uploads!)
- setMultiPart(true);
-
- // set max upload size in form as info text
- Long maxBytes = ImportHelper.getMaxUploadSize(Application
- .getBean(ConfigurationDao.class));
- double megaBytes = maxBytes.doubleValue() / 1024 / 1024;
- DecimalFormat formatter = new DecimalFormat("#,###.00");
- add(new Label("MaxUploadSize", formatter.format(megaBytes)));
-
- // Add one file input field
- fileUploadField = new FileUploadField("fileInput");
- add(fileUploadField);
-
- includeFilesInBackup = new CheckBox("includeFilesInBackup",
- Model.of(true));
- add(includeFilesInBackup);
-
- // Set maximum size controlled by configuration
- setMaxSize(Bytes.bytes(ImportHelper.getMaxUploadSize(Application
- .getBean(ConfigurationDao.class))));
-
- // Add a component to download a file without page refresh
- final AjaxDownload download = new AjaxDownload();
- add(download);
- // add an download button
- add(new AjaxButton("download", this) {
- private static final long serialVersionUID = 839803820502260006L;
-
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
-
- File working_dir = OmFileHelper.getUploadBackupDir();
-
- String dateString = "backup_"
- + CalendarPatterns.getTimeForStreamId(new Date());
-
- File backup_dir = new File(working_dir, dateString);
- File backupFile = new File(backup_dir, dateString + ".zip");
-
- try {
- Application.getBean(BackupExport.class).performExport(
- backupFile,
- backup_dir,
- includeFilesInBackup.getConvertedInput()
- .booleanValue());
-
- download.setFileName(backupFile.getName());
- download.setResourceStream(new FileResourceStream(
- backupFile));
- download.initiate(target);
- } catch (Exception e) {
- log.error("Exception on panel backup download ", e);
- uploadFeedback.error(e);
- }
-
- // repaint the feedback panel so that it is hidden
- target.add(uploadFeedback);
- }
-
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so errors are shown
- target.add(uploadFeedback);
- }
- });
-
- // add an upload button
- add(new AjaxButton("upload", this) {
- private static final long serialVersionUID = 839803820502260006L;
-
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- FileUpload upload = fileUploadField.getFileUpload();
- try {
- if (upload == null || upload.getInputStream() == null) {
- uploadFeedback.error("File is empty");
- return;
- }
- Application.getBean(BackupImportController.class)
- .performImport(upload.getInputStream());
- } catch (IOException e) {
- log.error("IOException on panel backup upload ", e);
- uploadFeedback.error(e);
- } catch (Exception e) {
- log.error("Exception on panel backup upload ", e);
- uploadFeedback.error(e);
- }
-
- // repaint the feedback panel so that it is hidden
- target.add(uploadFeedback);
-
- }
-
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so errors are shown
- target.add(uploadFeedback);
- }
- });
-
- }
-
- }
-
- public BackupPanel(String id) {
- super(id);
-
- // Create feedback panels
- uploadFeedback = new FeedbackPanel("uploadFeedback");
- // Set Id so that it can be replaced dynamically
- uploadFeedback.setOutputMarkupId(true);
- add(uploadFeedback);
-
- BackupForm backupForm = new BackupForm("backupUpload");
-
- backupForm.add(new UploadProgressBar("progress", backupForm,
- backupForm.fileUploadField));
-
- add(backupForm);
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/backup/BackupPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/backup/BackupPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/backup/BackupPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div>
- <span wicket:id="uploadFeedback"/>
- </div>
- <!-- wicket:id="form" -->
- <form wicket:id="backupUpload" class="adminForm adminBackupForm">
- <fieldset>
- <legend><wicket:ommessage key="1066" /></legend>
- <div class="formelement">
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1065" /></span>
- </div>
- <div class="formelement">
- <label><wicket:ommessage key="1537" /></label> <input type="checkbox" wicket:id="includeFilesInBackup" />
- </div>
- <div class="formelement">
- <input class="uploadFileField" wicket:id="fileInput" type="file"/>
- </div>
- <div class="formelement">
- <span wicket:id="progress">[[upload progressbar]]</span>
- </div>
- <div class="formelement">
- <!-- Perform Download -->
- <input type="submit" wicket:ommessage="value:1536" wicket:id="upload" />
- <!-- Perform Upload -->
- <input type="submit" wicket:ommessage="value:1066" wicket:id="download" />
- </div>
- <div class="formelement">
- <!-- Max upload size -->
- <wicket:ommessage key="1491" /> <span wicket:id="MaxUploadSize" /><span>MB</span>
- </div>
- <div class="formelement">
- <!-- Backup CLI import information -->
- <div class="info-icon" /><span style="font-style: italic;"><wicket:ommessage key="1505" /></span>
- </div>
- </fieldset>
- </form>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin;
-
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.ConfirmCallListener;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.panel.FeedbackPanel;
-import org.apache.wicket.model.Model;
-
-public abstract class AdminBaseFormPanel<T> extends AdminPanel {
- private static final long serialVersionUID = 8361623159373532543L;
- private Label newRecord;
-
- public AdminBaseFormPanel(String id, final AdminBaseForm<T> form) {
- super(id);
-
- setOutputMarkupId(true);
-
- final FeedbackPanel feedback = new FeedbackPanel("feedback");
- feedback.setOutputMarkupId(true);
- add(feedback);
- newRecord = new Label("newRecord", Model.of(WebSession.getString(344L)));
- add(newRecord.setVisible(false).setOutputMarkupId(true));
-
- // add a save button that can be used to submit the form via ajax
- add(new AjaxButton("ajax-save-button", form) {
- private static final long serialVersionUID = 839803820502260006L;
-
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so that it is hidden
- target.add(feedback);
- onSaveSubmit(target, form);
- }
-
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so errors are shown
- target.add(feedback);
- onSaveError(target, form);
- }
- });
-
- // add a new button that can be used to submit the form via ajax
- add(new AjaxButton("ajax-new-button", form) {
- private static final long serialVersionUID = 839803820502260006L;
-
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so that it is hidden
- target.add(feedback);
- newRecord.setVisible(true);
- target.add(newRecord);
- onNewSubmit(target, form);
- }
-
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so errors are shown
- target.add(feedback);
- onNewError(target, form);
- }
- });
-
- // add a refresh button that can be used to submit the form via ajax
- add(new AjaxButton("ajax-refresh-button", form) {
- private static final long serialVersionUID = 839803820502260006L;
-
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so that it is hidden
- target.add(feedback);
- hideNewRecord();
- onRefreshSubmit(target, form);
- }
-
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so errors are shown
- target.add(feedback);
- hideNewRecord();
- onRefreshError(target, form);
- }
- });
-
- // add a cancel button that can be used to submit the form via ajax
- add(new AjaxButton("ajax-cancel-button", form) {
- private static final long serialVersionUID = 839803820502260006L;
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
- }
-
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so that it is hidden
- target.add(feedback);
- hideNewRecord();
- onDeleteSubmit(target, form);
- }
-
- @Override
- protected void onError(AjaxRequestTarget target, Form<?> form) {
- // repaint the feedback panel so errors are shown
- target.add(feedback);
- hideNewRecord();
- onDeleteError(target, form);
- }
- });
- }
-
- /**
- * Hide the new record text
- */
- public void hideNewRecord() {
- newRecord.setVisible(false);
- }
-
- /**
- * Hide the new record text
- */
- public void showNewRecord() {
- newRecord.setVisible(true);
- }
-
- protected abstract void onSaveSubmit(AjaxRequestTarget target, Form<?> form);
- protected abstract void onSaveError(AjaxRequestTarget target, Form<?> form);
-
- protected abstract void onNewSubmit(AjaxRequestTarget target, Form<?> form);
- protected abstract void onNewError(AjaxRequestTarget target, Form<?> form);
-
- protected abstract void onRefreshSubmit(AjaxRequestTarget target, Form<?> form);
- protected abstract void onRefreshError(AjaxRequestTarget target, Form<?> form);
-
- protected abstract void onDeleteSubmit(AjaxRequestTarget target, Form<?> form);
- protected abstract void onDeleteError(AjaxRequestTarget target, Form<?> form);
-}
Index: src/org/apache/openmeetings/web/components/admin/AdminPagingNavigator.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/AdminPagingNavigator.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/AdminPagingNavigator.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin;
-
-import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;
-import org.apache.wicket.markup.html.navigation.paging.IPageable;
-
-public class AdminPagingNavigator extends AjaxPagingNavigator {
-
- private static final long serialVersionUID = 1L;
-
- public AdminPagingNavigator(String id, IPageable pageable) {
- super(id, pageable);
- }
-
-}
Index: src/org/apache/openmeetings/web/components/admin/PagedEntityListPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/PagedEntityListPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/PagedEntityListPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.PropertyModel;
-
-public abstract class PagedEntityListPanel extends AdminPanel {
- private static final long serialVersionUID = -4280843184916302671L;
- private int entitiesPerPage = 50;
- private List<Integer> numbers = Arrays.asList(10, 25, 50, 75, 100, 200);
-
- public PagedEntityListPanel(String id, final SearchableDataView<? extends IDataProviderEntity> dataView) {
- super(id);
-
- dataView.setItemsPerPage(entitiesPerPage);
- final Form<Void> f = new Form<Void>("pagingForm");
-
- f.add(new AdminPagingNavigator("navigator", dataView).setOutputMarkupId(true))
- .add(new DropDownChoice<Integer>("entitiesPerPage", new PropertyModel<Integer>(this, "entitiesPerPage"), numbers)
- .add(new AjaxFormComponentUpdatingBehavior("onchange") {
- private static final long serialVersionUID = -7754441983330112248L;
-
- @Override
- protected void onUpdate(AjaxRequestTarget target) {
- long newPage = dataView.getCurrentPage() * dataView.getItemsPerPage() / entitiesPerPage;
- dataView.setItemsPerPage(entitiesPerPage);
- dataView.setCurrentPage(newPage);
- target.add(f);
- PagedEntityListPanel.this.onEvent(target);
- }
- }));
-
- final SearchableDataProvider<? extends IDataProviderEntity> dp = dataView.getDataProvider();
- Form<Void> searchForm = new Form<Void>("searchForm");
- add(searchForm.setOutputMarkupId(true));
- searchForm.add(new TextField<String>("searchText", new PropertyModel<String>(dp, "search")).setOutputMarkupId(true));
- searchForm.add(new AjaxButton("search", searchForm) {
- private static final long serialVersionUID = -1659023337945692814L;
-
- @Override
- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
- target.add(f);
- PagedEntityListPanel.this.onEvent(target);
- }
- });
- add(f.setOutputMarkupId(true));
- }
-
- protected abstract void onEvent(AjaxRequestTarget target);
-}
Index: src/org/apache/openmeetings/web/components/admin/groups/AddUsersForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/groups/AddUsersForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/groups/AddUsersForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.groups;
-
-import static org.apache.openmeetings.web.components.admin.groups.GroupUsersPanel.getUser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.openmeetings.data.user.dao.UsersDao;
-import org.apache.openmeetings.persistence.beans.domain.Organisation;
-import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.user.User;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.IChoiceRenderer;
-import org.apache.wicket.markup.html.form.ListMultipleChoice;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
-
-public class AddUsersForm extends Form<Void> {
- private static final long serialVersionUID = -2458265250684437277L;
- private Organisation organisation;
- private String userSearchText;
- private List<User> usersInList = new ArrayList<User>();
- private List<User> usersToAdd = new ArrayList<User>();
-
- public AddUsersForm(String id, final GroupForm groupForm) {
- super(id);
-
- IModel<List<User>> listUsersModel = new PropertyModel<List<User>>(AddUsersForm.this, "usersInList");
- IModel<List<User>> selectedUsersModel = new PropertyModel<List<User>>(AddUsersForm.this, "usersToAdd");
- final ListMultipleChoice<User> users = new ListMultipleChoice<User>("users"
- , selectedUsersModel
- , listUsersModel
- , new IChoiceRenderer<User>() {
- private static final long serialVersionUID = 1L;
-
- public Object getDisplayValue(User object) {
- return getUser(object);
- }
-
- public String getIdValue(User object, int index) {
- return "" + object.getUser_id();
- }
- });
-
- add(new TextField<String>("searchText", new PropertyModel<String>(AddUsersForm.this, "userSearchText")));
- add(new AjaxButton("search", Model.of(WebSession.getString(182L))) {
- private static final long serialVersionUID = -4752180617634945030L;
-
- protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
- clear();
- usersInList.addAll(Application.getBean(UsersDao.class).get(userSearchText));
- target.add(users);
- }
- });
- add(users.setOutputMarkupId(true));
- add(new AjaxButton("add", Model.of(WebSession.getString(175L))) {
- private static final long serialVersionUID = 5553555064487161840L;
-
- protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
- UsersDao userDao = Application.getBean(UsersDao.class);
- for (User u : usersToAdd) {
- List<Organisation_Users> orgUsers = u.getOrganisation_users();
- boolean found = false;
- for (Organisation_Users ou : orgUsers) {
- if (ou.getOrganisation().getOrganisation_id().equals(organisation.getOrganisation_id())) {
- found = true;
- break;
- }
- }
- if (!found) {
- Organisation_Users orgUser = new Organisation_Users(organisation);
- orgUser.setDeleted(false);
- orgUsers.add(orgUser);
- userDao.update(u, WebSession.getUserId());
- }
- }
- target.appendJavaScript("$('#addUsers').dialog('close');");
- groupForm.updateView(target);
- }
- });
- }
-
- public void clear() {
- usersToAdd.clear();
- usersInList.clear();
- }
-
- public void setOrganisation(Organisation org) {
- organisation = org;
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/groups/GroupUsersPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/groups/GroupUsersPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/groups/GroupUsersPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.groups;
-
-import org.apache.openmeetings.data.user.dao.OrganisationUserDao;
-import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.user.User;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.ConfirmCallListener;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.model.Model;
-
-public class GroupUsersPanel extends Panel {
- private static final long serialVersionUID = -1813488722913433227L;
- private long organisationId;
-
- public static String getUser(User u) {
- return u.getLogin() + " [" + u.getFirstname() + ", " + u.getLastname() + "]";
- }
-
- public GroupUsersPanel(String id, long orgId) {
- super(id);
- this.organisationId = orgId;
- setOutputMarkupId(true);
-
- SearchableDataView<Organisation_Users> dataView = new SearchableDataView<Organisation_Users>("userList", new SearchableDataProvider<Organisation_Users>(OrganisationUserDao.class){
- private static final long serialVersionUID = 1L;
-
- public long size() {
- return search == null
- ? Application.getBean(OrganisationUserDao.class).count(organisationId)
- : Application.getBean(OrganisationUserDao.class).count(organisationId, search);
- }
-
- public java.util.Iterator<? extends Organisation_Users> iterator(long first, long count) {
- return (search == null && getSort() == null
- ? Application.getBean(OrganisationUserDao.class).get(organisationId, (int)first, (int)count)
- : Application.getBean(OrganisationUserDao.class).get(organisationId, search, (int)first, (int)count, getSortStr())).iterator();
- }
- }) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(Item<Organisation_Users> item) {
- final Organisation_Users orgUser = item.getModelObject();
- User u = orgUser.getUser();
- if (u != null) {
- item.add(new Label("label", Model.of(getUser(u))));
- } else {
- item.add(new Label("label", Model.of("")));
- }
- item.add(new WebMarkupContainer("deleteUserBtn").add(new AjaxEventBehavior("onclick"){
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
- }
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- Application.getBean(OrganisationUserDao.class).delete(orgUser, WebSession.getUserId());
- target.add(GroupUsersPanel.this);
- }
- }));
- item.add(AttributeModifier.append("class", ((item.getIndex() % 2 == 1) ? "even" : "odd")));
- }
- };
- add(dataView).setOutputMarkupId(true);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = 5097048616003411362L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- target.add(GroupUsersPanel.this);
- }
- });
- }
-
- void update(long orgId) {
- organisationId = orgId;
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.groups;
-
-import org.apache.openmeetings.data.user.dao.OrganisationDao;
-import org.apache.openmeetings.persistence.beans.domain.Organisation;
-import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.web.components.admin.AdminPanel;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
-import org.apache.openmeetings.web.components.admin.PagedEntityListPanel;
-import org.apache.openmeetings.web.data.DataViewContainer;
-import org.apache.openmeetings.web.data.SearchableDataProvider;
-import org.apache.openmeetings.web.data.OrderByBorder;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxEventBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.repeater.Item;
-
-/**
- * Modify/ CRUD operations for {@link Organisation} and
- * {@link Organisation_Users}
- *
- * @author swag
- *
- */
-public class GroupsPanel extends AdminPanel {
- private static final long serialVersionUID = -5170400556006464830L;
- private AddUsersForm addUsersForm;
- private GroupForm form;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("groupsInit();");
- }
-
- @SuppressWarnings("unchecked")
- public GroupsPanel(String id) {
- super(id);
- final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
- final WebMarkupContainer addUsersBtn = new WebMarkupContainer("addUsersBtn");
- addUsersBtn.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = 6037994365235148885L;
-
- protected void onEvent(AjaxRequestTarget target) {
- addUsersForm.clear();
- target.add(addUsersForm);
- target.appendJavaScript("addUsers();");
- }
- });
-
- //Adding the Group Form
- form = new GroupForm("form", listContainer, new Organisation()){
- private static final long serialVersionUID = -3042797340375988889L;
-
- @Override
- protected void onModelChanged() {
- super.onModelChanged();
- boolean orgEmpty = getModelObject().getOrganisation_id() == null;
- if (orgEmpty) {
- addUsersBtn.add(AttributeModifier.replace("class", "formNewButton disabled"));
- } else {
- addUsersBtn.add(AttributeModifier.replace("class", "formNewButton"));
- }
- addUsersBtn.setEnabled(!orgEmpty);
- addUsersForm.setOrganisation(getModelObject());
- }
-
- @Override
- void updateView(AjaxRequestTarget target) {
- super.updateView(target);
- target.add(addUsersBtn);
- }
- };
- add(form.add(addUsersBtn.setOutputMarkupId(true)));
- addUsersForm = new AddUsersForm("addUsers", form);
- add(addUsersForm);
-
- //List view
- SearchableDataView<Organisation> dataView = new SearchableDataView<Organisation>("groupList", new SearchableDataProvider<Organisation>(OrganisationDao.class)) {
- private static final long serialVersionUID = 8715559628755439596L;
-
- @Override
- protected void populateItem(Item<Organisation> item) {
- final Organisation organisation = item.getModelObject();
- item.add(new Label("organisation_id", "" + organisation.getOrganisation_id()));
- item.add(new Label("name", "" + organisation.getName()));
- item.add(new AjaxEventBehavior("onclick") {
- private static final long serialVersionUID = -8069413566800571061L;
-
- protected void onEvent(AjaxRequestTarget target) {
- form.hideNewRecord();
- form.setModelObject(organisation);
- form.updateView(target);
- target.appendJavaScript("groupsInit();");
- }
- });
- item.add(AttributeModifier.append("class", "clickable " + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
- }
- };
-
- //Paging
- add(listContainer.add(dataView).setOutputMarkupId(true));
- DataViewContainer<Organisation> container = new DataViewContainer<Organisation>(listContainer, dataView);
- container.setLinks(new OrderByBorder<Organisation>("orderById", "organisation_id", container)
- , new OrderByBorder<Organisation>("orderByName", "name", container));
- add(container.orderLinks);
- add(new PagedEntityListPanel("navigator", dataView) {
- private static final long serialVersionUID = 5097048616003411362L;
-
- @Override
- protected void onEvent(AjaxRequestTarget target) {
- target.add(listContainer);
- }
- });
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/groups/GroupForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/admin/groups/GroupForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/groups/GroupForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.admin.groups;
-
-import org.apache.openmeetings.data.user.dao.OrganisationDao;
-import org.apache.openmeetings.persistence.beans.domain.Organisation;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.admin.AdminBaseForm;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.util.time.Duration;
-
-public class GroupForm extends AdminBaseForm<Organisation> {
- private static final long serialVersionUID = -1720731686053912700L;
- private GroupUsersPanel usersPanel;
- private WebMarkupContainer groupList;
-
- public GroupForm(String id, WebMarkupContainer groupList, Organisation organisation) {
- super(id, new CompoundPropertyModel<Organisation>(organisation));
- this.groupList = groupList;
- setOutputMarkupId(true);
-
- add(new RequiredTextField<String>("name"));
- usersPanel = new GroupUsersPanel("users", getOrgId());
- add(usersPanel);
-
- // attach an ajax validation behavior to all form component's keydown
- // event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown",
- Duration.ONE_SECOND);
- }
-
- void updateView(AjaxRequestTarget target) {
- usersPanel.update(getOrgId());
- target.add(this);
- target.appendJavaScript("groupsInit();");
- }
-
- private long getOrgId() {
- return getModelObject().getOrganisation_id() != null ? getModelObject().getOrganisation_id() : 0;
- }
-
- @Override
- protected void onNewSubmit(AjaxRequestTarget target, Form<?> f) {
- this.setModelObject(new Organisation());
- updateView(target);
- }
-
- @Override
- protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
- Organisation org = getModelObject();
- if (org.getOrganisation_id() != null) {
- org = Application.getBean(OrganisationDao.class).get(org.getOrganisation_id());
- } else {
- org = new Organisation();
- }
- this.setModelObject(org);
- updateView(target);
- }
-
- @Override
- protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(OrganisationDao.class).delete(getModelObject(), WebSession.getUserId());
- target.add(groupList);
- target.appendJavaScript("groupsInit();");
- }
-
- @Override
- protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
- Application.getBean(OrganisationDao.class).update(getModelObject(), WebSession.getUserId());
- hideNewRecord();
- target.add(groupList);
- target.appendJavaScript("groupsInit();");
- }
-}
Index: src/org/apache/openmeetings/web/components/admin/groups/GroupUsersPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/groups/GroupUsersPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/groups/GroupUsersPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div class="usergroupspanel">
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable" style="min-width: 400px; max-width: 400px" >
- <tr>
- <th style="width: 360px"><wicket:ommessage key="177" /></th>
- <th style="width: 34px"><wicket:ommessage key="275" /></th>
- </tr>
- </table>
- <div class="tableWrapper" style="width: 420px; height: 420px;">
- <table class="adminListTable" style="min-width: 400px; max-width: 400px">
- <tbody>
- <tr wicket:id="userList">
- <td style="width: 360px"><div style="width: 360px"><span wicket:id="label"></span></div></td>
- <td style="width: 34px"><div style="width: 34px"><div class="formCancelButton" wicket:id="deleteUserBtn" wicket:ommessage="title:274"><input/></div></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- function groupsInit() {
- $('#addUsers').dialog({
- closeOnEscape: true
- , autoOpen: false
- , resizable: false
- , width: 400
- , modal: true
- });
- var documentHeight = $(document).height();
- $('#adminForm').height(documentHeight-114);
- $('#adminTable').height(documentHeight-144);
- };
-
- function addUsers() {
- $('#addUsers :text').val('');
- $('#addUsers').dialog('open');
- };
- </script>
- </wicket:head>
- <wicket:panel>
- <div class="adminPanel">
- <div class="adminPanelColumnTable">
- <span wicket:id="navigator">[dataview navigator]</span>
- <table class="adminListTable">
- <tr>
- <th class="two_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="164" /></th>
- <th class="two_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="165" /></th>
- </tr>
- </table>
- <div class="tableWrapper" id="adminTable">
- <table class="adminListTable">
- <tbody wicket:id="listContainer">
- <tr wicket:id="groupList">
- <td class="two_column_layout_column1"><div class="two_column_layout_divcolumn1"><span wicket:id="organisation_id"></span></div></td>
- <td class="two_column_layout_column2"><div class="two_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="adminPanelColumnForm">
- <form wicket:id="form" class="adminForm">
- <div wicket:id="buttons"></div>
- <div class="scrollcontent" id="adminForm">
- <fieldset>
- <legend><wicket:ommessage key="170" /></legend>
- <div class="formelement">
- <label><wicket:ommessage key="171" /></label><input type="text" wicket:id="name" />
- </div>
- <div class="formelement">
- <label style="font-weight: bold;"><wicket:ommessage key="273" /></label>
- <div wicket:id="addUsersBtn" class="formNewButton disabled" wicket:ommessage="title:178"><input/></div>
- </div>
- <div class="formelement">
- <div wicket:id="users"></div>
- </div>
- </fieldset>
- </div>
- </form>
- </div>
- </div>
- <div id="addUsers" wicket:ommessage="title:180" style="display: none;">
- <form wicket:id="addUsers">
- <table>
- <tr>
- <td><wicket:ommessage key="181" /></td>
- <td><input type="text" wicket:id="searchText" /></td>
- </tr>
- <tr>
- <td style="text-align: right"><input type="button" wicket:id="search" /></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="183" /></td>
- <td><select wicket:id="users" style="width: 200px; height: 300px;"></select></td>
- </tr>
- <tr>
- <td colspan="2" style="text-align: right"><input type="button" wicket:id="add" /></td>
- </tr>
- </table>
- </form>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/BasePanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/BasePanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/BasePanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components;
-
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.panel.Panel;
-
-public abstract class BasePanel extends Panel {
- private static final long serialVersionUID = 8663740955529405678L;
-
- public BasePanel(String id) {
- super(id);
- setOutputMarkupId(true);
- }
-
- /**
- * Overwrite this method to execute Java code after Panel is loaded by the
- * {@link MenuPanel}
- *
- * @param target
- */
- public void onMenuPanelLoad(AjaxRequestTarget target) {
-
- }
-
-}
Index: src/org/apache/openmeetings/web/components/HeaderPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/HeaderPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/HeaderPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div id="header">
- <span id="logo"></span><span wicket:id="appName"></span>
- </div>
- </wicket:panel>
-</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/components/UserPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/UserPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/UserPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components;
-
-import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
-
-@AuthorizeInstantiation("USER")
-public abstract class UserPanel extends BasePanel {
- private static final long serialVersionUID = 8607846885689465360L;
-
- public UserPanel(String id) {
- super(id);
- }
-}
Index: src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,266 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.user.calendar;
-
-import static org.apache.wicket.ajax.attributes.CallbackParameter.context;
-import static org.apache.wicket.ajax.attributes.CallbackParameter.explicit;
-import static org.apache.wicket.ajax.attributes.CallbackParameter.resolved;
-
-import java.util.Calendar;
-
-import org.apache.openmeetings.data.calendar.daos.AppointmentDao;
-import org.apache.openmeetings.persistence.beans.calendar.Appointment;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.UserPanel;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.attributes.AjaxCallListener;
-import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
-import org.apache.wicket.ajax.json.JSONArray;
-import org.apache.wicket.ajax.json.JSONException;
-import org.apache.wicket.ajax.json.JSONObject;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.JavaScriptHeaderItem;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.request.handler.TextRequestHandler;
-
-public class CalendarPanel extends UserPanel {
-
- private static final long serialVersionUID = -6536379497642291437L;
-
- @Override
- public void onMenuPanelLoad(AjaxRequestTarget target) {
- target.appendJavaScript("calendarInit();");
- }
-
- public CalendarPanel(String id) {
- super(id);
- WebMarkupContainer calendar = new WebMarkupContainer("calendar");
- calendar.setOutputMarkupId(true);
- calendar.setMarkupId("calendar");
- add(calendar);
-
- final CalendarForm form = new CalendarForm("appointment", new CompoundPropertyModel<Appointment>(new Appointment()));
- add(form);
-
- //fetchEvents
- add(new AbstractDefaultAjaxBehavior() {
- private static final long serialVersionUID = 6880514947331946407L;
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.setDataType("json");
- attributes.setWicketAjaxResponse(false);
- attributes.getAjaxCallListeners().add(new AjaxCallListener().onSuccess("callback(data);"));
- }
-
- @Override
- public void renderHead(Component component, IHeaderResponse response) {
- super.renderHead(component, response);
- response.render(JavaScriptHeaderItem.forScript(
- "var fetchEventsFunc = "
- + this.getCallbackFunction(
- context("start")
- , context("end")
- , context("callback")
- , resolved("_start", "start.getTime()")
- , resolved("_end", "end.getTime()")) + ";"
- , "fetchEventsFunc"));
- }
-
- @Override
- protected void respond(AjaxRequestTarget target) {
- Calendar start = WebSession.getCalendar();
- start.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_start").toLong());
- Calendar end = WebSession.getCalendar();
- end.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_end").toLong());
- JSONArray events = new JSONArray();
- for (Appointment a : Application.getBean(AppointmentDao.class).getAppointmentsByRange(WebSession.getUserId(),
- start.getTime(), end.getTime())) {
- try {
- events.put(new JSONObject()
- .put("id", a.getAppointmentId())
- .put("title", a.getAppointmentName())
- .put("description", a.getAppointmentDescription())
- .put("start", WebSession.getDateFormat().format(a.getAppointmentStarttime()))
- .put("end", WebSession.getDateFormat().format(a.getAppointmentEndtime()))
- .put("allDay", false));
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- getRequestCycle().scheduleRequestHandlerAfterCurrent(
- new TextRequestHandler("application/json", "UTF-8", events.toString()));
- }
- });
- //dropEvent
- add(new DropResizeBehavior(true, "dropEventFunc"));
- //resizeEvent
- add(new DropResizeBehavior(false, "resizeEventFunc"));
- //create on click-and-drag
- add(new AbstractDefaultAjaxBehavior() {
- private static final long serialVersionUID = 6880514947331946407L;
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.getAjaxCallListeners().add(new AjaxCallListener().onSuccess("$('#appointment').dialog('open');"));
- }
-
- @Override
- public void renderHead(Component component, IHeaderResponse response) {
- super.renderHead(component, response);
- response.render(JavaScriptHeaderItem.forScript(
- "var selectFunc = "
- + this.getCallbackFunction(
- context("start")
- , context("end")
- , context("allDay")
- , context("jsEvent")
- , context("view")
- , resolved("_start", "start.getTime()")
- , resolved("_end", "end.getTime()")) + ";"
- , "selectFunc"));
- }
-
- @Override
- protected void respond(AjaxRequestTarget target) {
- Calendar start = WebSession.getCalendar();
- start.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_start").toLong());
- Calendar end = WebSession.getCalendar();
- end.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_end").toLong());
-
- if (start.equals(end)) {
- end.add(Calendar.HOUR_OF_DAY, 1);
- }
- Appointment a = new Appointment();
- a.setAppointmentStarttime(start.getTime());
- a.setAppointmentEndtime(end.getTime());
- form.setModelObject(a);
-
- target.add(form);
- }
- });
- //eventClick
- add(new AbstractDefaultAjaxBehavior() {
- private static final long serialVersionUID = 6880514947331946407L;
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.getAjaxCallListeners().add(new AjaxCallListener().onSuccess("$('#appointment').dialog('open');"));
- }
-
- @Override
- public void renderHead(Component component, IHeaderResponse response) {
- super.renderHead(component, response);
- response.render(JavaScriptHeaderItem.forScript(
- "var eventClickFunc = "
- + this.getCallbackFunction(
- context("event")
- , context("jsEvent")
- , context("view")
- , resolved("_id", "event.id")) + ";"
- , "eventClickFunc"));
- }
-
- @Override
- protected void respond(AjaxRequestTarget target) {
- Appointment a = Application.getBean(AppointmentDao.class).getAppointmentById(
- getRequestCycle().getRequest().getRequestParameters().getParameterValue("_id").toLong());
- form.setModelObject(a);
-
- target.add(form);
- }
- });
- }
-
- private class DropResizeBehavior extends AbstractDefaultAjaxBehavior {
- private static final long serialVersionUID = -3060872155563135236L;
- private boolean drop = false;
- private String funcName;
-
- DropResizeBehavior(boolean drop, String funcName) {
- this.drop = drop;
- this.funcName = funcName;
- }
-
- @Override
- protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
- super.updateAjaxAttributes(attributes);
- attributes.getAjaxCallListeners().add(new AjaxCallListener().onFailure("revertFunc();"));
- }
-
- @Override
- public void renderHead(Component component, IHeaderResponse response) {
- super.renderHead(component, response);
- response.render(JavaScriptHeaderItem.forScript(
- "var " + funcName + " = "
- + (drop
- ? this.getCallbackFunction(
- context("event")
- , explicit("dayDelta")
- , explicit("minuteDelta")
- , context("allDay")
- , context("revertFunc")
- , context("jsEvent")
- , context("ui")
- , context("view")
- , resolved("_id", "event.id"))
- : this.getCallbackFunction(
- context("event")
- , explicit("dayDelta")
- , explicit("minuteDelta")
- , context("revertFunc")
- , context("jsEvent")
- , context("ui")
- , context("view")
- , resolved("_id", "event.id"))) + ";"
- , funcName));
- }
-
- @Override
- protected void respond(AjaxRequestTarget target) {
- AppointmentDao dao = Application.getBean(AppointmentDao.class);
- Appointment a = dao.getAppointmentById(
- getRequestCycle().getRequest().getRequestParameters().getParameterValue("_id").toLong());
-
- int dayDelta = getRequestCycle().getRequest().getRequestParameters().getParameterValue("dayDelta").toInt();
- int minuteDelta = getRequestCycle().getRequest().getRequestParameters().getParameterValue("minuteDelta").toInt();
-
- Calendar cal = WebSession.getCalendar();
- if (drop) {
- cal.setTime(a.getAppointmentStarttime());
- cal.add(Calendar.DATE, dayDelta);
- cal.add(Calendar.MINUTE, minuteDelta);
- a.setAppointmentStarttime(cal.getTime());
- }
- cal.setTime(a.getAppointmentEndtime());
- cal.add(Calendar.DATE, dayDelta);
- cal.add(Calendar.MINUTE, minuteDelta);
- a.setAppointmentEndtime(cal.getTime());
-
- dao.updateAppointment(a);
- }
- }
-}
Index: src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <link media="screen" type="text/css" rel="stylesheet" href='css/fullcalendar.css' />
- <!-- link media="print" type="text/css" rel="stylesheet" href='css/fullcalendar.print.css' /--> <!-- FIXME incorrectly rendered -->
- <script type="text/javascript">
- function getCalendarHeight() {
- return $(window).height() - $('#calendar').position().top - 20; //FIXME HACK
- }
-
- function refetchEvents() {
- $('#calendar').fullCalendar('refetchEvents');
- window.setTimeout(refetchEvents, 10 * 1000);
- }
-
- function calendarInit() {
- $('#calendar').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- }
- , editable: true
- , allDaySlot: false
- , axisFormat: 'HH(:mm)'
- , selectable: true
- , defaultEventMinutes: 60
- , timeFormat: {
- agenda: 'HH:mm{ - HH:mm}'
- , '': 'HH(:mm)'
- }
- , height: getCalendarHeight()
- , windowResize: function() {
- //$('#calendar').data().fullCalendar.option('height', getCalendarHeight());
- this.option('height', getCalendarHeight());
- }
- , eventDrop: dropEventFunc //TODO confirm ??
- , eventResize: resizeEventFunc //TODO confirm ??
- , eventClick: eventClickFunc
- , select: selectFunc
- , eventSources: [
- {
- events: fetchEventsFunc
- //, color: '#4793E6'
- //, textColor: 'black'
- }
- ]
- });
- refetchEvents();
-
- $('#appointment').dialog({
- closeOnEscape: true
- , resizable: true
- , width: 450
- , autoOpen: false
- , modal: true
- });
- }
- </script>
- </wicket:head>
- <wicket:panel>
- <script type="text/javascript" src="js/fullcalendar.min.js"></script>
- <div wicket:id="calendar"></div>
- <!-- bottom section -->
- <div id="appointment" wicket:ommessage="title:815">
- <form wicket:id="appointment">
- <table>
- <tr>
- <td><wicket:ommessage key="572" /></td>
- <td><input type="text" wicket:id="appointmentName" /></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="570" /></td>
- <td><span wicket:id="appointmentStarttime"></span></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="571" /></td>
- <td><span wicket:id="appointmentEndtime"></span></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="565" /></td>
- <td><select wicket:id="remind" ></select></td>
- </tr>
- <tr>
- <td colspan="2"><input type="checkbox" wicket:id="createRoom" /><wicket:ommessage key="1509" /></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="619" /></td>
- <td><select wicket:id="room.roomtype" ></select></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="406" /></td>
- <td><select wicket:id="room" ></select></td>
- </tr>
- <tr>
- <td colspan="2"><input type="checkbox" wicket:id="isPasswordProtected" /><wicket:ommessage key="524" /></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="525" /></td>
- <td><input type="password" wicket:id="password" /></td>
- </tr>
- <tr>
- <td colspan="2"><wicket:ommessage key="1445" /></td>
- </tr>
- <!--
- <tr>
- <td><wicket:ommessage key="803" /></td>
- <td><select wicket:id="meetingMember" ></select></td>
- </tr -->
- <tr>
- <td><wicket:ommessage key="569" /></td>
- <td><input type="text" wicket:id="appointmentLocation" /></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="573" /></td>
- <td><textarea wicket:id="appointmentDescription"></textarea></td>
- </tr>
- <!-- tr>
- <td colspan="2" style="text-align: right"><input type="button" wicket:id="save" /><input type="button" wicket:id="cancel" /></td>
- </tr -->
- </table>
- </form>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/user/calendar/CalendarForm.java
===================================================================
--- src/org/apache/openmeetings/web/components/user/calendar/CalendarForm.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/calendar/CalendarForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.user.calendar;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.openmeetings.data.calendar.daos.AppointmentReminderTypDao;
-import org.apache.openmeetings.data.conference.RoomManager;
-import org.apache.openmeetings.data.conference.dao.RoomDao;
-import org.apache.openmeetings.data.user.dao.UsersDao;
-import org.apache.openmeetings.persistence.beans.calendar.Appointment;
-import org.apache.openmeetings.persistence.beans.calendar.AppointmentReminderTyps;
-import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
-import org.apache.openmeetings.persistence.beans.room.RoomType;
-import org.apache.openmeetings.persistence.beans.room.Room;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
-import org.apache.wicket.extensions.yui.calendar.DateTimeField;
-import org.apache.wicket.markup.html.form.ChoiceRenderer;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.PasswordTextField;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.PropertyModel;
-
-public class CalendarForm extends Form<Appointment> {
- private static final long serialVersionUID = -1764738237821487526L;
- private boolean createRoom = true;
-
- public CalendarForm(String id, IModel<Appointment> model) {
- super(id, model);
- setOutputMarkupId(true);
-
- add(new RequiredTextField<String>("appointmentName"));
- add(new TextArea<String>("appointmentDescription"));
- add(new TextField<String>("appointmentLocation"));
- add(new DateTimeField("appointmentStarttime"));
- add(new DateTimeField("appointmentEndtime"));
- final PasswordTextField pwd = new PasswordTextField("password");
- pwd.setEnabled(isPwdProtected());
- pwd.setOutputMarkupId(true);
- add(pwd);
-
- add(new DropDownChoice<AppointmentReminderTyps>(
- "remind"
- , Application.getBean(AppointmentReminderTypDao.class).getAppointmentReminderTypList()
- , new ChoiceRenderer<AppointmentReminderTyps>("name", "typId")));
-
- final DropDownChoice<RoomType> roomType = new DropDownChoice<RoomType>(
- "room.roomtype"
- , Application.getBean(RoomManager.class).getAllRoomTypes()
- , new ChoiceRenderer<RoomType>("name", "roomtypes_id"));
- roomType.setEnabled(createRoom);
- roomType.setOutputMarkupId(true);
- add(roomType);
-
- final DropDownChoice<Room> room = new DropDownChoice<Room>(
- "room"
- , getRoomList()
- , new ChoiceRenderer<Room>("name", "rooms_id"));
- room.setEnabled(!createRoom);
- room.setOutputMarkupId(true);
- add(room);
-
- add(new AjaxCheckBox("createRoom", new PropertyModel<Boolean>(this, "createRoom")) {
- private static final long serialVersionUID = -3743113990890386035L;
-
- @Override
- protected void onUpdate(AjaxRequestTarget target) {
- createRoom = getConvertedInput();
- target.add(roomType.setEnabled(createRoom), room.setEnabled(!createRoom));
- }
- });
- add(new AjaxCheckBox("isPasswordProtected") {
- private static final long serialVersionUID = 6041200584296439976L;
-
- @Override
- protected void onUpdate(AjaxRequestTarget target) {
- CalendarForm.this.getModelObject().setIsPasswordProtected(getConvertedInput());
- pwd.setEnabled(isPwdProtected());
- target.add(pwd);
- }
- });
- }
-
- private boolean isPwdProtected() {
- return Boolean.TRUE.equals(getModelObject().getIsPasswordProtected());
- }
-
- private List<Room> getRoomList() {
- //FIXME need to be reviewed
- List<Room> result = new ArrayList<Room>();
- RoomDao dao = Application.getBean(RoomDao.class);
- result.addAll(dao.getPublicRooms());
- for (Organisation_Users ou : Application.getBean(UsersDao.class).get(WebSession.getUserId()).getOrganisation_users()) {
- result.addAll(dao.getOrganisationRooms(ou.getOrganisation().getOrganisation_id()));
- }
- if (getModelObject().getRoom() != null && getModelObject().getRoom().getAppointment()) { //FIXME review
- result.add(getModelObject().getRoom());
- }
- return result;
- }
-}
Index: src/org/apache/openmeetings/web/components/user/AboutPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/user/AboutPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/AboutPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.user;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.components.UserPanel;
-import org.apache.wicket.markup.html.basic.Label;
-
-public class AboutPanel extends UserPanel {
- private static final long serialVersionUID = 1400355222295594321L;
- private static String version = null;
- private static String revision = null;
- private static String buildDate = null;
-
- private Attributes getAttributes() throws MalformedURLException, IOException {
- String jarUrl = getClass().getResource(getClass().getSimpleName() + ".class").toString();
- return new Manifest(new URL(jarUrl.substring(0, jarUrl.indexOf('!')) + "!/META-INF/MANIFEST.MF").openStream()).getMainAttributes();
- }
-
- private String getVersion() {
- if (version == null) {
- try {
- version = getAttributes().getValue("Product-Version");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return version;
- }
-
- private String getRevision() {
- if (revision == null) {
- try {
- revision = getAttributes().getValue("Svn-Revision");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return revision;
- }
-
- private String getBuildDate() {
- if (buildDate == null) {
- try {
- buildDate = getAttributes().getValue("Built-On");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return buildDate;
- }
-
- public AboutPanel(String id) {
- super(id);
- setOutputMarkupId(true);
- setMarkupId(id);
-
- add(new Label("name", Application.getBean(ConfigurationDao.class).getConfValue(
- "application.name"
- , String.class
- , ConfigurationDao.DEFAULT_APP_NAME)));
- add(new Label("version", getVersion()));
- add(new Label("revision", getRevision()));
- add(new Label("buildDate", getBuildDate()));
- }
-}
Index: src/org/apache/openmeetings/web/components/user/AboutPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/user/AboutPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/AboutPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div wicket:id="name">[name]</div>
- <div wicket:id="version">[version]</div>
- <div wicket:id="revision">[revision]</div>
- <div wicket:id="buildDate">[buildDate]</div>
- </wicket:panel>
-</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/components/user/ChatPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/user/ChatPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/ChatPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.user;
-
-import java.util.Date;
-
-import org.apache.openmeetings.OpenmeetingsVariables;
-import org.apache.openmeetings.data.chat.ChatDao;
-import org.apache.openmeetings.data.user.dao.UsersDao;
-import org.apache.openmeetings.persistence.beans.chat.ChatMessage;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.UserPanel;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
-import org.apache.wicket.ajax.json.JSONException;
-import org.apache.wicket.ajax.json.JSONObject;
-import org.apache.wicket.behavior.Behavior;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Button;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.TextArea;
-import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.protocol.ws.IWebSocketSettings;
-import org.apache.wicket.protocol.ws.api.IWebSocketConnection;
-import org.apache.wicket.protocol.ws.api.IWebSocketConnectionRegistry;
-import org.red5.logging.Red5LoggerFactory;
-import org.slf4j.Logger;
-
-public class ChatPanel extends UserPanel {
- private static final Logger log = Red5LoggerFactory.getLogger(ChatPanel.class, OpenmeetingsVariables.webAppRootKey);
- private static final long serialVersionUID = -9144707674886211557L;
- private String message;
-
- private JSONObject getMessage(ChatMessage m) throws JSONException {
- return new JSONObject()
- .put("type", "chat")
- .put("msg", new JSONObject()
- .put("id", m.getId())
- .put("message", m.getMessage())
- );
- }
-
- public ChatPanel(String id) {
- super(id);
- setOutputMarkupId(true);
- setMarkupId(id);
-
- add(new Behavior() {
- private static final long serialVersionUID = -2205036360048419129L;
-
- @Override
- public void renderHead(Component component, IHeaderResponse response) {
- ChatDao dao = Application.getBean(ChatDao.class);
- try {
- StringBuilder sb = new StringBuilder();
- for (ChatMessage m : dao.get(0, Integer.MAX_VALUE)) {
- sb.append("addChatMessage(").append(getMessage(m).toString()).append(");");
- }
- if (sb.length() > 0) {
- response.render(OnDomReadyHeaderItem.forScript(sb.toString()));
- }
- } catch (JSONException e) {
-
- }
- super.renderHead(component, response);
- }
- });
- add(new WebMarkupContainer("messages").setMarkupId("messageArea"));
- final Form<Void> f = new Form<Void>("sendForm");
- f.add(new TextArea<String>("message", new PropertyModel<String>(ChatPanel.this, "message")).setOutputMarkupId(true));
- f.add(new Button("send").add(new AjaxFormSubmitBehavior("onclick"){
- private static final long serialVersionUID = -3746739738826501331L;
-
- protected void onSubmit(AjaxRequestTarget target) {
- ChatDao dao = Application.getBean(ChatDao.class);
- ChatMessage m = new ChatMessage();
- m.setMessage(message);
- m.setSent(new Date());
- m.setFromUser(Application.getBean(UsersDao.class).get(WebSession.getUserId()));
- dao.update(m);
- IWebSocketConnectionRegistry reg = IWebSocketSettings.Holder.get(getApplication()).getConnectionRegistry();
- for (IWebSocketConnection c : reg.getConnections(getApplication())) {
- try {
- c.sendMessage(getMessage(m).toString());
- } catch(Exception e) {
- log.error("Error while sending message", e);
- }
- }
- ChatPanel.this.message = "";
- target.add(f);
- };
- }));
- add(f.setOutputMarkupId(true));
- }
-
-}
Index: src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components.user.rooms;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.openmeetings.data.conference.dao.RoomDao;
-import org.apache.openmeetings.persistence.beans.room.Room;
-import org.apache.openmeetings.session.SessionManager;
-import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.MenuPanel.MenuParams;
-import org.apache.openmeetings.web.components.UserPanel;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.list.ListView;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-
-public class UserRoomsPanel extends UserPanel {
- private static final long serialVersionUID = -3246259803623925341L;
-
- public UserRoomsPanel(String id, MenuParams param) {
- super(id);
-
- long title, desc;
- List<Room> rooms;
- switch (param) {
- case myTabButton:
- title = 781L;
- desc = 782L;
- //rooms = Application.getBean(RoomDao.class).getPublicRooms();
- //FIXME 2 !!!! fake rooms appointmentLogic.getTodaysAppointmentsForUser(users_id);
- rooms = new ArrayList<Room>();
- break;
- case privateTabButton:
- title = 779L;
- desc = 780L;
- //FIXME getRoomsOrganisationByOrganisationId
- rooms = new ArrayList<Room>();
- break;
- case publicTabButton:
- default:
- title = 777L;
- desc = 778L;
- rooms = Application.getBean(RoomDao.class).getPublicRooms();
- break;
- }
- add(new Label("title", WebSession.getString(title)));
- add(new Label("desc", WebSession.getString(desc)));
- add(new ListView<Room>("list", rooms) {
- private static final long serialVersionUID = 9189085478336224890L;
-
- @Override
- protected void populateItem(ListItem<Room> item) {
- final Room r = item.getModelObject();
- item.add(new Label("roomName", r.getName()));
- final IModel<Integer> curUsersModel = new Model<Integer>(Application.getBean(SessionManager.class).getClientListByRoom(r.getRooms_id()).size());
- final Label curUsers = new Label("curUsers", curUsersModel);
- item.add(curUsers.setOutputMarkupId(true));
- item.add(new Label("totalUsers", r.getNumberOfPartizipants()));
- item.add(new AjaxLink<Void>("refresh") {
- private static final long serialVersionUID = -3426813755917489787L;
-
- @Override
- public void onClick(AjaxRequestTarget target) {
- curUsersModel.setObject(Application.getBean(SessionManager.class).getClientListByRoom(r.getRooms_id()).size());
- target.add(curUsers);
- }
- });
- }
- });
- }
-}
Index: src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/rooms/UserRoomsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div wicket:id="title"></div>
- <div wicket:id="desc"></div>
- <table style="border-collapse: collapse;">
- <tr wicket:id="list" style="background-color: rgb(248, 248, 248); border-bottom: 5px solid white;">
- <td>
- <span wicket:id="roomName">[room name]</span><br/>
- <wicket:ommessage key="398" />&nbsp;<span wicket:id="curUsers"></span>&nbsp;/&nbsp;<span
- wicket:id="totalUsers"></span>&nbsp;&nbsp;<span wicket:id="refresh"
- class="ui-icon ui-icon-arrowrefresh-1-n" style="display: inline-block"></span></td>
- <td><button><wicket:ommessage key="131"/></button></td>
- </tr>
- </table>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/user/ChatPanel.html
===================================================================
--- src/org/apache/openmeetings/web/components/user/ChatPanel.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/user/ChatPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<html xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- function toggleChat() {
- var chat = $('#chat');
- $('#chat #controlBlock #control')
- .removeClass('ui-icon-carat-1-' + (chat.height() < 20 ? 'n' : 's'))
- .addClass('ui-icon-carat-1-' + (chat.height() < 20 ? 's' : 'n'));
- chat.animate({ height: chat.height() < 20 ? "300px" : "16px" }, 1000);
- }
- function addChatMessage(m) {
- if (m && m.type == "chat") {
- $('#messageArea').append('<div>' + m.msg.message + '</div>');
- }
- }
- Wicket.Event.subscribe("/websocket/message", function(jqEvent, msg) {
- addChatMessage(jQuery.parseJSON(msg));
- });
- </script>
- </wicket:head>
- <wicket:panel>
- <div id="chat">
- <div id="controlBlock" onclick="toggleChat();"><div id="control" class="ui-icon ui-icon-carat-1-n sort-icon"></div></div>
- <div wicket:id="messages"></div>
- <form wicket:id="sendForm">
- <textarea wicket:id="message"></textarea><input type="submit" wicket:id="send"/>
- </form>
- </div>
- </wicket:panel>
-</html>
Index: src/org/apache/openmeetings/web/components/ConfirmCallListener.java
===================================================================
--- src/org/apache/openmeetings/web/components/ConfirmCallListener.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/components/ConfirmCallListener.java (.../trunk/singlewebapp) (revision 1490226)
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") + you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.web.components;
-
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.wicket.ajax.attributes.AjaxCallListener;
-import org.apache.wicket.core.util.string.JavaScriptUtils;
-
-public class ConfirmCallListener extends AjaxCallListener {
- private static final long serialVersionUID = 7355235720213137963L;
-
- public ConfirmCallListener(long id) {
- this(id, "");
- }
-
- //TODO confirm need to be replaced with jQuery modal dialog
- public ConfirmCallListener(long id, String js) {
- onPrecondition("if (!confirm('" + JavaScriptUtils.escapeQuotes(WebSession.getString(id)) + "')) {"
- + js + "; hideBusyIndicator(); return false;}");
- }
-}
Index: src/org/apache/openmeetings/web/pages/SwfPage.html
===================================================================
--- src/org/apache/openmeetings/web/pages/SwfPage.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/SwfPage.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:head>
+ <meta http-equiv="cache-control" content="no-cache">
+
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
+ <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
+ <title wicket:id="titleAppName"></title>
+ <style type="text/css">
+ html,body { /* http://www.quirksmode.org/css/100percheight.html */
+ height: 100%;
+ /* prevent scrollbars */
+ margin: 0;
+ padding: 0;
+ border: 0 none;
+ overflow: hidden;
+ }
+ body {
+ background-color: #ffffff;
+ }
+ img {
+ border: 0 none;
+ }
+ </style>
+</wicket:head>
+<wicket:extend>
+<!-- <body style="width: 100%; height: 100%;"> -->
+ <div wicket:id="room" style="width: 100%; height: 100%;"></div>
+<!-- </body> -->
+</wicket:extend>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/pages/MainPage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/MainPage.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/pages/MainPage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,35 +18,61 @@
*/
package org.apache.openmeetings.web.pages;
-import org.apache.openmeetings.OpenmeetingsVariables;
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.web.util.OmUrlFragment.CHILD_ID;
+import static org.apache.openmeetings.web.util.OmUrlFragment.DASHBOARD;
+import static org.apache.openmeetings.web.util.OmUrlFragment.PROFILE_EDIT;
+import static org.apache.openmeetings.web.util.OmUrlFragment.PROFILE_MESSAGES;
+import static org.apache.openmeetings.web.util.OmUrlFragment.getPanel;
+
import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.components.ConfirmableAjaxLink;
-import org.apache.openmeetings.web.components.MenuPanel;
-import org.apache.openmeetings.web.components.user.AboutPanel;
-import org.apache.openmeetings.web.components.user.ChatPanel;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.BasePanel;
+import org.apache.openmeetings.web.common.ConfirmableAjaxLink;
+import org.apache.openmeetings.web.common.MenuPanel;
+import org.apache.openmeetings.web.user.AboutDialog;
+import org.apache.openmeetings.web.user.ChatPanel;
+import org.apache.openmeetings.web.util.OmUrlFragment;
import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
+import org.apache.wicket.devutils.debugbar.DebugBar;
import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.link.ExternalLink;
+import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.protocol.ws.api.WebSocketBehavior;
import org.apache.wicket.protocol.ws.api.message.ClosedMessage;
import org.apache.wicket.protocol.ws.api.message.ConnectedMessage;
+import org.apache.wicket.request.IRequestParameters;
+import org.apache.wicket.util.time.Duration;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
+import org.wicketstuff.urlfragment.UrlFragment;
@AuthorizeInstantiation("USER")
-public class MainPage extends BasePage {
+public class MainPage extends BaseInitedPage {
private static final long serialVersionUID = 6421960759218157999L;
- private static final Logger log = Red5LoggerFactory.getLogger(MainPage.class, OpenmeetingsVariables.webAppRootKey);
+ private static final Logger log = Red5LoggerFactory.getLogger(MainPage.class, webAppRootKey);
private final MenuPanel menu;
+ private final MarkupContainer contents;
+ private final AbstractAjaxTimerBehavior areaBehavior;
+ private DebugBar dev = null;
public MainPage() {
- MarkupContainer contents = new WebMarkupContainer("contents");
- contents.add(new WebMarkupContainer("child")).setOutputMarkupId(true).setMarkupId("contents");
- add(contents);
- menu = new MenuPanel("menu", contents);
+ contents = new WebMarkupContainer("contents");
+ add(contents.add(new WebMarkupContainer(CHILD_ID)).setOutputMarkupId(true).setMarkupId("contents"));
+ menu = new MenuPanel("menu");
add(menu);
+ add(new AjaxLink<Void>("messages") {
+ private static final long serialVersionUID = 4065339709905366840L;
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ updateContents(PROFILE_MESSAGES, target);
+ }
+ });
add(new ConfirmableAjaxLink("logout", 634L) {
private static final long serialVersionUID = -2994610981053570537L;
@@ -56,15 +82,32 @@
setResponsePage(Application.get().getSignInPageClass());
}
});
+ add(new AjaxLink<Void>("profile") {
+ private static final long serialVersionUID = 4065339709905366840L;
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ updateContents(PROFILE_EDIT, target);
+ }
+ });
+ final AboutDialog about = new AboutDialog("aboutDialog");
add(new AjaxLink<Void>("about") {
private static final long serialVersionUID = 4065339709905366840L;
@Override
public void onClick(AjaxRequestTarget target) {
- target.appendJavaScript("showAbout();");
+ about.open(target);
}
});
- add(new AboutPanel("aboutDialog"));
+ add(about);
+ if (getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled()) {
+ add(dev = new DebugBar("dev"));
+ dev.setOutputMarkupId(true);
+ } else {
+ add(new EmptyPanel("dev").setVisible(false));
+ }
+ add(new ExternalLink("bug", "https://issues.apache.org/jira/browse/OPENMEETINGS"));//FIXME hardcoded
+
add(new ChatPanel("chatPanel"));
add(new WebSocketBehavior() {
private static final long serialVersionUID = -3311970325911992958L;
@@ -81,5 +124,39 @@
log.debug("WebSocketBehavior::onClose");
}
});
+ //load preselected content
+ add(areaBehavior = new AbstractAjaxTimerBehavior(Duration.ONE_SECOND) {
+ private static final long serialVersionUID = -1551197896975384329L;
+
+ @Override
+ protected void onTimer(AjaxRequestTarget target) {
+ OmUrlFragment area = WebSession.get().getArea();
+ updateContents(area == null ? DASHBOARD : area, target);
+ stop(target);
+ WebSession.get().setArea(null);
+ }
+ });
+ }
+
+ public void updateContents(OmUrlFragment f, AjaxRequestTarget target) {
+ BasePanel panel = getPanel(f.getArea(), f.getType());
+ if (panel != null) {
+ target.add(contents.replace(panel));
+ UrlFragment uf = new UrlFragment(target);
+ uf.set(f.getArea().name(), f.getType());
+ panel.onMenuPanelLoad(target);
+ }
+ if (dev != null){
+ target.add(dev);
+ }
+ }
+
+ @Override
+ protected void onParameterArrival(IRequestParameters params, AjaxRequestTarget target) {
+ OmUrlFragment uf = getUrlFragment(params);
+ if (uf != null) {
+ areaBehavior.stop(target);
+ updateContents(uf, target);
+ }
}
}
Index: src/org/apache/openmeetings/web/pages/auth/RegisterDialog.java
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/RegisterDialog.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/auth/RegisterDialog.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,193 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages.auth;
+
+import static org.apache.openmeetings.utils.UserHelper.getMinLoginLength;
+import static org.apache.openmeetings.utils.UserHelper.getMinPasswdLength;
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.wicket.validation.validator.StringValidator.minimumLength;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.openmeetings.data.basic.FieldLanguageDao;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.data.basic.dao.OmTimeZoneDao;
+import org.apache.openmeetings.data.user.UserManager;
+import org.apache.openmeetings.data.user.dao.StateDao;
+import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
+import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
+import org.apache.openmeetings.persistence.beans.user.State;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.pages.SwfPage;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog;
+import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton;
+
+public class RegisterDialog extends AbstractFormDialog<String> {
+ private static final long serialVersionUID = -8333305491376538792L;
+ private DialogButton cancelBtn = new DialogButton(WebSession.getString(122));
+ private DialogButton registerBtn = new DialogButton(WebSession.getString(121));
+ private FeedbackPanel feedback = new FeedbackPanel("feedback");
+ private Form<String> form;
+ private SignInDialog s;
+ private String firstName;
+ private String lastName;
+ private String login;
+ private String password;
+ private String email;
+ private OmTimeZone tz;
+ private State state;
+ private FieldLanguage lang;
+
+ public RegisterDialog(String id) {
+ super(id, WebSession.getString(113));
+ add(form = new RegisterForm("form"));
+ }
+
+ public void setSignInDialog(SignInDialog s) {
+ this.s = s;
+ }
+
+ @Override
+ public int getWidth() {
+ return 400;
+ }
+
+ @Override
+ protected List<DialogButton> getButtons() {
+ return Arrays.asList(registerBtn, cancelBtn);
+ }
+
+ public void onClose(AjaxRequestTarget target, DialogButton button) {
+ s.open(target);
+ }
+
+ @Override
+ protected DialogButton getSubmitButton() {
+ return registerBtn;
+ }
+
+ @Override
+ public Form<String> getForm() {
+ return form;
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target) {
+ target.add(feedback);
+ }
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target) {
+ //FIXME need to be refactored to be handled by Wicket
+ getBean(UserManager.class).registerUser(login, password, lastName
+ , firstName, email, null, ""/*street*/, ""/*additionalname*/, ""/*fax*/, ""/*zip*/
+ , state.getState_id(), ""/*town*/, lang.getLanguage_id(), ""/*phone*/, false/*sendSMS*/
+ , "" + getRequestCycle().urlFor(SwfPage.class, new PageParameters()), false, tz.getJname());
+ }
+
+ class RegisterForm extends StatelessForm<String> {
+ private static final long serialVersionUID = 1701373326213602431L;
+ private PasswordTextField confirmPassword;
+ private PasswordTextField passwordField;
+ private RequiredTextField<String> emailField;
+ private RequiredTextField<String> loginField;
+ private RequiredTextField<String> firstNameField;
+ private RequiredTextField<String> lastNameField;
+
+ public RegisterForm(String id) {
+ super(id);
+ add(feedback.setOutputMarkupId(true));
+ ConfigurationDao cfgDao = getBean(ConfigurationDao.class);
+ add(firstNameField = new RequiredTextField<String>("firstName", new PropertyModel<String>(RegisterDialog.this, "firstName")));
+ firstNameField.setLabel(Model.of(WebSession.getString(117)));
+ add(lastNameField = new RequiredTextField<String>("lastName", new PropertyModel<String>(RegisterDialog.this, "lastName")));
+ lastNameField.setLabel(Model.of(WebSession.getString(118)));
+ add(loginField = new RequiredTextField<String>("login", new PropertyModel<String>(RegisterDialog.this, "login")));
+ loginField.setLabel(Model.of(WebSession.getString(114)));
+ loginField.add(minimumLength(getMinLoginLength(cfgDao)));
+ add(passwordField = new PasswordTextField("password", new PropertyModel<String>(RegisterDialog.this, "password")));
+ passwordField.setLabel(Model.of(WebSession.getString(115)));
+ passwordField.setResetPassword(true).add(minimumLength(getMinPasswdLength(cfgDao)));
+ add(confirmPassword = new PasswordTextField("confirmPassword", new Model<String>()).setResetPassword(true));
+ confirmPassword.setLabel(Model.of(WebSession.getString(116)));
+ add(emailField = new RequiredTextField<String>("email", new PropertyModel<String>(RegisterDialog.this, "email")));
+ emailField.setLabel(Model.of(WebSession.getString(119)));
+ emailField.add(RfcCompliantEmailAddressValidator.getInstance());
+ add(new DropDownChoice<FieldLanguage>("lang"
+ , new PropertyModel<FieldLanguage>(RegisterDialog.this, "lang")
+ , getBean(FieldLanguageDao.class).getLanguages()
+ , new ChoiceRenderer<FieldLanguage>("name", "language_id"))
+ .setRequired(true).setLabel(Model.of(WebSession.getString(111))));
+ add(new DropDownChoice<OmTimeZone>("tz"
+ , new PropertyModel<OmTimeZone>(RegisterDialog.this, "tz")
+ , getBean(OmTimeZoneDao.class).getOmTimeZones()
+ , new ChoiceRenderer<OmTimeZone>("frontEndLabel", "jname"))
+ .setRequired(true).setLabel(Model.of(WebSession.getString(1143))));
+ add(new DropDownChoice<State>("state"
+ , new PropertyModel<State>(RegisterDialog.this, "state")
+ , getBean(StateDao.class).getStates()
+ , new ChoiceRenderer<State>("name", "state_id"))
+ .setRequired(true).setLabel(Model.of(WebSession.getString(120))));
+
+ add(new AjaxButton("submit") { //FAKE button so "submit-on-enter" works as expected
+ private static final long serialVersionUID = -3612671587183668912L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ RegisterDialog.this.onSubmit(target);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ RegisterDialog.this.onError(target);
+ }
+ });
+ }
+
+ @Override
+ protected void onValidate() {
+ if (passwordField.getConvertedInput() == null
+ || !passwordField.getConvertedInput().equals(confirmPassword.getConvertedInput())) {
+ error(WebSession.getString(232));
+ }
+ if(!getBean(UsersDao.class).checkUserEMail(emailField.getConvertedInput(), null)) {
+ error(WebSession.getString(1000));
+ }
+ if(!getBean(UsersDao.class).checkUserLogin(loginField.getConvertedInput(), null)) {
+ error(WebSession.getString(105));
+ }
+ }
+ }
+}
Index: src/org/apache/openmeetings/web/pages/auth/SignInPage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/SignInPage.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/pages/auth/SignInPage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,91 +18,50 @@
*/
package org.apache.openmeetings.web.pages.auth;
-import org.apache.openmeetings.web.app.Application;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.FRONTEND_REGISTER_KEY;
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.pages.BasePage;
-import org.apache.wicket.RestartResponseException;
-import org.apache.wicket.authentication.IAuthenticationStrategy;
-import org.apache.wicket.markup.html.form.CheckBox;
-import org.apache.wicket.markup.html.form.HiddenField;
-import org.apache.wicket.markup.html.form.PasswordTextField;
-import org.apache.wicket.markup.html.form.RequiredTextField;
-import org.apache.wicket.markup.html.form.StatelessForm;
-import org.apache.wicket.markup.html.panel.FeedbackPanel;
-import org.apache.wicket.model.PropertyModel;
+import org.apache.openmeetings.web.pages.BaseInitedPage;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
+import org.apache.wicket.request.IRequestParameters;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-public class SignInPage extends BasePage {
+public class SignInPage extends BaseInitedPage {
private static final long serialVersionUID = -3843571657066167592L;
+ private SignInDialog d;
+
+ static boolean allowRegister() {
+ return "1".equals(getBean(ConfigurationDao.class).getConfValue(FRONTEND_REGISTER_KEY, String.class, "0"));
+ }
public SignInPage(PageParameters p) {
this();
}
public SignInPage() {
- add(new SignInForm("signin"));
+ RegisterDialog r = new RegisterDialog("register");
+ ForgetPasswordDialog f = new ForgetPasswordDialog("forget");
+ d = new SignInDialog("signin");
+ d.setRegisterDialog(r);
+ d.setForgetPasswordDialog(f);
+ r.setSignInDialog(d);
+ f.setSignInDialog(d);
+ add(d, r.setVisible(allowRegister()), f);
}
- class SignInForm extends StatelessForm<Void> {
- private static final long serialVersionUID = 4079939497154278822L;
- private String password;
- private String login;
- private String area = "";
- private boolean rememberMe = false;
-
- public SignInForm(String id) {
- super(id);
-
- if (WebSession.get().isSignedIn()) {
- alreadyLoggedIn();
- } else {
- IAuthenticationStrategy strategy = getApplication().getSecuritySettings().getAuthenticationStrategy();
- // get username and password from persistence store
- String[] data = strategy.load();
-
- if ((data != null) && (data.length > 1)) {
- // try to sign in the user
- if (WebSession.get().signIn(data[0], data[1])) {
- login = data[0];
- password = data[1];
-
- alreadyLoggedIn();
- } else {
- // the loaded credentials are wrong. erase them.
- strategy.remove();
- }
- }
- }
- add(new FeedbackPanel("feedback"));
- add(new RequiredTextField<String>("login", new PropertyModel<String>(this, "login")));
- add(new PasswordTextField("pass", new PropertyModel<String>(this, "password")).setResetPassword(true));
- add(new CheckBox("rememberMe", new PropertyModel<Boolean>(this, "rememberMe")).setOutputMarkupId(true));
- add(new HiddenField<String>("area", new PropertyModel<String>(this, "area"))
- .setMarkupId("area")
- .setOutputMarkupId(true));
- }
-
- private void alreadyLoggedIn() {
- // logon successful. Continue to the original destination
- continueToOriginalDestination();
- // Ups, no original destination. Go to the home page
- throw new RestartResponseException(Application.get().getHomePage());
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ //TODO need to be removed if autoOen will be enabled
+ response.render(OnDomReadyHeaderItem.forScript("$('#" + d.getMarkupId() + "').dialog('open');"));
}
@Override
- protected void onSubmit() {
- IAuthenticationStrategy strategy = getApplication().getSecuritySettings().getAuthenticationStrategy();
- if (WebSession.get().signIn(login, password)) {
- WebSession.get().setArea(area);
- setResponsePage(Application.get().getHomePage());
- if (rememberMe) {
- strategy.save(login, password);
- } else {
- strategy.remove();
- }
- } else {
- strategy.remove();
- }
- }
+ protected void onParameterArrival(IRequestParameters params, AjaxRequestTarget arg1) {
+ WebSession.get().setArea(getUrlFragment(params));
}
}
Index: src/org/apache/openmeetings/web/pages/auth/RegisterDialog.html
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/RegisterDialog.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/auth/RegisterDialog.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <form wicket:id="form">
+ <table>
+ <tr>
+ <td class="desc"><wicket:ommessage key="117" /></td>
+ <td><input wicket:id="firstName" type="text" value="" /></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="118" /></td>
+ <td><input wicket:id="lastName" type="text" value="" /></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="114" /></td>
+ <td><input wicket:id="login" type="text" value="" /></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="115" /></td>
+ <td><input wicket:id="password" type="password" value="" /></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="116" /></td>
+ <td><input wicket:id="confirmPassword" type="password" value="" /></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="119" /></td>
+ <td><input wicket:id="email" type="text" value="" /></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="1143" /></td>
+ <td><select wicket:id="tz"></select></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="120" /></td>
+ <td><select wicket:id="state"></select></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="111" /></td>
+ <td><select wicket:id="lang"></select></td>
+ </tr>
+ </table>
+ <span wicket:id="feedback"></span>
+ <input type="submit" wicket:id="submit" class="invisible-form-component"/>
+ </form>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/auth/SignInDialog.java
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/SignInDialog.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/auth/SignInDialog.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,272 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages.auth;
+
+import static org.apache.openmeetings.web.app.Application.getAuthenticationStrategy;
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.pages.auth.SignInPage.allowRegister;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.openmeetings.persistence.beans.basic.LdapConfig;
+import org.apache.openmeetings.remote.LdapConfigService;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.OmAuthenticationStrategy;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.pages.SwfPage;
+import org.apache.wicket.RestartResponseException;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.authentication.IAuthenticationStrategy;
+import org.apache.wicket.markup.head.CssContentHeaderItem;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.StatelessForm;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import com.googlecode.wicket.jquery.core.JQueryBehavior;
+import com.googlecode.wicket.jquery.core.Options;
+import com.googlecode.wicket.jquery.ui.effect.JQueryEffectBehavior;
+import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog;
+import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton;
+
+public class SignInDialog extends AbstractFormDialog<String> {
+ private static final long serialVersionUID = 7746996016261051947L;
+ private Form<String> form;
+ private DialogButton loginBtn = new DialogButton(WebSession.getString(112));
+ private DialogButton registerBtn = new DialogButton(WebSession.getString(123));
+ private String password;
+ private String login;
+ private boolean rememberMe = false;
+ private RegisterDialog r;
+ private ForgetPasswordDialog f;
+ private LdapConfig domain;
+ private String ldapConfigFileName;
+
+ public SignInDialog(String id) {
+ super(id, WebSession.getString(108));
+ add(form = new SignInForm("signin"));
+ }
+
+ public void setRegisterDialog(RegisterDialog r) {
+ this.r = r;
+ }
+
+ public void setForgetPasswordDialog(ForgetPasswordDialog f) {
+ this.f = f;
+ }
+
+ @Override
+ public void renderHead(IHeaderResponse response) {
+ super.renderHead(response);
+ //to remove upper-right close button
+ response.render(new CssContentHeaderItem(".no-close .ui-dialog-titlebar-close { display: none; }", "dialog-noclose", ""));
+ }
+
+ @Override
+ protected void onInitialize() {
+ super.onInitialize();
+ add(new JQueryBehavior(JQueryWidget.getSelector(this), "dialog") {
+ private static final long serialVersionUID = -249782023133645704L;
+
+ @Override
+ protected String $()
+ {
+ return this.$(Options.asString("open"));
+ }
+ });
+ }
+
+ @Override
+ protected void onConfigure(JQueryBehavior behavior) {
+ super.onConfigure(behavior);
+ //behavior.setOption("autoOpen", true); //TODO need to be updated as soon as API will be added
+ behavior.setOption("closeOnEscape", false);
+ behavior.setOption("dialogClass", Options.asString("no-close"));
+ behavior.setOption("resizable", false);
+ }
+
+ @Override
+ public boolean isDefaultCloseEventEnabled() {
+ return false;
+ }
+
+ @Override
+ public int getWidth() {
+ return 450;
+ }
+
+ @Override
+ public void onClose(AjaxRequestTarget target, DialogButton button) {
+ if (registerBtn.equals(button)) {
+ r.open(target);
+ }
+ }
+
+ @Override
+ protected List<DialogButton> getButtons() {
+ List<DialogButton> list = new ArrayList<DialogButton>();
+ if (allowRegister()) {
+ list.add(registerBtn);
+ }
+ list.add(loginBtn);
+ return list;
+ }
+
+ @Override
+ protected DialogButton getSubmitButton() {
+ return loginBtn;
+ }
+
+ @Override
+ public Form<String> getForm() {
+ return form;
+ }
+
+ private void shake(AjaxRequestTarget target) {
+ JQueryEffectBehavior shake = new JQueryEffectBehavior("#" + getMarkupId(), "shake");
+ target.appendJavaScript(shake.toString());
+ }
+
+ @Override
+ public void onClick(AjaxRequestTarget target, DialogButton button) {
+ if (button.equals(registerBtn) || WebSession.get().isSignedIn()) {
+ super.onClick(target, button);
+ }
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target) {
+ shake(target);
+ }
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target) {
+ ldapConfigFileName = domain.getConfigFileName() == null ? "" : domain.getConfigFileName();
+ if (domain.getAddDomainToUserName()) {
+ login = login + "@" + domain.getDomain();
+ }
+ OmAuthenticationStrategy strategy = getAuthenticationStrategy();
+ if (WebSession.get().signIn(login, password, ldapConfigFileName)) {
+ setResponsePage(Application.get().getHomePage());
+ if (rememberMe) {
+ strategy.save(login, password, ldapConfigFileName);
+ } else {
+ strategy.remove();
+ }
+ } else {
+ strategy.remove();
+ shake(target);
+ }
+ }
+
+ class SignInForm extends StatelessForm<String> {
+ private static final long serialVersionUID = 4079939497154278822L;
+ private PasswordTextField passField;
+ private RequiredTextField<String> loginField;
+
+ public SignInForm(String id) {
+ super(id);
+
+ if (WebSession.get().isSignedIn()) {
+ alreadyLoggedIn();
+ } else {
+ IAuthenticationStrategy strategy = getAuthenticationStrategy();
+ // get username and password from persistence store
+ String[] data = strategy.load();
+
+ if ((data != null) && (data.length > 2)) {
+ // try to sign in the user
+ if (WebSession.get().signIn(data[0], data[1], data[2])) {
+ login = data[0];
+ password = data[1];
+ ldapConfigFileName = data[2];
+
+ alreadyLoggedIn();
+ } else {
+ // the loaded credentials are wrong. erase them.
+ strategy.remove();
+ }
+ }
+ }
+ add(new FeedbackPanel("feedback"));
+ add(loginField = new RequiredTextField<String>("login", new PropertyModel<String>(SignInDialog.this, "login")));
+ loginField.setLabel(Model.of(WebSession.getString(114)));
+ add(passField = new PasswordTextField("pass", new PropertyModel<String>(SignInDialog.this, "password")).setResetPassword(true));
+ passField.setLabel(Model.of(WebSession.getString(115)));
+ List<LdapConfig> ldaps = getBean(LdapConfigService.class).getActiveLdapConfigs();
+ domain = ldaps.get(0);
+ add(new WebMarkupContainer("ldap")
+ .add(new DropDownChoice<LdapConfig>("domain", new PropertyModel<LdapConfig>(SignInDialog.this, "domain")
+ , ldaps, new ChoiceRenderer<LdapConfig>("name", "ldapConfigId"))).setVisible(ldaps.size() > 1));
+ add(new CheckBox("rememberMe", new PropertyModel<Boolean>(SignInDialog.this, "rememberMe")).setOutputMarkupId(true));
+ add(new AjaxButton("submit") { //FAKE button so "submit-on-enter" works as expected
+ private static final long serialVersionUID = -3612671587183668912L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ SignInDialog.this.onSubmit(target);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ SignInDialog.this.onError(target);
+ }
+ });
+ add(new AjaxLink<Void>("forget") {
+ private static final long serialVersionUID = -7497568829491287604L;
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ SignInDialog.this.close(target, null);
+ f.open(target);
+ }
+ });
+ add(new Link<Void>("netTest") {
+ private static final long serialVersionUID = -9055312659797800331L;
+
+ @Override
+ public void onClick() {
+ PageParameters pp = new PageParameters();
+ pp.add("swf", "networktesting.swf10.swf");
+ setResponsePage(SwfPage.class, pp);
+ }
+ });
+ }
+
+ private void alreadyLoggedIn() {
+ // logon successful. Continue to the original destination
+ continueToOriginalDestination();
+ // Ups, no original destination. Go to the home page
+ throw new RestartResponseException(Application.get().getHomePage());
+ }
+ }
+}
Index: src/org/apache/openmeetings/web/pages/auth/SignInPage.html
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/SignInPage.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/pages/auth/SignInPage.html (.../trunk/singlewebapp) (revision 1490226)
@@ -20,54 +20,23 @@
-->
<html xmlns:wicket="http://wicket.apache.org">
<wicket:head>
- <link media="screen" type="text/css" rel="stylesheet" href="css/theme.css"/>
- <link media="screen" type="text/css" rel="stylesheet" href="css/jquery-ui-1.9.0.custom.min.css"/>
<style>
- #login .ui-dialog .ui-dialog-titlebar-close {
- display: none;
- }
- #login input:not([type='checkbox']) {
+ input:not([type='checkbox']):not([type='radio']), select {
width: 170px;
}
- #login input:
+ td.desc {
+ width: 200px;
+ }
</style>
</wicket:head>
<wicket:extend>
<script type="text/javascript">
$(function(){
- $('#login').dialog({
- closeOnEscape: false
- , resizable: false
- , width: 400
- , open: function(event, ui) {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
$('#area').val(location.hash);
});
</script>
- <div id="login" wicket:ommessage="title:108">
- <form wicket:id="signin">
- <table>
- <tr>
- <td><wicket:ommessage key="109" /></td>
- <td><input wicket:id="login" type="text" value="" /></td>
- </tr>
- <tr>
- <td><wicket:ommessage key="110" /></td>
- <td><input wicket:id="pass" type="password" value="" /></td>
- </tr>
- <tr>
- <td></td>
- <td><input wicket:id="rememberMe" type="checkbox" /><label wicket:for="rememberMe"><wicket:ommessage key="288" /></label></td>
- </tr>
- <tr>
- <td align="right" colspan="2"><input type="submit" wicket:ommessage="value:112"/></td>
- </tr>
- </table>
- <span wicket:id="feedback"></span>
- <input wicket:id="area" type="hidden" value="" />
- </form>
- </div>
+ <div wicket:id="signin"></div>
+ <div wicket:id="register"></div>
+ <div wicket:id="forget"></div>
</wicket:extend>
</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/pages/auth/ForgetPasswordDialog.java
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/ForgetPasswordDialog.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/auth/ForgetPasswordDialog.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages.auth;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.openmeetings.data.user.UserManager;
+import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.pages.SwfPage;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.Radio;
+import org.apache.wicket.markup.html.form.RadioGroup;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog;
+import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton;
+
+public class ForgetPasswordDialog extends AbstractFormDialog<String> {
+ private static final long serialVersionUID = 8494008571497363018L;
+ private DialogButton send = new DialogButton(WebSession.getString(317));
+ private DialogButton cancel = new DialogButton(WebSession.getString(122));
+ private FeedbackPanel feedback = new FeedbackPanel("feedback");
+ private RequiredTextField<String> nameField;
+ private Form<String> form;
+ private SignInDialog s;
+ private String name;
+ private Type type = Type.email;
+
+ enum Type {
+ email
+ , login
+ }
+
+ public ForgetPasswordDialog(String id) {
+ super(id, WebSession.getString(312));
+ add(form = new Form<String>("form") {
+ private static final long serialVersionUID = 6340692639510268144L;
+ private IModel<String> lblModel = Model.of(WebSession.getString(315));
+ private Label label = new Label("label", lblModel);
+
+ {
+ add(feedback.setOutputMarkupId(true));
+ add(label.setOutputMarkupId(true));
+ add(nameField = new RequiredTextField<String>("name", new PropertyModel<String>(ForgetPasswordDialog.this, "name")));
+ nameField.setLabel(Model.of(WebSession.getString(type == Type.email ? 315 : 316)));
+ RadioGroup<Type> rg = new RadioGroup<Type>("type", new PropertyModel<Type>(ForgetPasswordDialog.this, "type"));
+ add(rg.add(new Radio<Type>("email", Model.of(Type.email)).setOutputMarkupId(true))
+ .add(new Radio<Type>("login", Model.of(Type.login)).setOutputMarkupId(true))
+ .setOutputMarkupId(true));
+ rg.add(new AjaxFormChoiceComponentUpdatingBehavior() {
+ private static final long serialVersionUID = 5814272716387415523L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ lblModel.setObject(WebSession.getString(type == Type.email ? 315 : 316));
+ nameField.setLabel(Model.of(WebSession.getString(type == Type.email ? 315 : 316)));
+ target.add(label);
+ }
+ });
+ add(new AjaxButton("submit") { //FAKE button so "submit-on-enter" works as expected
+ private static final long serialVersionUID = 5257502637636428620L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ ForgetPasswordDialog.this.onSubmit(target);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ ForgetPasswordDialog.this.onError(target);
+ }
+ });
+ }
+
+ @Override
+ protected void onValidate() {
+ UsersDao dao = getBean(UsersDao.class);
+ String n = nameField.getConvertedInput();
+ if (type == Type.email && null == dao.getUserByEmail(n)) {
+ error(WebSession.getString(318));
+ }
+ if (type == Type.login && null == dao.getUserByName(n)) {
+ error(WebSession.getString(320));
+ }
+ }
+ });
+ }
+
+ public void onClose(AjaxRequestTarget target, DialogButton button) {
+ s.open(target);
+ }
+
+ public void setSignInDialog(SignInDialog s) {
+ this.s = s;
+ }
+
+ @Override
+ protected List<DialogButton> getButtons() {
+ return Arrays.asList(send, cancel);
+ }
+
+ @Override
+ protected DialogButton getSubmitButton() {
+ return send;
+ }
+
+ @Override
+ public Form<?> getForm() {
+ return form;
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target) {
+ target.add(feedback);
+ }
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target) {
+ //FIXME forgot password should be handled be Wicket
+ getBean(UserManager.class).resetUser(type == Type.email ? name : "", type == Type.login ? name : ""
+ , "" + getRequestCycle().urlFor(SwfPage.class, new PageParameters()));
+ }
+}
Index: src/org/apache/openmeetings/web/pages/auth/SignInDialog.html
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/SignInDialog.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/auth/SignInDialog.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <form wicket:id="signin">
+ <table>
+ <tr>
+ <td class="desc"><wicket:ommessage key="109" /></td>
+ <td><input wicket:id="login" type="text" value="" /></td>
+ </tr>
+ <tr>
+ <td class="desc"><wicket:ommessage key="110" /></td>
+ <td><input wicket:id="pass" type="password" value="" /></td>
+ </tr>
+ <tr wicket:id="ldap">
+ <td class="desc"><wicket:ommessage key="1372" /></td>
+ <td><select wicket:id="domain"></select></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td style="white-space: nowrap;"><input wicket:id="rememberMe"
+ type="checkbox" /><label wicket:for="rememberMe"><wicket:ommessage key="288" /></label></td>
+ </tr>
+ <tr>
+ <td><a wicket:id="forget"><wicket:ommessage key="311"/></a></td>
+ <td><a wicket:id="netTest" target="_blank"><wicket:ommessage key="1527"/></a></td>
+ </tr>
+ </table>
+ <span wicket:id="feedback"></span>
+ <input type="submit" wicket:id="submit" class="invisible-form-component"/>
+ </form>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/auth/ForgetPasswordDialog.html
===================================================================
--- src/org/apache/openmeetings/web/pages/auth/ForgetPasswordDialog.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/auth/ForgetPasswordDialog.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <form wicket:id="form">
+ <table>
+ <tr wicket:id="type">
+ <td>
+ <label wicket:for="email"><wicket:ommessage key="313" /></label>&nbsp;<input
+ type="radio" wicket:id="email" />
+ </td>
+ <td>
+ <label wicket:for="login"><wicket:ommessage key="314" /></label>&nbsp;<input
+ type="radio" wicket:id="login" />
+ </td>
+ </tr>
+ <tr>
+ <td><span wicket:id="label"></span></td>
+ <td><input wicket:id="name" type="text" /></td>
+ </tr>
+ </table>
+ <span wicket:id="feedback"></span>
+ <input type="submit" wicket:id="submit" class="invisible-form-component"/>
+ </form>
+</wicket:panel>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/pages/BaseInitedPage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/BaseInitedPage.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/BaseInitedPage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
+import org.apache.openmeetings.web.app.WebSession;
+
+public abstract class BaseInitedPage extends BasePage {
+ private static final long serialVersionUID = 5716753033219700254L;
+
+ @Override
+ protected String getApplicationName() {
+ return getBean(ConfigurationDao.class).getAppName();
+ }
+
+ @Override
+ protected FieldLanguage getLanguage() {
+ return WebSession.getLanguageObj();
+ }
+}
Index: src/org/apache/openmeetings/web/pages/MainPage.html
===================================================================
--- src/org/apache/openmeetings/web/pages/MainPage.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/pages/MainPage.html (.../trunk/singlewebapp) (revision 1490226)
@@ -20,10 +20,6 @@
-->
<html xmlns:wicket="http://wicket.apache.org">
<wicket:head>
- <link media="screen" type="text/css" rel="stylesheet" href="css/theme.css"/>
-
- <script type="text/javascript" src="js/jquery-ui-1.9.0.custom.min.js"></script>
- <link media="screen" type="text/css" rel="stylesheet" href="css/jquery-ui-1.9.0.custom.min.css"/>
<script type="text/javascript">
function showBusyIndicator() {
$('#busy_indicator').show();
@@ -31,16 +27,6 @@
function hideBusyIndicator() {
$('#busy_indicator').hide();
}
- function showAbout() {
- $('#aboutDialog').dialog({
- closeOnEscape: true
- , autoOpen: false
- , resizable: false
- , width: 400
- , modal: true
- });
- $('#aboutDialog').dialog('open');
- }
</script>
</wicket:head>
<wicket:extend>
@@ -53,12 +39,14 @@
});
</script>
<div id="topLinks"><span
- id="contactsAndMessages"><wicket:ommessage key="1188"/></span><span
- id="profile"><wicket:ommessage key="5"/></span><span
+ id="contactsAndMessages"><a wicket:id="messages"><wicket:ommessage key="1188"/></a></span><span
+ id="profile"><a wicket:id="profile"><wicket:ommessage key="5"/></a></span><span
id="logout"><a wicket:id="logout"><wicket:ommessage key="310"/></a></span><span
- id="reportBug"><wicket:ommessage key="284"/></span><span><a
- wicket:id="about">About</a></span></div>
- <div id="busy_indicator">Loading ...</div>
+ id="reportBug"><a target="_blank" wicket:id="bug"><wicket:ommessage key="284"/></a></span><span><a
+ wicket:id="about"><wicket:ommessage key="1549"/></a></span>
+ </div>
+ <div wicket:id="dev" />
+ <div id="busy_indicator"><wicket:ommessage key="1554"/></div>
<div wicket:id="menu"></div>
<div wicket:id="contents"><div wicket:id="child"></div></div>
<div wicket:id="chatPanel"></div>
Index: src/org/apache/openmeetings/web/pages/BaseNotInitedPage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/BaseNotInitedPage.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/BaseNotInitedPage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages;
+
+import org.apache.openmeetings.installation.InstallationConfig;
+import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.request.IRequestParameters;
+
+public abstract class BaseNotInitedPage extends BasePage {
+ private static final long serialVersionUID = 5716753033219700254L;
+ private static final InstallationConfig installCfg = new InstallationConfig();
+ private static final FieldLanguage l = new FieldLanguage();
+ static {
+ l.setCode("en");
+ l.setRtl(false);
+ }
+
+
+ @Override
+ protected String getApplicationName() {
+ return installCfg.appName;
+ }
+
+ @Override
+ protected FieldLanguage getLanguage() {
+ return l;
+ }
+
+ @Override
+ protected void onParameterArrival(IRequestParameters arg0, AjaxRequestTarget arg1) {
+ }
+}
Index: src/org/apache/openmeetings/web/pages/install/CongratulationsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/CongratulationsPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/CongratulationsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <h2>
+ <a wicket:id="url">Enter the Application</a>
+ </h2>
+ <br />
+ <br />
+ If your Red5-Server runs on a different Port or on a different domain<br />
+ <a href="public/config.xml">alter the config values of the client</a>
+ <br />
+ <br />
+ <br />
+
+ <b> <span style="font-size: 1.4em">Mailing list</span></b>
+ <br />
+ <br />
+
+ <span style="font-size: 1.3em"><a
+ href="http://openmeetings.apache.org/mail-lists.html" target="_blank">http://openmeetings.apache.org/mail-lists.html</a></span>
+ <br />
+ <br />
+
+
+ <b> <span style="font-size: 1.4em">There are some companies
+ that also offer commercial support for Apache OpenMeetings:</span></b>
+ <br />
+ <br />
+
+ <span style="font-size: 1.3em"><a
+ href="http://openmeetings.apache.org/commercial-support.html"
+ target="_blank">http://openmeetings.apache.org/commercial-support.html</a></span>
+ <br />
+
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep1.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep1.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep1.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <fieldset id="userData">
+
+ <legend>Userdata</legend>
+ <ul>
+ <li><label wicket:for="cfg.username">Username</label>
+ <input wicket:id="cfg.username" title="Enter a username" type="text" />
+ </li>
+ <li><label wicket:for="cfg.password">Userpass</label>
+ <input wicket:id="cfg.password" title="Enter a password" type="password" />
+ </li>
+ <li><label wicket:for="cfg.email">EMail</label>
+ <input wicket:id="cfg.email" title="Enter a EMail" type="text" />
+ </li>
+ <li><label wicket:for="ical_timeZone">User Time Zone</label>
+ <select wicket:id="ical_timeZone"></select>
+ </li>
+ </ul>
+ </fieldset>
+
+ <fieldset id="userOrga">
+
+ <legend>Organisation(Domains)</legend>
+ <ul>
+ <li><label wicket:for="cfg.group">Name</label>
+ <input wicket:id="cfg.group" title="Enter a default Organisation" type="text" /></li>
+ </ul>
+ </fieldset>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep2.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep2.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep2.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <fieldset id="userConf">
+ <legend>Configuration</legend>
+ <ul>
+ <li><label for="configdefault">Allow self-registering (allow_frontend_register)</label>
+ <select wicket:id="allowFrontendRegister"></select>
+ </li>
+ <li><label wicket:for="sendEmailAtRegister">Send Email to new registered Users (sendEmailAtRegister)</label>
+ <select wicket:id="sendEmailAtRegister"></select>
+ </li>
+ <li><label wicket:for="sendEmailWithVerficationCode">New Users need to verify their EMail (sendEmailWithVerficationCode)</label>
+ <select wicket:id="sendEmailWithVerficationCode"></select>
+ </li>
+ <li><label wicket:for="createDefaultRooms">Default Rooms of all types will be created</label>
+ <select wicket:id="createDefaultRooms"></select>
+ </li>
+ <li><label wicket:for="cfg.mailReferer">Mail-Referer (system_email_addr)</label>
+ <input wicket:id="cfg.mailReferer" title="Enter a Referer" type="text" />
+ </li>
+ <li><label wicket:for="cfg.smtpServer">SMTP-Server (smtp_server)</label>
+ <input wicket:id="cfg.smtpServer" title="Enter a SMTP-Server" type="text" />
+ </li>
+ <li><label wicket:for="cfg.smtpPort">SMTP-Server Port(default Smtp-Server Port is 25) (smtp_port)</label>
+ <input wicket:id="cfg.smtpPort" title="Enter a SMTP-Server.Port normally 25" type="text" />
+ </li>
+ <li><label wicket:for="cfg.mailAuthName">SMTP-Username (email_userpass)</label>
+ <input wicket:id="cfg.mailAuthName" title="Enter the mail-username" type="text" />
+ </li>
+ <li><label wicket:for="cfg.mailAuthPass">SMTP-Userpass (email_userpass)</label>
+ <input wicket:id="cfg.mailAuthPass" title="Enter the mail-userpass" type="password" />
+ </li>
+ <li><label wicket:for="mailUseTls">Enable TLS in Mail Server Auth</label>
+ <select wicket:id="mailUseTls"></select>
+ </li>
+ <li><label wicket:for="replyToOrganizer">Set inviter's email
+ address as ReplyTo in email invitations (inviter.email.as.replyto)</label>
+ <select wicket:id="replyToOrganizer"></select>
+ </li>
+ <li><label wicket:for="defaultLangId">Default Language</label>
+ <select wicket:id="defaultLangId"></select>
+ </li>
+ <li><label wicket:for="cfg.defaultExportFont">Default Font for Export [default_export_font]</label>
+ <select wicket:id="cfg.defaultExportFont"></select>
+ </li>
+ </ul>
+ </fieldset>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard$InstallStep.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard$InstallStep.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard$InstallStep.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <p wicket:id="desc">Please click "Finish" button to start installation!</p>
+ <div wicket:id="container" style="margin: 20px;">
+ <div wicket:id="progress"><!-- div><span wicket:id="value"></span>%</div--></div>
+ <div wicket:id="status"></div>
+ </div>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep3.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep3.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep3.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <fieldset id="userConf1">
+ <legend>Converters</legend>
+ <ul>
+ <li><label wicket:for="cfg.swfZoom">SWFTools Zoom</label>
+ <input wicket:id="cfg.swfZoom" title="Enter the dpi that swftools will use for PDF to SWF conversion"
+ type="text" />
+ <p>
+ <i>You can test if swftools is installed into system path by
+ opening a shell or cmd-prompt and type pdf2swf Enter the dpi
+ that swftools will use for PDF to SWF conversion. Default is 72
+ dpi. see also <a
+ href="http://openmeetings.apache.org/installation.html"
+ target="_blank">Installation</a>
+ </i>
+ </p></li>
+ <li><label wicket:for="cfg.swfJpegQuality">SWFTools JPEG Quality</label>
+ <input wicket:id="cfg.swfJpegQuality"
+ title="Enter the quality of embedded jpeg pictures to quality. 0 is worst (small), 100 is best (big). (default:85)"
+ type="text" />
+ <p>
+ <i>You can test if swftools is installed into system path by
+ opening a shell or cmd-prompt and type pdf2swf Enter the
+ quality of embedded jpeg pictures to quality. 0 is worst (small),
+ 100 is best (big). (default:85) see also <a
+ href="http://openmeetings.apache.org/installation.html"
+ target="_blank">Installation</a>
+ </i>
+ </p>
+ </li>
+ <li><label wicket:for="cfg.swfPath">SWFTools Path</label>
+ <input wicket:id="cfg.swfPath"
+ title="Enter the path to swftools for example C:/swftools (Windows) or leave blank if swftools is a known to your system path"
+ type="text" />
+ <p>
+ <i>You can test if swftools is installed into system path by
+ opening a shell or cmd-prompt and type pdf2swf If this shows
+ a list of options leave this field blank otherwise you have to
+ specify the path to pdf2swf on your system see also <a
+ href="http://openmeetings.apache.org/installation.html"
+ target="_blank">Installation</a>
+ </i>
+ </p></li>
+ <li><label wicket:for="cfg.imageMagicPath">ImageMagick Path</label>
+ <input wicket:id="cfg.imageMagicPath"
+ title="Enter the path to ImageMagick, leave blank if ImageMagick is successfully installed to system-path"
+ type="text" />
+ <p>
+ <i>see also <a
+ href="http://openmeetings.apache.org/installation.html"
+ target="_blank">Installation</a></i>
+ </p></li>
+ <li><label wicket:for="cfg.ffmpegPath">FFMPEG Path</label>
+ <input wicket:id="cfg.ffmpegPath"
+ title="Enter the path to FFMPEG, leave blank if FFMPEG is successfully installed to system-path"
+ type="text" />
+ <p>
+ <i>see also <a
+ href="http://openmeetings.apache.org/installation.html"
+ target="_blank">Installation</a></i>
+ </p></li>
+ <li><label wicket:for="cfg.soxPath">SoX Path</label>
+ <input wicket:id="cfg.soxPath"
+ title="Enter the path to SoX, leave blank if SoX is successfully installed to system-path"
+ type="text" />
+ <p>
+ <i>see also <a
+ href="http://openmeetings.apache.org/installation.html"
+ target="_blank">Installation</a></i>
+ </p></li>
+ <li><label wicket:for="cfg.jodPath">JOD Path</label>
+ <input wicket:id="cfg.jodPath"
+ title="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"
+ type="text" />
+ <p>
+ <i>see also <a
+ href="http://openmeetings.apache.org/installation.html"
+ target="_blank">Installation</a></i>
+ </p></li>
+ <li><label wicket:for="cfg.officePath">OpenOffice/LibreOffice Path for jodconverter</label>
+ <input wicket:id="cfg.officePath"
+ title="The path to OpenOffice/LibreOffice (optional) please set this to the real path in case jodconverter is unable to find OpenOffice/LibreOffice installation automatically"
+ type="text" />
+ <p>The path to OpenOffice/LibreOffice (optional) please set this
+ to the real path in case jodconverter is unable to find
+ OpenOffice/LibreOffice installation</p></li>
+ </ul>
+ </fieldset>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep4.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep4.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard$ParamsStep4.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <fieldset id="userConf2">
+
+ <legend>Crypt Type</legend>
+ <ul>
+ <li><label wicket:for="cfg.cryptClassName">Crypt Class</label>
+ <input wicket:id="cfg.cryptClassName" type="text"
+ title="Enter the Class name of the Encryption Class. DO NOT ALTER THIS IF YOU ARE NOT SURE" />
+ <p>
+ <i> You can use this default crypt type which is equal to
+ PHP-MD5 function or BSD-Style encryption by using:<b>org.apache.openmeetings.utils.crypt.MD5CryptImplementation</b>
+ for more information or to write your own Crypt-Style see: <a
+ href="http://openmeetings.apache.org/CustomCryptMechanism.html"
+ target="_blank">Custom Crypt Mechanism</a> You can edit this
+ value later BUT previous created Users and Sessions might be not
+ usable anymore
+ </i>
+ </p></li>
+ </ul>
+ </fieldset>
+
+ <fieldset id="red5sip">
+ <legend>red5SIP Configuration</legend>
+ <ul>
+ <li><label wicket:for="red5SipEnable">Enable SIP</label>
+ <select wicket:id="red5SipEnable"></select>
+ <p>
+ <i> Enable red5SIP integration </i>
+ </p> </li>
+
+ <li><label wicket:for="cfg.red5SipRoomPrefix">SIP rooms prefix</label>
+ <input wicket:id="cfg.red5SipRoomPrefix" type="text" />
+ <p>
+ <i>Prefix for phone number of conference rooms</i>
+ </p></li>
+
+ <li><label wicket:for="cfg.red5SipExtenContext">SIP extensions context</label>
+ <input wicket:id="cfg.red5SipExtenContext" type="text" />
+ <p>
+ <i>Context of Asterisk extensions</i>
+ </p></li>
+ </ul>
+ </fieldset>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/pages/install/InstallWizardPage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizardPage.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizardPage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages.install;
+
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.common.ErrorMessagePanel;
+import org.apache.openmeetings.web.pages.BaseNotInitedPage;
+import org.apache.wicket.RestartResponseException;
+
+public class InstallWizardPage extends BaseNotInitedPage {
+ private static final long serialVersionUID = -438388395397826138L;
+
+ public InstallWizardPage() {
+ if (Application.isInstalled()) {
+ throw new RestartResponseException(Application.get().getHomePage());
+ }
+ try {
+ add(new InstallWizard("wizard"));
+ } catch (RestartResponseException re) {
+ throw re;
+ } catch (Exception e) {
+ //TODO localization
+ add(new ErrorMessagePanel("wizard", "Error while running installer, please check your installation", e));
+ }
+ }
+}
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard$WelcomeStep.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard$WelcomeStep.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard$WelcomeStep.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,157 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <ol>
+ <li>
+ <h4>
+ <a id="Recommendation_for_production_environment"></a>Recommendation
+ for production environment<a target="_blank"
+ href="#Recommendation_for_production_environment"
+ class="section_anchor"></a>
+ </h4>
+ <blockquote>
+ By default <span wicket:id="app"></span> uses the integrated Apache Derby database. For
+ production environment you should consider using <a target="_blank"
+ href="http://openmeetings.apache.org/MySQLConfig.html">MySQL</a>, <a
+ target="_blank"
+ href="http://openmeetings.apache.org/PostgresConfig.html">Postgres</a>
+ or for example <a target="_blank"
+ href="http://openmeetings.apache.org/IBMDB2Config.html">IBM DB2</a>
+ or <a href="http://openmeetings.apache.org/OracleConfig.html"
+ target="_blank">Oracle</a>
+ </blockquote>
+ </li>
+ <li><h4>
+ <a id="Enabling_Image_Upload_and_import_to_whiteboard"></a>Enabling
+ Image Upload and import to whiteboard<a
+ href="#Enabling_Image_Upload_and_import_to_whiteboard"
+ class="section_anchor"></a>
+ </h4>
+ <ul>
+ <li>Install <strong>ImageMagick</strong> on the server, you can
+ get more information on <a target="_blank"
+ href="http://www.imagemagick.org" rel="nofollow">http://www.imagemagick.org</a>
+ regarding installation. The instructions for installation can be
+ found there <a target="_blank"
+ href="http://www.imagemagick.org/script/binary-releases.php"
+ rel="nofollow">http://www.imagemagick.org/script/binary-releases.php</a>,
+ however on most linux systems you can get it via your favorite
+ package managers (apt-get it)
+ </li>
+ </ul>
+ </li>
+ <li><h4>
+ <a id="Enabling_import_of_PDFs_into_whiteboard"></a>Enabling
+ import of PDFs into whiteboard<a
+ href="#Enabling_import_of_PDFs_into_whiteboard"
+ class="section_anchor"></a>
+ </h4>
+ <ul>
+ <li>Install <strong>GhostScript</strong> on the server, you can
+ get more information on <a target="_blank"
+ href="http://pages.cs.wisc.edu/%7Eghost/" rel="nofollow">http://pages.cs.wisc.edu/~ghost/</a>
+ regarding installation. The instructions for installation can be
+ found there, however on most linux systems you can get it via your
+ favorite package managers (apt-get it).
+ </li>
+ <li>Install <strong>SWFTools</strong> on the server, you can get
+ more information on <a target="_blank"
+ href="http://www.swftools.org/" rel="nofollow">http://www.swftools.org/</a>
+ regarding installation. Some of the Linux distributions already have
+ it in there package manager see <a target="_blank"
+ href="http://packages.debian.org/unstable/utils/swftools"
+ rel="nofollow">http://packages.debian.org/unstable/utils/swftools</a>),
+ the recommended version of <strong>SWFTools</strong> is 0.9 as prior
+ version have a bug that does lead to wrong object dimensions in the
+ Whiteboard
+ </li>
+ </ul>
+ </li>
+ <li><h4>
+ <a
+ id="Enabling_import_of_.doc,_.docx,_.ppt,_.pptx,_..._all_Office_Docu"></a>Enabling
+ import of .doc, .docx, .ppt, .pptx, ... all Office Documents into
+ whitebaord<a
+ href="#Enabling_import_of_.doc,_.docx,_.ppt,_.pptx,_..._all_Office_Docu"
+ class="section_anchor"></a>
+ </h4>
+ <ul>
+ <li><strong>OpenOffice-Service</strong> started and listening on
+ port 8100, see <a target="_blank"
+ href="http://openmeetings.apache.org/OpenOfficeConverter.html">OpenOfficeConverter</a>
+ for details</li>
+ </ul>
+ </li>
+ <li><h4>
+ <a
+ id="Enabling_Recording_and_import_of_.avi,_.flv,_.mov_and_.mp4_into"></a>Enabling
+ Recording and import of .avi, .flv, .mov and .mp4 into whiteboard<a
+ href="#Enabling_Recording_and_import_of_.avi,_.flv,_.mov_and_.mp4_into"
+ class="section_anchor"></a>
+ </h4>
+ <ul>
+ <li>Install <strong>FFMpeg</strong>. You should get FFMPEG in an
+ up to date copy! For Windows you can download a Build for example
+ from <a target="_blank" href="http://ffmpeg.arrozcru.org/builds/"
+ rel="nofollow">http://ffmpeg.arrozcru.org/builds/</a> Linux or OSx
+ Users should be able to use one of the various Installation
+ Instructions on the Web. You need to enable libmp3lame!
+ </li>
+ <li>Install <strong>SoX</strong> <a
+ href="http://sox.sourceforge.net/" target="_BLANK">http://sox.sourceforge.net/</a>.
+ You should install SoX in a up to date copy! SoX 12.xx will NOT
+ work!
+ </li>
+ </ul>
+ </li>
+ </ol>
+
+ <br />
+ <b> <span style="font-size: 1.2em">If you have further
+ questions or need support in installation or hosting:</span></b>
+ <br />
+ <br />
+
+ <b> <span style="font-size: 1.2em">Commercial-Support:</span></b>
+ <br />
+ <br />
+
+ <span style="font-size: 1.1em"><b>By phone</b></span>
+ <br />
+ <span style="font-size: 1.1em">++49 721 467 27327</span>
+ <br />
+ <span style="font-size: 1.1em"><b>By email</b></span>
+ <br />
+ <span style="font-size: 1.1em"><a
+ href="mailto:service@openmeetings.de">service@openmeetings.de</a></span>
+ <br />
+ <br />
+ <br />
+ <b><span style="font-size: 1.2em">Community-Support:</span></b>
+ <br />
+ <br />
+ <span style="font-size: 1.1em"><a
+ href="http://openmeetings.apache.org/mail-lists.html"
+ target="_blank">Mailing lists</a></span>
+ <br />
+</wicket:panel>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard.java
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,500 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages.install;
+
+import static org.apache.openmeetings.installation.InstallationConfig.USER_LOGIN_MINIMUM_LENGTH;
+import static org.apache.openmeetings.installation.InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH;
+import static org.apache.wicket.validation.validator.StringValidator.minimumLength;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.apache.openmeetings.installation.ImportInitvalues;
+import org.apache.openmeetings.installation.InstallationConfig;
+import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.common.ErrorMessagePanel;
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator;
+import org.apache.wicket.extensions.wizard.IWizardStep;
+import org.apache.wicket.extensions.wizard.Wizard;
+import org.apache.wicket.extensions.wizard.dynamic.DynamicWizardModel;
+import org.apache.wicket.extensions.wizard.dynamic.DynamicWizardStep;
+import org.apache.wicket.extensions.wizard.dynamic.IDynamicWizardStep;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.util.time.Duration;
+
+import com.googlecode.wicket.jquery.ui.widget.progressbar.ProgressBar;
+
+//TODO maybe JQ wizard should be used
+public class InstallWizard extends Wizard {
+ private static final long serialVersionUID = 1L;
+ private InstallationConfig cfg;
+ private CompoundPropertyModel<InstallWizard> model;
+ private final static List<SelectOption> yesNoList = Arrays.asList(SelectOption.NO, SelectOption.YES);
+ private final static List<String> allFonts = Arrays.asList("TimesNewRoman", "Verdana", "Arial");
+ private final IDynamicWizardStep welcomeStep;
+ private final IDynamicWizardStep paramsStep1;
+ private final IDynamicWizardStep paramsStep2;
+ private final IDynamicWizardStep paramsStep3;
+ private final IDynamicWizardStep paramsStep4;
+ private final InstallStep installStep;
+ private Throwable th = null;
+
+ //onInit, applyState
+ public InstallWizard(String id) throws Exception {
+ super(id);
+ //TODO enable install after first params
+ cfg = new InstallationConfig();
+ setDefaultModel(model = new CompoundPropertyModel<InstallWizard>(this));
+ welcomeStep = new WelcomeStep();
+ paramsStep1 = new ParamsStep1();
+ paramsStep2 = new ParamsStep2();
+ paramsStep3 = new ParamsStep3();
+ paramsStep4 = new ParamsStep4();
+ //TODO add install/progress step
+ installStep = new InstallStep();
+
+ DynamicWizardModel wmodel = new DynamicWizardModel(welcomeStep);
+ wmodel.setCancelVisible(false);
+ wmodel.setLastVisible(true);
+ init(wmodel);
+ }
+
+ @Override
+ protected Component newButtonBar(String id) {
+ final Panel bBar = (Panel)super.newButtonBar(id);
+ AjaxButton finish = new AjaxButton("finish", new ResourceModel("org.apache.wicket.extensions.wizard.finish")) {
+ private static final long serialVersionUID = 1L;
+
+ public boolean isEnabled() {
+ IWizardStep activeStep = getWizardModel().getActiveStep();
+ return ((activeStep != null) && getWizardModel().isLastStep(activeStep));
+ }
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ installStep.startInstallation(target);
+ target.add(bBar.setEnabled(false));
+ }
+ };
+ return bBar.replace(finish).setOutputMarkupId(true);
+ }
+
+ private abstract class BaseStep extends DynamicWizardStep {
+ private static final long serialVersionUID = 1L;
+
+ public BaseStep(IDynamicWizardStep prev) {
+ super(prev);
+ //TODO localize
+ setTitleModel(Model.of(cfg.appName + " - Installation"));
+ setSummaryModel(Model.of(""));
+ }
+ }
+
+ private final class WelcomeStep extends BaseStep {
+ private static final long serialVersionUID = 1L;
+
+ public WelcomeStep() {
+ super(null);
+ //TODO localize
+ //TODO add check for DB connection
+ add(new Label("app", cfg.appName));
+ }
+
+ public boolean isLastStep() {
+ return false;
+ }
+
+ public IDynamicWizardStep next() {
+ return paramsStep1;
+ }
+ }
+
+ private final class ParamsStep1 extends BaseStep {
+ private static final long serialVersionUID = 1L;
+
+ public ParamsStep1() throws Exception {
+ super(welcomeStep);
+ //TODO localize
+ add(new RequiredTextField<String>("cfg.username").add(minimumLength(USER_LOGIN_MINIMUM_LENGTH)));
+ add(new PasswordTextField("cfg.password").add(minimumLength(USER_PASSWORD_MINIMUM_LENGTH)));
+ add(new RequiredTextField<String>("cfg.email").add(RfcCompliantEmailAddressValidator.getInstance()));
+ add(new TzDropDown("ical_timeZone"));
+ add(new RequiredTextField<String>("cfg.group"));
+ }
+
+ public boolean isLastStep() {
+ return false;
+ }
+
+ public IDynamicWizardStep next() {
+ return paramsStep2;
+ }
+
+ @Override
+ public boolean isLastAvailable() {
+ return true;
+ }
+
+ @Override
+ public IDynamicWizardStep last() {
+ return installStep;
+ }
+ }
+
+ private final class ParamsStep2 extends BaseStep {
+ private static final long serialVersionUID = 1L;
+
+ public ParamsStep2() throws Exception {
+ super(paramsStep1);
+ //TODO localize
+ //TODO validation
+ add(new YesNoDropDown("allowFrontendRegister"));
+ add(new YesNoDropDown("sendEmailAtRegister"));
+ add(new YesNoDropDown("sendEmailWithVerficationCode"));
+ add(new YesNoDropDown("createDefaultRooms"));
+ add(new TextField<String>("cfg.mailReferer"));
+ add(new TextField<String>("cfg.smtpServer"));
+ add(new TextField<String>("cfg.smtpPort"));
+ add(new TextField<String>("cfg.mailAuthName"));
+ add(new PasswordTextField("cfg.mailAuthPass").setRequired(false));
+ add(new YesNoDropDown("mailUseTls"));
+ //TODO check mail server
+ add(new YesNoDropDown("replyToOrganizer"));
+ add(new LangDropDown("defaultLangId"));
+ add(new DropDownChoice<String>("cfg.defaultExportFont", allFonts));
+ }
+
+ public boolean isLastStep() {
+ return false;
+ }
+
+ public IDynamicWizardStep next() {
+ return paramsStep3;
+ }
+
+ @Override
+ public boolean isLastAvailable() {
+ return true;
+ }
+
+ @Override
+ public IDynamicWizardStep last() {
+ return installStep;
+ }
+ }
+
+ private final class ParamsStep3 extends BaseStep {
+ private static final long serialVersionUID = 1L;
+
+ public ParamsStep3() {
+ super(paramsStep2);
+
+ add(new TextField<String>("cfg.swfZoom"));
+ add(new TextField<String>("cfg.swfJpegQuality"));
+ add(new TextField<String>("cfg.swfPath"));
+ add(new TextField<String>("cfg.imageMagicPath"));
+ add(new TextField<String>("cfg.ffmpegPath"));
+ add(new TextField<String>("cfg.soxPath"));
+ add(new TextField<String>("cfg.jodPath"));
+ add(new TextField<String>("cfg.officePath"));
+ }
+
+ public boolean isLastStep() {
+ return false;
+ }
+
+ public IDynamicWizardStep next() {
+ return paramsStep4;
+ }
+
+ @Override
+ public boolean isLastAvailable() {
+ return true;
+ }
+
+ @Override
+ public IDynamicWizardStep last() {
+ return installStep;
+ }
+ }
+
+ private final class ParamsStep4 extends BaseStep {
+ private static final long serialVersionUID = 1L;
+
+ public ParamsStep4() {
+ super(paramsStep3);
+ add(new RequiredTextField<String>("cfg.cryptClassName")); //Validate class
+
+ //TODO add check for red5sip connection
+ add(new YesNoDropDown("red5SipEnable"));
+ add(new TextField<String>("cfg.red5SipRoomPrefix"));
+ add(new TextField<String>("cfg.red5SipExtenContext"));
+ }
+
+ public boolean isLastStep() {
+ return false;
+ }
+
+ public IDynamicWizardStep next() {
+ return installStep;
+ }
+
+ @Override
+ public boolean isLastAvailable() {
+ return true;
+ }
+
+ @Override
+ public IDynamicWizardStep last() {
+ return installStep;
+ }
+}
+
+ private final class InstallStep extends BaseStep {
+ private static final long serialVersionUID = 1L;
+ private final CongratulationsPanel congrat;
+ private WebMarkupContainer container = new WebMarkupContainer("container");
+ private AbstractAjaxTimerBehavior timer;
+ private ProgressBar progressBar;
+ private WebMarkupContainer desc = new WebMarkupContainer("desc");
+ private Label value;
+ private boolean started = false;
+
+ public void startInstallation(AjaxRequestTarget target) {
+ started = true;
+ timer.restart(target);
+ new Thread(new InstallProcess(Application.get()._getBean(ImportInitvalues.class))
+ , "Openmeetings - Installation").start(); //TODO remove hardcoded
+ //progressBar.setVisible(true);
+ target.add(container);
+ }
+
+ public InstallStep() {
+ super(paramsStep4);
+
+ add(desc.setOutputMarkupId(true));
+ // Timer //
+ container.add(timer = new AbstractAjaxTimerBehavior(Duration.ONE_SECOND) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void onTimer(AjaxRequestTarget target) {
+ if (!started) {
+ timer.stop(target);
+ return;
+ }
+ if (th != null) {
+ timer.stop(target);
+ //TODO change text, localize
+ progressBar.setVisible(false);
+ target.add(container.replace(new ErrorMessagePanel("status", "Installation is failed", th))
+ , desc.setVisible(false)
+ );
+ } else {
+ progressBar.setModelObject(Application.get()._getBean(ImportInitvalues.class).getProgress());
+ progressBar.respond(target);
+ //TODO uncomment later target.add(value);
+ //TODO add current step result as info
+ }
+ }
+ });
+ container.add(progressBar = new ProgressBar("progress", new Model<Integer>(0)) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void onComplete(AjaxRequestTarget target) {
+ timer.stop(target);
+ progressBar.setVisible(false);
+ congrat.setVisible(true);
+ target.add(container, desc.setVisible(false));
+ }
+ });
+ //TODO uncomment later progressBar.add(value = new Label("value", progressBar.getModel()));
+ //TODO uncomment later value.setOutputMarkupId(true);
+ //progressBar.setVisible(false);
+
+ container.add(congrat = new CongratulationsPanel("status"));
+ congrat.setVisible(false);
+
+ add(container.setOutputMarkupId(true));
+ }
+
+ public boolean isLastStep() {
+ return true;
+ }
+
+ public IDynamicWizardStep next() {
+ return null;
+ }
+ }
+
+ private class InstallProcess implements Runnable {
+ private ImportInitvalues installer;
+
+ public InstallProcess(ImportInitvalues installer) {
+ this.installer = installer;
+ th = null;
+ }
+
+ public void run() {
+ try {
+ installer.loadAll(cfg, true);
+ } catch (Exception e) {
+ th = e;
+ }
+ }
+ }
+
+ private static class SelectOption implements Serializable {
+ private static final long serialVersionUID = 2559982745410615390L;
+ private static SelectOption NO = new SelectOption("0", "No");
+ private static SelectOption YES = new SelectOption("1", "Yes");
+ public String key;
+ @SuppressWarnings("unused")
+ public String value;
+
+ SelectOption(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+ }
+
+ private abstract class WizardDropDown<T> extends DropDownChoice<T> {
+ private static final long serialVersionUID = 8870736740532631296L;
+ T option;
+ IModel<Object> propModel;
+
+ WizardDropDown(String id) {
+ super(id);
+ propModel = InstallWizard.this.model.bind("cfg." + id);
+ setModel(new PropertyModel<T>(this, "option"));
+ }
+ }
+
+ private final class TzDropDown extends WizardDropDown<OmTimeZone> {
+ private static final long serialVersionUID = 6084349711073918837L;
+
+ public TzDropDown(String id) throws Exception {
+ super(id);
+ List<OmTimeZone> tzList = ImportInitvalues.getTimeZones();
+ setChoices(tzList);
+ setChoiceRenderer(new IChoiceRenderer<OmTimeZone>() {
+ private static final long serialVersionUID = 1L;
+
+ public Object getDisplayValue(OmTimeZone object) {
+ return object.getLabel() + " (" + object.getJname() + ")";
+ }
+ public String getIdValue(OmTimeZone object, int index) {
+ return object.getIcal();
+ }
+ });
+ option = tzList.get(0);
+ for (OmTimeZone tz : tzList) {
+ if (tz.getIcal().equals(propModel.getObject())) {
+ option = tz;
+ break;
+ }
+ }
+ }
+
+ @Override
+ protected void onModelChanged() {
+ if (propModel != null && option != null) {
+ propModel.setObject(option.getIcal());
+ }
+ }
+ }
+
+ private class SelectOptionDropDown extends WizardDropDown<SelectOption> {
+ private static final long serialVersionUID = -1433015274371279328L;
+
+ SelectOptionDropDown(String id) {
+ super(id);
+ setChoiceRenderer(new ChoiceRenderer<SelectOption>("value", "key"));
+ }
+
+ @Override
+ protected void onModelChanged() {
+ if (propModel != null && option != null) {
+ propModel.setObject(option.key);
+ }
+ }
+
+ }
+ private final class YesNoDropDown extends SelectOptionDropDown {
+ private static final long serialVersionUID = 578375825530725477L;
+
+ YesNoDropDown(String id) {
+ super(id);
+ setChoices(yesNoList);
+ this.option = SelectOption.NO.key.equals(propModel.getObject()) ?
+ SelectOption.NO : SelectOption.YES;
+ }
+ }
+
+ private final class LangDropDown extends SelectOptionDropDown {
+ private static final long serialVersionUID = -2826765890538795285L;
+
+ public LangDropDown(String id) throws Exception {
+ super(id);
+ LinkedHashMap<Integer, LinkedHashMap<String, Object>> allLanguagesAll
+ = ImportInitvalues.getLanguageFiles();
+
+ List<SelectOption> list = new ArrayList<SelectOption>();
+
+ for (Integer key : allLanguagesAll.keySet()) {
+ String langName = (String) allLanguagesAll.get(key).get("name");
+ String langCode = (String) allLanguagesAll.get(key).get("code");
+ SelectOption op = new SelectOption(key.toString(), langName);
+ if (langCode != null) {
+ if (getSession().getLocale().toString().startsWith(langCode)) {
+ option = op;
+ }
+ list.add(op);
+ }
+ if (option == null && key.toString().equals(cfg.defaultLangId)) {
+ option = op;
+ }
+ }
+ setChoices(list);
+ }
+ }
+}
Index: src/org/apache/openmeetings/web/pages/install/InstallWizardPage.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizardPage.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizardPage.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:head>
+ <style type="text/css">
+ form,fieldset {
+ margin: 0;
+ padding: 0;
+ }
+ fieldset {
+ border: 1px solid #000;
+ }
+ legend {
+ padding: 0;
+ color: #000;
+ }
+ input:focus,textarea:focus {
+ color: #000;
+ background: #fff;
+ outline: 1px solid black;
+ }
+ input,textarea,select {
+ margin: 0;
+ padding: 1px;
+ position: absolute;
+ left: 700px;
+ background: #ddd;
+ font-size: 100%;
+ font-family: inherit;
+ width: 300px;
+ }
+ select {
+ padding: 0;
+ }
+ form.wicketExtensionsWizardForm {
+ width: 1024px;
+ font-size: 1.1em;
+ color: #333;
+ }
+ form.wicketExtensionsWizardForm legend {
+ padding-left: 0;
+ }
+ form.wicketExtensionsWizardForm legend,form.wicketExtensionsWizardForm label {
+ color: #333;
+ }
+ form.wicketExtensionsWizardForm fieldset {
+ border: none;
+ border-top: 1px solid #C9DCA6;
+ }
+ form.wicketExtensionsWizardForm fieldset fieldset {
+ background: none;
+ }
+ form.wicketExtensionsWizardForm fieldset li {
+ padding: 5px 10px 7px;
+ }
+ form.wicketExtensionsWizardForm fieldset {
+ margin-bottom: 10px;
+ }
+ form.wicketExtensionsWizardForm legend {
+ padding: 0 2px;
+ font-weight: bold;
+ }
+ form.wicketExtensionsWizardForm label {
+ display: inline-block;
+ line-height: 1.8;
+ vertical-align: top;
+ }
+ form.wicketExtensionsWizardForm fieldset ol {
+ margin: 0;
+ padding: 0;
+ }
+ form.wicketExtensionsWizardForm fieldset li {
+ list-style: none;
+ margin: 0;
+ }
+ form.wicketExtensionsWizardForm fieldset fieldset {
+ border: none;
+ margin: 3px 0 0;
+ }
+ form.wicketExtensionsWizardForm fieldset fieldset legend {
+ padding: 0 0 5px;
+ font-weight: normal;
+ }
+ form.wicketExtensionsWizardForm fieldset fieldset label {
+ display: block;
+ width: auto;
+ }
+ form.wicketExtensionsWizardForm em {
+ font-weight: bold;
+ font-style: normal;
+ color: #f00;
+ }
+ form.wicketExtensionsWizardForm label {
+ width: 420px;
+ }
+ form.wicketExtensionsWizardForm fieldset fieldset label {
+ margin-left: 123px;
+ }
+ .wicketExtensionsWizard {
+ padding-right: 100px;
+ padding-left: 100px;
+ width: 850px;
+ }
+ .wicketExtensionsWizardHeader {
+ font-size: 2em;
+ padding: 10px;
+ }
+ .wicketExtensionsWizardViewInner {
+ padding: 5px;
+ }
+ .wicketExtensionsWizardInnerTable, .wicketExtensionsWizardOuterTable {
+ width: 100%;
+ }
+ .wicketExtensionsWizardButtonBar input {
+ position: initial;
+ width: initial;
+ padding-right: 15px;
+ padding-left: 15px;
+ margin: 5px;
+ }
+ </style>
+</wicket:head>
+<wicket:extend>
+ <div>
+ <div wicket:id="wizard"></div>
+ </div>
+</wicket:extend>
+</html>
Index: src/org/apache/openmeetings/web/pages/install/InstallWizard.html
===================================================================
--- src/org/apache/openmeetings/web/pages/install/InstallWizard.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/InstallWizard.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<wicket:panel xmlns:wicket="http://wicket.apache.org">
+ <div class="wicketExtensionsWizard">
+ <form wicket:id="form" class="wicketExtensionsWizardForm">
+ <table class="wicketExtensionsWizardOuterTable">
+ <tr>
+ <td valign="top"><span wicket:id="overview"></span></td>
+ <td valign="top">
+ <table class="wicketExtensionsWizardInnerTable">
+ <tr class="wicketExtensionsWizardHeaderRow">
+ <td valign="top" class="wicketExtensionsWizardHeader"><span
+ wicket:id="header"></span></td>
+ </tr>
+ <tr class="wicketExtensionsWizardFeedbackRow">
+ <td valign="top" class="wicketExtensionsWizardFeedback"><span
+ wicket:id="feedback"></span></td>
+ </tr>
+ <tr class="wicketExtensionsWizardViewRow">
+ <td valign="top" class="wicketExtensionsWizardView"><div
+ wicket:id="view" class="wicketExtensionsWizardViewInner"></div></td>
+ </tr>
+ <tr class="wicketExtensionsWizardButtonBarRow">
+ <td valign="top" class="wicketExtensionsWizardButtonBar"><span
+ wicket:id="buttons"></span></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+</wicket:panel>
Index: src/org/apache/openmeetings/web/pages/install/CongratulationsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/pages/install/CongratulationsPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/install/CongratulationsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages.install;
+
+import org.apache.openmeetings.web.app.Application;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.markup.html.panel.Panel;
+
+public class CongratulationsPanel extends Panel {
+ private static final long serialVersionUID = 1L;
+
+ public CongratulationsPanel(String id) {
+ super(id);
+
+ add(new Link<Void>("url") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void onClick() {
+ setResponsePage(Application.get().getHomePage());
+ }
+ });
+ }
+}
Index: src/org/apache/openmeetings/web/pages/BasePage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/BasePage.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/pages/BasePage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,25 +18,37 @@
*/
package org.apache.openmeetings.web.pages;
-import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
import org.apache.openmeetings.web.app.Application;
-import org.apache.openmeetings.web.app.WebSession;
-import org.apache.openmeetings.web.components.HeaderPanel;
+import org.apache.openmeetings.web.common.HeaderPanel;
+import org.apache.openmeetings.web.util.OmUrlFragment;
+import org.apache.openmeetings.web.util.OmUrlFragment.AreaKeys;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.html.TransparentWebMarkupContainer;
-import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.request.IRequestParameters;
+import org.apache.wicket.util.string.StringValue;
+import org.wicketstuff.urlfragment.AsyncUrlFragmentAwarePage;
-public abstract class BasePage extends WebPage {
+public abstract class BasePage extends AsyncUrlFragmentAwarePage {
private static final long serialVersionUID = -6237917782433412496L;
+ private final Map<String, String> options;
+
+ protected abstract FieldLanguage getLanguage();
+ protected abstract String getApplicationName();
public BasePage() {
- String appName = Application.getBean(ConfigurationDao.class).getAppName();
+ options = new HashMap<String, String>();
+ options.put("fragmentIdentifierSuffix", "");
+ options.put("keyValueDelimiter", "/");
+ String appName = getApplicationName();
- FieldLanguage lang = WebSession.getLanguageObj();
+ FieldLanguage lang = getLanguage();
String code = lang.getCode();
add(new TransparentWebMarkupContainer("html")
.add(new AttributeModifier("xml:lang", code))
@@ -46,11 +58,25 @@
add(new HeaderPanel("header", appName));
}
+ protected OmUrlFragment getUrlFragment(IRequestParameters params) {
+ for (AreaKeys key : AreaKeys.values()) {
+ StringValue type = params.getParameterValue(key.name());
+ if (!type.isEmpty()) {
+ return new OmUrlFragment(key, type.toString());
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected Map<String, String> getOptions() {
+ return options;
+ }
+
@Override
public void renderHead(IHeaderResponse response) {
response.render(JavaScriptHeaderItem.forReference(Application.get()
.getJavaScriptLibrarySettings().getJQueryReference()));
- response.render(JavaScriptHeaderItem.forUrl("js/jquery-ui-1.9.0.custom.min.js", "jquery-ui"));
super.renderHead(response);
}
}
Index: src/org/apache/openmeetings/web/pages/BasePage.html
===================================================================
--- src/org/apache/openmeetings/web/pages/BasePage.html (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/pages/BasePage.html (.../trunk/singlewebapp) (revision 1490226)
@@ -21,9 +21,11 @@
<html xmlns:wicket="http://wicket.apache.org" wicket:id="html">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
+ <link rel="shortcut icon" href="public/favicon.ico" type="image/x-icon"/>
<title wicket:id="pageTitle">[title]</title>
+ <link media="screen" type="text/css" rel="stylesheet" href="css/jquery-ui-1.10.2.custom.min.css"/>
<link rel="stylesheet" type="text/css" href="css/openmeetings-forms.css"/>
+ <link media="screen" type="text/css" rel="stylesheet" href="css/theme.css"/>
</head>
<body>
<div wicket:id="header"></div>
Index: src/org/apache/openmeetings/web/pages/NotInitedPage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/NotInitedPage.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/NotInitedPage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages;
+
+import org.apache.openmeetings.remote.red5.ScopeApplicationAdapter;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.wicket.RestartResponseException;
+
+public class NotInitedPage extends BaseNotInitedPage {
+ private static final long serialVersionUID = 5002281516467955607L;
+
+ public NotInitedPage() {
+ if (ScopeApplicationAdapter.initComplete) {
+ continueToOriginalDestination();
+ // Ups, no original destination. Go to the home page
+ throw new RestartResponseException(Application.get().getHomePage());
+ }
+ }
+}
Index: src/org/apache/openmeetings/web/pages/SwfPage.java
===================================================================
--- src/org/apache/openmeetings/web/pages/SwfPage.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/SwfPage.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.pages;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.web.user.rooms.RoomPanel;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public class SwfPage extends BaseNotInitedPage {
+ private static final long serialVersionUID = 6492618860620779445L;
+
+ public SwfPage() {
+ this(new PageParameters());
+ }
+
+ public SwfPage(PageParameters pp) {
+ add(new Label("titleAppName", getBean(ConfigurationDao.class).getAppName()));
+ add(new RoomPanel("room", pp));
+ }
+
+}
Index: src/org/apache/openmeetings/web/pages/NotInitedPage.html
===================================================================
--- src/org/apache/openmeetings/web/pages/NotInitedPage.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/pages/NotInitedPage.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:extend>
+ <!-- FIXME localized versions of this file need to be created -->
+ <div class="message">
+ <b>OpenMeetings - Loading ...</b><br />
+ The server is not yet completely initialized. Please try again in a couple of seconds.<br/>
+ If this message persists for several minutes contact your Sys-Administration.<br/>
+ If that message stays forever you should check the logs located in
+ <pre>openmeetings_install_dir/log</pre> folder, probably your database user/pwd/host is wrong!
+ </div>
+</wicket:extend>
+</html>
Index: src/org/apache/openmeetings/web/app/WebSession.java
===================================================================
--- src/org/apache/openmeetings/web/app/WebSession.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/app/WebSession.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,6 +18,13 @@
*/
package org.apache.openmeetings.web.app;
+import static java.text.DateFormat.SHORT;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DASHBOARD_SHOW_MYROOMS_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DASHBOARD_SHOW_RSS_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.DEFAUT_LANG_KEY;
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.Application.getDashboardContext;
+
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@@ -30,21 +37,36 @@
import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
import org.apache.openmeetings.data.user.UserManager;
import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.ldap.LdapLoginManagement;
import org.apache.openmeetings.persistence.beans.basic.Sessiondata;
import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.openmeetings.web.user.dashboard.PrivateRoomsWidgetDescriptor;
+import org.apache.openmeetings.web.user.dashboard.RssWidgetDescriptor;
+import org.apache.openmeetings.web.user.dashboard.StartWidgetDescriptor;
+import org.apache.openmeetings.web.user.dashboard.WelcomeWidgetDescriptor;
+import org.apache.openmeetings.web.util.OmUrlFragment;
import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
import org.apache.wicket.request.Request;
+import org.apache.wicket.util.string.Strings;
+
+import ro.fortsoft.wicket.dashboard.Dashboard;
+import ro.fortsoft.wicket.dashboard.DefaultDashboard;
+import ro.fortsoft.wicket.dashboard.WidgetFactory;
+import ro.fortsoft.wicket.dashboard.web.DashboardContext;
public class WebSession extends AbstractAuthenticatedWebSession {
private static final long serialVersionUID = 1123393236459095315L;
+ //private static final Map<String, Locale> LNG_TO_LOCALE_MAP = new HashMap<String, Locale> ();
private long userId = -1;
private long userLevel = -1;
private String SID = null;
- private String area = null;
+ private OmUrlFragment area = null;
private TimeZone tz;
private SimpleDateFormat ISO8601FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+ private DateFormat sdf;
+ private Dashboard dashboard;
public WebSession(Request request) {
super(request);
@@ -56,18 +78,16 @@
userId = -1;
userLevel = -1;
SID = null;
+ sdf = null;
}
@Override
public Roles getRoles() {
Roles r = null;
if (isSignedIn()) {
- userLevel = Application.getBean(UserManager.class).getUserLevelByID(userId);
- AuthLevelUtil authLevel = Application.getBean(AuthLevelUtil.class);
+ userLevel = getBean(UserManager.class).getUserLevelByID(userId);
+ AuthLevelUtil authLevel = getBean(AuthLevelUtil.class);
r = new Roles(Roles.USER);
- if (authLevel.checkUserLevel(userLevel)) {
- r.add(Roles.USER);
- }
if (authLevel.checkAdminLevel(userLevel)) {
r.add(Roles.ADMIN);
}
@@ -80,17 +100,20 @@
return (userId > -1);
}
- public boolean signIn(String login, String password) {
- Sessiondata sessData = Application.getBean(SessiondataDao.class).startsession();
+ public boolean signIn(String login, String password, String ldapConfigFileName) {
+ Sessiondata sessData = getBean(SessiondataDao.class).startsession();
SID = sessData.getSession_id();
- Object u = Application.getBean(UserManager.class).loginUser(SID, login, password,
- null, null, false);
+ Object u = Strings.isEmpty(ldapConfigFileName)
+ ? getBean(UserManager.class).loginUser(SID, login, password, null, null, false)
+ : getBean(LdapLoginManagement.class).doLdapLogin(login, password, null, null, SID, ldapConfigFileName);
if (u instanceof User) {
User user = (User)u;
userId = user.getUser_id();
tz = TimeZone.getTimeZone(user.getOmTimeZone().getIcal());
ISO8601FORMAT.setTimeZone(tz);
+ //FIXMW locale need to be set by User language first
+ sdf = DateFormat.getDateTimeInstance(SHORT, SHORT, getLocale());
if (null == getId()) {
bind();
}
@@ -104,21 +127,22 @@
}
public static String getString(long id) {
- FieldManager fieldManager = Application.getBean(FieldManager.class);
- return fieldManager.getString(id, getLanguage());
+ FieldManager fieldManager = getBean(FieldManager.class);
+ String s = fieldManager.getString(id, getLanguage());
+ return s == null ? "[Missing]" : s;
}
public static long getLanguage() {
WebSession session = get();
if (session.isSignedIn()) {
- return Application.getBean(UsersDao.class).get(session.userId).getLanguage_id();
+ return getBean(UsersDao.class).get(session.userId).getLanguage_id();
} else {
- return Application.getBean(ConfigurationDao.class).getConfValue("default_lang_id", Long.class, "1");
+ return getBean(ConfigurationDao.class).getConfValue(DEFAUT_LANG_KEY, Long.class, "1");
}
}
public static FieldLanguage getLanguageObj() {
- return Application.getBean(FieldLanguageDao.class).getFieldLanguageById(getLanguage());
+ return getBean(FieldLanguageDao.class).getFieldLanguageById(getLanguage());
}
public static String getSid() {
@@ -133,19 +157,54 @@
return Calendar.getInstance(get().tz);
}
- public static DateFormat getDateFormat() {
+ public static DateFormat getIsoDateFormat() {
return get().ISO8601FORMAT;
}
+ public static DateFormat getDateFormat() {
+ return get().sdf;
+ }
+
public static long getUserLevel() {
return get().userLevel;
}
- public String getArea() {
+ public OmUrlFragment getArea() {
return area;
}
- public void setArea(String area) {
+ public void setArea(OmUrlFragment area) {
this.area = area;
}
+
+
+ public static Dashboard getDashboard() {
+ Dashboard d = get().dashboard;
+ if (d == null) {
+ get().initDashboard();
+ d = get().dashboard;
+ }
+ return d;
+ }
+
+ private void initDashboard() {
+ DashboardContext dashboardContext = getDashboardContext();
+ //FIXME check title etc.
+ dashboard = dashboardContext.getDashboardPersiter().load();
+ if (dashboard == null) {
+ dashboard = new DefaultDashboard("default", "Default");
+
+ WidgetFactory widgetFactory = dashboardContext.getWidgetFactory();
+ dashboard.addWidget(widgetFactory.createWidget(new WelcomeWidgetDescriptor()));
+ dashboard.addWidget(widgetFactory.createWidget(new StartWidgetDescriptor()));
+ ConfigurationDao cfgDao = getBean(ConfigurationDao.class);
+ if ("1".equals(cfgDao.getConfValue(DASHBOARD_SHOW_MYROOMS_KEY, Integer.class, "0"))) {
+ dashboard.addWidget(widgetFactory.createWidget(new PrivateRoomsWidgetDescriptor()));
+ }
+ if ("1".equals(cfgDao.getConfValue(DASHBOARD_SHOW_RSS_KEY, Integer.class, "0"))) {
+ dashboard.addWidget(widgetFactory.createWidget(new RssWidgetDescriptor()));
+ }
+ dashboardContext.getDashboardPersiter().save(dashboard);
+ }
+ }
}
Index: src/org/apache/openmeetings/web/app/Application.java
===================================================================
--- src/org/apache/openmeetings/web/app/Application.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/app/Application.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,14 +18,29 @@
*/
package org.apache.openmeetings.web.app;
+import static org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext;
+
+import org.apache.openmeetings.data.basic.FieldLanguagesValuesDao;
+import org.apache.openmeetings.data.user.dao.UsersDao;
import org.apache.openmeetings.remote.red5.ScopeApplicationAdapter;
import org.apache.openmeetings.web.pages.MainPage;
+import org.apache.openmeetings.web.pages.NotInitedPage;
+import org.apache.openmeetings.web.pages.SwfPage;
import org.apache.openmeetings.web.pages.auth.SignInPage;
+import org.apache.openmeetings.web.pages.install.InstallWizardPage;
+import org.apache.openmeetings.web.user.dashboard.PrivateRoomsWidgetDescriptor;
+import org.apache.openmeetings.web.user.dashboard.RssWidgetDescriptor;
+import org.apache.openmeetings.web.user.dashboard.StartWidgetDescriptor;
+import org.apache.openmeetings.web.user.dashboard.WelcomeWidgetDescriptor;
+import org.apache.openmeetings.web.util.Mp4RecordingResourceReference;
+import org.apache.openmeetings.web.util.OggRecordingResourceReference;
+import org.apache.openmeetings.web.util.UserDashboardPersister;
import org.apache.wicket.Page;
+import org.apache.wicket.RestartResponseException;
import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
import org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler;
-import org.apache.wicket.core.request.mapper.HomePageMapper;
+import org.apache.wicket.core.request.mapper.MountedMapper;
import org.apache.wicket.markup.MarkupFactory;
import org.apache.wicket.markup.MarkupParser;
import org.apache.wicket.markup.MarkupResourceStream;
@@ -33,15 +48,23 @@
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.Url;
+import org.apache.wicket.request.component.IRequestablePage;
import org.apache.wicket.request.mapper.info.PageComponentInfo;
+import org.apache.wicket.request.mapper.parameter.PageParametersEncoder;
import org.apache.wicket.settings.IPageSettings;
-import org.springframework.context.ApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
+
+import ro.fortsoft.wicket.dashboard.WidgetRegistry;
+import ro.fortsoft.wicket.dashboard.web.DashboardContext;
+import ro.fortsoft.wicket.dashboard.web.DashboardContextInjector;
+import ro.fortsoft.wicket.dashboard.web.DashboardSettings;
public class Application extends AuthenticatedWebApplication {
+ private DashboardContext dashboardContext;
+ private static boolean isInstalled;
@Override
protected void init() {
+ getSecuritySettings().setAuthenticationStrategy(new OmAuthenticationStrategy());
IPageSettings pageSettings = getPageSettings();
pageSettings.addComponentResolver(new MessageResolver());
pageSettings.addComponentResolver(new MessageTagHandler());
@@ -61,9 +84,39 @@
super.init();
+ // register some widgets
+ dashboardContext = new DashboardContext();
+ dashboardContext.setDashboardPersiter(new UserDashboardPersister());
+ WidgetRegistry widgetRegistry = dashboardContext.getWidgetRegistry();
+ widgetRegistry.registerWidget(new PrivateRoomsWidgetDescriptor());
+ widgetRegistry.registerWidget(new WelcomeWidgetDescriptor());
+ widgetRegistry.registerWidget(new StartWidgetDescriptor());
+ widgetRegistry.registerWidget(new RssWidgetDescriptor());
+ // add dashboard context injector
+ DashboardContextInjector dashboardContextInjector = new DashboardContextInjector(dashboardContext);
+ getComponentInstantiationListeners().add(dashboardContextInjector);
+ DashboardSettings dashboardSettings = DashboardSettings.get();
+ dashboardSettings.setIncludeJQuery(false);
+ dashboardSettings.setIncludeJQueryUI(false);
+
+ getRootRequestMapperAsCompound().add(new NoVersionMapper(getHomePage()));
+ getRootRequestMapperAsCompound().add(new NoVersionMapper("notinited", NotInitedPage.class));
+ mountPage("swf", SwfPage.class);
+ mountPage("install", InstallWizardPage.class);
mountPage("signin", getSignInPageClass());
+ mountResource("/recordings/mp4/${id}", new Mp4RecordingResourceReference());
+ mountResource("/recordings/ogg/${id}", new OggRecordingResourceReference());
+ }
+
+ private static class NoVersionMapper extends MountedMapper {
+ public NoVersionMapper(final Class<? extends IRequestablePage> pageClass) {
+ this("/", pageClass);
+ }
+
+ public NoVersionMapper(String mountPath, final Class<? extends IRequestablePage> pageClass) {
+ super(mountPath, pageClass, new PageParametersEncoder());
+ }
- getRootRequestMapperAsCompound().add(new HomePageMapper(getHomePage()) {
@Override
protected void encodePageComponentInfo(Url url, PageComponentInfo info) {
//Does nothing
@@ -77,7 +130,10 @@
return super.mapHandler(requestHandler);
}
}
- });
+ }
+
+ public static OmAuthenticationStrategy getAuthenticationStrategy() {
+ return (OmAuthenticationStrategy)get().getSecuritySettings().getAuthenticationStrategy();
}
@Override
@@ -99,11 +155,35 @@
return (Application) WebApplication.get();
}
+ public static DashboardContext getDashboardContext() {
+ return get().dashboardContext;
+ }
+
+ //TODO need more safe way FIXME
+ public <T> T _getBean(Class<T> clazz) {
+ return getWebApplicationContext(getServletContext()).getBean(clazz);
+ }
+
+ public static boolean isInstalled() {
+ boolean result = isInstalled;
+ if (!isInstalled) {
+ if (ScopeApplicationAdapter.initComplete) {
+ //TODO can also check crypt class here
+ result = get()._getBean(UsersDao.class).count() > 0
+ && get()._getBean(FieldLanguagesValuesDao.class).count() > 0;
+ }
+ }
+ return result;
+ }
+
public static <T> T getBean(Class<T> clazz) {
if (ScopeApplicationAdapter.initComplete) {
- ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(get().getServletContext());
- return context.getBean(clazz);
+ if (!isInstalled()) {
+ throw new RestartResponseException(InstallWizardPage.class);
+ }
+ return get()._getBean(clazz);
+ } else {
+ throw new RestartResponseException(NotInitedPage.class);
}
- return null;
}
}
Index: src/org/apache/openmeetings/web/app/OmAuthenticationStrategy.java
===================================================================
--- src/org/apache/openmeetings/web/app/OmAuthenticationStrategy.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/app/OmAuthenticationStrategy.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.app;
+
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
+import org.apache.openmeetings.web.pages.MainPage;
+import org.apache.wicket.authentication.strategy.DefaultAuthenticationStrategy;
+import org.apache.wicket.util.string.Strings;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+
+public class OmAuthenticationStrategy extends DefaultAuthenticationStrategy {
+ /** The separator used to concatenate the username and password */
+ private static final String VALUE_SEPARATOR = "-sep-";
+ private static final String COOKIE_KEY = "LoggedIn";
+ private static final Logger log = Red5LoggerFactory.getLogger(MainPage.class, webAppRootKey);
+ /** The cookie name to store the username/password/domain */
+ private final String cookieKey;
+
+ public OmAuthenticationStrategy() {
+ super(COOKIE_KEY);
+ cookieKey = COOKIE_KEY;
+ }
+
+ /**
+ * @see org.apache.wicket.authentication.IAuthenticationStrategy#load()
+ */
+ @Override
+ public String[] load()
+ {
+ String value = getCookieUtils().load(cookieKey);
+ if (Strings.isEmpty(value) == false)
+ {
+ try
+ {
+ value = getCrypt().decryptUrlSafe(value);
+ }
+ catch (RuntimeException e)
+ {
+ log.info(
+ "Error decrypting login cookie: {}. The cookie will be deleted. Possible cause is that a session-relative encryption key was used to encrypt this cookie while this decryption attempt is happening in a different session, eg user coming back to the application after session expiration",
+ cookieKey);
+ getCookieUtils().remove(cookieKey);
+ value = null;
+ }
+ if (Strings.isEmpty(value) == false)
+ {
+ String username = null;
+ String password = null;
+ String domain = null;
+
+ String[] values = value.split(VALUE_SEPARATOR);
+ if ((values.length > 0) && (Strings.isEmpty(values[0]) == false))
+ {
+ username = values[0];
+ }
+ if ((values.length > 1) && (Strings.isEmpty(values[1]) == false))
+ {
+ password = values[1];
+ }
+ if ((values.length > 2) && (Strings.isEmpty(values[2]) == false))
+ {
+ domain = values[2];
+ }
+
+ return new String[] { username, password, domain };
+ }
+ }
+
+ return null;
+ }
+
+ public void save(final String username, final String password, final String domain) {
+ String value = username + VALUE_SEPARATOR + password + VALUE_SEPARATOR + domain;
+
+ String encryptedValue = getCrypt().encryptUrlSafe(value);
+
+ getCookieUtils().save(cookieKey, encryptedValue);
+
+ }
+}
Index: src/org/apache/openmeetings/web/admin/groups/GroupsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/groups/GroupsPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/groups/GroupsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.groups;
+
+import org.apache.openmeetings.data.user.dao.OrganisationDao;
+import org.apache.openmeetings.persistence.beans.domain.Organisation;
+import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.DataViewContainer;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.openmeetings.web.data.OrderByBorder;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+
+/**
+ * Modify/ CRUD operations for {@link Organisation} and
+ * {@link Organisation_Users}
+ *
+ * @author swag
+ *
+ */
+public class GroupsPanel extends AdminPanel {
+ private static final long serialVersionUID = -5170400556006464830L;
+ private AddUsersForm addUsersForm;
+ private GroupForm form;
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ target.appendJavaScript("groupsInit();");
+ }
+
+ @SuppressWarnings("unchecked")
+ public GroupsPanel(String id) {
+ super(id);
+ final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
+ final WebMarkupContainer addUsersBtn = new WebMarkupContainer("addUsersBtn");
+ addUsersBtn.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = 6037994365235148885L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ addUsersForm.clear();
+ target.add(addUsersForm);
+ target.appendJavaScript("addUsers();");
+ }
+ });
+
+ //Adding the Group Form
+ form = new GroupForm("form", listContainer, new Organisation()){
+ private static final long serialVersionUID = -3042797340375988889L;
+
+ @Override
+ protected void onModelChanged() {
+ super.onModelChanged();
+ boolean orgEmpty = getModelObject().getOrganisation_id() == null;
+ if (orgEmpty) {
+ addUsersBtn.add(AttributeModifier.replace("class", "formNewButton disabled"));
+ } else {
+ addUsersBtn.add(AttributeModifier.replace("class", "formNewButton"));
+ }
+ addUsersBtn.setEnabled(!orgEmpty);
+ addUsersForm.setOrganisation(getModelObject());
+ }
+
+ @Override
+ void updateView(AjaxRequestTarget target) {
+ super.updateView(target);
+ target.add(addUsersBtn);
+ }
+ };
+ add(form.add(addUsersBtn.setOutputMarkupId(true)));
+ addUsersForm = new AddUsersForm("addUsers", form);
+ add(addUsersForm);
+
+ //List view
+ SearchableDataView<Organisation> dataView = new SearchableDataView<Organisation>("groupList", new SearchableDataProvider<Organisation>(OrganisationDao.class)) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(Item<Organisation> item) {
+ final Organisation organisation = item.getModelObject();
+ item.add(new Label("organisation_id", "" + organisation.getOrganisation_id()));
+ item.add(new Label("name", "" + organisation.getName()));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = -8069413566800571061L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ form.hideNewRecord();
+ form.setModelObject(organisation);
+ form.updateView(target);
+ target.appendJavaScript("groupsInit();");
+ }
+ });
+ item.add(AttributeModifier.append("class", "clickable " + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
+ }
+ };
+
+ //Paging
+ add(listContainer.add(dataView).setOutputMarkupId(true));
+ DataViewContainer<Organisation> container = new DataViewContainer<Organisation>(listContainer, dataView);
+ container.setLinks(new OrderByBorder<Organisation>("orderById", "organisation_id", container)
+ , new OrderByBorder<Organisation>("orderByName", "name", container));
+ add(container.orderLinks);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = 5097048616003411362L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(listContainer);
+ }
+ });
+ }
+}
Index: src/org/apache/openmeetings/web/admin/groups/GroupForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/groups/GroupForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/groups/GroupForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.groups;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getUserId;
+
+import org.apache.openmeetings.data.user.dao.OrganisationDao;
+import org.apache.openmeetings.persistence.beans.domain.Organisation;
+import org.apache.openmeetings.web.admin.AdminBaseForm;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.OmAjaxFormValidatingBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.time.Duration;
+
+public class GroupForm extends AdminBaseForm<Organisation> {
+ private static final long serialVersionUID = -1720731686053912700L;
+ private GroupUsersPanel usersPanel;
+ private WebMarkupContainer groupList;
+
+ public GroupForm(String id, WebMarkupContainer groupList, Organisation organisation) {
+ super(id, new CompoundPropertyModel<Organisation>(organisation));
+ this.groupList = groupList;
+ setOutputMarkupId(true);
+
+ add(new RequiredTextField<String>("name").setLabel(Model.of(WebSession.getString(165))));
+ usersPanel = new GroupUsersPanel("users", getOrgId());
+ add(usersPanel);
+
+ // attach an ajax validation behavior to all form component's keydown
+ // event and throttle it down to once per second
+ OmAjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
+ }
+
+ void updateView(AjaxRequestTarget target) {
+ usersPanel.update(getOrgId());
+ target.add(this);
+ target.appendJavaScript("groupsInit();");
+ }
+
+ private long getOrgId() {
+ return getModelObject().getOrganisation_id() != null ? getModelObject().getOrganisation_id() : 0;
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> f) {
+ this.setModelObject(new Organisation());
+ updateView(target);
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ Organisation org = getModelObject();
+ if (org.getOrganisation_id() != null) {
+ org = getBean(OrganisationDao.class).get(org.getOrganisation_id());
+ } else {
+ org = new Organisation();
+ }
+ this.setModelObject(org);
+ updateView(target);
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ getBean(OrganisationDao.class).delete(getModelObject(), getUserId());
+ target.add(groupList);
+ target.appendJavaScript("groupsInit();");
+ }
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ getBean(OrganisationDao.class).update(getModelObject(), getUserId());
+ hideNewRecord();
+ target.add(groupList);
+ target.appendJavaScript("groupsInit();");
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+}
Index: src/org/apache/openmeetings/web/admin/groups/GroupUsersPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/groups/GroupUsersPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/groups/GroupUsersPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div class="usergroupspanel">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable" style="min-width: 400px; max-width: 400px" >
+ <tr>
+ <th style="width: 360px"><wicket:ommessage key="177" /></th>
+ <th style="width: 34px"><wicket:ommessage key="275" /></th>
+ </tr>
+ </table>
+ <div class="tableWrapper" style="width: 420px; height: 420px;">
+ <table class="adminListTable" style="min-width: 400px; max-width: 400px">
+ <tbody>
+ <tr wicket:id="userList">
+ <td style="width: 360px"><div style="width: 360px"><span wicket:id="label"></span></div></td>
+ <td style="width: 34px"><div style="width: 34px"><div class="formCancelButton" wicket:id="deleteUserBtn" wicket:ommessage="title:274"><input/></div></div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/groups/GroupsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/groups/GroupsPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/groups/GroupsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <script type="text/javascript">
+ function groupsInit() {
+ $('#addUsers').dialog({
+ closeOnEscape: true
+ , autoOpen: false
+ , resizable: false
+ , width: 400
+ , modal: true
+ });
+ var documentHeight = $(document).height();
+ $('#adminForm').height(documentHeight-114);
+ $('#adminTable').height(documentHeight-144);
+ };
+
+ function addUsers() {
+ $('#addUsers :text').val('');
+ $('#addUsers').dialog('open');
+ };
+ </script>
+ </wicket:head>
+ <wicket:panel>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <tr>
+ <th class="two_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="164" /></th>
+ <th class="two_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="165" /></th>
+ </tr>
+ </table>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="listContainer">
+ <tr wicket:id="groupList">
+ <td class="two_column_layout_column1"><div class="two_column_layout_divcolumn1"><span wicket:id="organisation_id"></span></div></td>
+ <td class="two_column_layout_column2"><div class="two_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="adminPanelColumnForm">
+ <form wicket:id="form" class="adminForm">
+ <div wicket:id="buttons"></div>
+ <div class="scrollcontent" id="adminForm">
+ <fieldset>
+ <legend><wicket:ommessage key="170" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="171" /></label><input type="text" wicket:id="name" />
+ </div>
+ <div class="formelement">
+ <label style="font-weight: bold;"><wicket:ommessage key="273" /></label>
+ <div wicket:id="addUsersBtn" class="formNewButton disabled" wicket:ommessage="title:178"><input/></div>
+ </div>
+ <div class="formelement">
+ <div wicket:id="users"></div>
+ </div>
+ </fieldset>
+ </div>
+ </form>
+ </div>
+ </div>
+ <div id="addUsers" wicket:ommessage="title:180" style="display: none;">
+ <form wicket:id="addUsers">
+ <table>
+ <tr>
+ <td><wicket:ommessage key="181" /></td>
+ <td><input type="text" wicket:id="searchText" /></td>
+ </tr>
+ <tr>
+ <td style="text-align: right"><input type="button" wicket:id="search" /></td>
+ </tr>
+ <tr>
+ <td><wicket:ommessage key="183" /></td>
+ <td><select wicket:id="users" style="width: 200px; height: 300px;"></select></td>
+ </tr>
+ <tr>
+ <td colspan="2" style="text-align: right"><input type="button" wicket:id="add" /></td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/groups/AddUsersForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/groups/AddUsersForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/groups/AddUsersForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.groups;
+
+import static org.apache.openmeetings.web.admin.groups.GroupUsersPanel.getUser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.persistence.beans.domain.Organisation;
+import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
+import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.ListMultipleChoice;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+public class AddUsersForm extends Form<Void> {
+ private static final long serialVersionUID = -2458265250684437277L;
+ private Organisation organisation;
+ private String userSearchText;
+ private List<User> usersInList = new ArrayList<User>();
+ private List<User> usersToAdd = new ArrayList<User>();
+
+ public AddUsersForm(String id, final GroupForm groupForm) {
+ super(id);
+
+ IModel<List<User>> listUsersModel = new PropertyModel<List<User>>(AddUsersForm.this, "usersInList");
+ IModel<List<User>> selectedUsersModel = new PropertyModel<List<User>>(AddUsersForm.this, "usersToAdd");
+ final ListMultipleChoice<User> users = new ListMultipleChoice<User>("users"
+ , selectedUsersModel
+ , listUsersModel
+ , new IChoiceRenderer<User>() {
+ private static final long serialVersionUID = 1L;
+
+ public Object getDisplayValue(User object) {
+ return getUser(object);
+ }
+
+ public String getIdValue(User object, int index) {
+ return "" + object.getUser_id();
+ }
+ });
+
+ add(new TextField<String>("searchText", new PropertyModel<String>(AddUsersForm.this, "userSearchText")));
+ add(new AjaxButton("search", Model.of(WebSession.getString(182L))) {
+ private static final long serialVersionUID = -4752180617634945030L;
+
+ protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
+ clear();
+ usersInList.addAll(Application.getBean(UsersDao.class).get(userSearchText));
+ target.add(users);
+ }
+ });
+ add(users.setOutputMarkupId(true));
+ add(new AjaxButton("add", Model.of(WebSession.getString(175L))) {
+ private static final long serialVersionUID = 5553555064487161840L;
+
+ protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
+ UsersDao userDao = Application.getBean(UsersDao.class);
+ for (User u : usersToAdd) {
+ List<Organisation_Users> orgUsers = u.getOrganisation_users();
+ boolean found = false;
+ for (Organisation_Users ou : orgUsers) {
+ if (ou.getOrganisation().getOrganisation_id().equals(organisation.getOrganisation_id())) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ Organisation_Users orgUser = new Organisation_Users(organisation);
+ orgUser.setDeleted(false);
+ orgUsers.add(orgUser);
+ userDao.update(u, WebSession.getUserId());
+ }
+ }
+ target.appendJavaScript("$('#addUsers').dialog('close');");
+ groupForm.updateView(target);
+ }
+ });
+ }
+
+ public void clear() {
+ usersToAdd.clear();
+ usersInList.clear();
+ }
+
+ public void setOrganisation(Organisation org) {
+ organisation = org;
+ }
+}
Index: src/org/apache/openmeetings/web/admin/groups/GroupUsersPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/groups/GroupUsersPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/groups/GroupUsersPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.groups;
+
+import org.apache.openmeetings.data.user.dao.OrganisationUserDao;
+import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
+import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.ConfirmCallListener;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.Model;
+
+public class GroupUsersPanel extends Panel {
+ private static final long serialVersionUID = -1813488722913433227L;
+ private long organisationId;
+
+ public static String getUser(User u) {
+ return u.getLogin() + " [" + u.getFirstname() + ", " + u.getLastname() + "]";
+ }
+
+ public GroupUsersPanel(String id, long orgId) {
+ super(id);
+ this.organisationId = orgId;
+ setOutputMarkupId(true);
+
+ SearchableDataView<Organisation_Users> dataView = new SearchableDataView<Organisation_Users>("userList", new SearchableDataProvider<Organisation_Users>(OrganisationUserDao.class){
+ private static final long serialVersionUID = 1L;
+
+ protected OrganisationUserDao getDao() {
+ return (OrganisationUserDao)super.getDao();
+ }
+
+ public long size() {
+ return search == null ? getDao().count(organisationId) : getDao().count(organisationId, search);
+ }
+
+ public java.util.Iterator<? extends Organisation_Users> iterator(long first, long count) {
+ return (search == null && getSort() == null
+ ? getDao().get(organisationId, (int)first, (int)count)
+ : getDao().get(organisationId, search, (int)first, (int)count, getSortStr())).iterator();
+ }
+ }) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(Item<Organisation_Users> item) {
+ final Organisation_Users orgUser = item.getModelObject();
+ User u = orgUser.getUser();
+ if (u != null) {
+ item.add(new Label("label", Model.of(getUser(u))));
+ } else {
+ item.add(new Label("label", Model.of("")));
+ }
+ item.add(new WebMarkupContainer("deleteUserBtn").add(new AjaxEventBehavior("onclick"){
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+ attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
+ }
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ Application.getBean(OrganisationUserDao.class).delete(orgUser, WebSession.getUserId());
+ target.add(GroupUsersPanel.this);
+ }
+ }));
+ item.add(AttributeModifier.append("class", ((item.getIndex() % 2 == 1) ? "even" : "odd")));
+ }
+ };
+ add(dataView).setOutputMarkupId(true);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = 5097048616003411362L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(GroupUsersPanel.this);
+ }
+ });
+ }
+
+ void update(long orgId) {
+ organisationId = orgId;
+ }
+}
Index: src/org/apache/openmeetings/web/admin/AdminBaseForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/AdminBaseForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/AdminBaseForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.IModel;
+
+/**
+ * provides basic functionality to insert, update, remove, refresh record in
+ * admin section
+ *
+ * @author swagner
+ *
+ * @param <T>
+ */
+public abstract class AdminBaseForm<T> extends Form<T> {
+ private static final long serialVersionUID = 1L;
+ private AdminSavePanel<T> savePanel;
+
+ public AdminBaseForm(String id, IModel<T> object) {
+ super(id, object);
+
+ savePanel = new AdminSavePanel<T>("buttons", this) {
+ private static final long serialVersionUID = -5833647470067891270L;
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onSaveSubmit(target, form);
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onSaveError(target, form);
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onNewSubmit(target, form);
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onNewError(target, form);
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onRefreshSubmit(target, form);
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onRefreshError(target, form);
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onDeleteSubmit(target, form);
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ AdminBaseForm.this.onDeleteError(target, form);
+ }
+
+ };
+ add(savePanel);
+
+
+ }
+
+ /**
+ * @see AdminBaseForm#hideNewRecord()
+ */
+ public void hideNewRecord() {
+ savePanel.hideNewRecord();
+ }
+
+ /**
+ * @see AdminBaseForm#showNewRecord()
+ */
+ public void showNewRecord() {
+ savePanel.showNewRecord();
+ }
+
+ /**
+ * invoked when user press save button
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onSaveSubmit(AjaxRequestTarget target, Form<?> form);
+
+ /**
+ * invoked when save has error
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onSaveError(AjaxRequestTarget target, Form<?> form);
+
+ /**
+ * invoked when new button is pressed
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onNewSubmit(AjaxRequestTarget target, Form<?> form);
+
+ /**
+ * invoked if new has error
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onNewError(AjaxRequestTarget target, Form<?> form);
+
+ /**
+ * invoked when refresh button is pressed
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onRefreshSubmit(AjaxRequestTarget target, Form<?> form);
+
+ /**
+ * invoked when refresh has error
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onRefreshError(AjaxRequestTarget target, Form<?> form);
+
+ /**
+ * invoked when delete button is pressed
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onDeleteSubmit(AjaxRequestTarget target, Form<?> form);
+
+ /**
+ * invoked when delete has error
+ *
+ * @param target
+ * @param form
+ */
+ protected abstract void onDeleteError(AjaxRequestTarget target, Form<?> form);
+
+}
Index: src/org/apache/openmeetings/web/admin/AdminPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/AdminPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/AdminPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin;
+
+import org.apache.openmeetings.web.common.BasePanel;
+import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
+
+@AuthorizeInstantiation("ADMIN")
+public abstract class AdminPanel extends BasePanel {
+ private static final long serialVersionUID = 6811243474361803279L;
+
+ public AdminPanel(String id) {
+ super(id);
+ }
+}
Index: src/org/apache/openmeetings/web/admin/servers/ServersPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/servers/ServersPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/servers/ServersPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.servers;
+
+import org.apache.openmeetings.data.basic.dao.ServerDao;
+import org.apache.openmeetings.persistence.beans.basic.Server;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.DataViewContainer;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.openmeetings.web.data.OrderByBorder;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+
+/**
+ * Form component with list and form to manipulate {@link Server}
+ *
+ * @author swagner
+ *
+ */
+public class ServersPanel extends AdminPanel {
+ private static final long serialVersionUID = -2197334608577346569L;
+ private ServerForm form;
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ target.appendJavaScript("omServerPanelInit();");
+ }
+
+ @SuppressWarnings("unchecked")
+ public ServersPanel(String id) {
+ super(id);
+ SearchableDataView<Server> dataView = new SearchableDataView<Server>("serverList",
+ new SearchableDataProvider<Server>(ServerDao.class)) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(final Item<Server> item) {
+ final Server Server = item.getModelObject();
+ item.add(new Label("id", "" + Server.getId()));
+ item.add(new Label("name", "" + Server.getName()));
+ item.add(new Label("address", "" + Server.getAddress()));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = -8069413566800571061L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ form.setModelObject(Server);
+ form.hideNewRecord();
+ target.add(form);
+ target.appendJavaScript("omServerPanelInit();");
+ }
+ });
+ item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
+ }
+ };
+
+ final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
+ add(listContainer.add(dataView).setOutputMarkupId(true));
+ DataViewContainer<Server> container = new DataViewContainer<Server>(listContainer, dataView);
+ container.setLinks(new OrderByBorder<Server>("orderById", "id", container)
+ , new OrderByBorder<Server>("orderByName", "name", container)
+ , new OrderByBorder<Server>("orderByAddress", "address", container));
+ add(container.orderLinks);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = 5097048616003411362L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(listContainer);
+ }
+ });
+
+ form = new ServerForm("form", listContainer, new Server());
+ form.showNewRecord();
+ add(form);
+
+ }
+}
Index: src/org/apache/openmeetings/web/admin/servers/ServerForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/servers/ServerForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/servers/ServerForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.servers;
+
+import org.apache.openmeetings.data.basic.dao.ServerDao;
+import org.apache.openmeetings.persistence.beans.basic.Server;
+import org.apache.openmeetings.web.admin.AdminBaseForm;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.OmAjaxFormValidatingBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.datetime.markup.html.basic.DateLabel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.time.Duration;
+
+/**
+ * Form component to insert/update/delete {@link Server}
+ *
+ * @author swagner
+ *
+ */
+public class ServerForm extends AdminBaseForm<Server> {
+
+ private final WebMarkupContainer listContainer;
+ private static final long serialVersionUID = 1L;
+
+ public ServerForm(String id, WebMarkupContainer listContainer,
+ final Server server) {
+ super(id, new CompoundPropertyModel<Server>(server));
+ setOutputMarkupId(true);
+ this.listContainer = listContainer;
+
+ add(new RequiredTextField<String>("name").setLabel(Model.of(WebSession.getString(1500))));
+ add(new CheckBox("active"));
+ add(new RequiredTextField<String>("address").setLabel(Model.of(WebSession.getString(1501))));
+ add(new TextField<Integer>("port"));
+ add(new TextField<String>("user"));
+ add(new TextField<String>("pass"));
+ add(new TextField<String>("webapp"));
+ add(new TextField<String>("protocol"));
+ add(DateLabel.forDatePattern("lastPing", "dd.MM.yyyy HH:mm:ss"));
+ //add(new Label("pingRunning"));
+ add(DateLabel.forDatePattern("inserted", "dd.MM.yyyy HH:mm:ss"));
+ add(new Label("insertedby.login"));
+ add(DateLabel.forDatePattern("updated", "dd.MM.yyyy HH:mm:ss"));
+ add(new Label("updatedby.login"));
+ add(new TextArea<String>("comment"));
+
+ // attach an ajax validation behavior to all form component's keydown
+ // event and throttle it down to once per second
+ OmAjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
+ }
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ Application.getBean(ServerDao.class).update(getModelObject(),
+ WebSession.getUserId());
+ Server server = Application.getBean(ServerDao.class).get(
+ getModelObject().getId());
+ setModelObject(server);
+ hideNewRecord();
+ target.add(this);
+ target.add(listContainer);
+ target.appendJavaScript("omServerPanelInit();");
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
+ Server s = new Server();
+ s.setWebapp("openmeetings");
+ s.setProtocol("http");
+ setModelObject(s);
+ target.add(this);
+ target.appendJavaScript("omServerPanelInit();");
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ Server server = getModelObject();
+ if (server.getId() <= 0) {
+ server = Application.getBean(ServerDao.class).get(
+ server.getId());
+ } else {
+ server = new Server();
+ }
+ setModelObject(server);
+ target.add(this);
+ target.appendJavaScript("omServerPanelInit();");
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ Application.getBean(ServerDao.class).delete(getModelObject(),
+ WebSession.getUserId());
+ this.setModelObject(new Server());
+ target.add(listContainer);
+ target.add(this);
+ target.appendJavaScript("omServerPanelInit();");
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+}
Index: src/org/apache/openmeetings/web/admin/servers/ServersPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/servers/ServersPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/servers/ServersPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <script type="text/javascript">
+ function omServerPanelInit() {
+ var documentHeight = $(document).height();
+ $('#adminForm').height(documentHeight-114);
+ $('#adminTable').height(documentHeight-144);
+ }
+ </script>
+ </wicket:head>
+ <wicket:panel>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <thead>
+ <tr>
+ <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="188" /></th>
+ <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="1500" /></th>
+ <th class="three_column_layout_column3"><span wicket:id="orderByAddress"></span><wicket:ommessage key="1501" /></th>
+ </tr>
+ </thead>
+ </table>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="listContainer">
+ <tr wicket:id="serverList">
+ <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="id"></span></div></td>
+ <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
+ <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="address"></span></div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="adminPanelColumnForm">
+ <form wicket:id="form" class="adminForm">
+ <div wicket:id="buttons"></div>
+ <div class="scrollcontent" id="adminForm">
+ <fieldset>
+ <legend><wicket:ommessage key="1502" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="1500" /></label><input type="text" wicket:id="name"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1525" /></label><input type="checkbox" class="formcheckbox" wicket:id="active" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1501" /></label><input type="text" wicket:id="address"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1519" /></label><input type="text" wicket:id="port"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1520" /></label><input type="text" wicket:id="user"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1521" /></label><input type="text" wicket:id="pass"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1522" /></label><input type="text" wicket:id="webapp"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1523" /></label><input type="text" wicket:id="protocol"/>
+ </div>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage key="1518" /></div>
+ <br/>
+ <label><wicket:ommessage key="1517" /></label><span wicket:id="lastPing"/>
+ <!-- br/>
+ <label><wicket:ommessage key="1524" /></label><span wicket:id="pingRunning"/-->
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1110" /></label><span wicket:id="inserted"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1111" /></label><span wicket:id="insertedby.login"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1112" /></label><span wicket:id="updated"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1113" /></label><span wicket:id="updatedby.login"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="270" /></label><textarea wicket:id="comment"/>
+ </div>
+ </fieldset>
+ </div>
+ </form>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/AdminSavePanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/AdminSavePanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/AdminSavePanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div class="formNewButton">
+ <input type="submit" value="" wicket:id="ajax-new-button" wicket:ommessage="title:155" />
+ </div>
+ <div class="formCancelButton">
+ <input type="submit" value="" wicket:id="ajax-cancel-button" wicket:ommessage="title:157" />
+ </div>
+ <span wicket:id="newRecord"></span>
+ </wicket:extend>
+</html>
Index: src/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.configurations;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.persistence.beans.basic.Configuration;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.DataViewContainer;
+import org.apache.openmeetings.web.data.OrderByBorder;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+
+/**
+ * add/update/delete {@link Configuration}
+ *
+ * @author swagner
+ *
+ */
+public class ConfigsPanel extends AdminPanel {
+ private static final long serialVersionUID = -1L;
+ private ConfigForm form;
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ target.appendJavaScript("omConfigPanelInit();");
+ }
+
+ @SuppressWarnings("unchecked")
+ public ConfigsPanel(String id) {
+ super(id);
+
+ SearchableDataView<Configuration> dataView = new SearchableDataView<Configuration>("configList"
+ , new SearchableDataProvider<Configuration>(ConfigurationDao.class)) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(final Item<Configuration> item) {
+ final Configuration configuration = item.getModelObject();
+ item.add(new Label("configuration_id", "" + configuration.getConfiguration_id()));
+ item.add(new Label("conf_key", "" + configuration.getConf_key()));
+ item.add(new Label("conf_value", "" + configuration.getConf_value()));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = -8069413566800571061L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ form.hideNewRecord();
+ form.setModelObject(configuration);
+ target.add(form);
+ target.appendJavaScript("omConfigPanelInit();");
+ }
+ });
+ item.add(AttributeModifier.replace("class", "clickable "
+ + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
+ }
+ };
+ final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
+ add(listContainer.add(dataView).setOutputMarkupId(true));
+ DataViewContainer<Configuration> container = new DataViewContainer<Configuration>(listContainer, dataView);
+ container.setLinks(new OrderByBorder<Configuration>("orderById", "configuration_id", container)
+ , new OrderByBorder<Configuration>("orderByKey", "conf_key", container)
+ , new OrderByBorder<Configuration>("orderByValue", "conf_value", container));
+ add(container.orderLinks);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = 5097048616003411362L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(listContainer);
+ }
+ });
+
+ form = new ConfigForm("form", listContainer, new Configuration());
+ form.showNewRecord();
+ add(form);
+
+ }
+}
Index: src/org/apache/openmeetings/web/admin/configurations/ConfigForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/configurations/ConfigForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/configurations/ConfigForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.configurations;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.persistence.beans.basic.Configuration;
+import org.apache.openmeetings.web.admin.AdminBaseForm;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.OmAjaxFormValidatingBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.datetime.markup.html.basic.DateLabel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+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
+ *
+ * @author swagner
+ *
+ */
+public class ConfigForm extends AdminBaseForm<Configuration> {
+
+ 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, Configuration configuration) {
+ super(id, new CompoundPropertyModel<Configuration>(configuration));
+ setOutputMarkupId(true);
+ this.listContainer = listContainer;
+ add(new RequiredTextField<String>("conf_key").setLabel(Model.of(WebSession.getString(267))).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(ConfigForm.this.getModelObject().getConfiguration_id())) {
+ error(WebSession.getString(1544L));
+ }
+ }
+ }));
+ add(new RequiredTextField<String>("conf_value").setLabel(Model.of(WebSession.getString(271))));
+ add(DateLabel.forDatePattern("updatetime", "dd.MM.yyyy HH:mm:ss"));
+ add(new Label("user.login"));
+ add(new TextArea<String>("comment"));
+
+ // attach an ajax validation behavior to all form component's keydown
+ // event and throttle it down to once per second
+ OmAjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
+
+ }
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ this.setModelObject(getConfigDao().update(getModelObject(), WebSession.getUserId()));
+ hideNewRecord();
+ target.add(listContainer);
+ refresh(target);
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
+ this.setModelObject(new Configuration());
+ refresh(target);
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ Configuration conf = this.getModelObject();
+ if (conf.getConfiguration_id() != null) {
+ conf = getConfigDao().get(conf.getConfiguration_id());
+ } else {
+ conf = new Configuration();
+ }
+ this.setModelObject(conf);
+ refresh(target);
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ Application.getBean(ConfigurationDao.class).delete(this.getModelObject(), WebSession.getUserId());
+ this.setModelObject(new Configuration());
+ target.add(listContainer);
+ refresh(target);
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+}
Index: src/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/configurations/ConfigsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <script type="text/javascript">
+ function omConfigPanelInit() {
+ var documentHeight = $(document).height();
+ $('#adminForm').height(documentHeight-114);
+ $('#adminTable').height(documentHeight-144);
+ }
+ </script>
+ </wicket:head>
+ <wicket:panel>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <thead>
+ <tr>
+ <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="264" /></th>
+ <th class="three_column_layout_column2"><span wicket:id="orderByKey"></span><wicket:ommessage key="265" /></th>
+ <th class="three_column_layout_column3"><span wicket:id="orderByValue"></span><wicket:ommessage key="598" /></th>
+ </tr>
+ </thead>
+ </table>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="listContainer" >
+ <tr wicket:id="configList">
+ <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="configuration_id"></span></div></td>
+ <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="conf_key"></span></div></td>
+ <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="conf_value"></span></div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="adminPanelColumnForm">
+ <form wicket:id="form" class="adminForm">
+ <div wicket:id="buttons"></div>
+ <div class="scrollcontent" id="adminForm">
+ <fieldset>
+ <legend><wicket:ommessage key="266" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="267" /></label><input type="text" wicket:id="conf_key"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="271" /></label><input type="text" wicket:id="conf_value"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="268" /></label><span wicket:id="updatetime"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="269" /></label><span wicket:id="user.login"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="270" /></label><textarea wicket:id="comment"/>
+ </div>
+ </fieldset>
+ </div>
+ </form>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/AdminPagingNavigator.html
===================================================================
--- src/org/apache/openmeetings/web/admin/AdminPagingNavigator.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/AdminPagingNavigator.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <a wicket:id="first" class="first"></a>
+ <a wicket:id="prev" class="prev"></a>
+ <span wicket:id="navigation" class="goto">
+ <a wicket:id="pageLink" href="#"><span wicket:id="pageNumber">5</span></a>
+ </span>
+ <a wicket:id="next" class="next"></a>
+ <a wicket:id="last" class="last"></a>
+ </wicket:panel>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/admin/SearchableDataView.java
===================================================================
--- src/org/apache/openmeetings/web/admin/SearchableDataView.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/SearchableDataView.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin;
+
+import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.wicket.markup.repeater.data.DataView;
+
+/**
+ * Provides {@link SearchableDataProvider}
+ *
+ * @author swagner
+ *
+ * @param <T>
+ */
+public abstract class SearchableDataView<T extends IDataProviderEntity> extends DataView<T> {
+ private static final long serialVersionUID = -6251644410385789409L;
+ private SearchableDataProvider<T> dp;
+
+ public SearchableDataView(String id, SearchableDataProvider<T> dp) {
+ super(id, dp);
+ this.dp = dp;
+ }
+
+ @Override
+ public SearchableDataProvider<T> getDataProvider() {
+ return dp;
+ }
+}
Index: src/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.connection;
+
+import static java.lang.Boolean.TRUE;
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getSid;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.openmeetings.persistence.beans.room.Client;
+import org.apache.openmeetings.remote.UserService;
+import org.apache.openmeetings.session.SessionManager;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.ConfirmableAjaxLink;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.markup.repeater.RepeatingView;
+
+public class ConnectionsPanel extends AdminPanel {
+ private static final long serialVersionUID = -5074847509312630580L;
+
+ public ConnectionsPanel(String id) {
+ super(id);
+
+ SearchableDataProvider<Client> sdp = new SearchableDataProvider<Client>(null) {
+ private static final long serialVersionUID = 1L;
+
+ //FIXME add search
+
+ @Override
+ public Iterator<? extends Client> iterator(long first, long count) {
+ //FIXME add grouping by public SID
+ List<Client> l = new ArrayList<Client>(getBean(SessionManager.class).getClients());
+ return l.subList((int)Math.max(0, first), (int)Math.min(first + count, l.size())).iterator();
+ }
+
+ @Override
+ public long size() {
+ return getBean(SessionManager.class).getClients().size();
+ }
+ };
+ final WebMarkupContainer container = new WebMarkupContainer("container");
+ final WebMarkupContainer details = new WebMarkupContainer("details");
+ SearchableDataView<Client> dataView = new SearchableDataView<Client>("clientList", sdp) {
+ private static final long serialVersionUID = 2863400959190625386L;
+
+ @Override
+ protected void populateItem(final Item<Client> item) {
+ Client c = item.getModelObject();
+ item.add(new Label("id", c.getStreamid()));
+ item.add(new Label("login", c.getUsername()));
+ item.add(new Label("since", c.getConnectedSince()));
+ item.add(new Label("scope", c.getScope()));
+ item.add(new Label("server", c.getServer() == null ? "no cluster" : c.getServer().getAddress())); //FIXME localization
+ item.add(new ConfirmableAjaxLink("kick", 605) {
+ private static final long serialVersionUID = 1860369399943234763L;
+
+ @Override
+ public void onClick(AjaxRequestTarget target) {
+ Client c = item.getModelObject();
+ getBean(UserService.class).kickUserByStreamId(getSid(), c.getStreamid()
+ , c.getServer() == null ? 0 : c.getServer().getId());
+ target.add(container, details.setVisible(false));
+ }
+ }.setEnabled(!TRUE.equals(c.getIsScreenClient()) && !TRUE.equals(c.getIsAVClient())));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = 9180559138402389613L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ Field[] ff = Client.class.getDeclaredFields();
+ RepeatingView lines = new RepeatingView("line");
+ Client c = item.getModelObject();
+ for (Field f : ff) {
+ int mod = f.getModifiers();
+ if (Modifier.isStatic(mod) || Modifier.isTransient(mod)) {
+ continue;
+ }
+ WebMarkupContainer line = new WebMarkupContainer(lines.newChildId());
+ line.add(new Label("name", f.getName()));
+ String val = "";
+ try {
+ f.setAccessible(true);
+ val = "" + f.get(c);
+ } catch (Exception e) {
+ //noop
+ }
+ line.add(new Label("value", val));
+ lines.add(line);
+ }
+ details.addOrReplace(lines);
+ target.add(details.setVisible(true));
+ }
+ });
+ item.add(AttributeModifier.append("class", "clickable " + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
+ }
+ };
+ add(container.add(dataView).setOutputMarkupId(true), details.setVisible(false).setOutputMarkupPlaceholderTag(true));
+
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = 5097048616003411362L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(container);
+ }
+ });
+ }
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ }
+}
Index: src/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/connection/ConnectionsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <thead>
+ <tr>
+ <th><wicket:ommessage key="599" /></th>
+ <th><wicket:ommessage key="600" /></th>
+ <th><wicket:ommessage key="601" /></th>
+ <th><wicket:ommessage key="602" /></th>
+ <th><wicket:ommessage key="603" /></th>
+ <th><wicket:ommessage key="1501" /></th>
+ </tr>
+ </thead>
+ <tbody wicket:id="container" >
+ <tr wicket:id="clientList">
+ <td wicket:id="id"></td>
+ <td wicket:id="login"></td>
+ <td wicket:id="since"></td>
+ <td wicket:id="scope"></td>
+ <td><a wicket:id="kick"><wicket:ommessage key="603" /></a></td>
+ <td wicket:id="server"></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="adminPanelColumnForm">
+ <table wicket:id="details" style="width: 450px;">
+ <tr wicket:id="line"><td wicket:id="name"></td><td wicket:id="value"></td></tr>
+ </table>
+ </div>
+ </div>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/rooms/RoomsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/rooms/RoomsPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/rooms/RoomsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.rooms;
+
+import org.apache.openmeetings.data.conference.dao.RoomDao;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.DataViewContainer;
+import org.apache.openmeetings.web.data.OrderByBorder;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+
+public class RoomsPanel extends AdminPanel {
+
+ private static final long serialVersionUID = -1L;
+ private RoomForm form;
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ target.appendJavaScript("omRoomPanelInit();");
+ }
+
+ @SuppressWarnings("unchecked")
+ public RoomsPanel(String id) {
+ super(id);
+ SearchableDataView<Room> dataView = new SearchableDataView<Room>("roomList", new SearchableDataProvider<Room>(RoomDao.class)) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(final Item<Room> item) {
+ final Room room = item.getModelObject();
+ item.add(new Label("rooms_id", "" + room.getRooms_id()));
+ item.add(new Label("name", "" + room.getName()));
+ item.add(new Label("ispublic", ""+room.getIspublic()));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = -8069413566800571061L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ form.setModelObject(room);
+ form.hideNewRecord();
+ target.add(form);
+ target.appendJavaScript("omRoomPanelInit();");
+ }
+ });
+ item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
+ }
+ };
+
+ final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
+ add(listContainer.add(dataView).setOutputMarkupId(true));
+ DataViewContainer<Room> container = new DataViewContainer<Room>(listContainer, dataView);
+ container.setLinks(new OrderByBorder<Room>("orderById", "rooms_id", container)
+ , new OrderByBorder<Room>("orderByName", "name", container)
+ , new OrderByBorder<Room>("orderByPublic", "ispublic", container));
+ add(container.orderLinks);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = -1L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(listContainer);
+ }
+ });
+
+ form = new RoomForm("form", listContainer, new Room());
+ form.showNewRecord();
+ add(form);
+
+ }
+}
Index: src/org/apache/openmeetings/web/admin/rooms/RoomForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/rooms/RoomForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/rooms/RoomForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.rooms;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getUserId;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.openmeetings.data.conference.RoomManager;
+import org.apache.openmeetings.data.conference.dao.RoomDao;
+import org.apache.openmeetings.data.user.OrganisationManager;
+import org.apache.openmeetings.persistence.beans.domain.Organisation;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.persistence.beans.room.RoomOrganisation;
+import org.apache.openmeetings.persistence.beans.room.RoomType;
+import org.apache.openmeetings.web.admin.AdminBaseForm;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.OmAjaxFormValidatingBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.ListMultipleChoice;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.time.Duration;
+
+public class RoomForm extends AdminBaseForm<Room> {
+ private static final long serialVersionUID = 1L;
+ private final static List<Long> DROPDOWN_NUMBER_OF_PARTICIPANTS = Arrays.asList(2L, 4L, 6L, 8L, 10L, 12L, 14L, 16L, 20L, 25L, 32L, 50L,
+ 100L, 150L, 200L, 500L, 1000L);
+ private final WebMarkupContainer roomList;
+
+ public RoomForm(String id, WebMarkupContainer roomList, final Room room) {
+ super(id, new CompoundPropertyModel<Room>(room));
+ this.roomList = roomList;
+ setOutputMarkupId(true);
+ RequiredTextField<String> name = new RequiredTextField<String>("name");
+ name.setLabel(new Model<String>(WebSession.getString(193)));
+ add(name);
+
+ add(new DropDownChoice<Long>("numberOfPartizipants", //
+ DROPDOWN_NUMBER_OF_PARTICIPANTS, //
+ new IChoiceRenderer<Long>() {
+ private static final long serialVersionUID = 1L;
+ public Object getDisplayValue(Long id) {
+ return id;
+ }
+ public String getIdValue(Long id, int index) {
+ return "" + id;
+ }
+ }));
+
+ add(new DropDownChoice<RoomType>("roomtype", Application.getBean(
+ RoomManager.class).getAllRoomTypes(WebSession.getLanguage()),
+ new ChoiceRenderer<RoomType>("label.value", "roomtypes_id")));
+
+ add(new TextArea<String>("comment"));
+
+ add(new CheckBox("appointment"));
+ add(new CheckBox("ispublic"));
+
+ List<Organisation> orgList = Application.getBean(
+ OrganisationManager.class).getOrganisations(3L);
+ List<RoomOrganisation> orgRooms = new ArrayList<RoomOrganisation>(
+ orgList.size());
+ for (Organisation org : orgList) {
+ orgRooms.add(new RoomOrganisation(org));
+ }
+ ListMultipleChoice<RoomOrganisation> orgChoiceList = new ListMultipleChoice<RoomOrganisation>(
+ "roomOrganisations", orgRooms,
+ new ChoiceRenderer<RoomOrganisation>("organisation.name",
+ "organisation.organisation_id"));
+ orgChoiceList.setMaxRows(6);
+ add(orgChoiceList);
+
+ add(new CheckBox("isDemoRoom"));
+ TextField<Integer> demoTime = new TextField<Integer>("demoTime");
+ demoTime.setLabel(new Model<String>(WebSession.getString(637)));
+ add(demoTime);
+ add(new CheckBox("allowUserQuestions"));
+ add(new CheckBox("isAudioOnly"));
+ add(new CheckBox("isClosed"));
+ add(new TextField<String>("redirectURL"));
+ add(new CheckBox("waitForRecording"));
+ add(new CheckBox("allowRecording"));
+
+ add(new CheckBox("hideTopBar"));
+ add(new CheckBox("hideChat"));
+ add(new CheckBox("hideActivitiesAndActions"));
+ add(new CheckBox("hideFilesExplorer"));
+ add(new CheckBox("hideActionsMenu"));
+ add(new CheckBox("hideScreenSharing"));
+ add(new CheckBox("hideWhiteboard"));
+ add(new CheckBox("showMicrophoneStatus"));
+ add(new CheckBox("chatModerated"));
+ add(new CheckBox("chatOpened"));
+ add(new CheckBox("filesOpened"));
+ add(new CheckBox("autoVideoSelect"));
+
+ // FIXME: Room user moderator list
+
+ add(new CheckBox("isModeratedRoom"));
+
+
+ // attach an ajax validation behavior to all form component's keydown
+ // event and throttle it down to once per second
+ OmAjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
+ }
+
+ private void updateView(AjaxRequestTarget target) {
+ target.add(this);
+ target.add(roomList);
+ target.appendJavaScript("omRoomPanelInit();");
+ }
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ getBean(RoomDao.class).update(getModelObject(), getUserId());
+ hideNewRecord();
+ updateView(target);
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
+ setModelObject(new Room());
+ updateView(target);
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ Room r = getModelObject();
+ if (r.getRooms_id() != null) {
+ r = getBean(RoomDao.class).get(r.getRooms_id());
+ } else {
+ r = new Room();
+ }
+ setModelObject(r);
+ updateView(target);
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ getBean(RoomDao.class).delete(getModelObject(), getUserId());
+ target.add(roomList);
+ updateView(target);
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+}
Index: src/org/apache/openmeetings/web/admin/rooms/RoomsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/rooms/RoomsPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/rooms/RoomsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <script type="text/javascript">
+ function omRoomPanelInit() {
+ var documentHeight = $(document).height();
+ $('#adminForm').height(documentHeight-114);
+ $('#adminTable').height(documentHeight-144);
+ }
+ </script>
+ </wicket:head>
+ <wicket:panel>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <thead>
+ <tr>
+ <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="188" /></th>
+ <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="189" /></th>
+ <th class="three_column_layout_column3"><span wicket:id="orderByPublic"></span><wicket:ommessage key="190" /></th>
+ </tr>
+ </thead>
+ </table>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="listContainer">
+ <tr wicket:id="roomList">
+ <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="rooms_id"></span></div></td>
+ <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
+ <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="ispublic"></span></div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="adminPanelColumnForm">
+ <form wicket:id="form" class="adminForm">
+ <div wicket:id="buttons"></div>
+ <div class="scrollcontent" id="adminForm">
+
+ <!-- General -->
+ <fieldset>
+ <legend><wicket:ommessage key="187" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="193" /></label><input type="text" wicket:id="name" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="482" /></label><select wicket:id="numberOfPartizipants"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="194" /></label><select wicket:id="roomtype"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="196" /></label><textarea style="width: 200px; height: 100px;" wicket:id="comment"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="620" /></label><input type="checkbox" class="formcheckbox" wicket:id="appointment" />
+ </div>
+ </fieldset>
+
+ <!-- Organisations -->
+ <fieldset>
+ <legend><wicket:ommessage key="191" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="195" /></label><input type="checkbox" class="formcheckbox" wicket:id="ispublic" />
+ </div>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage key="828" /></div>
+ <br/>
+ <div class="info-text"><wicket:ommessage key="191" /></div>
+ <br/>
+ <label><wicket:ommessage key="191" /></label><select wicket:id="roomOrganisations" style="height: 80px"/>
+ </div>
+ </fieldset>
+
+ <!-- Limitations -->
+ <fieldset>
+ <legend><wicket:ommessage key="830" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="636" /></label><input type="checkbox" class="formcheckbox" wicket:id="isDemoRoom" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="637" /></label><input type="text" wicket:id="demoTime" />
+ </div>
+ </fieldset>
+
+ <!-- Rights -->
+ <fieldset>
+ <legend><wicket:ommessage key="881" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="879" /></label><input type="checkbox" class="formcheckbox" wicket:id="allowUserQuestions" />
+ </div>
+ <div class="formelement">
+ <wicket:ommessage key="880" />
+ <br/>
+ <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="isAudioOnly" />
+ </div>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage key="1077" /></div>
+ <br/>
+ <div class="info-text"><wicket:ommessage key="1101" /></div>
+ <br/>
+ <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="isClosed" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1100" /></label><input type="text" wicket:id="redirectURL" />
+ </div>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage key="1102" /></div>
+ <br/>
+ <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="waitForRecording" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1076" /></label><input type="checkbox" class="formcheckbox" wicket:id="allowRecording" />
+ </div>
+ </fieldset>
+
+ <!-- Room Layout options -->
+ <fieldset>
+ <legend><wicket:ommessage key="1443" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="1357" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideTopBar" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1436" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideChat" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1437" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideActivitiesAndActions" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1438" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideFilesExplorer" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1439" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideActionsMenu" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1440" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideScreenSharing" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1441" /></label><input type="checkbox" class="formcheckbox" wicket:id="hideWhiteboard" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1442" /></label><input type="checkbox" class="formcheckbox" wicket:id="showMicrophoneStatus" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1513" /></label><input type="checkbox" class="formcheckbox" wicket:id="chatModerated" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1515" /></label><input type="checkbox" class="formcheckbox" wicket:id="chatOpened" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1516" /></label><input type="checkbox" class="formcheckbox" wicket:id="filesOpened" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1526" /></label><input type="checkbox" class="formcheckbox" wicket:id="autoVideoSelect" />
+ </div>
+ <div class="formelement">
+ <!--
+ FIXME: add user moderator list
+ <wicket:ommessage key="587" /> <select wicket:id="moderators"/>
+ <br/>
+ -->
+ <div class="info-text"><wicket:ommessage key="823" /></div>
+ <br/>
+ <label><wicket:ommessage key="640" /></label><input type="checkbox" class="formcheckbox" wicket:id="isModeratedRoom" />
+ </div>
+ <div class="formelement">
+ <wicket:ommessage key="816" />
+ </div>
+ </fieldset>
+ </div>
+ </form>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/users/UsersPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/users/UsersPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/users/UsersPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.users;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getUserId;
+
+import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.DataViewContainer;
+import org.apache.openmeetings.web.data.OrderByBorder;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+
+public class UsersPanel extends AdminPanel {
+
+ private static final long serialVersionUID = -4463107742579790120L;
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ target.appendJavaScript("omUserPanelInit();");
+ }
+
+ private UserForm form;
+
+ @SuppressWarnings("unchecked")
+ public UsersPanel(String id) {
+ super(id);
+
+ final SearchableDataView<User> dataView = new SearchableDataView<User>("userList"
+ , new SearchableDataProvider<User>(UsersDao.class)) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(Item<User> item) {
+ final User u = item.getModelObject();
+ item.add(new Label("userId", "" + u.getUser_id()));
+ item.add(new Label("login", u.getLogin()));
+ item.add(new Label("firstName", u.getFirstname()));
+ item.add(new Label("lastName", u.getLastname()));
+ item.add(AttributeModifier.append("class", "clickable "
+ + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = -8069413566800571061L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ form.setModelObject(u);
+ form.hideNewRecord();
+ target.add(form);
+ //re-initialize height
+ target.appendJavaScript("omUserPanelInit();");
+ }
+ });
+ }
+ };
+ final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
+ add(listContainer.add(dataView).setOutputMarkupId(true));
+ DataViewContainer<User> container = new DataViewContainer<User>(listContainer, dataView);
+ container.setLinks(new OrderByBorder<User>("orderById", "user_id", container)
+ , new OrderByBorder<User>("orderByLogin", "login", container)
+ , new OrderByBorder<User>("orderByFirstName", "firstname", container)
+ , new OrderByBorder<User>("orderByLastName", "lastname", container));
+ add(container.orderLinks);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = 5097048616003411362L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(listContainer);
+ }
+ });
+
+ UsersDao usersDaoImpl = getBean(UsersDao.class);
+ form = new UserForm("form", listContainer, usersDaoImpl.getNewUserInstance(usersDaoImpl.get(getUserId())));
+ form.showNewRecord();
+ add(form);
+ }
+}
Index: src/org/apache/openmeetings/web/admin/users/UserForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/users/UserForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/users/UserForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,223 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.users;
+
+import static org.apache.openmeetings.utils.UserHelper.getMinLoginLength;
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getUserId;
+import static org.apache.wicket.validation.validator.StringValidator.minimumLength;
+
+import java.util.Arrays;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.openmeetings.utils.crypt.ManageCryptStyle;
+import org.apache.openmeetings.web.admin.AdminBaseForm;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.ComunityUserForm;
+import org.apache.openmeetings.web.common.GeneralUserForm;
+import org.apache.openmeetings.web.common.OmAjaxFormValidatingBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.datetime.markup.html.basic.DateLabel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.time.Duration;
+
+/**
+ * CRUD operations in form for {@link User}
+ *
+ * @author swagner
+ *
+ */
+public class UserForm extends AdminBaseForm<User> {
+ private static final long serialVersionUID = 1L;
+ private WebMarkupContainer listContainer;
+ private GeneralUserForm generalForm;
+ private RequiredTextField<String> login;
+
+ public UserForm(String id, WebMarkupContainer listContainer, final User user) {
+ super(id, new CompoundPropertyModel<User>(user));
+ setOutputMarkupId(true);
+ this.listContainer = listContainer;
+
+ // Add form fields
+ addFormFields();
+
+ // attach an ajax validation behavior to all form component's keydown
+ // event and throttle it down to once per second
+ OmAjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
+
+ }
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ User u = getModelObject();
+ // TODO: Why the password field is not set via the Model is because its
+ // FetchType is Lazy, this extra hook here might be not needed with a
+ // different mechanism to protect the password from being read
+ // sebawagner, 01.10.2012
+ try {
+ String pass = generalForm.getPasswordField().getConvertedInput();
+ if (pass != null && !pass.isEmpty()) {
+ u.updatePassword(getBean(ManageCryptStyle.class), getBean(ConfigurationDao.class), pass);
+ }
+ getBean(UsersDao.class).update(u, getUserId());
+ } catch (Exception e) {
+ // FIXME update feedback with the error details
+ }
+ setModelObject(u);
+ hideNewRecord();
+ target.add(this);
+ target.add(listContainer);
+ target.appendJavaScript("omUserPanelInit();");
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
+ UsersDao usersDaoImpl = getBean(UsersDao.class);
+ setModelObject(usersDaoImpl.getNewUserInstance(usersDaoImpl.get(getUserId())));
+ target.add(this);
+ target.appendJavaScript("omUserPanelInit();");
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ User user = getModelObject();
+ if (user.getUser_id() != null) {
+ user = getBean(UsersDao.class).get(user.getUser_id());
+ } else {
+ user = new User();
+ }
+ setModelObject(user);
+ target.add(this);
+ target.appendJavaScript("omUserPanelInit();");
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ UsersDao usersDaoImpl = getBean(UsersDao.class);
+ usersDaoImpl.delete(this.getModelObject(), getUserId());
+ this.setModelObject(usersDaoImpl.getNewUserInstance(usersDaoImpl.get(getUserId())));
+ target.add(listContainer);
+ target.add(this);
+ target.appendJavaScript("omUserPanelInit();");
+ }
+
+ /**
+ * Add the fields to the form
+ */
+ private void addFormFields() {
+ ConfigurationDao cfgDao = getBean(ConfigurationDao.class);
+ login = new RequiredTextField<String>("login");
+ login.setLabel(Model.of(WebSession.getString(132)));
+ add(login.add(minimumLength(getMinLoginLength(cfgDao))));
+
+ add(generalForm = new GeneralUserForm("general", getModel(), true));
+
+ add(DateLabel.forDatePattern("starttime", "dd.MM.yyyy HH:mm:ss"));
+ add(DateLabel.forDatePattern("updatetime", "dd.MM.yyyy HH:mm:ss"));
+
+ add(new CheckBox("forceTimeZoneCheck"));
+
+ final String field159 = WebSession.getString(159);
+ final String field160 = WebSession.getString(160);
+
+ add(new DropDownChoice<Integer>("status", Arrays.asList(0, 1), new IChoiceRenderer<Integer>() {
+
+ private static final long serialVersionUID = 1L;
+
+ public Object getDisplayValue(Integer id) {
+ if (id.equals(0)) {
+ return field159;
+ } else if (id.equals(1)) {
+ return field160;
+ }
+ return null;
+ }
+
+ public String getIdValue(Integer id, int index) {
+ return "" + id;
+ }
+
+ }));
+
+ final String field166 = WebSession.getString(166);
+ final String field167 = WebSession.getString(167);
+ final String field168 = WebSession.getString(168);
+ final String field1311 = WebSession.getString(1311);
+
+ add(new DropDownChoice<Long>("level_id", Arrays.asList(1L, 2L, 3L, 4L), new IChoiceRenderer<Long>() {
+
+ private static final long serialVersionUID = 1L;
+
+ public Object getDisplayValue(Long id) {
+ if (id.equals(1L)) {
+ return field166;
+ } else if (id.equals(2L)) {
+ return field167;
+ } else if (id.equals(3L)) {
+ return field168;
+ } else if (id.equals(4L)) {
+ return field1311;
+ }
+ return null;
+ }
+
+ public String getIdValue(Long id, int index) {
+ return "" + id;
+ }
+
+ }));
+ add(new ComunityUserForm("comunity", getModel()));
+ }
+
+ @Override
+ protected void onValidate() {
+ if(!getBean(UsersDao.class).checkUserLogin(login.getConvertedInput(), getModelObject().getUser_id())) {
+ error(WebSession.getString(105));
+ }
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+}
Index: src/org/apache/openmeetings/web/admin/users/UsersPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/users/UsersPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/users/UsersPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:head>
+ <script type="text/javascript">
+ function omUserPanelInit() {
+ var documentHeight = $(document).height();
+ $('#adminForm').height(documentHeight - 114);
+ $('#adminTable').height(documentHeight - 144);
+ }
+ </script>
+</wicket:head>
+<wicket:panel>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <thead>
+ <tr>
+ <th class="four_column_layout_column1"><span
+ wicket:id="orderById"></span> <wicket:ommessage key="146" /></th>
+ <th class="four_column_layout_column2"><span
+ wicket:id="orderByLogin"></span> <wicket:ommessage key="147" /></th>
+ <th class="four_column_layout_column3"><span
+ wicket:id="orderByFirstName"></span> <wicket:ommessage key="148" /></th>
+ <th class="four_column_layout_column4"><span
+ wicket:id="orderByLastName"></span> <wicket:ommessage key="149" /></th>
+ </tr>
+ </thead>
+ </table>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="listContainer">
+ <tr wicket:id="userList">
+ <td class="four_column_layout_column1"><div
+ class="four_column_layout_divcolumn1">
+ <span wicket:id="userId"></span>
+ </div></td>
+ <td class="four_column_layout_column2"><div
+ class="four_column_layout_divcolumn2">
+ <span wicket:id="login"></span>
+ </div></td>
+ <td class="four_column_layout_column3"><div
+ class="four_column_layout_divcolumn3">
+ <span wicket:id="firstName"></span>
+ </div></td>
+ <td class="four_column_layout_column4"><div
+ class="four_column_layout_divcolumn4">
+ <span wicket:id="lastName"></span>
+ </div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="adminPanelColumnForm">
+ <form wicket:id="form" class="adminForm">
+ <div wicket:id="buttons"></div>
+ <div class="scrollcontent" id="adminForm">
+ <fieldset>
+ <legend>
+ <wicket:ommessage key="143" />
+ </legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="132" /></label><input type="text"
+ wicket:id="login" />
+ </div>
+ <form wicket:id="general"></form>
+ <div class="formelement">
+ <label><wicket:ommessage key="1110" /></label><span
+ wicket:id="starttime" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1112" /></label><span
+ wicket:id="updatetime" />
+ </div>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage
+ key="1149" /></div> <br /> <label><wicket:ommessage
+ key="1148" /></label><input class="formcheckbox" type="checkbox"
+ wicket:id="forceTimeZoneCheck" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="158" /></label><select
+ wicket:id="status" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="169" /></label><select
+ wicket:id="level_id" />
+ </div>
+ </fieldset>
+ <fieldset>
+ <legend>
+ <wicket:ommessage key="1159" />
+ </legend>
+ <form wicket:id="comunity"></form>
+ </fieldset>
+ </div>
+ </form>
+ </div>
+ </div>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/labels/AddLanguageForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/labels/AddLanguageForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/labels/AddLanguageForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.labels;
+
+import java.util.Date;
+
+import org.apache.openmeetings.data.basic.FieldLanguageDao;
+import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+/**
+ *
+ * @author solomax, swagner
+ *
+ */
+public class AddLanguageForm extends Form<Void> {
+ private static final long serialVersionUID = 8743289610974962636L;
+ private String newLanguageName;
+ private String newLanguageISO;
+
+ public AddLanguageForm(String id, final LangPanel langPanel) {
+ super(id);
+
+ add(new RequiredTextField<String>("name", new PropertyModel<String>(this, "newLanguageName")));
+ add(new RequiredTextField<String>("iso", new PropertyModel<String>(this, "newLanguageISO")));
+
+ add(new AjaxButton("add", Model.of(WebSession.getString(366L)), this) {
+ private static final long serialVersionUID = -552597041751688740L;
+
+ @Override
+ public void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ FieldLanguageDao langDao = Application.getBean(FieldLanguageDao.class);
+
+ FieldLanguage fl = new FieldLanguage();
+ fl.setLanguage_id(langDao.getNextAvailableId());
+ fl.setStarttime(new Date());
+ fl.setDeleted(false);
+ fl.setName(newLanguageName);
+ fl.setRtl(false); //FIXME
+ fl.setCode(newLanguageISO);
+
+ try {
+ langDao.updateLanguage(fl);
+ } catch (Exception e) {
+ // TODO add feedback message
+ e.printStackTrace();
+ }
+
+ langPanel.getLangForm().updateLanguages(target);
+ /* FIXME
+ languages.setChoices(langDao.getLanguages());
+ target.add(languages);
+ */
+ target.appendJavaScript("$('#addLanguage').dialog('close');");
+ }
+ });
+ }
+}
Index: src/org/apache/openmeetings/web/admin/labels/LangPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/labels/LangPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/labels/LangPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.labels;
+
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.openmeetings.data.basic.FieldLanguageDao;
+import org.apache.openmeetings.data.basic.FieldManager;
+import org.apache.openmeetings.data.basic.FieldValueDao;
+import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
+import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
+import org.apache.openmeetings.persistence.beans.lang.Fieldvalues;
+import org.apache.openmeetings.servlet.outputhandler.ImportController;
+import org.apache.openmeetings.servlet.outputhandler.LangExport;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.DataViewContainer;
+import org.apache.openmeetings.web.data.OrderByBorder;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.openmeetings.web.util.AjaxDownload;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.upload.FileUpload;
+import org.apache.wicket.markup.html.form.upload.FileUploadField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.util.resource.AbstractResourceStream;
+import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
+import org.dom4j.Document;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+
+import com.googlecode.wicket.jquery.ui.form.button.AjaxButton;
+
+/**
+ * Language Editor, add/insert/update {@link Fieldlanguagesvalues} and
+ * add/delete {@link FieldLanguage} contains several Forms and one list
+ *
+ * @author solomax, swagner
+ *
+ */
+public class LangPanel extends AdminPanel {
+ private static final Logger log = Red5LoggerFactory.getLogger(LangPanel.class, webAppRootKey);
+
+ private static final long serialVersionUID = 5904180813198016592L;
+
+ FieldLanguage language;
+ final WebMarkupContainer listContainer;
+ private LangForm langForm;
+ private FileUploadField fileUploadField;
+ // Create feedback panels
+ private final FeedbackPanel importFeedback = new FeedbackPanel("importFeedback");
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ target.appendJavaScript("labelsInit();");
+ }
+
+ @SuppressWarnings("unchecked")
+ public LangPanel(String id) {
+ super(id);
+ // Create feedback panels
+ add(importFeedback.setOutputMarkupId(true));
+ FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
+ language = langDao.getFieldLanguageById(1L);
+
+ Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
+ flv.setLanguage_id(language.getLanguage_id());
+ final LabelsForm form = new LabelsForm("form", this, flv);
+ form.showNewRecord();
+ add(form);
+
+ final SearchableDataView<Fieldvalues> dataView = new SearchableDataView<Fieldvalues>(
+ "langList"
+ , new SearchableDataProvider<Fieldvalues>(FieldValueDao.class) {
+ private static final long serialVersionUID = -6822789354860988626L;
+
+ @Override
+ protected FieldValueDao getDao() {
+ return (FieldValueDao)super.getDao();
+ }
+
+ @Override
+ public long size() {
+ return search == null ? getDao().count() : getDao().count(language.getLanguage_id(), search);
+ }
+
+ public Iterator<? extends Fieldvalues> iterator(long first, long count) {
+ return (search == null && getSort() == null
+ ? getDao().get(language.getLanguage_id(), (int)first, (int)count)
+ : getDao().get(language.getLanguage_id(), search, (int)first, (int)count, getSortStr())).iterator();
+ }
+ }) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(final Item<Fieldvalues> item) {
+ final Fieldvalues fv = item.getModelObject();
+ item.add(new Label("lblId", "" + fv.getFieldvalues_id()));
+ item.add(new Label("name", fv.getName()));
+ item.add(new Label("value", fv.getFieldlanguagesvalue() != null ? fv.getFieldlanguagesvalue().getValue() : null));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = -8069413566800571061L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ form.setModelObject(fv.getFieldlanguagesvalue());
+ form.hideNewRecord();
+ target.add(form);
+ target.appendJavaScript("labelsInit();");
+ }
+ });
+ item.add(AttributeModifier.append("class", "clickable "
+ + ((item.getIndex() % 2 == 1) ? "even" : "odd")));
+ }
+ };
+
+ listContainer = new WebMarkupContainer("listContainer");
+ add(listContainer.add(dataView).setOutputMarkupId(true));
+ DataViewContainer<Fieldvalues> container = new DataViewContainer<Fieldvalues>(listContainer, dataView);
+ container.setLinks(new OrderByBorder<Fieldvalues>("orderById", "fieldvalues.fieldvalues_id", container)
+ , new OrderByBorder<Fieldvalues>("orderByName", "fieldvalues.name", container)
+ , new OrderByBorder<Fieldvalues>("orderByValue", "value", container));
+ add(container.orderLinks);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = 5097048616003411362L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ dataView.modelChanging();
+ target.add(listContainer);
+ }
+ });
+ langForm = new LangForm("langForm", listContainer, this);
+ fileUploadField = new FileUploadField("fileInput");
+ langForm.add(fileUploadField);
+ langForm.add(new UploadProgressBar("progress", langForm, fileUploadField));
+ fileUploadField.add(new AjaxFormSubmitBehavior(langForm, "onchange") {
+ private static final long serialVersionUID = 2160216679027859231L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target) {
+ FileUpload download = fileUploadField.getFileUpload();
+ try {
+ if (download == null || download.getInputStream() == null) {
+ importFeedback.error("File is empty");
+ return;
+ }
+ getBean(ImportController.class).importLanguage(language.getLanguage_id(), download.getInputStream());
+ } catch (IOException e) {
+ log.error("IOException on panel language editor import ", e);
+ importFeedback.error(e);
+ } catch (Exception e) {
+ log.error("Exception on panel language editor import ", e);
+ importFeedback.error(e);
+ }
+
+ // repaint the feedback panel so that it is hidden
+ target.add(importFeedback);
+ }
+ });
+
+ // Add a component to download a file without page refresh
+ final AjaxDownload download = new AjaxDownload();
+ langForm.add(download);
+
+ langForm.add(new AjaxButton("export"){
+ private static final long serialVersionUID = -2845639751469777460L;
+
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+
+ final List<Fieldlanguagesvalues> flvList = getBean(FieldManager.class).getMixedFieldValuesList(language.getLanguage_id());
+
+ FieldLanguage fl = getBean(FieldLanguageDao.class).getFieldLanguageById(language.getLanguage_id());
+ if (fl != null && flvList != null) {
+ download.setFileName(fl.getName() + ".xml");
+ download.setResourceStream(new AbstractResourceStream() {
+ private static final long serialVersionUID = 1L;
+ private StringWriter sw;
+ private InputStream is;
+
+ public InputStream getInputStream() throws ResourceStreamNotFoundException {
+ try {
+ Document doc = LangExport.createDocument(flvList, getBean(FieldManager.class).getUntranslatedFieldValuesList(language.getLanguage_id()));
+ sw = new StringWriter();
+ LangExport.serializetoXML(sw, "UTF-8", doc);
+ is = new ByteArrayInputStream(sw.toString().getBytes());
+ return is;
+ } catch (Exception e) {
+ throw new ResourceStreamNotFoundException(e);
+ }
+ }
+
+ public void close() throws IOException {
+ if (is != null) {
+ is.close();
+ is = null;
+ }
+ sw = null;
+ }
+ });//new FileResourceStream(new File(requestedFile)));
+ download.initiate(target);
+ }
+
+ // repaint the feedback panel so that it is hidden
+ target.add(importFeedback);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so errors are shown
+ target.add(importFeedback);
+ }
+
+ });
+
+ add(langForm);
+ add(new AddLanguageForm("addLangForm", this));
+ }
+
+ public LangForm getLangForm() {
+ return langForm;
+ }
+}
Index: src/org/apache/openmeetings/web/admin/labels/LangPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/labels/LangPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/labels/LangPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div>
+ <span wicket:id="importFeedback"/>
+ </div>
+ <script type="text/javascript">
+ function labelsInit() {
+ $('#addLanguage').dialog({
+ closeOnEscape: true
+ , autoOpen: false
+ , resizable: false
+ });
+ var documentHeight = $(document).height();
+ $('#adminForm').height(documentHeight-114);
+ $('#adminTable').height(documentHeight-164);
+ };
+ </script>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <form wicket:id="langForm" class="addLanguagePanel">
+ <table>
+ <tr>
+ <td>
+ <div class="formNewButton" wicket:ommessage="title:362"
+ onclick="$('#addLanguage :text').val(''); $('#addLanguage').dialog('open');"><input type="button" title=""/></div>
+ </td>
+ <td>
+ <div wicket:id="deleteLangBtn" class="formCancelButton" wicket:ommessage="title:363"><input type="button" title=""/></div>
+ </td>
+ <td>
+ <select wicket:id="language"></select>
+ </td>
+ <td>
+ <input wicket:id="export" type="button" wicket:ommessage="value:360"/>
+ </td>
+ <td class="profile">
+ <div
+ class="uploadtext"><wicket:ommessage key="387"/></div><div class="upload"><input type="file"
+ accept="text/xml" wicket:id="fileInput"/><span wicket:id="progress">[progressbar]</span>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <thead>
+ <tr>
+ <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="350" /></th>
+ <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="351" /></th>
+ <th class="three_column_layout_column3"><span wicket:id="orderByValue"></span><wicket:ommessage key="352" /></th>
+ </tr>
+ </thead>
+ </table>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="listContainer" >
+ <tr wicket:id="langList">
+ <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="lblId"></span></div></td>
+ <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
+ <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="value"></span></div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="adminPanelColumnForm">
+ <form wicket:id="form" class="adminForm">
+ <div wicket:id="buttons"></div>
+ <div class="scrollcontent" id="adminForm">
+ <fieldset>
+ <legend><wicket:ommessage key="353" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="356" /></label><span wicket:id="fieldvalues.fieldvalues_id"></span>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="354" /></label><input type="text" wicket:id="fieldvalues.name"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="355" /></label><textarea wicket:id="value"></textarea>
+ </div>
+ </fieldset>
+ </div>
+ </form>
+ </div>
+ </div>
+ <div id="addLanguage" wicket:ommessage="title:364" style="display: none;">
+ <form wicket:id="addLangForm">
+ <table>
+ <tr>
+ <td><wicket:ommessage key="365" /></td>
+ <td><input type="text" wicket:id="name"/></td>
+ </tr>
+ <tr>
+ <td><wicket:ommessage key="1422" /></td>
+ <td><input type="text" wicket:id="iso"/></td>
+ </tr>
+ <tr>
+ <td align="right" colspan="2"><input type="submit" wicket:id="add"/></td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/labels/LangForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/labels/LangForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/labels/LangForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.labels;
+
+import org.apache.openmeetings.data.basic.FieldLanguageDao;
+import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.common.ConfirmCallListener;
+import org.apache.openmeetings.web.common.OmAjaxFormValidatingBehavior;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.util.time.Duration;
+
+/**
+ * Modify the language selection, add/delete {@link FieldLanguage}
+ *
+ * @author swagner
+ *
+ */
+public class LangForm extends Form<Void> {
+
+ private static final long serialVersionUID = 2837702941211636609L;
+ private DropDownChoice<FieldLanguage> languages;
+
+ public void updateLanguages(AjaxRequestTarget target) {
+ FieldLanguageDao langDao = Application
+ .getBean(FieldLanguageDao.class);
+ languages.setChoices(langDao.getLanguages());
+ // add(languages);
+ target.add(languages);
+ }
+
+ /**
+ * Render Main
+ *
+ * @param id
+ * @param listContainer
+ * @param language
+ * @param langPanel
+ */
+ public LangForm(String id, final WebMarkupContainer listContainer,
+ final LangPanel langPanel) {
+ super(id);
+ setOutputMarkupId(true);
+
+ FieldLanguageDao langDao = Application
+ .getBean(FieldLanguageDao.class);
+
+ languages = new DropDownChoice<FieldLanguage>("language"
+ , new PropertyModel<FieldLanguage>(langPanel, "language")
+ , langDao.getLanguages()
+ , new ChoiceRenderer<FieldLanguage>("name", "language_id"));
+
+ languages.add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ private static final long serialVersionUID = -2055912815073387536L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ target.add(listContainer);
+ }
+ });
+ add(languages);
+
+ add(new WebMarkupContainer("deleteLangBtn").add(new AjaxEventBehavior("onclick"){
+ private static final long serialVersionUID = -1650946343073068686L;
+
+ @Override
+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+ attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
+ }
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ langPanel.language.setDeleted(true);
+ FieldLanguageDao langDao = Application.getBean(FieldLanguageDao.class);
+ try {
+ langDao.updateLanguage(langPanel.language);
+ } catch (Exception e) {
+ // TODO add feedback message
+ e.printStackTrace();
+ }
+ languages.setChoices(langDao.getLanguages());
+ target.add(languages);
+ // FIXME need to force update list container
+ target.add(listContainer);
+ }
+ }));
+
+ // attach an ajax validation behavior to all form component's keydown
+ // event and throttle it down to once per second
+ OmAjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
+ }
+}
Index: src/org/apache/openmeetings/web/admin/labels/LabelsForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/labels/LabelsForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/labels/LabelsForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.labels;
+
+import org.apache.openmeetings.data.basic.FieldLanguagesValuesDao;
+import org.apache.openmeetings.data.basic.FieldValueDao;
+import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
+import org.apache.openmeetings.persistence.beans.lang.Fieldvalues;
+import org.apache.openmeetings.web.admin.AdminBaseForm;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.CompoundPropertyModel;
+
+/**
+ * Add/edit/delete {@link Fieldlanguagesvalues}
+ *
+ * @author swagner
+ *
+ */
+public class LabelsForm extends AdminBaseForm<Fieldlanguagesvalues> {
+ private static final long serialVersionUID = -1309878909524329047L;
+ private LangPanel panel;
+
+ public LabelsForm(String id, LangPanel panel, Fieldlanguagesvalues fieldlanguagesvalues) {
+ super(id, new CompoundPropertyModel<Fieldlanguagesvalues>(fieldlanguagesvalues));
+ this.panel = panel;
+
+ add(new Label("fieldvalues.fieldvalues_id"));
+ add(new TextField<String>("fieldvalues.name"));
+ add(new TextArea<String>("value"));
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> f) {
+ Fieldlanguagesvalues flv = new Fieldlanguagesvalues();
+ flv.setLanguage_id(panel.language.getLanguage_id());
+ this.setModelObject(flv);
+ target.add(this);
+ target.appendJavaScript("labelsInit();");
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ Fieldlanguagesvalues flv = getModelObject();
+ if (flv.getFieldlanguagesvalues_id() != null) {
+ flv = Application.getBean(FieldLanguagesValuesDao.class)
+ .get(getModelObject().getFieldlanguagesvalues_id());
+ } else {
+ flv = new Fieldlanguagesvalues();
+ }
+ this.setModelObject(flv);
+ target.add(this);
+ target.appendJavaScript("labelsInit();");
+ }
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ Fieldlanguagesvalues flv = getModelObject();
+ Fieldvalues fv = flv.getFieldvalues();
+ Application.getBean(FieldValueDao.class).update(fv, WebSession.getUserId());
+
+ flv.setFieldvalues(fv);
+ Application.getBean(FieldLanguagesValuesDao.class)
+ .update(flv, WebSession.getUserId());
+ hideNewRecord();
+ target.add(panel.listContainer);
+ target.appendJavaScript("labelsInit();");
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ Application.getBean(FieldLanguagesValuesDao.class)
+ .delete(getModelObject(), WebSession.getUserId());
+ target.add(panel.listContainer);
+ target.appendJavaScript("labelsInit();");
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+}
Index: src/org/apache/openmeetings/web/admin/ldaps/LdapsPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/ldaps/LdapsPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/ldaps/LdapsPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.ldaps;
+
+import org.apache.openmeetings.data.basic.dao.LdapConfigDao;
+import org.apache.openmeetings.persistence.beans.basic.LdapConfig;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.common.PagedEntityListPanel;
+import org.apache.openmeetings.web.data.DataViewContainer;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.openmeetings.web.data.OrderByBorder;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.ajax.AjaxEventBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+
+/**
+ * {@link AdminPanel} to list and modify {@link LdapConfig}
+ *
+ * @author swagner
+ *
+ */
+public class LdapsPanel extends AdminPanel {
+ private static final long serialVersionUID = -1L;
+ private LdapForm form;
+
+ @Override
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+ target.appendJavaScript("omLdapPanelInit();");
+ }
+
+ @SuppressWarnings("unchecked")
+ public LdapsPanel(String id) {
+ super(id);
+ SearchableDataView<LdapConfig> dataView = new SearchableDataView<LdapConfig>("ldapList"
+ , new SearchableDataProvider<LdapConfig>(LdapConfigDao.class)) {
+ private static final long serialVersionUID = 8715559628755439596L;
+
+ @Override
+ protected void populateItem(final Item<LdapConfig> item) {
+ final LdapConfig ldapConfig = item.getModelObject();
+ item.add(new Label("ldapConfigId", "" + ldapConfig.getLdapConfigId()));
+ item.add(new Label("name", "" + ldapConfig.getName()));
+ item.add(new Label("configFileName", "" + ldapConfig.getConfigFileName()));
+ item.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = -8069413566800571061L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ form.setModelObject(ldapConfig);
+ form.hideNewRecord();
+ target.add(form);
+ target.appendJavaScript("omLdapPanelInit();");
+ }
+ });
+ item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
+ }
+ };
+ final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
+ add(listContainer.add(dataView).setOutputMarkupId(true));
+ DataViewContainer<LdapConfig> container = new DataViewContainer<LdapConfig>(listContainer, dataView);
+ container.setLinks(new OrderByBorder<LdapConfig>("orderById", "ldapConfigId", container)
+ , new OrderByBorder<LdapConfig>("orderByName", "name", container)
+ , new OrderByBorder<LdapConfig>("orderByFile", "configFileName", container));
+ add(container.orderLinks);
+ add(new PagedEntityListPanel("navigator", dataView) {
+ private static final long serialVersionUID = -1L;
+
+ @Override
+ protected void onEvent(AjaxRequestTarget target) {
+ target.add(listContainer);
+ }
+ });
+
+ form = new LdapForm("form", listContainer, new LdapConfig());
+ form.showNewRecord();
+ add(form);
+
+ }
+}
Index: src/org/apache/openmeetings/web/admin/ldaps/LdapForm.java
===================================================================
--- src/org/apache/openmeetings/web/admin/ldaps/LdapForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/ldaps/LdapForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.ldaps;
+
+import org.apache.openmeetings.data.basic.dao.LdapConfigDao;
+import org.apache.openmeetings.persistence.beans.basic.LdapConfig;
+import org.apache.openmeetings.web.admin.AdminBaseForm;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.OmAjaxFormValidatingBehavior;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.datetime.markup.html.basic.DateLabel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.time.Duration;
+
+/**
+ * Form components to insert/update/delete {@link LdapConfig}
+ *
+ * @author swagner
+ *
+ */
+public class LdapForm extends AdminBaseForm<LdapConfig> {
+
+ private static final long serialVersionUID = 1L;
+ private final WebMarkupContainer listContainer;
+
+ public LdapForm(String id, WebMarkupContainer listContainer,
+ final LdapConfig ldapConfig) {
+ super(id, new CompoundPropertyModel<LdapConfig>(ldapConfig));
+ setOutputMarkupId(true);
+ this.listContainer = listContainer;
+
+ add(new RequiredTextField<String>("name").setLabel(Model.of(WebSession.getString(1108))));
+ add(new CheckBox("isActive"));
+ add(DateLabel.forDatePattern("inserted", "dd.MM.yyyy HH:mm:ss"));
+ add(new Label("insertedby.login"));
+ add(DateLabel.forDatePattern("updated", "dd.MM.yyyy HH:mm:ss"));
+ add(new Label("updatedby.login"));
+ add(new RequiredTextField<String>("configFileName").setLabel(Model.of(WebSession.getString(1115))));
+ add(new CheckBox("addDomainToUserName"));
+ add(new TextField<String>("domain"));
+ add(new TextArea<String>("comment"));
+
+ // attach an ajax validation behavior to all form component's keydown
+ // event and throttle it down to once per second
+ OmAjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
+ }
+
+ @Override
+ protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
+ Application.getBean(LdapConfigDao.class).update(getModelObject(),
+ WebSession.getUserId());
+ LdapConfig ldapConfig = Application.getBean(LdapConfigDao.class)
+ .get(getModelObject().getLdapConfigId());
+ this.setModelObject(ldapConfig);
+ hideNewRecord();
+ target.add(this);
+ target.add(listContainer);
+ target.appendJavaScript("omLdapPanelInit();");
+ }
+
+ @Override
+ protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
+ this.setModelObject(new LdapConfig());
+ target.add(this);
+ target.appendJavaScript("omLdapPanelInit();");
+ }
+
+ @Override
+ protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
+ LdapConfig ldapConfig = this.getModelObject();
+ if (ldapConfig.getLdapConfigId() <= 0) {
+ ldapConfig = Application.getBean(LdapConfigDao.class).get(
+ ldapConfig.getLdapConfigId());
+ } else {
+ ldapConfig = new LdapConfig();
+ }
+ this.setModelObject(ldapConfig);
+ target.add(this);
+ target.appendJavaScript("omLdapPanelInit();");
+ }
+
+ @Override
+ protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
+ Application.getBean(LdapConfigDao.class).delete(
+ this.getModelObject(), WebSession.getUserId());
+ this.setModelObject(new LdapConfig());
+ target.add(listContainer);
+ target.add(this);
+ target.appendJavaScript("omLdapPanelInit();");
+ }
+
+ @Override
+ protected void onSaveError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onNewError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onRefreshError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void onDeleteError(AjaxRequestTarget target, Form<?> form) {
+ // TODO Auto-generated method stub
+ }
+}
Index: src/org/apache/openmeetings/web/admin/ldaps/LdapsPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/ldaps/LdapsPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/ldaps/LdapsPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <script type="text/javascript">
+ function omLdapPanelInit() {
+ var documentHeight = $(document).height();
+ $('#adminForm').height(documentHeight-114);
+ $('#adminTable').height(documentHeight-144);
+ }
+ </script>
+ </wicket:head>
+ <wicket:panel>
+ <div class="adminPanel">
+ <div class="adminPanelColumnTable">
+ <span wicket:id="navigator">[dataview navigator]</span>
+ <table class="adminListTable">
+ <thead>
+ <tr>
+ <th class="three_column_layout_column1"><span wicket:id="orderById"></span><wicket:ommessage key="1104" /></th>
+ <th class="three_column_layout_column2"><span wicket:id="orderByName"></span><wicket:ommessage key="1105" /></th>
+ <th class="three_column_layout_column3"><span wicket:id="orderByFile"></span><wicket:ommessage key="1106" /></th>
+ </tr>
+ </thead>
+ </table>
+ <div class="tableWrapper" id="adminTable">
+ <table class="adminListTable">
+ <tbody wicket:id="listContainer">
+ <tr wicket:id="ldapList">
+ <td class="three_column_layout_column1"><div class="three_column_layout_divcolumn1"><span wicket:id="ldapConfigId"></span></div></td>
+ <td class="three_column_layout_column2"><div class="three_column_layout_divcolumn2"><span wicket:id="name"></span></div></td>
+ <td class="three_column_layout_column3"><div class="three_column_layout_divcolumn3"><span wicket:id="configFileName"></span></div></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="adminPanelColumnForm">
+ <form wicket:id="form" class="adminForm">
+ <div wicket:id="buttons"></div>
+ <div class="scrollcontent" id="adminForm">
+ <fieldset>
+ <legend><wicket:ommessage key="1107" /></legend>
+ <div class="formelement">
+ <label><wicket:ommessage key="1108" /></label><input type="text" wicket:id="name"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1109" /></label><input type="checkbox" class="formcheckbox" wicket:id="isActive"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1110" /></label><span wicket:id="inserted"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1111" /></label><span wicket:id="insertedby.login"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1112" /></label><span wicket:id="updated"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1113" /></label><span wicket:id="updatedby.login"/>
+ </div>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage key="1114" /></div>
+ <br/>
+ <label><wicket:ommessage key="1115" /></label><input type="text" wicket:id="configFileName"/>
+ </div>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage key="1116" /></div>
+ <br/>
+ <label><wicket:ommessage key="1117" /></label><input type="checkbox" class="formcheckbox" wicket:id="addDomainToUserName"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1118" /></label><input type="text" wicket:id="domain"/>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="270" /></label><textarea wicket:id="comment"/>
+ </div>
+ </fieldset>
+ </div>
+ </form>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/backup/BackupPanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/backup/BackupPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/backup/BackupPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin.backup;
+
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.util.Date;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.servlet.outputhandler.BackupExport;
+import org.apache.openmeetings.servlet.outputhandler.BackupImportController;
+import org.apache.openmeetings.utils.ImportHelper;
+import org.apache.openmeetings.utils.OmFileHelper;
+import org.apache.openmeetings.utils.math.CalendarPatterns;
+import org.apache.openmeetings.web.admin.AdminPanel;
+import org.apache.openmeetings.web.util.AjaxDownload;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.upload.FileUpload;
+import org.apache.wicket.markup.html.form.upload.FileUploadField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.lang.Bytes;
+import org.apache.wicket.util.resource.FileResourceStream;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+
+/**
+ * Panel component to manage Backup Import/Export
+ *
+ * @author swagner
+ *
+ */
+public class BackupPanel extends AdminPanel {
+ private static final Logger log = Red5LoggerFactory.getLogger(BackupPanel.class, webAppRootKey);
+
+ private static final long serialVersionUID = -1L;
+
+ // Create feedback panels
+ final FeedbackPanel uploadFeedback;
+
+ /**
+ * Form to handle upload files
+ *
+ * @author swagner
+ *
+ */
+ private class BackupForm extends Form<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ FileUploadField fileUploadField;
+ CheckBox includeFilesInBackup;
+
+ public BackupForm(String id) {
+ super(id);
+
+ // set this form to multipart mode (allways needed for uploads!)
+ setMultiPart(true);
+
+ // set max upload size in form as info text
+ Long maxBytes = ImportHelper.getMaxUploadSize(getBean(ConfigurationDao.class));
+ double megaBytes = maxBytes.doubleValue() / 1024 / 1024;
+ DecimalFormat formatter = new DecimalFormat("#,###.00");
+ add(new Label("MaxUploadSize", formatter.format(megaBytes)));
+
+ // Add one file input field
+ fileUploadField = new FileUploadField("fileInput");
+ add(fileUploadField);
+
+ includeFilesInBackup = new CheckBox("includeFilesInBackup",
+ Model.of(true));
+ add(includeFilesInBackup);
+
+ // Set maximum size controlled by configuration
+ setMaxSize(Bytes.bytes(ImportHelper.getMaxUploadSize(getBean(ConfigurationDao.class))));
+
+ // Add a component to download a file without page refresh
+ final AjaxDownload download = new AjaxDownload();
+ add(download);
+ // add an download button
+ add(new AjaxButton("download", this) {
+ private static final long serialVersionUID = 839803820502260006L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+
+ File working_dir = OmFileHelper.getUploadBackupDir();
+
+ String dateString = "backup_"
+ + CalendarPatterns.getTimeForStreamId(new Date());
+
+ File backup_dir = new File(working_dir, dateString);
+ File backupFile = new File(backup_dir, dateString + ".zip");
+
+ try {
+ getBean(BackupExport.class).performExport(
+ backupFile,
+ backup_dir,
+ includeFilesInBackup.getConvertedInput()
+ .booleanValue());
+
+ download.setFileName(backupFile.getName());
+ download.setResourceStream(new FileResourceStream(
+ backupFile));
+ download.initiate(target);
+ } catch (Exception e) {
+ log.error("Exception on panel backup download ", e);
+ uploadFeedback.error(e);
+ }
+
+ // repaint the feedback panel so that it is hidden
+ target.add(uploadFeedback);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so errors are shown
+ target.add(uploadFeedback);
+ }
+ });
+
+ // add an upload button
+ add(new AjaxButton("upload", this) {
+ private static final long serialVersionUID = 839803820502260006L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ FileUpload upload = fileUploadField.getFileUpload();
+ try {
+ if (upload == null || upload.getInputStream() == null) {
+ uploadFeedback.error("File is empty");
+ return;
+ }
+ getBean(BackupImportController.class).performImport(upload.getInputStream());
+ } catch (IOException e) {
+ log.error("IOException on panel backup upload ", e);
+ uploadFeedback.error(e);
+ } catch (Exception e) {
+ log.error("Exception on panel backup upload ", e);
+ uploadFeedback.error(e);
+ }
+
+ // repaint the feedback panel so that it is hidden
+ target.add(uploadFeedback);
+
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so errors are shown
+ target.add(uploadFeedback);
+ }
+ });
+
+ }
+
+ }
+
+ public BackupPanel(String id) {
+ super(id);
+
+ // Create feedback panels
+ uploadFeedback = new FeedbackPanel("uploadFeedback");
+ // Set Id so that it can be replaced dynamically
+ uploadFeedback.setOutputMarkupId(true);
+ add(uploadFeedback);
+
+ BackupForm backupForm = new BackupForm("backupUpload");
+
+ backupForm.add(new UploadProgressBar("progress", backupForm,
+ backupForm.fileUploadField));
+
+ add(backupForm);
+ }
+}
Index: src/org/apache/openmeetings/web/admin/backup/BackupPanel.html
===================================================================
--- src/org/apache/openmeetings/web/admin/backup/BackupPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/backup/BackupPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div>
+ <span wicket:id="uploadFeedback"/>
+ </div>
+ <!-- wicket:id="form" -->
+ <form wicket:id="backupUpload" class="adminForm adminBackupForm">
+ <fieldset>
+ <legend><wicket:ommessage key="1066" /></legend>
+ <div class="formelement">
+ <div class="info-text"><wicket:ommessage key="1065" /></div>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1537" /></label> <input type="checkbox" wicket:id="includeFilesInBackup" />
+ </div>
+ <div class="formelement">
+ <input class="uploadFileField" wicket:id="fileInput" type="file"/>
+ </div>
+ <div class="formelement">
+ <span wicket:id="progress">[[upload progressbar]]</span>
+ </div>
+ <div class="formelement">
+ <!-- Perform Download -->
+ <input type="submit" wicket:ommessage="value:1536" wicket:id="upload" />
+ <!-- Perform Upload -->
+ <input type="submit" wicket:ommessage="value:1066" wicket:id="download" />
+ </div>
+ <div class="formelement">
+ <!-- Max upload size -->
+ <wicket:ommessage key="1491" /> <span wicket:id="MaxUploadSize" /><span>MB</span>
+ </div>
+ <div class="formelement">
+ <!-- Backup CLI import information -->
+ <div class="info-text"><wicket:ommessage key="1505" /></div>
+ </div>
+ </fieldset>
+ </form>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/admin/AdminSavePanel.java
===================================================================
--- src/org/apache/openmeetings/web/admin/AdminSavePanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/AdminSavePanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin;
+
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.common.ConfirmCallListener;
+import org.apache.openmeetings.web.common.FormSaveRefreshPanel;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.Model;
+
+public abstract class AdminSavePanel<T> extends FormSaveRefreshPanel<T> {
+ private static final long serialVersionUID = -8916631148087019924L;
+ private Label newRecord;
+
+ public AdminSavePanel(String id, final Form<T> form) {
+ super(id, form);
+
+ newRecord = new Label("newRecord", Model.of(WebSession.getString(344L)));
+ add(newRecord.setVisible(false).setOutputMarkupId(true));
+
+ // add a new button that can be used to submit the form via ajax
+ add(new AjaxButton("ajax-new-button", form) {
+ private static final long serialVersionUID = 839803820502260006L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so that it is hidden
+ target.add(feedback);
+ newRecord.setVisible(true);
+ target.add(newRecord);
+ onNewSubmit(target, form);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so errors are shown
+ target.add(feedback);
+ onNewError(target, form);
+ }
+ });
+
+ // add a cancel button that can be used to submit the form via ajax
+ add(new AjaxButton("ajax-cancel-button", form) {
+ private static final long serialVersionUID = 839803820502260006L;
+
+ @Override
+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+ attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
+ }
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so that it is hidden
+ target.add(feedback);
+ hideNewRecord();
+ onDeleteSubmit(target, form);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so errors are shown
+ target.add(feedback);
+ hideNewRecord();
+ onDeleteError(target, form);
+ }
+ });
+ }
+
+ /**
+ * Hide the new record text
+ */
+ public void hideNewRecord() {
+ newRecord.setVisible(false);
+ }
+
+ /**
+ * Hide the new record text
+ */
+ public void showNewRecord() {
+ newRecord.setVisible(true);
+ }
+
+ protected abstract void onNewSubmit(AjaxRequestTarget target, Form<?> form);
+ protected abstract void onNewError(AjaxRequestTarget target, Form<?> form);
+
+ protected abstract void onDeleteSubmit(AjaxRequestTarget target, Form<?> form);
+ protected abstract void onDeleteError(AjaxRequestTarget target, Form<?> form);
+}
Index: src/org/apache/openmeetings/web/admin/AdminPagingNavigator.java
===================================================================
--- src/org/apache/openmeetings/web/admin/AdminPagingNavigator.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/admin/AdminPagingNavigator.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.admin;
+
+import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;
+import org.apache.wicket.markup.html.navigation.paging.IPageable;
+
+public class AdminPagingNavigator extends AjaxPagingNavigator {
+
+ private static final long serialVersionUID = 1L;
+
+ public AdminPagingNavigator(String id, IPageable pageable) {
+ super(id, pageable);
+ }
+
+}
Index: src/org/apache/openmeetings/web/common/UploadableProfileImagePanel.html
===================================================================
--- src/org/apache/openmeetings/web/common/UploadableProfileImagePanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/UploadableProfileImagePanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <form wicket:id="form"><div
+ class="uploadtext"><wicket:ommessage key="379"/></div><div class="upload"><input type="file"
+ wicket:id="image"/><span wicket:id="progress">[progressbar]</span></div></form>
+ </wicket:extend>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/common/ConfirmCallListener.java
===================================================================
--- src/org/apache/openmeetings/web/common/ConfirmCallListener.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ConfirmCallListener.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.core.util.string.JavaScriptUtils;
+
+public class ConfirmCallListener extends AjaxCallListener {
+ private static final long serialVersionUID = 7355235720213137963L;
+
+ public ConfirmCallListener(long id) {
+ this(id, "");
+ }
+
+ //TODO confirm need to be replaced with jQuery modal dialog
+ public ConfirmCallListener(long id, String js) {
+ onPrecondition("if (!confirm('" + JavaScriptUtils.escapeQuotes(WebSession.getString(id)) + "')) {"
+ + js + "; hideBusyIndicator(); return false;}");
+ }
+}
Index: src/org/apache/openmeetings/web/common/GeneralUserForm.java
===================================================================
--- src/org/apache/openmeetings/web/common/GeneralUserForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/GeneralUserForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import static org.apache.openmeetings.utils.UserHelper.getMinPasswdLength;
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getLanguage;
+import static org.apache.wicket.validation.validator.StringValidator.minimumLength;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.openmeetings.data.basic.FieldLanguageDao;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.data.basic.dao.OmTimeZoneDao;
+import org.apache.openmeetings.data.user.OrganisationManager;
+import org.apache.openmeetings.data.user.dao.SalutationDao;
+import org.apache.openmeetings.data.user.dao.StateDao;
+import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.persistence.beans.basic.OmTimeZone;
+import org.apache.openmeetings.persistence.beans.domain.Organisation;
+import org.apache.openmeetings.persistence.beans.domain.Organisation_Users;
+import org.apache.openmeetings.persistence.beans.lang.FieldLanguage;
+import org.apache.openmeetings.persistence.beans.user.Salutation;
+import org.apache.openmeetings.persistence.beans.user.State;
+import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.extensions.markup.html.form.DateTextField;
+import org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator;
+import org.apache.wicket.extensions.yui.calendar.DatePicker;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.ListMultipleChoice;
+import org.apache.wicket.markup.html.form.PasswordTextField;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.IMarkupSourcingStrategy;
+import org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+public class GeneralUserForm extends Form<User> {
+ private static final long serialVersionUID = 5360667099083510234L;
+ private Salutation salutation;
+ private FieldLanguage lang;
+ private PasswordTextField passwordField;
+ private RequiredTextField<String> email;
+
+ public GeneralUserForm(String id, IModel<User> model, boolean isAdminForm) {
+ super(id, model);
+
+ //TODO should throw exception if non admin User edit somebody else (or make all fields read-only)
+ add(passwordField = new PasswordTextField("password", new Model<String>()));
+ ConfigurationDao cfgDao = getBean(ConfigurationDao.class);
+ passwordField.setRequired(false).add(minimumLength(getMinPasswdLength(cfgDao)));
+
+ SalutationDao salutDao = getBean(SalutationDao.class);
+ FieldLanguageDao langDao = getBean(FieldLanguageDao.class);
+ salutation = salutDao.get(getModelObject().getSalutations_id(), getLanguage());
+ lang = langDao.getFieldLanguageById(getModelObject().getLanguage_id());
+ add(new DropDownChoice<Salutation>("salutation"
+ , new PropertyModel<Salutation>(this, "salutation")
+ , salutDao.getUserSalutations(getLanguage())
+ , new ChoiceRenderer<Salutation>("label.value", "salutations_id"))
+ .add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ private static final long serialVersionUID = -6748844721645465468L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ GeneralUserForm.this.getModelObject().setSalutations_id(salutation.getSalutations_id());
+ }
+ }));
+ add(new TextField<String>("firstname"));
+ add(new TextField<String>("lastname"));
+
+ add(new DropDownChoice<OmTimeZone>("omTimeZone", getBean(OmTimeZoneDao.class).getOmTimeZones(),
+ new ChoiceRenderer<OmTimeZone>("frontEndLabel", "jname")));
+
+ add(new DropDownChoice<FieldLanguage>("language"
+ , new PropertyModel<FieldLanguage>(this, "lang")
+ , langDao.getLanguages()
+ , new ChoiceRenderer<FieldLanguage>("name", "language_id"))
+ .add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ private static final long serialVersionUID = 2072021284702632856L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ GeneralUserForm.this.getModelObject().setLanguage_id(lang.getLanguage_id());
+ }
+ }));
+
+ add(email = new RequiredTextField<String>("adresses.email"));
+ email.setLabel(Model.of(WebSession.getString(137)));
+ email.add(RfcCompliantEmailAddressValidator.getInstance());
+ add(new TextField<String>("adresses.phone"));
+ add(new CheckBox("sendSMS"));
+ DateTextField age = new DateTextField("age");
+ DatePicker datePicker = new DatePicker() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected String getAdditionalJavaScript() {
+ return "${calendar}.cfg.setProperty(\"navigator\",true,false); ${calendar}.render();";
+ }
+ };
+ datePicker.setShowOnFieldClick(true);
+ datePicker.setAutoHide(true);
+ age.add(datePicker);
+ add(age);
+ add(new TextField<String>("adresses.street"));
+ add(new TextField<String>("adresses.additionalname"));
+ add(new TextField<String>("adresses.zip"));
+ add(new TextField<String>("adresses.town"));
+ add(new DropDownChoice<State>("adresses.states", getBean(StateDao.class).getStates()
+ , new ChoiceRenderer<State>("name", "state_id")));
+ add(new TextArea<String>("adresses.comment"));
+
+ List<Organisation_Users> orgUsers;
+ if (isAdminForm) {
+ List<Organisation> orgList = getBean(OrganisationManager.class).getOrganisations(3L);
+ orgUsers = new ArrayList<Organisation_Users>(orgList.size());
+ for (Organisation org : orgList) {
+ orgUsers.add(new Organisation_Users(org));
+ }
+ } else {
+ orgUsers = getModelObject().getOrganisation_users();
+ }
+ ListMultipleChoice<Organisation_Users> orgChoiceList = new ListMultipleChoice<Organisation_Users>(
+ "organisation_users", orgUsers,
+ new ChoiceRenderer<Organisation_Users>("organisation.name", "organisation.organisation_id"));
+ add(orgChoiceList.setEnabled(isAdminForm));
+ }
+
+ @Override
+ protected void onValidate() {
+ if(!getBean(UsersDao.class).checkUserEMail(email.getConvertedInput(), getModelObject().getUser_id())) {
+ error(WebSession.getString(1000));
+ }
+ super.onValidate();
+ }
+
+ public PasswordTextField getPasswordField() {
+ return passwordField;
+ }
+
+ @Override
+ protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
+ return new PanelMarkupSourcingStrategy(false);
+ }
+}
Index: src/org/apache/openmeetings/web/common/ErrorMessagePanel.html
===================================================================
--- src/org/apache/openmeetings/web/common/ErrorMessagePanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ErrorMessagePanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <div class="message error">
+ <h3 wicket:id="msg"></h3>
+ <pre wicket:id="err"></pre>
+ </div>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/common/ConfirmableAjaxLink.java
===================================================================
--- src/org/apache/openmeetings/web/common/ConfirmableAjaxLink.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ConfirmableAjaxLink.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+
+public abstract class ConfirmableAjaxLink extends AjaxLink<Void> {
+ private static final long serialVersionUID = 7301747891668537168L;
+ private long confirmId;
+
+ public ConfirmableAjaxLink(String id, long confirmId) {
+ super(id);
+ this.confirmId = confirmId;
+ setOutputMarkupId(true);
+ }
+
+ @Override
+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+ super.updateAjaxAttributes(attributes);
+ attributes.getAjaxCallListeners().add(new ConfirmCallListener(confirmId, "hideBusyIndicator();"));
+ }
+}
Index: src/org/apache/openmeetings/web/common/AddFolderDialog.java
===================================================================
--- src/org/apache/openmeetings/web/common/AddFolderDialog.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/AddFolderDialog.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.Model;
+
+import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog;
+import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton;
+
+public abstract class AddFolderDialog extends AbstractFormDialog<String> {
+ private static final long serialVersionUID = 1L;
+ private static final DialogButton add = new DialogButton(WebSession.getString(1261));
+ private static final DialogButton cancel = new DialogButton(WebSession.getString(219));
+ private final Form<String> form;
+ private final FeedbackPanel feedback = new FeedbackPanel("feedback");
+ private final String name;
+ private RequiredTextField<String> title;
+
+ public AddFolderDialog(String id) {
+ this(id, null);
+ }
+
+ public AddFolderDialog(String id, String name) {
+ super(id, WebSession.getString(1260), Model.of(name));
+ this.name = name;
+ form = new Form<String>("form", getModel()) {
+ private static final long serialVersionUID = 1L;
+ {
+ add(title = new RequiredTextField<String>("title", getModel()));
+ title.setLabel(Model.of(WebSession.getString(572)));
+ add(feedback.setOutputMarkupId(true));
+ add(new AjaxButton("submit") { //FAKE button so "submit-on-enter" works as expected
+ private static final long serialVersionUID = -3612671587183668912L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ AddFolderDialog.this.onSubmit(target);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ AddFolderDialog.this.onError(target);
+ }
+ });
+ }
+ };
+ add(form);
+ }
+
+ @Override
+ protected void onOpen(AjaxRequestTarget target) {
+ super.onOpen(target);
+
+ setModelObject(name);
+ getFeedbackMessages().clear();
+ }
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target) {
+ close(target, getSubmitButton());
+ }
+
+ @Override
+ protected List<DialogButton> getButtons() {
+ return Arrays.asList(add, cancel);
+ }
+
+ @Override
+ protected DialogButton getSubmitButton() {
+ return add;
+ }
+
+ @Override
+ public Form<String> getForm() {
+ return form;
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target) {
+ target.add(feedback);
+ }
+}
Index: src/org/apache/openmeetings/web/common/FormSaveRefreshPanel.html
===================================================================
--- src/org/apache/openmeetings/web/common/FormSaveRefreshPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/FormSaveRefreshPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div class="formSaveBar">
+ <div class="formSaveButton">
+ <input type="submit" value="" wicket:id="ajax-save-button" wicket:ommessage="title:144" />
+ </div>
+ <div class="formRefreshButton">
+ <input type="submit" value="" wicket:id="ajax-refresh-button" wicket:ommessage="title:156" />
+ </div>
+ <wicket:child/>
+ </div>
+ <div wicket:id="feedback" class="adminFormsFeedbackPanel">[[ feedback ]]</div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/common/ProfileImagePanel.html
===================================================================
--- src/org/apache/openmeetings/web/common/ProfileImagePanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ProfileImagePanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div class="profile" wicket:id="profile"><img wicket:id="img"/><wicket:child/></div>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/common/MenuPanel.html
===================================================================
--- src/org/apache/openmeetings/web/common/MenuPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/MenuPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <link media="screen" type="text/css" rel="stylesheet" href="css/jquery.ui.menubar.css"/>
+ </wicket:head>
+ <wicket:panel>
+ <script type="text/javascript" src="js/jquery.ui.menubar.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $("#jMenu").menubar({
+ autoExpand: true
+ , menuIcon: true
+ , buttons: true
+ , position: {
+ within: $("#menu").add(window).first()
+ }
+ //, select: select
+ });
+ });
+ </script>
+ <ul id="jMenu">
+ <li wicket:id="mainItem">
+ <a class="fNiv" href="#" onclick="return false;"><span wicket:id="label"></span></a>
+ <ul wicket:enclosure="childItem">
+ <li wicket:id="childItem">
+ <a wicket:id="link" href="#">
+ <span class="menuName" wicket:id="name"></span><br />
+ <span class="menuDesc" wicket:id="description"></span>
+ </a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/common/HeaderPanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/HeaderPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/HeaderPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.wicket.markup.html.basic.Label;
+
+public class HeaderPanel extends BasePanel {
+ private static final long serialVersionUID = 9020842845946685193L;
+
+ public HeaderPanel(String id, String appName) {
+ super(id);
+ add(new Label("appName", appName));
+ }
+}
Index: src/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/UploadableProfileImagePanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import static org.apache.openmeetings.utils.ImportHelper.getMaxUploadSize;
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import java.util.List;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+import org.apache.openmeetings.documents.GenerateImage;
+import org.apache.openmeetings.utils.StoredFile;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormSubmitBehavior;
+import org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.upload.FileUpload;
+import org.apache.wicket.markup.html.form.upload.FileUploadField;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.util.lang.Bytes;
+
+public class UploadableProfileImagePanel extends ProfileImagePanel {
+ private static final long serialVersionUID = -6681473769070950510L;
+ private FileUploadField fileUploadField;
+
+ public UploadableProfileImagePanel(String id, final long userId) {
+ super(id, userId);
+ final Form<Void> form = new Form<Void>("form");
+ form.setMultiPart(true);
+ form.setMaxSize(Bytes.bytes(getMaxUploadSize(getBean(ConfigurationDao.class))));
+ // Model is necessary here to avoid writing image to the User object
+ form.add(fileUploadField = new FileUploadField("image", new IModel<List<FileUpload>>() {
+ private static final long serialVersionUID = -8514518605278263956L;
+
+ //FIXME this need to be eliminated
+ public void detach() {
+ }
+
+ public void setObject(List<FileUpload> object) {
+ }
+
+ public List<FileUpload> getObject() {
+ return null;
+ }
+ }));
+ form.add(new UploadProgressBar("progress", form, fileUploadField));
+ fileUploadField.add(new AjaxFormSubmitBehavior(form, "onchange") {
+ private static final long serialVersionUID = 2160216679027859231L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target) {
+ FileUpload fu = fileUploadField.getFileUpload();
+ if (fu != null) {
+ StoredFile sf = new StoredFile(fu.getClientFileName());
+ if (sf.isImage()) {
+ boolean asIs = sf.isAsIs();
+ try {
+ //FIXME need to work with InputStream !!!
+ getBean(GenerateImage.class)
+ .convertImageUserProfile(fu.writeToTempFile(), userId, asIs);
+ } catch (Exception e) {
+ // TODO display error
+ e.printStackTrace();
+ }
+ } else {
+ //TODO display error
+ }
+ }
+ target.add(profile, form);
+ }
+ });
+ add(form.setOutputMarkupId(true));
+ }
+}
Index: src/org/apache/openmeetings/web/common/PagedEntityListPanel.html
===================================================================
--- src/org/apache/openmeetings/web/common/PagedEntityListPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/PagedEntityListPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <form wicket:id="pagingForm" class="pagedEntityListPanel">
+ <select wicket:id="entitiesPerPage"></select>
+ <span wicket:id="navigator">[dataview navigator]</span>
+ </form>
+ <form wicket:id="searchForm" class="searchForm">
+ <input type="text" wicket:id="searchText" wicket:ommessage="title:714"/>
+ <input type="submit" wicket:id="search" wicket:ommessage="value:715"/>
+ </form>
+ </wicket:panel>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/common/ComunityUserForm.html
===================================================================
--- src/org/apache/openmeetings/web/common/ComunityUserForm.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ComunityUserForm.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <div class="formelementradiobox">
+ <div wicket:id="community_settings">
+ <div>
+ <input wicket:id="everybody" type="radio" /><label wicket:for="everybody"><wicket:ommessage key="1160"/></label>
+ <div class="clear"></div>
+ </div>
+ <div>
+ <input wicket:id="contact" type="radio" /><label wicket:for="contact"><wicket:ommessage key="1168"/></label>
+ <div class="clear"></div>
+ </div>
+ <div>
+ <input wicket:id="nobody" type="radio" /><label wicket:for="nobody"><wicket:ommessage key="1169"/></label>
+ <div class="clear"></div>
+ </div>
+ </div>
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1162" /></label>
+ <textarea wicket:id="userOffers" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1163" /></label>
+ <textarea wicket:id="userSearchs" />
+ </div>
+</wicket:panel>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/common/ErrorMessagePanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/ErrorMessagePanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ErrorMessagePanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+
+import java.io.PrintWriter;
+
+import org.apache.commons.io.output.StringBuilderWriter;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+
+public class ErrorMessagePanel extends Panel {
+ private static final Logger log = Red5LoggerFactory.getLogger(ErrorMessagePanel.class, webAppRootKey);
+ private static final long serialVersionUID = 1L;
+
+ public ErrorMessagePanel(String id, String msg, Throwable err) {
+ super(id);
+
+ log.error(msg, err);
+ add(new Label("msg", msg));
+ StringBuilderWriter sw = new StringBuilderWriter();
+ err.printStackTrace(new PrintWriter(sw));
+ add(new Label("err", sw.toString()));
+ }
+}
Index: src/org/apache/openmeetings/web/common/FormSaveRefreshPanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/FormSaveRefreshPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/FormSaveRefreshPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+
+public abstract class FormSaveRefreshPanel<T> extends BasePanel {
+ private static final long serialVersionUID = 6133794730008996211L;
+ protected final FeedbackPanel feedback;
+
+ public FormSaveRefreshPanel(String id, Form<T> form) {
+ super(id);
+ setOutputMarkupId(true);
+
+ feedback = new FeedbackPanel("feedback");
+ add(feedback.setOutputMarkupId(true));
+
+ // add a save button that can be used to submit the form via ajax
+ add(new AjaxButton("ajax-save-button", form) {
+ private static final long serialVersionUID = 839803820502260006L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so that it is hidden
+ target.add(feedback);
+ onSaveSubmit(target, form);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so errors are shown
+ target.add(feedback);
+ onSaveError(target, form);
+ }
+ });
+
+ // add a refresh button that can be used to submit the form via ajax
+ add(new AjaxButton("ajax-refresh-button", form) {
+ private static final long serialVersionUID = 839803820502260006L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so that it is hidden
+ target.add(feedback);
+ hideNewRecord();
+ onRefreshSubmit(target, form);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target, Form<?> form) {
+ // repaint the feedback panel so errors are shown
+ target.add(feedback);
+ hideNewRecord();
+ onRefreshError(target, form);
+ }
+ });
+
+ }
+ /**
+ * Hide the new record text
+ */
+ public void hideNewRecord() {
+ // for admin only, will be implemented in admin
+ }
+
+ protected abstract void onSaveSubmit(AjaxRequestTarget target, Form<?> form);
+ protected abstract void onSaveError(AjaxRequestTarget target, Form<?> form);
+
+ protected abstract void onRefreshSubmit(AjaxRequestTarget target, Form<?> form);
+ protected abstract void onRefreshError(AjaxRequestTarget target, Form<?> form);
+}
Index: src/org/apache/openmeetings/web/common/GeneralUserForm.html
===================================================================
--- src/org/apache/openmeetings/web/common/GeneralUserForm.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/GeneralUserForm.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <div class="formelement">
+ <label><wicket:ommessage key="133" /></label><input type="password" wicket:id="password" />
+ </div>
+ <wicket:child/>
+ <div class="formelement">
+ <label><wicket:ommessage key="135" /></label><select
+ wicket:id="salutation" style="width: 60px;" /><input type="text"
+ wicket:id="firstname" style="width: 216px;" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="136" /></label><input type="text" wicket:id="lastname" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1143" /></label><select wicket:id="omTimeZone" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="111" /></label><select wicket:id="language" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="137" /></label><input type="text" wicket:id="adresses.email" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="607" /></label><input type="text" wicket:id="adresses.phone" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="1503" /></label><input class="formcheckbox" type="checkbox" wicket:id="sendSMS" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="138" /></label><input type="text" wicket:id="age" style="width: 258px;" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="139" /></label><input type="text"
+ wicket:id="adresses.street" style="width: 244px;" /> <input
+ type="text" wicket:id="adresses.additionalname" style="width: 30px;" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="140" /></label><input type="text"
+ wicket:id="adresses.zip" style="width: 60px;" /> <input type="text"
+ wicket:id="adresses.town" style="width: 214px;" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="141" /></label><select wicket:id="adresses.states" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="142" /></label>
+ <textarea wicket:id="adresses.comment" />
+ </div>
+ <div class="formelement">
+ <label><wicket:ommessage key="161" /></label><select wicket:id="organisation_users" style="height: 80px" />
+ </div>
+</wicket:panel>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/common/ProfileImagePanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/ProfileImagePanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ProfileImagePanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import static org.apache.openmeetings.OpenmeetingsVariables.webAppRootKey;
+import static org.apache.openmeetings.web.app.Application.getBean;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URI;
+
+import org.apache.openmeetings.data.user.dao.UsersDao;
+import org.apache.openmeetings.utils.OmFileHelper;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.markup.html.TransparentWebMarkupContainer;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.request.resource.ByteArrayResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
+
+public class ProfileImagePanel extends BasePanel {
+ private static final long serialVersionUID = 1119719397241677937L;
+ private static final Logger log = Red5LoggerFactory.getLogger(ProfileImagePanel.class, webAppRootKey);
+ protected final WebMarkupContainer profile;
+
+ public ProfileImagePanel(String id, final long userId) {
+ super(id);
+
+ profile = new TransparentWebMarkupContainer("profile");
+ final String uri = getBean(UsersDao.class).get(userId).getPictureuri();
+ boolean absolute = false;
+ try {
+ absolute = URI.create(uri).isAbsolute();
+ } catch (Exception e) {
+ //no-op
+ }
+ if (absolute) {
+ profile.add(new Image("img", WebSession.getString(5L)).add(AttributeModifier.replace("src", uri)));
+ } else {
+ profile.add(new Image("img", new ByteArrayResource("image/jpeg") {
+ private static final long serialVersionUID = 6039580072791941591L;
+
+ @Override
+ protected ResourceResponse newResourceResponse(Attributes attributes) {
+ ResourceResponse rr = super.newResourceResponse(attributes);
+ rr.disableCaching();
+ return rr;
+ }
+
+ @Override
+ protected byte[] getData(Attributes attributes) {
+ File img = OmFileHelper.getUserProfilePicture(userId, uri);
+ try {
+ return IOUtils.toByteArray(new FileInputStream(img));
+ } catch (Exception e) {
+ log.error("failed to get bytes from image", e);
+ }
+ return null;
+ }
+ }));
+ }
+ add(profile.setOutputMarkupId(true));
+ }
+}
Index: src/org/apache/openmeetings/web/common/MenuPanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/MenuPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/MenuPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.openmeetings.data.basic.NaviBuilder;
+import org.apache.openmeetings.persistence.beans.basic.Naviglobal;
+import org.apache.openmeetings.persistence.beans.basic.Navimain;
+import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.pages.MainPage;
+import org.apache.openmeetings.web.util.OmUrlFragment;
+import org.apache.openmeetings.web.util.OmUrlFragment.MenuActions;
+import org.apache.openmeetings.web.util.OmUrlFragment.MenuParams;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+
+/**
+ * Loads the menu items into the main area
+ *
+ * @author sebawagner
+ *
+ */
+public class MenuPanel extends BasePanel {
+ private static final long serialVersionUID = 6626039612808753514L;
+
+ public MenuPanel(String id) {
+ super(id);
+ setMarkupId(id);
+
+ final NaviBuilder man = Application.getBean(NaviBuilder.class);
+ add(new ListView<Naviglobal>("mainItem", man.getMainMenu(WebSession.getUserLevel(), WebSession.getUserId(), WebSession.getLanguage())) {
+ private static final long serialVersionUID = 2173926553418745231L;
+
+ @Override
+ protected void populateItem(ListItem<Naviglobal> item) {
+ Naviglobal gl = item.getModelObject();
+ item.add(new Label("label", gl.getLabel().getValue()).setRenderBodyOnly(true));
+
+ item.add(new ListView<Navimain>("childItem", gl.getMainnavi()) {
+ private static final long serialVersionUID = 3609635268338379087L;
+
+ @Override
+ protected void populateItem(ListItem<Navimain> item) {
+ Navimain m = item.getModelObject();
+ final String name = m.getLabel().getValue();
+ final String desc = m.getTooltip().getValue();
+ final MenuActions action = MenuActions.valueOf(m.getAction());
+ final MenuParams params = m.getParams() != null ? MenuParams.valueOf(m.getParams()) : MenuParams.publicTabButton;
+ item.add(new AjaxLink<Void>("link") {
+ private static final long serialVersionUID = 5632618935550133709L;
+ {
+ add(new Label("name", name));
+ add(new Label("description", desc));
+ }
+
+ public void onClick(AjaxRequestTarget target) {
+ ((MainPage)getPage()).updateContents(new OmUrlFragment(action, params), target);
+ }
+ });
+ }
+ }.setReuseItems(true));
+ }
+ }.setReuseItems(true));
+ }
+}
Index: src/org/apache/openmeetings/web/common/OmAjaxFormValidatingBehavior.java
===================================================================
--- src/org/apache/openmeetings/web/common/OmAjaxFormValidatingBehavior.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/OmAjaxFormValidatingBehavior.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.attributes.ThrottlingSettings;
+import org.apache.wicket.ajax.form.AjaxFormValidatingBehavior;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.util.io.IClusterable;
+import org.apache.wicket.util.time.Duration;
+import org.apache.wicket.util.visit.IVisit;
+import org.apache.wicket.util.visit.IVisitor;
+
+//TODO should be removed in favor of AjaxFormValidatingBehavior after WICKET-5178 will be fixed
+public class OmAjaxFormValidatingBehavior extends AjaxFormValidatingBehavior {
+ private static final long serialVersionUID = 1L;
+
+ public OmAjaxFormValidatingBehavior(Form<?> form, String event) {
+ super(form, event);
+ }
+
+ public static void addToAllFormComponents(final Form<?> form, final String event, final Duration throttleDelay) {
+ form.visitChildren(FormComponent.class, new FormValidateVisitor(form, event, throttleDelay));
+ }
+
+ private static class FormValidateVisitor implements IVisitor<Component, Void>, IClusterable
+ {
+ private static final long serialVersionUID = 1L;
+ private final Form<?> form;
+ private final String event;
+ private final Duration throttleDelay;
+
+ private FormValidateVisitor(Form<?> form, String event, Duration throttleDelay)
+ {
+ this.form = form;
+ this.event = event;
+ this.throttleDelay = throttleDelay;
+ }
+
+ public void component(final Component component, final IVisit<Void> visit)
+ {
+ final AjaxFormValidatingBehavior behavior = new AjaxFormValidatingBehavior(form, event)
+ {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes)
+ {
+ super.updateAjaxAttributes(attributes);
+
+ if (throttleDelay != null)
+ {
+ String id = "throttle-" + component.getMarkupId();
+ ThrottlingSettings throttlingSettings = new ThrottlingSettings(id,
+ throttleDelay);
+ attributes.setThrottlingSettings(throttlingSettings);
+ }
+ attributes.setAllowDefault(true);
+ }
+ };
+ component.add(behavior);
+ visit.dontGoDeeper();
+ }
+ }
+}
Index: src/org/apache/openmeetings/web/common/AddFolderDialog.html
===================================================================
--- src/org/apache/openmeetings/web/common/AddFolderDialog.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/AddFolderDialog.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:panel>
+ <form wicket:id="form">
+ <span style="padding-left: 20px; padding-right: 20px;"><wicket:ommessage key="572"/></span><input type="text" wicket:id="title"/>
+ <div wicket:id="feedback"></div>
+ <input type="submit" wicket:id="submit" class="invisible-form-component"/>
+ </form>
+</wicket:panel>
+</html>
Index: src/org/apache/openmeetings/web/common/PagedEntityListPanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/PagedEntityListPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/PagedEntityListPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
+import org.apache.openmeetings.web.admin.AdminPagingNavigator;
+import org.apache.openmeetings.web.admin.SearchableDataView;
+import org.apache.openmeetings.web.data.SearchableDataProvider;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.PropertyModel;
+
+public abstract class PagedEntityListPanel extends BasePanel {
+ private static final long serialVersionUID = -4280843184916302671L;
+ private int entitiesPerPage = 50;
+ private List<Integer> numbers = Arrays.asList(10, 25, 50, 75, 100, 200);
+
+ public PagedEntityListPanel(String id, final SearchableDataView<? extends IDataProviderEntity> dataView) {
+ super(id);
+
+ dataView.setItemsPerPage(entitiesPerPage);
+ final Form<Void> f = new Form<Void>("pagingForm");
+
+ f.add(new AdminPagingNavigator("navigator", dataView).setOutputMarkupId(true))
+ .add(new DropDownChoice<Integer>("entitiesPerPage", new PropertyModel<Integer>(this, "entitiesPerPage"), numbers)
+ .add(new AjaxFormComponentUpdatingBehavior("onchange") {
+ private static final long serialVersionUID = -7754441983330112248L;
+
+ @Override
+ protected void onUpdate(AjaxRequestTarget target) {
+ long newPage = dataView.getCurrentPage() * dataView.getItemsPerPage() / entitiesPerPage;
+ dataView.setItemsPerPage(entitiesPerPage);
+ dataView.setCurrentPage(newPage);
+ target.add(f);
+ PagedEntityListPanel.this.onEvent(target);
+ }
+ }));
+
+ final SearchableDataProvider<? extends IDataProviderEntity> dp = dataView.getDataProvider();
+ Form<Void> searchForm = new Form<Void>("searchForm");
+ add(searchForm.setOutputMarkupId(true));
+ searchForm.add(new TextField<String>("searchText", new PropertyModel<String>(dp, "search")).setOutputMarkupId(true));
+ searchForm.add(new AjaxButton("search", searchForm) {
+ private static final long serialVersionUID = -1659023337945692814L;
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
+ target.add(f);
+ PagedEntityListPanel.this.onEvent(target);
+ }
+ });
+ add(f.setOutputMarkupId(true));
+ }
+
+ protected abstract void onEvent(AjaxRequestTarget target);
+}
Index: src/org/apache/openmeetings/web/common/ComunityUserForm.java
===================================================================
--- src/org/apache/openmeetings/web/common/ComunityUserForm.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/ComunityUserForm.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.openmeetings.persistence.beans.user.User;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.Radio;
+import org.apache.wicket.markup.html.form.RadioGroup;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.markup.html.panel.IMarkupSourcingStrategy;
+import org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+
+public class ComunityUserForm extends Form<User> {
+ private static final long serialVersionUID = -4487619335283747717L;
+
+ public ComunityUserForm(String id, IModel<User> model) {
+ super(id, model);
+
+ RadioGroup<Long> rg = new RadioGroup<Long>("community_settings", new IModel<Long>() {
+ private static final long serialVersionUID = 1L;
+
+ public Long getObject() {
+ User u = ComunityUserForm.this.getModelObject();
+ if (Boolean.TRUE.equals(u.getShowContactData())) {
+ return 1L;
+ } else if (Boolean.TRUE.equals(u.getShowContactDataToContacts())) {
+ return 2L;
+ }
+ return 3L;
+ }
+
+ public void setObject(Long choice) {
+ User u = ComunityUserForm.this.getModelObject();
+ if (choice.equals(1L)) {
+ u.setShowContactData(true);
+ u.setShowContactDataToContacts(false);
+ } else if (choice.equals(2L)) {
+ u.setShowContactData(false);
+ u.setShowContactDataToContacts(true);
+ } else {
+ u.setShowContactData(false);
+ u.setShowContactDataToContacts(false);
+ }
+ }
+
+ public void detach() {
+ }
+ });
+ add(rg.add(new Radio<Long>("everybody", Model.of(1L)), new Radio<Long>("contact", Model.of(2L))
+ , new Radio<Long>("nobody", Model.of(3L))).setOutputMarkupId(true).setRenderBodyOnly(false)
+ );
+
+ add(new TextArea<String>("userOffers"));
+ add(new TextArea<String>("userSearchs"));
+ }
+
+ @Override
+ protected IMarkupSourcingStrategy newMarkupSourcingStrategy() {
+ return new PanelMarkupSourcingStrategy(false);
+ }
+}
Index: src/org/apache/openmeetings/web/common/BasePanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/BasePanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/BasePanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.panel.Panel;
+
+public abstract class BasePanel extends Panel {
+ private static final long serialVersionUID = 8663740955529405678L;
+
+ public BasePanel(String id) {
+ super(id);
+ setOutputMarkupId(true);
+ }
+
+ /**
+ * Overwrite this method to execute Java code after Panel is loaded by the
+ * {@link MenuPanel}
+ *
+ * @param target
+ */
+ public void onMenuPanelLoad(AjaxRequestTarget target) {
+
+ }
+}
Index: src/org/apache/openmeetings/web/common/HeaderPanel.html
===================================================================
--- src/org/apache/openmeetings/web/common/HeaderPanel.html (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/HeaderPanel.html (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div id="header">
+ <span wicket:id="appName"></span>
+ </div>
+ </wicket:panel>
+</html>
\ В конце файла нет новой строки
Index: src/org/apache/openmeetings/web/common/UserPanel.java
===================================================================
--- src/org/apache/openmeetings/web/common/UserPanel.java (.../branches/2.1) (revision 0)
+++ src/org/apache/openmeetings/web/common/UserPanel.java (.../trunk/singlewebapp) (revision 1490226)
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") + you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.web.common;
+
+import static org.apache.openmeetings.web.app.Application.getBean;
+import static org.apache.openmeetings.web.app.WebSession.getUserId;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.openmeetings.data.conference.RoomManager;
+import org.apache.openmeetings.data.conference.dao.RoomDao;
+import org.apache.openmeetings.persistence.beans.room.Room;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
+
+@AuthorizeInstantiation("USER")
+public abstract class UserPanel extends BasePanel {
+ private static final long serialVersionUID = 8607846885689465360L;
+
+ public UserPanel(String id) {
+ super(id);
+ }
+
+ public static List<Room> getMyRooms() {
+ List<Room> result = new ArrayList<Room>();
+ result.add(getBean(RoomManager.class).getRoomByOwnerAndTypeId(getUserId(), 1L, WebSession.getString(1306L)));
+ result.add(getBean(RoomManager.class).getRoomByOwnerAndTypeId(getUserId(), 3L, WebSession.getString(1307L)));
+ result.addAll(getBean(RoomDao.class).getAppointedRoomsByUser(getUserId()));
+ return result;
+ }
+}
Index: src/org/apache/openmeetings/web/data/DataViewContainer.java
===================================================================
--- src/org/apache/openmeetings/web/data/DataViewContainer.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/data/DataViewContainer.java (.../trunk/singlewebapp) (revision 1490226)
@@ -21,7 +21,7 @@
import java.io.Serializable;
import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.web.components.admin.SearchableDataView;
+import org.apache.openmeetings.web.admin.SearchableDataView;
import org.apache.wicket.markup.html.WebMarkupContainer;
public class DataViewContainer<T extends IDataProviderEntity> implements Serializable {
@@ -35,6 +35,7 @@
this.view = view;
}
+ //TODO refactor to remove warnings
public void setLinks(OrderByBorder<T>... orderLinks) {
this.orderLinks = orderLinks;
}
Index: src/org/apache/openmeetings/web/data/SearchableDataProvider.java
===================================================================
--- src/org/apache/openmeetings/web/data/SearchableDataProvider.java (.../branches/2.1) (revision 1490226)
+++ src/org/apache/openmeetings/web/data/SearchableDataProvider.java (.../trunk/singlewebapp) (revision 1490226)
@@ -18,11 +18,12 @@
*/
package org.apache.openmeetings.web.data;
+import static org.apache.openmeetings.web.app.Application.getBean;
+
import java.util.Iterator;
import org.apache.openmeetings.data.IDataProviderDao;
import org.apache.openmeetings.persistence.beans.IDataProviderEntity;
-import org.apache.openmeetings.web.app.Application;
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
@@ -47,6 +48,10 @@
// does nothing
}
+ protected IDataProviderDao<T> getDao()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment