Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: bb6cc9b6 by Tony Chemit at 2022-10-10T10:33:06+02:00 Dysfonctionnement du formulaire échantillon, saisie des échantillons impossible - Closes #2453 - - - - - ef1159c8 by Tony Chemit at 2022-10-10T10:56:50+02:00 Lorsque l'on crée une nouvelle activité en séquence d'une autre, le form vide se positionne sur le dernier onglet utilisé sur l'activité précédente - Closes #2456 - - - - - 3c20fa4b by Tony Chemit at 2022-10-10T11:25:58+02:00 Sur une capture, exiger le champ origine de l'information - Closes #2455 - - - - - 2fe0417d by Tony Chemit at 2022-10-10T11:56:18+02:00 observe.exe ne fonctionne pas, le supprimer ? - Closes #2454 - - - - - 25 changed files: - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIHandler.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/edit/ContentEditUIOpenExecutor.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/open/ContentOpenableUIOpenExecutor.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/ropen/ContentRootOpenableUIOpenExecutor.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/simple/ContentSimpleUIOpenExecutor.java - client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIOpenExecutor.java - + client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SetCatchUIHandler.java - client/runner/src/main/assembly/bin.xml - core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-create-error-validation.xml - core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-update-error-validation.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/observation/CatchImpl.hbm.xml - core/persistence/resources/src/main/resources/db/migration/v9/9.0/03_create-table-ps_observation_catch-H2.sql - core/persistence/resources/src/main/resources/db/migration/v9/9.0/03_create-table-ps_observation_catch-PG.sql - core/persistence/resources/src/main/resources/db/migration/v9/9.0/99_0_add_missing_not_null-common.sql - core/persistence/resources/src/main/resources/db/migration/v9/9.0/empty-schema-H2.sql - core/persistence/resources/src/main/resources/db/migration/v9/9.0/empty-schema-PG.sql - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/Catch/validation-create.json - core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/Catch/validation-update.json - model/src/main/models/Observe/dto/attribute/notNull.properties - model/src/main/models/Observe/persistence/attribute/notNull.properties - server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-create-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-create.json - server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-update-error.xml - server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-update.json Changes: ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIHandler.java ===================================== @@ -479,4 +479,15 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe editor.setEnabled(enabled); }); } + + public void onEndOpenForCreateMode() { + if (getModel().getStates().isCreatingMode() && withMainTab) { + JTabbedPane mainTab = (JTabbedPane) ui.getObjectById(DefaultUIInitializer.MAIN_TABBED_PANE); + mainTab.setSelectedIndex(0); + if (withSubTab) { + JTabbedPane subTab = (JTabbedPane) ui.getObjectById(DefaultUIInitializer.SUB_TABBED_PANE); + subTab.setSelectedIndex(0); + } + } + } } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/edit/ContentEditUIOpenExecutor.java ===================================== @@ -66,6 +66,7 @@ public class ContentEditUIOpenExecutor<D extends EditableDto, U extends ContentE public void onOpened(U ui) { ContentEditUIHandler<D, U> handler = ui.getHandler(); handler.fixFormSize(); + handler.onEndOpenForCreateMode(); handler.onEndOpenUI(); } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/open/ContentOpenableUIOpenExecutor.java ===================================== @@ -55,6 +55,7 @@ public class ContentOpenableUIOpenExecutor<D extends OpenableDto, U extends Cont public void onOpened(U ui) { ContentOpenableUIHandler<D, U> handler = ui.getHandler(); handler.fixFormSize(); + handler.onEndOpenForCreateMode(); handler.onEndOpenUI(); } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/ropen/ContentRootOpenableUIOpenExecutor.java ===================================== @@ -55,6 +55,7 @@ public class ContentRootOpenableUIOpenExecutor<D extends RootOpenableDto, U exte public void onOpened(U ui) { ContentRootOpenableUIHandler<D, U> handler = ui.getHandler(); handler.fixFormSize(); + handler.onEndOpenForCreateMode(); handler.onEndOpenUI(); } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/simple/ContentSimpleUIOpenExecutor.java ===================================== @@ -56,6 +56,7 @@ public class ContentSimpleUIOpenExecutor<D extends SimpleDto, U extends ContentS public void onOpened(U ui) { ContentSimpleUIHandler<D, U> handler = ui.getHandler(); handler.fixFormSize(); + handler.onEndOpenForCreateMode(); handler.onEndOpenUI(); } ===================================== client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIOpenExecutor.java ===================================== @@ -125,7 +125,7 @@ public class ContentReferentialUIOpenExecutor<D extends ReferentialDto, R extend ContentReferentialUIHandler<D, R, U> handler = ui.getHandler(); handler.getContentOpen().prepareCoordinateEditors(); handler.fixFormSize(); - + handler.onEndOpenForCreateMode(); } @Override ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SetCatchUIHandler.java ===================================== @@ -0,0 +1,54 @@ +package fr.ird.observe.client.datasource.editor.ps.data.observation; + +/*- + * #%L + * ObServe Client :: DataSource :: Editor :: PS + * %% + * Copyright (C) 2008 - 2022 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% + */ + + +import fr.ird.observe.client.datasource.editor.api.DataSourceEditor; +import fr.ird.observe.client.datasource.editor.api.content.actions.save.SaveAction; +import fr.ird.observe.client.datasource.editor.api.content.data.table.actions.SaveContentTableUIAdapter; +import fr.ird.observe.dto.data.ps.observation.SetCatchDto; + +/** + * @author Tony Chemit - dev@tchemit.fr + * @since 9.0.12 + */ +public class SetCatchUIHandler extends GeneratedSetCatchUIHandler { + @Override + protected void installSaveAction() { + SaveAction + .create(ui, SetCatchDto.class) + .on(ui.getModel()::toSaveRequest) + .call((r, d) -> getContainerService().save(d)) + .then(new SaveContentTableUIAdapter<>() { + @Override + public void adaptUi(DataSourceEditor dataSourceEditor, SetCatchUI ui, boolean notPersisted, SetCatchDto savedBean) { + super.adaptUi(dataSourceEditor, ui, notPersisted, savedBean); + SetCatchUINavigationNode node = ui.getModel().getSource(); + SetUINavigationNode parent = node.getParent(); + parent.getSampleUINavigationNode().reloadNodeData(); + parent.getSetNonTargetCatchReleaseUINavigationNode().reloadNodeData(); + } + }) + .install(ui.getSave()); + } +} ===================================== client/runner/src/main/assembly/bin.xml ===================================== @@ -32,7 +32,8 @@ <fileMode>0755</fileMode> <includes> <include>${applicationJarName}.jar</include> - <include>${applicationJarName}.exe</include> +<!-- FIXME - See https://gitlab.com/ultreiaio/ird-observe/-/issues/2454--> +<!-- <include>${applicationJarName}.exe</include>--> </includes> </fileSet> ===================================== core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json ===================================== @@ -11853,7 +11853,8 @@ { "name": "informationSource", "comments": [ - "check if referential informationSource is disabled (only if validation is strong)" + "check if referential informationSource is disabled (only if validation is strong)", + "informationSource is mandatory" ] }, { @@ -11999,7 +12000,8 @@ { "name": "informationSource", "comments": [ - "check if referential informationSource is disabled (only if validation is strong)" + "check if referential informationSource is disabled (only if validation is strong)", + "informationSource is mandatory" ] }, { ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-create-error-validation.xml ===================================== @@ -52,6 +52,11 @@ </field> <field name="informationSource"> + <!-- informationSource is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential informationSource is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-update-error-validation.xml ===================================== @@ -52,6 +52,11 @@ </field> <field name="informationSource"> + <!-- informationSource is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential informationSource is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/observation/CatchImpl.hbm.xml ===================================== @@ -68,7 +68,7 @@ </property> <property name="well" access="field" type="java.lang.String" column="well"/> <many-to-one name="reasonForDiscard" class="fr.ird.observe.entities.referential.ps.observation.ReasonForDiscardImpl" column="reasonForDiscard" foreign-key="fk_ps_observation_catch_reasonfordiscard" /> - <many-to-one name="informationSource" class="fr.ird.observe.entities.referential.ps.observation.InformationSourceImpl" column="informationSource" foreign-key="fk_ps_observation_catch_informationsource" /> + <many-to-one name="informationSource" class="fr.ird.observe.entities.referential.ps.observation.InformationSourceImpl" column="informationSource" foreign-key="fk_ps_observation_catch_informationsource" not-null="true" /> <many-to-one name="species" class="fr.ird.observe.entities.referential.common.SpeciesImpl" column="species" foreign-key="fk_ps_observation_catch_species" not-null="true" /> <many-to-one name="weightMeasureMethod" class="fr.ird.observe.entities.referential.common.WeightMeasureMethodImpl" column="weightMeasureMethod" foreign-key="fk_ps_observation_catch_weightmeasuremethod" /> <many-to-one name="lengthMeasureMethod" class="fr.ird.observe.entities.referential.common.LengthMeasureMethodImpl" column="lengthMeasureMethod" foreign-key="fk_ps_observation_catch_lengthmeasuremethod" /> ===================================== core/persistence/resources/src/main/resources/db/migration/v9/9.0/03_create-table-ps_observation_catch-H2.sql ===================================== @@ -19,4 +19,4 @@ -- <http://www.gnu.org/licenses/gpl-3.0.html>. -- #L% --- -create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255), species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); +create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255) not null, species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); ===================================== core/persistence/resources/src/main/resources/db/migration/v9/9.0/03_create-table-ps_observation_catch-PG.sql ===================================== @@ -19,4 +19,4 @@ -- <http://www.gnu.org/licenses/gpl-3.0.html>. -- #L% --- -create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255), species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); +create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255) not null, species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); ===================================== core/persistence/resources/src/main/resources/db/migration/v9/9.0/99_0_add_missing_not_null-common.sql ===================================== @@ -229,6 +229,7 @@ ALTER TABLE ps_logbook.WellPlan ALTER COLUMN wellSamplingConformity SET NOT NULL ALTER TABLE ps_logbook.WellPlan ALTER COLUMN wellSamplingStatus SET NOT NULL; ALTER TABLE ps_logbook.WellPlan ALTER COLUMN well SET NOT NULL; ALTER TABLE ps_observation.Catch ALTER COLUMN species SET NOT NULL; +ALTER TABLE ps_observation.Catch ALTER COLUMN informationSource SET NOT NULL; -- ALTER TABLE ps_observation.Activity ALTER COLUMN latitude SET NOT NULL; -- ALTER TABLE ps_observation.Activity ALTER COLUMN longitude SET NOT NULL; ===================================== core/persistence/resources/src/main/resources/db/migration/v9/9.0/empty-schema-H2.sql ===================================== @@ -178,7 +178,7 @@ create table ps_logbook.wellSamplingConformity (topiaId varchar(255) not null, t create table ps_logbook.wellSamplingStatus (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_observation.activity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), time time not null, latitude numeric, longitude numeric, vesselSpeed numeric, seaSurfaceTemperature numeric, observedSystemDistance numeric, ersId varchar(255), vesselActivity varchar(255) not null, surroundingActivity varchar(255), wind varchar(255), detectionMode varchar(255), reasonForNoFishing varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), route varchar(255) not null, primary key (topiaId)); create table ps_observation.activity_observedSystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem)); -create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255), species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); +create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255) not null, species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); create table ps_observation.detectionMode (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_observation.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255), supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); create table ps_observation.floatingObjectPart (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), whenArriving varchar(255), whenLeaving varchar(255), objectMaterial varchar(255) not null, floatingObject varchar(255) not null, primary key (topiaId)); ===================================== core/persistence/resources/src/main/resources/db/migration/v9/9.0/empty-schema-PG.sql ===================================== @@ -178,7 +178,7 @@ create table ps_logbook.wellSamplingConformity (topiaId varchar(255) not null, t create table ps_logbook.wellSamplingStatus (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_observation.activity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), time time not null, latitude numeric, longitude numeric, vesselSpeed numeric, seaSurfaceTemperature numeric, observedSystemDistance numeric, ersId varchar(255), vesselActivity varchar(255) not null, surroundingActivity varchar(255), wind varchar(255), detectionMode varchar(255), reasonForNoFishing varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), route varchar(255) not null, primary key (topiaId)); create table ps_observation.activity_observedSystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem)); -create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255), species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); +create table ps_observation.catch (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), catchWeight numeric, catchWeightComputedSource integer, meanWeight numeric, meanWeightComputedSource integer, meanLength numeric, meanLengthComputedSource integer, totalCount integer, totalCountComputedSource integer, well varchar(255), reasonForDiscard varchar(255), informationSource varchar(255) not null, species varchar(255) not null, weightMeasureMethod varchar(255), lengthMeasureMethod varchar(255), speciesFate varchar(255), set varchar(255) not null, set_idx integer, primary key (topiaId)); create table ps_observation.detectionMode (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, code varchar(255) not null, uri varchar(255), homeId varchar(255), needComment boolean default false not null, status integer not null, label1 varchar(255) not null, label2 varchar(255) not null, label3 varchar(255) not null, label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId)); create table ps_observation.floatingObject (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), comment varchar(8192), objectOperation varchar(255), supportVesselName varchar(32), computedWhenArrivingBiodegradable varchar(255), computedWhenArrivingNonEntangling varchar(255), computedWhenArrivingSimplifiedObjectType varchar(255), computedWhenLeavingBiodegradable varchar(255), computedWhenLeavingNonEntangling varchar(255), computedWhenLeavingSimplifiedObjectType varchar(255), activity varchar(255) not null, primary key (topiaId)); create table ps_observation.floatingObjectPart (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp not null, lastUpdateDate timestamp default CURRENT_TIMESTAMP not null, homeId varchar(255), whenArriving varchar(255), whenLeaving varchar(255), objectMaterial varchar(255) not null, floatingObject varchar(255) not null, primary key (topiaId)); ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/Catch/validation-create.json ===================================== @@ -16,7 +16,8 @@ }, "informationSource": { "errors": [ - "check if referential informationSource is disabled (only if validation is strong)" + "check if referential informationSource is disabled (only if validation is strong)", + "informationSource is mandatory" ], "warnings": [ "check if referential informationSource is disabled (only if validation is not strong)" ===================================== core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/Catch/validation-update.json ===================================== @@ -16,7 +16,8 @@ }, "informationSource": { "errors": [ - "check if referential informationSource is disabled (only if validation is strong)" + "check if referential informationSource is disabled (only if validation is strong)", + "informationSource is mandatory" ], "warnings": [ "check if referential informationSource is disabled (only if validation is not strong)" ===================================== model/src/main/models/Observe/dto/attribute/notNull.properties ===================================== @@ -165,6 +165,7 @@ data.ps.observation.Activity.attribute.observedSystem=true data.ps.observation.Activity.attribute.quadrant=true data.ps.observation.Activity.attribute.time=true data.ps.observation.Activity.attribute.vesselActivity=true +data.ps.observation.Catch.attribute.informationSource=true data.ps.observation.Catch.attribute.species=true data.ps.observation.FloatingObjectPart.attribute.objectMaterial=true data.ps.observation.NonTargetCatchRelease.attribute.count=true ===================================== model/src/main/models/Observe/persistence/attribute/notNull.properties ===================================== @@ -167,6 +167,7 @@ data.ps.observation.Activity.attribute.latitude=false data.ps.observation.Activity.attribute.longitude=false data.ps.observation.Activity.attribute.time=true data.ps.observation.Activity.attribute.vesselActivity=true +data.ps.observation.Catch.attribute.informationSource=true data.ps.observation.Catch.attribute.species=true data.ps.observation.FloatingObjectPart.attribute.objectMaterial=true data.ps.observation.NonTargetCatchRelease.attribute.count=true ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-create-error.xml ===================================== @@ -52,6 +52,11 @@ </field> <field name="informationSource"> + <!-- informationSource is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential informationSource is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-create.json ===================================== @@ -16,7 +16,8 @@ }, "informationSource": { "errors": [ - "check if referential informationSource is disabled (only if validation is strong)" + "check if referential informationSource is disabled (only if validation is strong)", + "informationSource is mandatory" ], "warnings": [ "check if referential informationSource is disabled (only if validation is not strong)" ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-update-error.xml ===================================== @@ -52,6 +52,11 @@ </field> <field name="informationSource"> + <!-- informationSource is mandatory --> + <field-validator type="mandatory" short-circuit="true"> + <message/> + </field-validator> + <!-- check if referential informationSource is disabled (only if validation is strong) --> <field-validator type="checkDisabledReferentialOnErrorScope"> <message/> ===================================== server/runner/src/main/webResources/doc/api/public/data/ps/observation/Catch/validation-update.json ===================================== @@ -16,7 +16,8 @@ }, "informationSource": { "errors": [ - "check if referential informationSource is disabled (only if validation is strong)" + "check if referential informationSource is disabled (only if validation is strong)", + "informationSource is mandatory" ], "warnings": [ "check if referential informationSource is disabled (only if validation is not strong)" View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/5d2085d46203a6eb10ead4381... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/5d2085d46203a6eb10ead4381... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT (@tchemit)