This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 9ff22984b0ebe2a8cbbdd8b61c5b33cda699002e Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri Oct 16 16:49:46 2015 +0200 mise en place de la validation (refs #7603) --- .../content/table/impl/seine/SchoolEstimateUI.jaxx | 2 +- ...choolEstimateDto-n1-update-error-validation.xml | 76 ++++++++++++++++++++++ ...choolEstimateDto-n1-update-error-validation.xml | 65 ++++++++++++++++++ 3 files changed, 142 insertions(+), 1 deletion(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/SchoolEstimateUI.jaxx b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/SchoolEstimateUI.jaxx index d9cf3da..685f865 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/SchoolEstimateUI.jaxx +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/SchoolEstimateUI.jaxx @@ -67,7 +67,7 @@ autoField='true' beanClass='fr.ird.observe.services.dto.seine.SetSeineSchoolEstimateDto' errorTableModel='{getErrorTableModel()}' - context='n1-update-schoolEstimate'> + context='n1-update'> <!-- clef unique --> <field name="schoolEstimate" component="editorPanel"/> </BeanValidator> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SchoolEstimateDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SchoolEstimateDto-n1-update-error-validation.xml new file mode 100644 index 0000000..43e663a --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SchoolEstimateDto-n1-update-error-validation.xml @@ -0,0 +1,76 @@ +<?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.schoolEstimate.required.species</message> + </field-validator> + + <!-- species desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ species.enabled ]]> + </param> + <message>validator.schoolEstimate.desactivated.species</message> + </field-validator> + + </field> + + <field name="totalWeight"> + + <!-- l'un des deux weight doit etre renseignee --> + <field-validator type="fieldexpression"> + <param name="expression"> + <![CDATA[ (totalWeight !=null && totalWeight > 0) || (meanWeight !=null && meanWeight > 0) ]]> + </param> + <message>validator.schoolEstimate.required.weight</message> + </field-validator> + + </field> + + <field name="meanWeight"> + + <!-- l'un des deux weight doit etre renseignee --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ (totalWeight !=null && totalWeight > 0) || (meanWeight !=null && meanWeight > 0) ]]> + </param> + <message>validator.schoolEstimate.required.weight</message> + </field-validator> + + <!-- validation du weight par borne --> + <field-validator type="species_weight"> + <param name="ratio">1.0</param> + <message>validator.nonTargetCatch.bound.meanWeight##${min}##${max}</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SetSeineSchoolEstimateDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SetSeineSchoolEstimateDto-n1-update-error-validation.xml new file mode 100644 index 0000000..d33839f --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/SetSeineSchoolEstimateDto-n1-update-error-validation.xml @@ -0,0 +1,65 @@ +<?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="comment"> + + <!-- comentaire de moins de 1024 caractères --> + <field-validator type="stringlength"> + <param name="maxLength">1024</param> + <message>validator.set.comment.tobig</message> + </field-validator> + + <!-- comment requis selon le type d'species indiquee dans les tailles thons choisi --> + + <field-validator type="collectionFieldExpression"> + + <param name="collectionFieldName">schoolEstimate</param> + <param name="mode">ALL</param> + <param name="useSensitiveContext">true</param> + <param name="expression"> + <![CDATA[ (comment != null && !comment.empty) || current.species == null || !current.species.needComment ]]></param> + <message>validator.schoolEstimate.required.comment.for.species##${index}</message> + </field-validator> + + </field> + + <field name="schoolEstimate"> + + <!-- clef unique sur la species --> + + <field-validator type="collectionFieldExpression"> + + <param name="collectionFieldName">schoolEstimate</param> + <param name="mode">UNIQUE_KEY</param> + <param name="keys">species.Id</param> + <message>validator.schoolEstimate.species.uniqueKey</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>.