This is an automated email from the git hooks/post-receive script. New commit to branch feature/7608 in repository observe. See http://git.codelutin.com/observe.git commit 6e9949024ccf289dfd30983676e37a6f4281c9ef Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Oct 21 15:24:14 2015 +0200 ajout des validateurs (refs #7608) --- ...nTargetLengthDto-n1-update-error-validation.xml | 117 +++++++++++++++++++++ ...argetLengthDto-n1-update-warning-validation.xml | 53 ++++++++++ ...nTargetSampleDto-n1-update-error-validation.xml | 49 +++++++++ 3 files changed, 219 insertions(+) diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetLengthDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetLengthDto-n1-update-error-validation.xml new file mode 100644 index 0000000..6a4dc4e --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetLengthDto-n1-update-error-validation.xml @@ -0,0 +1,117 @@ +<?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.nonTargetSample.required.species</message> + </field-validator> + + <!-- species desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ species.enabled ]]> + </param> + <message>validator.nonTargetSample.desactivated.species</message> + </field-validator> + + </field> + + <field name="length"> + + <!-- taille obligatoire en mode par count --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ acquisitionMode == 1 || length != null ]]> + </param> + <message>validator.nonTargetSample.required.taille</message> + </field-validator> + + <!-- au moins un des 2 valeurs taille / weight doit etre renseignee (en mode par individu) --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ acquisitionMode == 0 || length != null || weight != null ]]> + </param> + <message>validator.nonTargetSample.required.weight.or.taille</message> + </field-validator> + + <!-- pas de length selectionnee --> + <!--field-validator type="required" short-circuit="true"> + <message>validator.nonTargetSample.required.length</message> + </field-validator--> + + <!-- length non renseigné ou > 0 --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ length == null || length > 0 ]]> + </param> + <message>validator.nonTargetSample.positive.length</message> + </field-validator> + + </field> + + <field name="weight"> + + <!-- au moins un des 2 valeurs taille / weight doit etre renseignee (en mode par individu) --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ acquisitionMode == 0 || length != null || weight != null ]]> + </param> + <message>validator.nonTargetSample.required.weight.or.taille</message> + </field-validator> + + <!-- weight non renseigné ou > 0 --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ weight == null || weight > 0 ]]> + </param> + <message>validator.nonTargetSample.positive.weight</message> + </field-validator> + + </field> + + <field name="count"> + + <!-- pas d'individu selectionnee --> + <field-validator type="required" short-circuit="true"> + <message>validator.nonTargetSample.required.count</message> + </field-validator> + + </field> + + <field name="sex"> + + <!-- pas de sex selectionne --> + <field-validator type="required" short-circuit="true"> + <message>validator.nonTargetSample.required.gender</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetLengthDto-n1-update-warning-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetLengthDto-n1-update-warning-validation.xml new file mode 100644 index 0000000..e38c3f0 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetLengthDto-n1-update-warning-validation.xml @@ -0,0 +1,53 @@ +<?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="length"> + + <!-- validation de la taille par borne --> + <field-validator type="species_length"> + <!--<param name="fieldName">length</param>--> + <param name="ratio">1.0</param> + <message>validator.nonTargetSample.bound.length##${min}##${max}</message> + </field-validator> + + </field> + + <field name="weight"> + + <!-- validation du weight par borne (uniquement pour mode saisie par individus) --> + <field-validator type="species_weight"> + <param name="ratio">1.0</param> + <param name="expression"> + <![CDATA[ acquisitionMode == 1 ]]> + </param> + <message>validator.nonTargetSample.bound.weight##${min}##${max}</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetSampleDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetSampleDto-n1-update-error-validation.xml new file mode 100644 index 0000000..41cda81 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/NonTargetSampleDto-n1-update-error-validation.xml @@ -0,0 +1,49 @@ +<?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.nonTargetSample.comment.tobig</message> + </field-validator> + + <!-- comment requis selone le type d'species indiquee dans les tailles thons choisi --> + + <field-validator type="collectionFieldExpression"> + <param name="mode">ALL</param> + <param name="useSensitiveContext">true</param> + <param name="collectionFieldName">nonTargetSample</param> + <param name="expression"> + <![CDATA[ (comment != null && !comment.empty) || current.species == null || !current.species.needComment ]]></param> + <message>validator.nonTargetSample.required.comment.for.species##${index}</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>.