Author: sletellier Date: 2011-11-14 14:53:50 +0100 (Mon, 14 Nov 2011) New Revision: 78 Url: http://forge.codelutin.com/repositories/revision/echobase/78 Log: - Add some validation files - Remove struts properties Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/ImportAction-importForm-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/export/ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/export/ManageExportQuery-doSaveQuery-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/ManageUser-validation.xml trunk/echobase-ui/src/main/resources/log4j.properties Removed: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/LoginAction-login-validation.xml trunk/echobase-ui/src/main/resources/struts.properties Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ImportAction.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/ManageUser.java trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/resources/struts.xml Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ImportAction.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ImportAction.java 2011-11-14 09:41:05 UTC (rev 77) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ImportAction.java 2011-11-14 13:53:50 UTC (rev 78) @@ -86,11 +86,11 @@ return SUCCESS; } - @Override - public void validate() { - //FIXME : do a real validation with a xml validation file. - if (!importModel.validate()) { - addActionError(_("echobase.error.importArgument")); - } - } +// @Override +// public void validate() { +// //FIXME : do a real validation with a xml validation file. +// if (!importModel.validate()) { +// addActionError(_("echobase.error.importArgument")); +// } +// } } Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/ManageUser.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/ManageUser.java 2011-11-14 09:41:05 UTC (rev 77) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/ManageUser.java 2011-11-14 13:53:50 UTC (rev 78) @@ -48,7 +48,7 @@ public static final String BACK_TO_LIST = "backToList"; - protected transient UserService service; + protected transient UserService userService; protected EchoBaseUserDTO user; @@ -63,10 +63,10 @@ } protected UserService getUserService() { - if (service == null) { - service = newService(UserService.class); + if (userService == null) { + userService = newService(UserService.class); } - return service; + return userService; } @Override Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/ImportAction-importForm-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/ImportAction-importForm-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/ImportAction-importForm-validation.xml 2011-11-14 13:53:50 UTC (rev 78) @@ -0,0 +1,45 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="importModel.selectedVoyage"> + + <field-validator type="fieldexpression"> + <param name="expression">importModel.accessImport == null</param> + <message key="echobase.validation.import.selectedVoyageOrAccessImport.required"/> + </field-validator> + </field> + + <field name="importModel.accessImport"> + + <field-validator type="fieldexpression"> + <param name="expression">importModel.selectedVoyage == null</param> + <message key="echobase.validation.import.selectedVoyageOrAccessImport.required"/> + </field-validator> + </field> + +</validators> Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/LoginAction-login-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/LoginAction-login-validation.xml 2011-11-14 09:41:05 UTC (rev 77) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/LoginAction-login-validation.xml 2011-11-14 13:53:50 UTC (rev 78) @@ -1,36 +0,0 @@ -<!-- - #%L - EchoBase :: UI - - $Id$ - $HeadURL$ - %% - Copyright (C) 2011 Ifremer, Codelutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> -<!DOCTYPE validators PUBLIC - "-//OpenSymphony Group//XWork Validator 1.0.2//EN" - "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> -<validators> - - <field name="email"> - - <field-validator type="login"> - <message/> - </field-validator> - </field> - -</validators> Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/export/ManageExportQuery-doSaveQuery-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/export/ManageExportQuery-doSaveQuery-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/export/ManageExportQuery-doSaveQuery-validation.xml 2011-11-14 13:53:50 UTC (rev 78) @@ -0,0 +1,56 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="query.name"> + + <field-validator type="requiredstring"> + <message key="echobase.validation.export.name.requiredstring"/> + </field-validator> + </field> + + <field name="query.description"> + + <field-validator type="requiredstring"> + <message key="echobase.validation.export.description.requiredstring"/> + </field-validator> + </field> + + <field name="query.sqlQuery"> + + <field-validator type="requiredstring"> + <message key="echobase.validation.export.sqlQuery.requiredstring"/> + </field-validator> + <field-validator type="regex"> + <!-- TODO sletellier 2011/11/14 : Find a better regex exression to define sql query --> + <param name="expression">^\s*select\s+.+\s+from\s+.+$</param> + <param name="caseSensitive">false</param> + <message key="echobase.validation.export.sqlQuery.wrongformat"/> + </field-validator> + </field> + +</validators> \ No newline at end of file Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml (from rev 76, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/LoginAction-login-validation.xml) =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml 2011-11-14 13:53:50 UTC (rev 78) @@ -0,0 +1,36 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="email"> + + <field-validator type="login"> + <message key="echobase.validation.login.wrongLogin"/> + </field-validator> + </field> + +</validators> Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/LoginAction-login-validation.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/ManageUser-validation.xml =================================================================== --- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/ManageUser-validation.xml (rev 0) +++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/user/ManageUser-validation.xml 2011-11-14 13:53:50 UTC (rev 78) @@ -0,0 +1,43 @@ +<!-- + #%L + EchoBase :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE validators PUBLIC + "-//OpenSymphony Group//XWork Validator 1.0.2//EN" + "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> +<validators> + + <field name="user.email"> + + <field-validator type="login"> + <message key="echobase.validation.login.wrongLogin"/> + </field-validator> + </field> + + <field name="user.password"> + + <field-validator type="requiredstring"> + <message key="echobase.validation.login.password.requiredstring"/> + </field-validator> + </field> + +</validators> \ No newline at end of file Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties =================================================================== --- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-14 09:41:05 UTC (rev 77) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-14 13:53:50 UTC (rev 78) @@ -31,8 +31,8 @@ echobase.common.sqlQueries=Requêtes enregistrées echobase.common.tableName=Nom de la table echobase.common.user=Utilisateur -echobase.common.voyage=Campagne -echobase.common.voyagesToSelect=Campagnes à exporter +echobase.common.voyage=Voyage +echobase.common.voyagesToSelect=Voyage à exporter echobase.embeddedApplication.configuration=Configuration de l'application embarquée echobase.error.bad.password=Mot de passe incorrrect echobase.error.email.already.used= @@ -89,4 +89,4 @@ echobase.title.modification.detail=Détail de la modification echobase.title.users=Adminitration des utilisateurs echobase.user.gridTitle=Liste des utilisateurs -echobase.voyage.selectHeader=Selectionnez une campagne +echobase.voyage.selectHeader=Selectionnez un voyage Added: trunk/echobase-ui/src/main/resources/log4j.properties =================================================================== --- trunk/echobase-ui/src/main/resources/log4j.properties (rev 0) +++ trunk/echobase-ui/src/main/resources/log4j.properties 2011-11-14 13:53:50 UTC (rev 78) @@ -0,0 +1,38 @@ +### +# #%L +# EchoBase :: UI +# +# $Id$ +# $HeadURL$ +# %% +# Copyright (C) 2011 Ifremer, Codelutin +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# #L% +### +# Default to info level output; this is very handy if you eventually use Hibernate as well. +log4j.rootCategory=info, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d %5p [%t] (%F:%L) %M - %m%n + +# Toute l'application +log4j.logger.fr.ifremer.echobase=INFO + +log4j.logger.com.opensymphony.xwork2.validator.ValidationInterceptor=DEBUG +log4j.logger.org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor=DEBUG \ No newline at end of file Deleted: trunk/echobase-ui/src/main/resources/struts.properties =================================================================== --- trunk/echobase-ui/src/main/resources/struts.properties 2011-11-14 09:41:05 UTC (rev 77) +++ trunk/echobase-ui/src/main/resources/struts.properties 2011-11-14 13:53:50 UTC (rev 78) @@ -1,36 +0,0 @@ -### -# #%L -# EchoBase :: UI -# -# $Id$ -# $HeadURL$ -# %% -# Copyright (C) 2011 Ifremer, Codelutin -# %% -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# #L% -### -struts.ognl.allowStaticMethodAccess=true - -# Help debugging -struts.devMode=true -struts.ognl.logMissingProperties=true -struts.el.throwExceptionOnFailure=true -struts.i18n.reload=true -struts.custom.i18n.resources=resources -struts.configuration.xml.reload=true - -# Performance tuning -# see http://struts.apache.org/2.2.3/docs/performance-tuning.html -struts.freemarker.templatesCache=true \ No newline at end of file Modified: trunk/echobase-ui/src/main/resources/struts.xml =================================================================== --- trunk/echobase-ui/src/main/resources/struts.xml 2011-11-14 09:41:05 UTC (rev 77) +++ trunk/echobase-ui/src/main/resources/struts.xml 2011-11-14 13:53:50 UTC (rev 78) @@ -42,6 +42,9 @@ <constant name="struts.configuration.xml.reload" value="false"/> <constant name="struts.ui.theme" value="css_xhtml"/> <constant name="struts.multipart.maxSize" value="209715200"/> + + <!--Performance tuning--> + <!--see http://struts.apache.org/2.2.3/docs/performance-tuning.html--> <constant name="struts.freemarker.templatesCache" value="true"/> <package name="default" extends="json-default" abstract="true"