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 e543f390cb504960b60a6340439060f75bb16659 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Oct 15 17:59:14 2015 +0200 mise en place de la validation (refs #7601) --- .../table/impl/seine/ObjectSchoolEstimateUI.jaxx | 2 +- ...choolEstimateDto-n1-update-error-validation.xml | 51 ++++++++++++++++++++ ...choolEstimateDto-n1-update-error-validation.xml | 55 ++++++++++++++++++++++ ...oolEstimateDto-n1-update-warning-validation.xml | 40 ++++++++++++++++ 4 files changed, 147 insertions(+), 1 deletion(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx index 4c5d393..df2d78e 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/ObjectSchoolEstimateUI.jaxx @@ -65,7 +65,7 @@ autoField='true' beanClass='fr.ird.observe.services.dto.seine.FloatingObjectSchoolEstimateDto' errorTableModel='{getErrorTableModel()}' - context='n1-update-schoolEstimate'/> + context='n1-update'/> <!-- le validateur d'une entrée de tableau --> <BeanValidator id='validatorTable' diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectSchoolEstimateDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectSchoolEstimateDto-n1-update-error-validation.xml new file mode 100644 index 0000000..4e638fe --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectSchoolEstimateDto-n1-update-error-validation.xml @@ -0,0 +1,51 @@ +<?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.schoolEstimate.comment.tobig</message> + </field-validator> + + <!-- comment requis si l'species en a besoin --> + <field-validator type="collectionFieldExpression"> + <!--FIXME il faut ajouter une propriete dans le validateur --> + <param name="collectionFieldName">schoolEstimate</param> + <param name="mode">ALL</param> + <param name="useSensitiveContext">true</param> + <param name="expression"> + <![CDATA[ current.species == null || !current.species.needComment || ( comment != null && comment != "" ) ]]> + </param> + <message>validator.schoolEstimate.required.comment.for.species##${index}</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/ObjectSchoolEstimateDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/ObjectSchoolEstimateDto-n1-update-error-validation.xml new file mode 100644 index 0000000..b1b4f29 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/ObjectSchoolEstimateDto-n1-update-error-validation.xml @@ -0,0 +1,55 @@ +<?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"> + + <!-- pas de tonnage renseigné --> + <field-validator type="required" short-circuit="true"> + <message>validator.schoolEstimate.required.weight</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/ObjectSchoolEstimateDto-n1-update-warning-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/ObjectSchoolEstimateDto-n1-update-warning-validation.xml new file mode 100644 index 0000000..0b16a55 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/ObjectSchoolEstimateDto-n1-update-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="totalWeight"> + + <!-- le tonnage est compris entre 1 et 500 --> + <field-validator type="int" short-circuit="true"> + <param name="min">1</param> + <param name="max">500</param> + <message>validator.schoolEstimate.bound.weight##${min}##${max}</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>.