Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: 0a0d2335 by tchemit at 2020-03-31T14:03:45+02:00 [REFERENTIEL BALISES] Ajout d'un champ 'technology' - Closes #1460 - - - - - 22 changed files: - client-core/src/main/i18n/getters/jaxx.getter - client-core/src/main/java/fr/ird/observe/client/ui/content/ref/seine/TransmittingBuoyTypeUI.jaxx - + client-core/src/main/java/fr/ird/observe/client/ui/content/ref/seine/TransmittingBuoyTypeUI.jcss - dto/src/main/models/Observe.model - observe-i18n/src/main/i18n/translations/observe_en_GB.properties - observe-i18n/src/main/i18n/translations/observe_es_ES.properties - observe-i18n/src/main/i18n/translations/observe_fr_FR.properties - persistence/src/main/java/fr/ird/observe/binder/referential/seine/TransmittingBuoyTypeEntityDtoBinder.java - persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_5.java - persistence/src/main/models/Observe.model - + persistence/src/main/resources/db/migration/7.5/02_add_transmittingBuoyType_technology_field-common.sql - test/src/main/java/fr/ird/observe/test/ObserveFixtures.java - test/src/main/resources/db/7.5/dataForTestLongline.sql.gz - test/src/main/resources/db/7.5/dataForTestSeine.sql.gz - test/src/main/resources/db/7.5/empty_h2.sql.gz - test/src/main/resources/db/7.5/empty_pg.sql.gz - test/src/main/resources/db/7.5/referentiel.sql.gz - validation/src/main/i18n/getters/validation-fields.getter - validation/src/main/i18n/getters/validation-messages.getter - + validation/src/main/resources/fr/ird/observe/dto/referential/seine/TransmittingBuoyTypeDto-create-error-validation.xml - + validation/src/main/resources/fr/ird/observe/dto/referential/seine/TransmittingBuoyTypeDto-update-error-validation.xml - validation/src/test/java/fr/ird/observe/validation/BeanValidatorDetectorTest.java Changes: ===================================== client-core/src/main/i18n/getters/jaxx.getter ===================================== @@ -644,6 +644,7 @@ observe.common.TransmittingBuoyDto.noBuoy observe.common.TransmittingBuoyDto.ownership observe.common.TransmittingBuoyDto.transmittingBuoyOperation observe.common.TransmittingBuoyDto.transmittingBuoyType +observe.common.TransmittingBuoyTypeDto.technology observe.common.TripDto.action.close.tip observe.common.TripDto.action.closeAndCreate observe.common.TripDto.action.closeAndCreate.tip ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/ref/seine/TransmittingBuoyTypeUI.jaxx ===================================== @@ -28,12 +28,13 @@ <import> fr.ird.observe.dto.reference.ReferentialDtoReference + fr.ird.observe.dto.referential.ReferenceStatus fr.ird.observe.dto.referential.seine.TransmittingBuoyTypeDto fr.ird.observe.dto.referential.seine.TransmittingBuoyTypeReference + org.nuiton.jaxx.widgets.text.BigTextEditor static fr.ird.observe.client.ui.util.UIHelper.getStringValue - fr.ird.observe.dto.referential.ReferenceStatus </import> <!-- validator --> @@ -79,5 +80,13 @@ </cell> </row> </Table> + <Table id='editMoreExtraTable'> + <!-- technology --> + <row> + <cell weightx="1" weighty="1" fill="both" columns="2"> + <BigTextEditor id="technology"/> + </cell> + </row> + </Table> </fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI> ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/ref/seine/TransmittingBuoyTypeUI.jcss ===================================== @@ -0,0 +1,26 @@ +/*- + * #%L + * ObServe :: Client core + * %% + * 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% + */ + +#technology { + model:{getBean()}; + i18nProperty:""; +} ===================================== dto/src/main/models/Observe.model ===================================== @@ -589,6 +589,7 @@ referential.seine.SurroundingActivity > referential.I18nReferential referential.seine.TransmittingBuoyOperation > referential.I18nReferential referential.seine.TransmittingBuoyType > referential.I18nReferential +technology + {*:1} String referential.seine.VesselActivitySeine > referential.I18nReferential | references=code,label,uri,allowFad allowFad + {*:1} boolean ===================================== observe-i18n/src/main/i18n/translations/observe_en_GB.properties ===================================== @@ -1543,6 +1543,7 @@ observe.common.TransmittingBuoyDto.type=Transmitting buoy observe.common.TransmittingBuoyDto.types=Transmitting buoys observe.common.TransmittingBuoyOperationDto.type=Transmitting buoy operation observe.common.TransmittingBuoyOperationDto.types=Transmitting buoy operations +observe.common.TransmittingBuoyTypeDto.technology=Technologies observe.common.TransmittingBuoyTypeDto.type=Transmitting buoy type observe.common.TransmittingBuoyTypeDto.types=Transmitting buoy types observe.common.TripDto.action.close.tip=Close the opened maree @@ -2315,6 +2316,7 @@ observe.validation.tdr.deployementStart.before.fishingStart=fishing start time m observe.validation.tdr.fishingEnd.before.deployementEnd=Deployement end time must be before fishing end time. observe.validation.tdr.fishingStart.before.fishingEnd=Fishing end time must be before fishing start time. observe.validation.tdr.required.position=Position must be filled. +observe.validation.technology.too.big=Field size can not exceed %s characters (actual length\: %s). observe.validation.trip.endDate.after.startDate=End date of the trip must be after trip start date. observe.validation.trip.invalid.date=Observation date must be after route date (route at position %1$s is not correct). observe.validation.trip.invalid.endDate=Trip end date must be after a route date (route at position %1$s is not correct). ===================================== observe-i18n/src/main/i18n/translations/observe_es_ES.properties ===================================== @@ -1543,6 +1543,7 @@ observe.common.TransmittingBuoyDto.type=Baliza emisora observe.common.TransmittingBuoyDto.types=Balizas emisoras observe.common.TransmittingBuoyOperationDto.type=Operación baliza observe.common.TransmittingBuoyOperationDto.types=Operaciones baliza +observe.common.TransmittingBuoyTypeDto.technology=Tecnologías observe.common.TransmittingBuoyTypeDto.type=Tipo de baliza observe.common.TransmittingBuoyTypeDto.types=Tipos de baliza observe.common.TripDto.action.close.tip=Cierre de la marea abierta @@ -2315,6 +2316,7 @@ observe.validation.tdr.deployementStart.before.fishingStart=La FechaHora de inic observe.validation.tdr.fishingEnd.before.deployementEnd=La FechaHora de fin de despliegue debe ir después de la FechaHora de fin de pesca observe.validation.tdr.fishingStart.before.fishingEnd=La FechaHora de fin de pesca debe llegar después del inicio del de inicio de pesca observe.validation.tdr.required.position=Deben registrarse posiciones +observe.validation.technology.too.big=El tamaño está limitado a %s caracteres (tamaño actual\: %s). observe.validation.trip.endDate.after.startDate=La fecha de fin de marea debe ser superior a la fecha de inicio observe.validation.trip.invalid.date=La fecha de esta ruta debe ser superior al la fecha de la ruta anterior (la ruta en la línea %1$s es incorrecta) observe.validation.trip.invalid.endDate=La fecha de fin de marea debe ser superior a la fecha de las rutas de la marea (la ruta %1$s es incorrecta) ===================================== observe-i18n/src/main/i18n/translations/observe_fr_FR.properties ===================================== @@ -1543,6 +1543,7 @@ observe.common.TransmittingBuoyDto.type=Balise lue observe.common.TransmittingBuoyDto.types=Balises lues observe.common.TransmittingBuoyOperationDto.type=Opération balise observe.common.TransmittingBuoyOperationDto.types=Opérations balise +observe.common.TransmittingBuoyTypeDto.technology=Technologies observe.common.TransmittingBuoyTypeDto.type=Type de balise observe.common.TransmittingBuoyTypeDto.types=Types de balise observe.common.TripDto.action.close.tip=Clôturer la marée ouverte @@ -2315,6 +2316,7 @@ observe.validation.tdr.deployementStart.before.fishingStart=L'horodatage de déb observe.validation.tdr.fishingEnd.before.deployementEnd=L'horodatage de fin de déploiement doit être après le début de celui de fin de pêche. observe.validation.tdr.fishingStart.before.fishingEnd=L'horodatage de fin de pêche doit être après le début de celui de début de pêche. observe.validation.tdr.required.position=Pas de position renseignée sur la palangre. +observe.validation.technology.too.big=La taille du champs est limitée à %s caractères (taille actuelle %s). observe.validation.trip.endDate.after.startDate=La date de fin de marée doit être supérieure à sa date de début. observe.validation.trip.invalid.date=Le jour d'observation doit être supérieure à celui d'une route précédente. (la route à la position %1$s est incorrecte). observe.validation.trip.invalid.endDate=La date de fin de marée doit être supérieure au jour d'observation de chaque route. (la route à la position %1$s est incorrecte). ===================================== persistence/src/main/java/fr/ird/observe/binder/referential/seine/TransmittingBuoyTypeEntityDtoBinder.java ===================================== @@ -40,20 +40,16 @@ public class TransmittingBuoyTypeEntityDtoBinder extends ReferentialEntityDtoBin @Override public void copyToEntity(ReferentialLocale referentialLocale, TransmittingBuoyTypeDto dto, TransmittingBuoyType entity) { - - copyDtoReferentialFieldsToEntity(dto, entity); copyDtoI18nFieldsToEntity(dto, entity); - + entity.setTechnology(dto.getTechnology()); } @Override public void copyToDto(ReferentialLocale referentialLocale, TransmittingBuoyType entity, TransmittingBuoyTypeDto dto) { - - copyEntityReferentialFieldsToDto(entity, dto); copyEntityI18nFieldsToDto(entity, dto); - + dto.setTechnology(entity.getTechnology()); } } ===================================== persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_5.java ===================================== @@ -41,6 +41,7 @@ public class DataSourceMigrationForVersion_7_5 extends MigrationVersionResource @Override public void generateSqlScript(MigrationVersionResourceExecutor executor) { executor.addScript("01", "migrate_TransmittingBuoyOperation_brand"); + executor.addScript("02", "add_transmittingBuoyType_technology_field"); } } ===================================== persistence/src/main/models/Observe.model ===================================== @@ -629,6 +629,7 @@ referentiel.seine.SurroundingActivity > referentiel.I18nReferentialEntity | enti referentiel.seine.TransmittingBuoyOperation > referentiel.I18nReferentialEntity | entity referentiel.seine.TransmittingBuoyType > referentiel.I18nReferentialEntity | entity +technology + {*:1} String | hibernateAttributeType=text referentiel.seine.VesselActivitySeine > referentiel.I18nReferentialEntity | entity dbName=VesselActivity allowFad + {*:1} boolean ===================================== persistence/src/main/resources/db/migration/7.5/02_add_transmittingBuoyType_technology_field-common.sql ===================================== @@ -0,0 +1,22 @@ +--- +-- #%L +-- ObServe :: Persistence +-- %% +-- 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% +--- +ALTER TABLE observe_seine.TransmittingBuoyType ADD COLUMN technology VARCHAR(1024); ===================================== test/src/main/java/fr/ird/observe/test/ObserveFixtures.java ===================================== @@ -68,16 +68,16 @@ public class ObserveFixtures { public static final int REFERENTIAL_FORM_COUNT = ENTITY_BINDER_REFERENTIAL_COUNT; public static final int DATA_FORM_COUNT = 47; - public static final int VALIDATORS_COUNT = 52;//90; + public static final int VALIDATORS_COUNT = 54;//90; public static final int VALIDATOR_CREATE_DATA_COUNT = 9; //8; // public static final int VALIDATOR_CREATE_ENTITY_DATA_COUNT = 33; public static final int VALIDATOR_CREATE_ENTITY_DATA_COUNT_REAL = 112; public static final int VALIDATOR_UPDATE_DATA_COUNT = 23;//32; // public static final int VALIDATOR_UPDATE_ENTITY_DATA_COUNT = 35; public static final int VALIDATOR_UPDATE_ENTITY_DATA_COUNT_REAL = 113; - public static final int VALIDATOR_UPDATE_REFERENTIAL_COUNT = 4;//17; + public static final int VALIDATOR_UPDATE_REFERENTIAL_COUNT = 5;//17; public static final int VALIDATOR_UPDATE_REFERENTIAL_COUNT_REAL = 66; - public static final int VALIDATOR_CREATE_REFERENTIAL_COUNT = 3;//18; + public static final int VALIDATOR_CREATE_REFERENTIAL_COUNT = 4;//18; public static final int VALIDATOR_CREATE_REFERENTIAL_COUNT_REAL = 66; public static final int VALIDATOR_UPDATE_EXTRA_CREATE_DATA_COUNT = 13; ===================================== test/src/main/resources/db/7.5/dataForTestLongline.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.5/dataForTestLongline.sql.gz and b/test/src/main/resources/db/7.5/dataForTestLongline.sql.gz differ ===================================== test/src/main/resources/db/7.5/dataForTestSeine.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.5/dataForTestSeine.sql.gz and b/test/src/main/resources/db/7.5/dataForTestSeine.sql.gz differ ===================================== test/src/main/resources/db/7.5/empty_h2.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.5/empty_h2.sql.gz and b/test/src/main/resources/db/7.5/empty_h2.sql.gz differ ===================================== test/src/main/resources/db/7.5/empty_pg.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.5/empty_pg.sql.gz and b/test/src/main/resources/db/7.5/empty_pg.sql.gz differ ===================================== test/src/main/resources/db/7.5/referentiel.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.5/referentiel.sql.gz and b/test/src/main/resources/db/7.5/referentiel.sql.gz differ ===================================== validation/src/main/i18n/getters/validation-fields.getter ===================================== @@ -267,6 +267,7 @@ observe.common.TdrDto.section observe.common.TdrDto.sensorBrand observe.common.TransmittingBuoyDto.transmittingBuoyOperation observe.common.TransmittingBuoyDto.transmittingBuoyType +observe.common.TransmittingBuoyTypeDto.technology observe.common.TripLonglineDto.activityLongline observe.common.TripLonglineDto.dataEntryOperator observe.common.TripLonglineDto.totalFishingOperationsNumber ===================================== validation/src/main/i18n/getters/validation-messages.getter ===================================== @@ -60,6 +60,7 @@ observe.validation.tdr.deployementStart.before.fishingStart observe.validation.tdr.fishingEnd.before.deployementEnd observe.validation.tdr.fishingStart.before.fishingEnd observe.validation.tdr.required.position +observe.validation.technology.too.big observe.validation.trip.endDate.after.startDate observe.validation.trip.invalid.date observe.validation.trip.invalid.endDate ===================================== validation/src/main/resources/fr/ird/observe/dto/referential/seine/TransmittingBuoyTypeDto-create-error-validation.xml ===================================== @@ -0,0 +1,32 @@ +<!-- + #%L + ObServe :: 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="technology"> + <field-validator type="commentLengthFieldDto"> + <message>observe.validation.technology.too.big##${maxLength}##${commentLength}</message> + </field-validator> + </field> + +</validators> ===================================== validation/src/main/resources/fr/ird/observe/dto/referential/seine/TransmittingBuoyTypeDto-update-error-validation.xml ===================================== @@ -0,0 +1,32 @@ +<!-- + #%L + ObServe :: 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="technology"> + <field-validator type="commentLengthFieldDto"> + <message>observe.validation.technology.too.big##${maxLength}##${commentLength}</message> + </field-validator> + </field> + +</validators> ===================================== validation/src/test/java/fr/ird/observe/validation/BeanValidatorDetectorTest.java ===================================== @@ -55,6 +55,7 @@ import fr.ird.observe.dto.referential.LengthLengthParameterDto; import fr.ird.observe.dto.referential.LengthWeightParameterDto; import fr.ird.observe.dto.referential.SpeciesListDto; import fr.ird.observe.dto.referential.seine.ObjectMaterialDto; +import fr.ird.observe.dto.referential.seine.TransmittingBuoyTypeDto; import fr.ird.observe.spi.DtoModelClasses; import fr.ird.observe.test.ObserveFixtures; import org.junit.Assert; @@ -141,6 +142,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest { // ShipOwnerDto.class, // SpeciesDto.class, SpeciesListDto.class, + TransmittingBuoyTypeDto.class, TripLonglineDto.class, TripSeineDto.class); // , @@ -202,6 +204,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest { TargetLengthDto.class, TdrDto.class, // TransmittingBuoyDto.class, + TransmittingBuoyTypeDto.class, TripLonglineDto.class, // TripLonglineGearUseDto.class, TripSeineDto.class); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/0a0d2335094b297e6feb1511c7... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/0a0d2335094b297e6feb1511c7... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT