Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 2b99d825 by Tony Chemit at 2023-05-19T15:39:01+02:00 Tant que la fonction corbeille de l'UI de synchro avancée de référentiel n'est pas 100% fiable, masquer les corbeilles - Closes #2693 - - - - - 2dcc11ad by Tony Chemit at 2023-05-19T15:39:01+02:00 Mapping du code 'avarie' dans l'importeur AVDTH non optimum - Closes #2699 - - - - - 02c550ed by Tony Chemit at 2023-05-19T15:39:01+02:00 Templates Validation - Do not generate notBlankString and stringMaxLength validations if attributes are marked to be skip copy to entity - - - - - b5d2fcc2 by Tony Chemit at 2023-05-19T15:39:01+02:00 Ne pas recopier le commentaire de la calée sur certains formulaires qui ne permettent pas son édition) - See #2692 - - - - - 63a92659 by Tony Chemit at 2023-05-19T15:39:01+02:00 Modification message de validation - See #2692 - - - - - 52f007ba by Tony Chemit at 2023-05-19T15:39:01+02:00 Mise à jour de la validation - Closes #2692 - - - - - 24 changed files: - client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/ReferentialSelectionTreePaneHandler.java - core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetCatchDto-create-error-validation.xml - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetCatchDto-update-error-validation.xml - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetCatchDto-create-error-validation.xml - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetCatchDto-update-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDetailCompositionDto-create-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDetailCompositionDto-update-error-validation.xml - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetTdrDto-create-error-validation.xml - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetTdrDto-update-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetCatchDto-create-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetCatchDto-update-error-validation.xml - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetNonTargetCatchReleaseDto-create-error-validation.xml - − core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetNonTargetCatchReleaseDto-update-error-validation.xml - core/persistence/avdth/src/main/java/fr/ird/observe/persistence/avdth/referential/interceptors/VesselActivityInterceptor.java - core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetCatchSpi.java - core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetNonTargetCatchReleaseSpi.java - core/services/i18n/src/main/i18n/translations/services_en_GB.properties - core/services/i18n/src/main/i18n/translations/services_es_ES.properties - core/services/i18n/src/main/i18n/translations/services_fr_FR.properties - model/src/main/models/Observe/dto/attribute/skipCopyToEntity.properties - src/site/markdown/avdth/referential.md - toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/ToolkitTagValues.java - toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/validation/DtoFormValidatorTransformer.java Changes: ===================================== client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/ng/tree/ReferentialSelectionTreePaneHandler.java ===================================== @@ -26,16 +26,11 @@ import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.Refer import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchroUI; import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchroUIHandler; import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.ReferentialSynchronizeMode; -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterCopy; -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterDeactivate; -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterDeactivateWithReplacement; -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterDelete; -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.RegisterRevert; -import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.SelectUnselect; +import fr.ird.observe.client.datasource.actions.synchronize.referential.ng.tree.actions.*; import fr.ird.observe.client.util.init.DefaultUIInitializer; import org.nuiton.jaxx.runtime.spi.UIHandler; -import java.awt.BorderLayout; +import java.awt.*; /** * @author Tony Chemit - dev@tchemit.fr @@ -63,6 +58,10 @@ public class ReferentialSelectionTreePaneHandler implements UIHandler<Referentia ui.remove(ui.getMiddleActions()); ui.add(ui.getMiddleActions(), BorderLayout.WEST); } + // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2693 + // Do not allow to delete (need to review delete actions, since it may cause error in some case if for example + // an update is asked using the deleted data...) + ui.getMiddleActions().remove(ui.delete); } private void onUpdateMode(ReferentialSelectionTreePane ui, ReferentialSynchronizeMode synchronizeMode) { ===================================== core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json ===================================== @@ -3021,34 +3021,6 @@ } ] }, - { - "type": "fr.ird.observe.dto.data.ll.logbook.SetCatchDto", - "scope": "ERROR", - "context": "create", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, - { - "type": "fr.ird.observe.dto.data.ll.logbook.SetCatchDto", - "scope": "ERROR", - "context": "update", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, { "type": "fr.ird.observe.dto.data.ll.logbook.SetDto", "scope": "ERROR", @@ -6129,34 +6101,6 @@ } ] }, - { - "type": "fr.ird.observe.dto.data.ll.observation.SetCatchDto", - "scope": "ERROR", - "context": "create", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, - { - "type": "fr.ird.observe.dto.data.ll.observation.SetCatchDto", - "scope": "ERROR", - "context": "update", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, { "type": "fr.ird.observe.dto.data.ll.observation.SetDetailCompositionDto", "scope": "ERROR", @@ -6174,13 +6118,6 @@ "branchlinesPerBasketCount is a positive number" ] }, - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - }, { "name": "homeId", "comments": [ @@ -6212,13 +6149,6 @@ "branchlinesPerBasketCount is a positive number" ] }, - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - }, { "name": "homeId", "comments": [ @@ -7061,34 +6991,6 @@ } ] }, - { - "type": "fr.ird.observe.dto.data.ll.observation.SetTdrDto", - "scope": "ERROR", - "context": "create", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, - { - "type": "fr.ird.observe.dto.data.ll.observation.SetTdrDto", - "scope": "ERROR", - "context": "update", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, { "type": "fr.ird.observe.dto.data.ll.observation.SizeMeasureDto", "scope": "ERROR", @@ -14560,13 +14462,6 @@ "comments": [ "check unique value on catches for tuple species,speciesFate,reasonForDiscard,weightMeasureMethod,minWeight,maxWeight,meanWeight,meanLength,well,informationSource" ] - }, - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] } ] }, @@ -14580,13 +14475,6 @@ "comments": [ "check unique value on catches for tuple species,speciesFate,reasonForDiscard,weightMeasureMethod,minWeight,maxWeight,meanWeight,meanLength,well,informationSource" ] - }, - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] } ] }, @@ -14902,34 +14790,6 @@ } ] }, - { - "type": "fr.ird.observe.dto.data.ps.observation.SetNonTargetCatchReleaseDto", - "scope": "ERROR", - "context": "create", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, - { - "type": "fr.ird.observe.dto.data.ps.observation.SetNonTargetCatchReleaseDto", - "scope": "ERROR", - "context": "update", - "fields": [ - { - "name": "comment", - "comments": [ - "comment (if not null) is not a blank string", - "comment length <= 8192" - ] - } - ] - }, { "type": "fr.ird.observe.dto.data.ps.observation.SetSchoolEstimateDto", "scope": "ERROR", ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetCatchDto-create-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetCatchDto-update-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetCatchDto-create-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetCatchDto-update-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDetailCompositionDto-create-error-validation.xml ===================================== @@ -38,19 +38,6 @@ </field-validator> </field> - <field name="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - <field name="homeId"> <!-- homeId (if not null) is not a blank string --> <field-validator type="notBlankString" short-circuit="true"> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDetailCompositionDto-update-error-validation.xml ===================================== @@ -38,19 +38,6 @@ </field-validator> </field> - <field name="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - <field name="homeId"> <!-- homeId (if not null) is not a blank string --> <field-validator type="notBlankString" short-circuit="true"> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetTdrDto-create-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetTdrDto-update-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetCatchDto-create-error-validation.xml ===================================== @@ -31,17 +31,4 @@ </field-validator> </field> - <field name="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - </validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetCatchDto-update-error-validation.xml ===================================== @@ -31,17 +31,4 @@ </field-validator> </field> - <field name="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - </validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetNonTargetCatchReleaseDto-create-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SetNonTargetCatchReleaseDto-update-error-validation.xml deleted ===================================== @@ -1,40 +0,0 @@ -<!-- - #%L - ObServe Core :: API :: Validation - %% - Copyright (C) 2008 - 2023 IRD, 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="comment"> - <!-- comment (if not null) is not a blank string --> - <field-validator type="notBlankString" short-circuit="true"> - <message/> - </field-validator> - - <!-- comment length <= 8192 --> - <field-validator type="stringMaxLength"> - <param name="maxLength">8192</param> - <message/> - </field-validator> - </field> - -</validators> ===================================== core/persistence/avdth/src/main/java/fr/ird/observe/persistence/avdth/referential/interceptors/VesselActivityInterceptor.java ===================================== @@ -70,7 +70,8 @@ public class VesselActivityInterceptor extends ReferentialInterceptor<VesselActi .put("32", "13") .put("33", "13") .put("34", "13") - .put("7", "22") + // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2699 + .put("7", "11") .put("8", "10") .put("9", "23") .put("10", "24") ===================================== core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetCatchSpi.java ===================================== @@ -37,6 +37,8 @@ public class SetCatchSpi extends GeneratedSetCatchSpi { @Override public void toDto(ReferentialLocale referentialLocale, Set entity, SetCatchDto dto) { super.toDto(referentialLocale, entity, dto); + // Do not copy set.comment (there is no editor in form for this) + dto.setComment(null); // is there some sample? if (entity.isSampleNotEmpty()) { Sample targetSample = entity.getSample().iterator().next(); ===================================== core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetNonTargetCatchReleaseSpi.java ===================================== @@ -39,6 +39,8 @@ public class SetNonTargetCatchReleaseSpi extends GeneratedSetNonTargetCatchRelea @Override public void toDto(ReferentialLocale referentialLocale, Set entity, SetNonTargetCatchReleaseDto dto) { super.toDto(referentialLocale, entity, dto); + // Do not copy set.comment (there is no editor in form for this) + dto.setComment(null); dto.setAvailableSpeciesIds(entity.getCatches().stream().map(Catch::getSpecies).filter(SetImpl::isSpeciesGroupRelease).map(Species::getTopiaId).collect(Collectors.toSet())); } } ===================================== core/services/i18n/src/main/i18n/translations/services_en_GB.properties ===================================== @@ -1477,7 +1477,7 @@ observe.data.ps.observation.Set.validation.haulingEndTime.after.startTime=Pursin observe.data.ps.observation.Set.validation.haulingStartTimeStamp.after.startTime=Hauling start time (%2$s) must be after starting time (%1). observe.data.ps.observation.Set.validation.startTime.after.currentPsObservationActivity.time=Start time (%2$s) must be before end time (%1$s). observe.data.ps.observation.SetCatch.catches=Catches -observe.data.ps.observation.SetCatch.catches.validation.uniqueKey=Tuple (species,speciesFate,reasonForDiscard,weightMeasureMethod,meanWeight,meanLength,well,informationSource) must be unique, value at index %s is duplicated. +observe.data.ps.observation.SetCatch.catches.validation.uniqueKey=Tuple (species,speciesFate,reasonForDiscard,weightMeasureMethod,minWeight,maxWeight,meanWeight,meanLength,well,informationSource) must be unique, value at index %s is duplicated. observe.data.ps.observation.SetCatch.type=Set catches observe.data.ps.observation.SetNonTargetCatchRelease.type=Set non target catch release observe.data.ps.observation.SetSchoolEstimate.schoolEstimate=School estimate ===================================== core/services/i18n/src/main/i18n/translations/services_es_ES.properties ===================================== @@ -1477,7 +1477,7 @@ observe.data.ps.observation.Set.validation.haulingEndTime.after.startTime=La hor observe.data.ps.observation.Set.validation.haulingStartTimeStamp.after.startTime=Hauling start time (%2$s) must be after starting time (%1$s). \#TODO observe.data.ps.observation.Set.validation.startTime.after.currentPsObservationActivity.time=La hora de inicio (%2$s) debe ser superior o igual a la hora de observación de la actividad (%1$s). observe.data.ps.observation.SetCatch.catches=Captura -observe.data.ps.observation.SetCatch.catches.validation.uniqueKey=Tuple (species,speciesFate,reasonForDiscard,weightMeasureMethod,meanWeight,meanLength,well,informationSource) must be unique, value at index %s is duplicated. +observe.data.ps.observation.SetCatch.catches.validation.uniqueKey=Tuple (species,speciesFate,reasonForDiscard,weightMeasureMethod,minWeight,maxWeight,meanWeight,meanLength,well,informationSource) must be unique, value at index %s is duplicated. observe.data.ps.observation.SetCatch.type=SetCatch observe.data.ps.observation.SetNonTargetCatchRelease.type=SetNonTargetCatchRelease observe.data.ps.observation.SetSchoolEstimate.schoolEstimate=Estimación del banco ===================================== core/services/i18n/src/main/i18n/translations/services_fr_FR.properties ===================================== @@ -1477,7 +1477,7 @@ observe.data.ps.observation.Set.validation.haulingEndTime.after.startTime=L'heur observe.data.ps.observation.Set.validation.haulingStartTimeStamp.after.startTime=L'heure de début de virage (%2$s) doit être supérieure ou égal à celle de début (%1$s). observe.data.ps.observation.Set.validation.startTime.after.currentPsObservationActivity.time=L'heure de début (%2$s) doit être supérieure ou égal à l'heure d'observation de l'activité (%1$s). observe.data.ps.observation.SetCatch.catches=Captures -observe.data.ps.observation.SetCatch.catches.validation.uniqueKey=Le tuple (espèce/devenir/raison rejet/méthode de mesure de poids/poids moyen/taille moyenne/cuve/origine de l'information) doit être unique, la donnée de rang %s est invalide. +observe.data.ps.observation.SetCatch.catches.validation.uniqueKey=Le tuple (espèce/devenir/raison rejet/méthode de mesure de poids/poids min/poids max/poids moyen/taille moyenne/cuve/origine de l'information) doit être unique, la donnée de rang %s est invalide. observe.data.ps.observation.SetCatch.type=Capture observe.data.ps.observation.SetNonTargetCatchRelease.type=Espèce accessoire sensible libérée observe.data.ps.observation.SetSchoolEstimate.schoolEstimate=Estimation banc ===================================== model/src/main/models/Observe/dto/attribute/skipCopyToEntity.properties ===================================== @@ -66,4 +66,6 @@ data.ps.observation.ActivityStub.attribute.longitude=true data.ps.observation.ActivityStub.attribute.seaSurfaceTemperature=true data.ps.observation.ActivityStub.attribute.time=true data.ps.observation.Route.attribute.activity=true +data.ps.observation.SetCatch.attribute.comment=true +data.ps.observation.SetNonTargetCatchRelease.attribute.comment=true data.ps.observation.SetNonTargetCatchRelease.attribute.endPursingTimeStamp=true ===================================== src/site/markdown/avdth/referential.md ===================================== @@ -223,7 +223,7 @@ Mapping type d'activité | 34 | 13 (2) | | 40 | 13 (2) | | 41 | 13 (2) | -| 7 | 22 | +| 7 | 11 | | 8 | 10 | | 9 | 23 | | 10 | 24 | ===================================== toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/ToolkitTagValues.java ===================================== @@ -30,8 +30,10 @@ import org.nuiton.eugene.models.extension.tagvalue.matcher.EqualsTagValueNameMat import org.nuiton.eugene.models.extension.tagvalue.provider.DefaultTagValueMetadatasProvider; import org.nuiton.eugene.models.extension.tagvalue.provider.TagValueMetadatasProvider; import org.nuiton.eugene.models.object.ObjectModelAttribute; +import org.nuiton.eugene.models.object.ObjectModelClass; import org.nuiton.eugene.models.object.ObjectModelClassifier; import org.nuiton.eugene.models.object.ObjectModelPackage; +import org.nuiton.eugene.models.tagvalue.ObjectModelTagValuesStore; import java.util.Arrays; import java.util.LinkedHashSet; @@ -139,6 +141,10 @@ public class ToolkitTagValues extends DefaultTagValueMetadatasProvider { return tagValue == null ? null : tagValue.trim(); } + public boolean isSkipCopyToEntity(ObjectModelTagValuesStore store, ObjectModelClass clazz, ObjectModelAttribute attribute) { + return store.findAttributeBooleanTagValue(Store.skipCopyToEntity, clazz, attribute); + } + public String notSkip(String tagValue) { return Objects.equals("skip", tagValue) ? null : tagValue; } ===================================== toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/validation/DtoFormValidatorTransformer.java ===================================== @@ -539,6 +539,12 @@ public class DtoFormValidatorTransformer extends ObjectModelTransformerToJava { attributes.addAll(beanClass.getAllOtherAttributes()); ObjectModelTagValuesStore tagValuesStore = model.getTagValuesStore(); + Set<String> skipCopyToEntity = new TreeSet<>(); + for (ObjectModelAttribute attribute : attributes) { + if (observeTagValues.isSkipCopyToEntity(tagValuesStore, beanClass, attribute)) { + skipCopyToEntity.add(attribute.getName()); + } + } if (WellIdAware.class.isAssignableFrom(dtoClazz)) { addErrorValidator("well", String.format(WELL_ID_AWARE_FIELD_TEMPLATE, dtoClazz.getPackageName().contains("ps") ? "ps" : "ll")); } else if (WellIdsAware.class.isAssignableFrom(dtoClazz)) { @@ -580,6 +586,9 @@ public class DtoFormValidatorTransformer extends ObjectModelTransformerToJava { Map<String, String> speciesLength = getStringProperties(beanClass, attributes, (c, a) -> validationTagValues.getSpeciesLength(tagValuesStore, c, a)); Map<String, String> collectionUniqueKey = getStringProperties(beanClass, attributes, (c, a) -> validationTagValues.getCollectionUniqueKey(tagValuesStore, c, a)); Map<String, Integer> stringMaxLength = getIntegerProperties(beanClass, attributes, (c, a) -> validationTagValues.getStringMaxLength(tagValuesStore, c, a)); + for (String attributeName : skipCopyToEntity) { + stringMaxLength.remove(attributeName); + } Map<String, String> dayBefore = getStringProperties(beanClass, attributes, (c, a) -> validationTagValues.getDayBefore(tagValuesStore, c, a)); Map<String, String> dayAfter = getStringProperties(beanClass, attributes, (c, a) -> validationTagValues.getDayAfter(tagValuesStore, c, a)); Map<String, String> dayAfterWarning = getStringProperties(beanClass, attributes, (c, a) -> validationTagValues.getDayAfterWarning(tagValuesStore, c, a)); @@ -599,6 +608,9 @@ public class DtoFormValidatorTransformer extends ObjectModelTransformerToJava { notBlankString.remove("homeId"); } } + for (String attributeName : skipCopyToEntity) { + notBlankString.remove(attributeName); + } mandatory.removeAll(mandatoryString); mandatory.removeAll(mandatoryCollection); mandatoryString.removeAll(mandatoryCollection); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/6d726165993d8cab729ca7498... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/6d726165993d8cab729ca7498... You're receiving this email because of your account on gitlab.com.