This is an automated email from the git hooks/post-receive script. New commit to branch feature/7604 in repository observe. See http://git.codelutin.com/observe.git commit 250352fa4007b1d2b86ee3e4bf05f5baf9e17ddc Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Oct 19 15:11:24 2015 +0200 mise en place de la validation (refs #7604) --- .../ui/content/table/impl/seine/TargetCatchUI.jaxx | 2 +- ...neTargetCatchDto-n1-update-error-validation.xml | 41 ++++++++++ ...hDto-n1-update-targetCatch-error-validation.xml | 91 ++++++++++++++++++++++ ...to-n1-update-targetCatch-warning-validation.xml | 40 ++++++++++ 4 files changed, 173 insertions(+), 1 deletion(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/TargetCatchUI.jaxx b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/TargetCatchUI.jaxx index 193fb48..881e02d 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/TargetCatchUI.jaxx +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/TargetCatchUI.jaxx @@ -65,7 +65,7 @@ <BeanValidator id='validator' beanClass='fr.ird.observe.services.dto.seine.SetSeineTargetCatchDto' errorTableModel='{getErrorTableModel()}' - context='n1-update-targetCatch'> + context='n1-update'> <!-- clef unique --> <field name="targetCatch" component="editorPanel"/> </BeanValidator> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SetSeineTargetCatchDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SetSeineTargetCatchDto-n1-update-error-validation.xml new file mode 100644 index 0000000..f6d972a --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SetSeineTargetCatchDto-n1-update-error-validation.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe :: Validation + %% + Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="targetCatch"> + + <!-- clef unique sur la categorie weight et well --> + + <field-validator type="collectionFieldExpression"> + <param name="mode">UNIQUE_KEY</param> + <param name="keys">weightCategory.id,well</param> + <message>validator.targetCatch.uniqueKey</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/TargetCatchDto-n1-update-targetCatch-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/TargetCatchDto-n1-update-targetCatch-error-validation.xml new file mode 100644 index 0000000..f9666e2 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/TargetCatchDto-n1-update-targetCatch-error-validation.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe :: Validation + %% + Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="species"> + + <!-- pas de species selectionnee --> + <field-validator type="required" short-circuit="true"> + <message>validator.targetCatch.required.species</message> + </field-validator> + + <!-- species desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ species.enabled ]]> + </param> + <message>validator.targetCatch.desactivated.species</message> + </field-validator> + + </field> + + <field name="weightCategory"> + + <!-- pas de categorie weight selectionnee --> + <field-validator type="required" short-circuit="true"> + <message>validator.targetCatch.required.weightCategory</message> + </field-validator> + + <!-- weightCategory desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ weightCategory.enabled ]]> + </param> + <message>validator.targetCatch.desactivated.weightCategory</message> + </field-validator> + + </field> + + <field name="well"> + + <!-- well non renseignée --> + <field-validator type="required" short-circuit="true"> + <message>validator.targetCatch.required.well</message> + </field-validator> + + </field> + + <field name="catchWeight"> + + <!-- catchWeight non renseigné --> + <field-validator type="required" short-circuit="true"> + <message>validator.targetCatch.required.weight</message> + </field-validator> + + </field> + + <field name="comment"> + + <!-- comentaire de moins de 1024 caractères --> + <field-validator type="stringlength"> + <param name="maxLength">1024</param> + <message>validator.targetCatch.comment.tobig</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/TargetCatchDto-n1-update-targetCatch-warning-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/TargetCatchDto-n1-update-targetCatch-warning-validation.xml new file mode 100644 index 0000000..1363e20 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/TargetCatchDto-n1-update-targetCatch-warning-validation.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe :: Validation + %% + Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="catchWeight"> + + <!-- catchWeight entre 0 et 400 --> + <field-validator type="double" short-circuit="true"> + <param name="minExclusive">0</param> + <param name="maxInclusive">400</param> + <message>validator.targetCatch.bound.weight##${minExclusive}##${maxInclusive}</message> + </field-validator> + + </field> + +</validators> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.