Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 2aecae7e by Tony Chemit at 2021-01-04T12:14:57+01:00 LL Logbook capture : validation formulaire - Closes #1727 - - - - - 7 changed files: - services/i18n/src/main/i18n/translations/services_en_GB.properties - services/i18n/src/main/i18n/translations/services_es_ES.properties - services/i18n/src/main/i18n/translations/services_fr_FR.properties - services/validation/src/main/i18n/getters/validation-messages.getter - services/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/CatchDto-update-error-validation.xml - + services/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/CatchDto-update-warning-validation.xml - services/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/CatchDto-update-error-validation.xml Changes: ===================================== services/i18n/src/main/i18n/translations/services_en_GB.properties ===================================== @@ -158,7 +158,6 @@ observe.data.ll.Activity.validation.endDate.before.currentTrip.endDate=End date observe.data.ll.Activity.validation.endTime.after.startTime=End time must be after start time observe.data.ll.Activity.validation.startDate.after.currentTrip.startDate=Start date must be after current trip start date observe.data.ll.Activity.validation.startDate.before.currentTrip.endDate=Start date must be before current trip end date -observe.data.ll.Catch.validation.required.count.when.acquisitionModeIsGrouped=Count must be filled in group mode. observe.data.ll.Set.validation.baitsComposition.uniqueKey=Tuple (type/status/size/weight) must be unique. observe.data.ll.Set.validation.branchlinesComposition.uniqueKey=Tuple (topType/type/size) must be unique. observe.data.ll.Set.validation.duplicated.homeId=Home id is already used in another fishing operation (%1$s). @@ -241,6 +240,7 @@ observe.data.ll.logbook.Catch.predator=TODO observe.data.ll.logbook.Catch.speciesCatch=Species observe.data.ll.logbook.Catch.totalWeight=Total weight (kg) observe.data.ll.logbook.Catch.type=Catch +observe.data.ll.logbook.Catch.validation.required.countOrTotalWeight.when.acquisitionModeIsGrouped=Count or total weight must be filled in group mode. observe.data.ll.logbook.FloatlinesComposition.length=Length observe.data.ll.logbook.FloatlinesComposition.lineType=Line type observe.data.ll.logbook.FloatlinesComposition.proportion=Proportion @@ -360,6 +360,7 @@ observe.data.ll.observation.Catch.speciesCatch=Species observe.data.ll.observation.Catch.stomachFullness=Stomac fullness observe.data.ll.observation.Catch.totalWeight=Total weight (kg) observe.data.ll.observation.Catch.type=Catch +observe.data.ll.observation.Catch.validation.required.count.when.acquisitionModeIsGrouped=Count must be filled in group mode. observe.data.ll.observation.Encounter.count=Count observe.data.ll.observation.Encounter.distance=Distance (m) observe.data.ll.observation.Encounter.encounterType=Type ===================================== services/i18n/src/main/i18n/translations/services_es_ES.properties ===================================== @@ -158,7 +158,6 @@ observe.data.ll.Activity.validation.endDate.before.currentTrip.endDate=End date observe.data.ll.Activity.validation.endTime.after.startTime=End time must be after start time \#TODO observe.data.ll.Activity.validation.startDate.after.currentTrip.startDate=Start date must be after current trip start date \#TODO observe.data.ll.Activity.validation.startDate.before.currentTrip.endDate=Start date must be before current trip end date \#TODO -observe.data.ll.Catch.validation.required.count.when.acquisitionModeIsGrouped=El número es mandatorio en modo grupado. observe.data.ll.Set.validation.baitsComposition.uniqueKey=La tupla (type/estado/tamaño/peso) debe ser única, la tupa ya está utilizada. observe.data.ll.Set.validation.branchlinesComposition.uniqueKey=La tupla (tipo alto/tipo bajo/tamaño) debe ser única, la tupa ya está utilizada. observe.data.ll.Set.validation.duplicated.homeId=El Id de negocio ya está utilizado por una otra operación de pesca (%s) @@ -241,6 +240,7 @@ observe.data.ll.logbook.Catch.predator=TODO observe.data.ll.logbook.Catch.speciesCatch=Especie observe.data.ll.logbook.Catch.totalWeight=Peso total (kg) observe.data.ll.logbook.Catch.type=Captura +observe.data.ll.logbook.Catch.validation.required.countOrTotalWeight.when.acquisitionModeIsGrouped=El número or total weight es mandatorio en modo grupado. \#TODO observe.data.ll.logbook.FloatlinesComposition.length=Longitud (m) observe.data.ll.logbook.FloatlinesComposition.lineType=Tipo observe.data.ll.logbook.FloatlinesComposition.proportion=Proporción (%) @@ -360,6 +360,7 @@ observe.data.ll.observation.Catch.speciesCatch=Especie observe.data.ll.observation.Catch.stomachFullness=Estatuto del estomago observe.data.ll.observation.Catch.totalWeight=Peso total (kg) observe.data.ll.observation.Catch.type=Captura +observe.data.ll.observation.Catch.validation.required.count.when.acquisitionModeIsGrouped=El número es mandatorio en modo grupado. observe.data.ll.observation.Encounter.count=Numéro observe.data.ll.observation.Encounter.distance=Distancia (m) observe.data.ll.observation.Encounter.encounterType=Tipo del encuentro ===================================== services/i18n/src/main/i18n/translations/services_fr_FR.properties ===================================== @@ -158,7 +158,6 @@ observe.data.ll.Activity.validation.endDate.before.currentTrip.endDate=La date d observe.data.ll.Activity.validation.endTime.after.startTime=L'heure de fin doit être supérieure ou égale à l'heure de début de l'activité observe.data.ll.Activity.validation.startDate.after.currentTrip.startDate=La date doit être supérieure ou égale à la date de début de marée observe.data.ll.Activity.validation.startDate.before.currentTrip.endDate=La date doit être inférieure ou égale à la date de fin de marée -observe.data.ll.Catch.validation.required.count.when.acquisitionModeIsGrouped=Le nombre est obligatoire en mode groupé. observe.data.ll.Set.validation.baitsComposition.uniqueKey=Le tuple (type/état/taille/poids) doit être unique, le tuple est déjà utilisé. observe.data.ll.Set.validation.branchlinesComposition.uniqueKey=Le tuple (type haut/type bas/taille) doit être unique observe.data.ll.Set.validation.duplicated.homeId=L'Id métier est déjà utilisé par une autre opération de pêche (%s) @@ -241,6 +240,7 @@ observe.data.ll.logbook.Catch.predator=TODO observe.data.ll.logbook.Catch.speciesCatch=Espèce observe.data.ll.logbook.Catch.totalWeight=Poids total (kg) observe.data.ll.logbook.Catch.type=Capture +observe.data.ll.logbook.Catch.validation.required.countOrTotalWeight.when.acquisitionModeIsGrouped=Le nombre ou le poids total est obligatoire en mode groupé. observe.data.ll.logbook.FloatlinesComposition.length=Longueur (m) observe.data.ll.logbook.FloatlinesComposition.lineType=Type observe.data.ll.logbook.FloatlinesComposition.proportion=Proportion (%) @@ -360,6 +360,7 @@ observe.data.ll.observation.Catch.speciesCatch=Espèce observe.data.ll.observation.Catch.stomachFullness=État de l'estomac observe.data.ll.observation.Catch.totalWeight=Poids total (kg) observe.data.ll.observation.Catch.type=Capture +observe.data.ll.observation.Catch.validation.required.count.when.acquisitionModeIsGrouped=Le nombre est obligatoire en mode groupé. observe.data.ll.observation.Encounter.count=Nombre observe.data.ll.observation.Encounter.distance=Distance (m) observe.data.ll.observation.Encounter.encounterType=Type de la rencontre ===================================== services/validation/src/main/i18n/getters/validation-messages.getter ===================================== @@ -29,7 +29,6 @@ observe.data.ll.Activity.validation.endDate.before.currentTrip.endDate observe.data.ll.Activity.validation.endTime.after.startTime observe.data.ll.Activity.validation.startDate.after.currentTrip.startDate observe.data.ll.Activity.validation.startDate.before.currentTrip.endDate -observe.data.ll.Catch.validation.required.count.when.acquisitionModeIsGrouped observe.data.ll.Set.validation.baitsComposition.uniqueKey observe.data.ll.Set.validation.branchlinesComposition.uniqueKey observe.data.ll.Set.validation.duplicated.homeId @@ -42,6 +41,7 @@ observe.data.ll.Set.validation.settingStartTimeStamp.before.settingEndTimeStamp observe.data.ll.landing.Landing.validation.endDate.after.startDate observe.data.ll.landing.LandingPart.validation.bound.categoryWeight observe.data.ll.landing.LandingPart.validation.required.weightMeasureMethod +observe.data.ll.logbook.Catch.validation.required.countOrTotalWeight.when.acquisitionModeIsGrouped observe.data.ll.logbook.SamplePart.validation.required.sizeMeasureType.for.length observe.data.ll.logbook.SamplePart.validation.required.weightMeasureType.for.weight observe.data.ll.logbook.Set.validation.required.haulingEndLatitude @@ -50,6 +50,7 @@ observe.data.ll.logbook.Set.validation.required.haulingStartLatitude observe.data.ll.logbook.Set.validation.required.haulingStartLongitude observe.data.ll.logbook.Set.validation.required.settingEndLatitude observe.data.ll.logbook.Set.validation.required.settingEndLongitude +observe.data.ll.observation.Catch.validation.required.count.when.acquisitionModeIsGrouped observe.data.ll.observation.LonglinePositionAware.validation.required.position observe.data.ll.observation.SetDetailComposition.validation.invalid.templates observe.data.ll.observation.Tdr.validation.deploymentStart.before.fishingStart ===================================== services/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/CatchDto-update-error-validation.xml ===================================== @@ -24,12 +24,17 @@ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> <validators> <field name="count"> - <!-- count obligatoire si mode = groupe --> - <field-validator type="fieldexpression" short-circuit="true"> - <param name="expression"> - <![CDATA[ acquisitionMode == 0 || count != null ]]> - </param> - <message>observe.data.ll.Catch.validation.required.count.when.acquisitionModeIsGrouped</message> + <!-- count ou totalWeight obligatoire si mode = groupe --> + <field-validator type="mandatory" short-circuit="true"> + <param name="skip">acquisitionMode == 0 || totalWeight != null</param> + <message>observe.data.ll.logbook.Catch.validation.required.countOrTotalWeight.when.acquisitionModeIsGrouped</message> + </field-validator> + </field> + <field name="totalWeight"> + <!-- count ou totalWeight obligatoire si mode = groupe --> + <field-validator type="mandatory" short-circuit="true"> + <param name="skip">acquisitionMode == 0 || count != null</param> + <message>observe.data.ll.logbook.Catch.validation.required.countOrTotalWeight.when.acquisitionModeIsGrouped</message> </field-validator> </field> <field name="depredatedProportion"> ===================================== services/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/CatchDto-update-warning-validation.xml ===================================== @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe Services :: Validation + %% + Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io + %% + 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="count"> + <field-validator type="notFilled" short-circuit="true"> + <param name="skip">acquisitionMode == 0 || totalWeight == null</param> + <message/> + </field-validator> + </field> + <field name="totalWeight"> + <field-validator type="notFilled" short-circuit="true"> + <param name="skip">acquisitionMode == 0 || count == null</param> + <message/> + </field-validator> + </field> + <field name="depredatedProportion"> + <field-validator type="boundNumber" short-circuit="true"> + <param name="min">1.0</param> + <param name="max">100.0</param> + <message/> + </field-validator> + </field> +</validators> ===================================== services/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/CatchDto-update-error-validation.xml ===================================== @@ -25,11 +25,9 @@ <validators> <field name="count"> <!-- count obligatoire si mode = groupe --> - <field-validator type="fieldexpression" short-circuit="true"> - <param name="expression"> - <![CDATA[ acquisitionMode == 0 || count != null ]]> - </param> - <message>observe.data.ll.Catch.validation.required.count.when.acquisitionModeIsGrouped</message> + <field-validator type="mandatory" short-circuit="true"> + <param name="skip">acquisitionMode == 0</param> + <message>observe.data.ll.observation.Catch.validation.required.count.when.acquisitionModeIsGrouped</message> </field-validator> </field> <field name="gonadeWeight"> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/2aecae7e8f2ae7dde1718be1e0... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/2aecae7e8f2ae7dde1718be1e0... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT