Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
May 2018
- 1 participants
- 144 discussions
[Git][ultreiaio/ird-observe][develop] Ajout du référentiel observe_common.WeightMeasureMethod - Clses #899
by Tony CHEMIT 20 May '18
by Tony CHEMIT 20 May '18
20 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
b77ac495 by Tony CHEMIT at 2018-05-20T01:19:02Z
Ajout du référentiel observe_common.WeightMeasureMethod - Clses #899
Ajout du référentiel observe_common.LengthMeasureMethod - Closes #900
- - - - -
30 changed files:
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthMeasureMethodUI.jaxx
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthMeasureMethodUIHandler.java
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthMeasureMethodUIModel.java
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/WeightMeasureMethodUI.jaxx
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/WeightMeasureMethodUIHandler.java
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/WeightMeasureMethodUIModel.java
- + dto/src/main/java/fr/ird/observe/binder/referential/common/LengthMeasureMethodDtoReferenceBinder.java
- + dto/src/main/java/fr/ird/observe/binder/referential/common/WeightMeasureMethodDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
- dto/src/main/models/Observe.model
- dto/src/main/resources/i18n/dto_en_GB.properties
- dto/src/main/resources/i18n/dto_es_ES.properties
- dto/src/main/resources/i18n/dto_fr_FR.properties
- + persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthMeasureMethodEntityDtoBinder.java
- + persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthMeasureMethodEntityReferenceBinder.java
- + persistence/src/main/java/fr/ird/observe/binder/referential/common/WeightMeasureMethodEntityDtoBinder.java
- + persistence/src/main/java/fr/ird/observe/binder/referential/common/WeightMeasureMethodEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/persistence/Entities.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- persistence/src/main/models/Observe.model
- + persistence/src/main/resources/db/migration/8.0/10_add_length_measure_method-common.sql
- + persistence/src/main/resources/db/migration/8.0/11_add_weight_measure_method-common.sql
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/empty_h2.sql.gz
- test/src/main/resources/db/8.0/empty_pg.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b77ac495f9fcda8be2fb7d4a51d…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b77ac495f9fcda8be2fb7d4a51d…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Ajout du référentiel observe_common.Compagnies - Closes #896
by Tony CHEMIT 20 May '18
by Tony CHEMIT 20 May '18
20 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
158824b7 by Tony CHEMIT at 2018-05-20T00:27:19Z
Ajout du référentiel observe_common.Compagnies - Closes #896
- - - - -
29 changed files:
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUI.jaxx
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUIHandler.java
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUIModel.java
- + dto/src/main/java/fr/ird/observe/binder/referential/common/CompagniesDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
- dto/src/main/models/Observe.model
- dto/src/main/resources/i18n/dto_en_GB.properties
- dto/src/main/resources/i18n/dto_es_ES.properties
- dto/src/main/resources/i18n/dto_fr_FR.properties
- + persistence/src/main/java/fr/ird/observe/binder/referential/common/CompagniesEntityDtoBinder.java
- + persistence/src/main/java/fr/ird/observe/binder/referential/common/CompagniesEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/persistence/Entities.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- persistence/src/main/models/Observe.model
- + persistence/src/main/resources/db/migration/8.0/09_add_compagnies-common.sql
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/empty_h2.sql.gz
- test/src/main/resources/db/8.0/empty_pg.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
- + validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-create-error-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-create-warning-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-update-error-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-update-warning-validation.xml
- validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUI.jaxx
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUI.jaxx
@@ -0,0 +1,90 @@
+<!--
+ #%L
+ ObServe :: Client
+ %%
+ Copyright (C) 2008 - 2018 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%
+ -->
+
+<fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI
+ i18nFormat="observe.common.CompagniesDto.%s"
+ superGenericType='CompagniesDto, CompagniesReference, CompagniesUI'>
+
+ <style source="../ReferenceEntity.jcss"/>
+
+ <import>
+ fr.ird.observe.dto.reference.ReferentialDtoReference
+ fr.ird.observe.dto.referential.CompagniesDto
+ fr.ird.observe.dto.referential.CompagniesReference
+
+ static fr.ird.observe.client.ui.util.UIHelper.getStringValue
+ fr.ird.observe.dto.referential.ReferenceStatus
+ </import>
+
+ <!-- validator -->
+ <BeanValidator id='validator' autoField='true' beanClass='fr.ird.observe.dto.referential.CompagniesDto'
+ context='create' errorTableModel='{getErrorTableModel()}'>
+ <field name='label1' component='label1'/>
+ <field name='label2' component='label2'/>
+ <field name='label3' component='label3'/>
+ </BeanValidator>
+
+ <!-- model -->
+ <CompagniesUIModel id='model'/>
+
+ <!-- edit bean -->
+ <CompagniesDto id='bean'/>
+
+ <Table id='editTable'>
+
+ <!-- uri -->
+ <row>
+ <cell anchor="west">
+ <JLabel id='uriLabel'/>
+ </cell>
+ <cell anchor='east' weightx="1" fill="both">
+ <JTextField id='uri'/>
+ </cell>
+ </row>
+
+ <!-- code / status -->
+ <row>
+ <cell anchor="west">
+ <JLabel id='codeStatusLabel'/>
+ </cell>
+ <cell anchor='east' weightx="1" fill="both">
+ <JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- needComment -->
+ <row>
+ <cell anchor='east' weightx="1" fill="both" columns="2">
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ </cell>
+ </row>
+ </Table>
+
+ <JTextField id='label1'/>
+ <JTextField id='label2'/>
+ <JTextField id='label3'/>
+</fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI>
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUIHandler.java
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUIHandler.java
@@ -0,0 +1,37 @@
+package fr.ird.observe.client.ui.content.ref.common;
+
+/*-
+ * #%L
+ * ObServe :: Client
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.client.ui.content.ref.ContentReferenceUIHandler;
+import fr.ird.observe.dto.referential.CompagniesDto;
+import fr.ird.observe.dto.referential.CompagniesReference;
+import org.nuiton.jaxx.runtime.spi.UIHandler;
+
+/**
+ * Created on 06/12/16.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 6.0
+ */
+class CompagniesUIHandler extends ContentReferenceUIHandler<CompagniesDto, CompagniesReference, CompagniesUI> implements UIHandler<CompagniesUI> {
+}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUIModel.java
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/CompagniesUIModel.java
@@ -0,0 +1,43 @@
+package fr.ird.observe.client.ui.content.ref.common;
+
+/*
+ * #%L
+ * ObServe :: Client
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.client.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.dto.referential.CompagniesDto;
+import fr.ird.observe.dto.referential.CompagniesReference;
+
+/**
+ * Created on 9/27/14.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since XXX
+ */
+public class CompagniesUIModel extends ContentReferenceUIModel<CompagniesDto, CompagniesReference> {
+
+ private static final long serialVersionUID = 1L;
+
+ public CompagniesUIModel() {
+ super(CompagniesDto.class, CompagniesReference.class);
+ }
+
+}
=====================================
dto/src/main/java/fr/ird/observe/binder/referential/common/CompagniesDtoReferenceBinder.java
=====================================
--- /dev/null
+++ b/dto/src/main/java/fr/ird/observe/binder/referential/common/CompagniesDtoReferenceBinder.java
@@ -0,0 +1,47 @@
+package fr.ird.observe.binder.referential.common;
+
+/*-
+ * #%L
+ * ObServe :: Dto
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.binder.referential.ReferentialDtoReferenceBinder;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.CompagniesDto;
+import fr.ird.observe.dto.referential.CompagniesReference;
+
+/**
+ * Created on 24/11/15.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class CompagniesDtoReferenceBinder extends ReferentialDtoReferenceBinder<CompagniesDto, CompagniesReference> {
+
+ public CompagniesDtoReferenceBinder() {
+ super(CompagniesDto.class, CompagniesReference.class);
+ }
+
+ @Override
+ public CompagniesReference toReference(ReferentialLocale referentialLocale, CompagniesDto dto) {
+
+ return new CompagniesReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
+
+ }
+}
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
+++ b/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
@@ -108,6 +108,8 @@ import fr.ird.observe.dto.reference.DtoReference;
import fr.ird.observe.dto.reference.ReferentialDtoReference;
import fr.ird.observe.dto.referential.CountryDto;
import fr.ird.observe.dto.referential.CountryReference;
+import fr.ird.observe.dto.referential.CompagniesDto;
+import fr.ird.observe.dto.referential.CompagniesReference;
import fr.ird.observe.dto.referential.DataQualityDto;
import fr.ird.observe.dto.referential.DataQualityReference;
import fr.ird.observe.dto.referential.FpaZoneDto;
@@ -474,6 +476,11 @@ public class DecoratorService extends DecoratorProvider {
}
@Override
+ public void initCompagniesDto() {
+ registerDefaultReferentialAndReferentialReferenceDecorator(CompagniesDto.class, CompagniesReference.class, libelle);
+ }
+
+ @Override
public void initCountryDto() {
registerDefaultReferentialAndReferentialReferenceDecorator(CountryDto.class, CountryReference.class, libelle);
}
=====================================
dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
+++ b/dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
@@ -78,6 +78,7 @@ import fr.ird.observe.dto.data.seine.TransmittingBuoyDto;
import fr.ird.observe.dto.data.seine.TripSeineDto;
import fr.ird.observe.dto.data.seine.TripSeineGearUseDto;
import fr.ird.observe.dto.referential.CountryDto;
+import fr.ird.observe.dto.referential.CompagniesDto;
import fr.ird.observe.dto.referential.DataQualityDto;
import fr.ird.observe.dto.referential.FpaZoneDto;
import fr.ird.observe.dto.referential.GearCaracteristicDto;
@@ -169,6 +170,7 @@ public class DtoModelClasses {
public static final ImmutableSet<Class<? extends ReferentialDto>> COMMON_REFERENTIAL_TYPES = ImmutableSet.of(
VesselSizeCategoryDto.class,
CountryDto.class,
+ CompagniesDto.class,
DataQualityDto.class,
HarbourDto.class,
ShipOwnerDto.class,
=====================================
dto/src/main/models/Observe.model
=====================================
--- a/dto/src/main/models/Observe.model
+++ b/dto/src/main/models/Observe.model
@@ -355,6 +355,8 @@ data.longline.WeightMeasure > data.Data | references=weightMeasureTypeLabel,weig
weight + {*:1} Float
weightMeasureType {*:1} fr.ird.observe.dto.referential.WeightMeasureTypeReference
+referential.Compagnies > referential.I18nReferential
+
referential.Country > referential.I18nReferential
iso2Code + {*:1} String
iso3Code + {*:1} String
=====================================
dto/src/main/resources/i18n/dto_en_GB.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_en_GB.properties
+++ b/dto/src/main/resources/i18n/dto_en_GB.properties
@@ -26,6 +26,8 @@ observe.common.CatchFateLonglineDto.types=Catch fates
observe.common.CatchLonglineDto.title=Catches
observe.common.CatchLonglineDto.type=Catch
observe.common.CatchLonglineDto.types=Catches
+observe.common.CompagniesDto.type=Compagnies
+observe.common.CompagniesDto.types=Compagnies
observe.common.CountryDto.type=Country
observe.common.CountryDto.types=Countries
observe.common.DataQualityDto.type=Data quality
=====================================
dto/src/main/resources/i18n/dto_es_ES.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_es_ES.properties
+++ b/dto/src/main/resources/i18n/dto_es_ES.properties
@@ -26,6 +26,8 @@ observe.common.CatchFateLonglineDto.types=Futuros de la captura
observe.common.CatchLonglineDto.title=Capturas
observe.common.CatchLonglineDto.type=Captura
observe.common.CatchLonglineDto.types=Capturas
+observe.common.CompagniesDto.type=Compagnies \#TODO
+observe.common.CompagniesDto.types=Compagnies \#TODO
observe.common.CountryDto.type=País
observe.common.CountryDto.types=Países
observe.common.DataQualityDto.type=Qualité de donnée \#TODO
=====================================
dto/src/main/resources/i18n/dto_fr_FR.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_fr_FR.properties
+++ b/dto/src/main/resources/i18n/dto_fr_FR.properties
@@ -26,6 +26,8 @@ observe.common.CatchFateLonglineDto.types=Devenirs capture
observe.common.CatchLonglineDto.title=Captures
observe.common.CatchLonglineDto.type=Capture
observe.common.CatchLonglineDto.types=Captures
+observe.common.CompagniesDto.type=Compagnies
+observe.common.CompagniesDto.types=Compagnies
observe.common.CountryDto.type=Pays
observe.common.CountryDto.types=Pays
observe.common.DataQualityDto.type=Qualité de donnée
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/common/CompagniesEntityDtoBinder.java
=====================================
--- /dev/null
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/common/CompagniesEntityDtoBinder.java
@@ -0,0 +1,53 @@
+package fr.ird.observe.binder.referential.common;
+
+/*-
+ * #%L
+ * ObServe :: Persistence
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.binder.referential.ReferentialEntityDtoBinderSupport;
+import fr.ird.observe.dto.referential.CompagniesDto;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.entities.referentiel.Compagnies;
+
+/**
+ * Created on 24/11/15.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class CompagniesEntityDtoBinder extends ReferentialEntityDtoBinderSupport<CompagniesDto, Compagnies> {
+
+ public CompagniesEntityDtoBinder() {
+ super(Compagnies.class, CompagniesDto.class);
+ }
+
+ @Override
+ public void copyToEntity(ReferentialLocale referentialLocale, CompagniesDto dto, Compagnies entity) {
+ copyDtoReferentialFieldsToEntity(dto, entity);
+ copyDtoI18nFieldsToEntity(dto, entity);
+ }
+
+ @Override
+ public void copyToDto(ReferentialLocale referentialLocale, Compagnies entity, CompagniesDto dto) {
+ copyEntityReferentialFieldsToDto(entity, dto);
+ copyEntityI18nFieldsToDto(entity, dto);
+ }
+
+}
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/common/CompagniesEntityReferenceBinder.java
=====================================
--- /dev/null
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/common/CompagniesEntityReferenceBinder.java
@@ -0,0 +1,46 @@
+package fr.ird.observe.binder.referential.common;
+
+/*-
+ * #%L
+ * ObServe :: Persistence
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.binder.referential.ReferentialEntityReferenceBinderSupport;
+import fr.ird.observe.dto.referential.CompagniesDto;
+import fr.ird.observe.dto.referential.CompagniesReference;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.entities.referentiel.Compagnies;
+
+/**
+ * Created on 24/11/15.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class CompagniesEntityReferenceBinder extends ReferentialEntityReferenceBinderSupport<CompagniesDto, CompagniesReference, Compagnies> {
+
+ public CompagniesEntityReferenceBinder() {
+ super(CompagniesDto.class, CompagniesReference.class, Compagnies.class);
+ }
+
+ @Override
+ public CompagniesReference toReference(ReferentialLocale referentialLocale, Compagnies dto) {
+ return new CompagniesReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
+ }
+}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/Entities.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/Entities.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/Entities.java
@@ -48,6 +48,7 @@ public class Entities {
new ObserveEntityEnum[]{
ObserveEntityEnum.VesselSizeCategory,
ObserveEntityEnum.Country,
+ ObserveEntityEnum.Compagnies,
ObserveEntityEnum.DataQuality,
ObserveEntityEnum.ShipOwner,
ObserveEntityEnum.Harbour,
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
@@ -74,6 +74,7 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
}
executor.addScript("07", "add_weight_determination_method");
executor.addScript("08", "add_weight_category");
+ executor.addScript("09", "add_compagnies");
}
}
=====================================
persistence/src/main/models/Observe.model
=====================================
--- a/persistence/src/main/models/Observe.model
+++ b/persistence/src/main/models/Observe.model
@@ -421,6 +421,8 @@ longline.WeightMeasure > ObserveDataEntity | entity
weight + {*:1} Float | sqlType=numeric
weightMeasureType {*:1} referentiel.WeightMeasureType
+referentiel.Compagnies > referentiel.I18nReferentialEntity | entity
+
referentiel.Country > referentiel.I18nReferentialEntity | entity
iso2Code + {*:1} String
iso3Code + {*:1} String
=====================================
persistence/src/main/resources/db/migration/8.0/09_add_compagnies-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/8.0/09_add_compagnies-common.sql
@@ -0,0 +1,3 @@
+CREATE TABLE observe_common.Compagnies(topiaid VARCHAR(255) NOT NULL,topiaversion BIGINT NOT NULL, topiacreatedate DATE, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needComment BOOLEAN DEFAULT false, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255),label4 VARCHAR(255),label5 VARCHAR(255),label6 VARCHAR(255),label7 VARCHAR(255),label8 VARCHAR(255));
+ALTER TABLE observe_common.Compagnies ADD CONSTRAINT PK_Compagnies PRIMARY KEY(topiaid);
+INSERT INTO observe_common.LASTUPDATEDATE(topiaId, topiaversion, topiacreatedate, TYPE , LASTUPDATEDATE) values ('fr.ird.observe.entities.LastUpdateDate#666#1006', 0,CURRENT_DATE, 'fr.ird.observe.entities.referentiel.Compagnies', CURRENT_TIMESTAMP);
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
=====================================
--- a/services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
+++ b/services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
@@ -113,6 +113,10 @@ public class UnidirectionalSynchronizeReferentialTest extends ServiceLocalTestSu
//empty
continue;
}
+ if (ObserveEntityEnum.Compagnies.equals(referenceEntity)) {
+ //empty
+ continue;
+ }
Class<? extends ReferentialDto> dtoType = DbModelHelper.fromReferentialEntity(referenceEntity).toDtoType();
Assert.assertTrue("can't find type " + dtoType, referentialNames.contains(dtoType));
Assert.assertTrue(result.getReferentialUpdated(dtoType).isEmpty());
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
=====================================
--- a/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
+++ b/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
@@ -146,8 +146,8 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport {
ImmutableSet<ValidationResultDtoMessage> messages = result.getMessagesForType(type);
System.out.println("assertValidateResult(result, " + type.getSimpleName() + ".class, " + messages.size() + ");");
}
- // no data of LengthLegnthParameter, WeightDeterminationMethod, WeightCategoryLongline
- Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 3, types.size());
+ // no data of LengthLegnthParameter, WeightDeterminationMethod, WeightCategoryLongline, Compagnies
+ Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 4, types.size());
assertValidateResult(result, DataQualityDto.class, 1);
assertValidateResult(result, SpeciesGroupReleaseModeDto.class, 2);
=====================================
test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
=====================================
--- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
+++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
@@ -62,13 +62,13 @@ public class ObserveFixtures {
public static final String SET_LONGLINE_ID_1 = "fr.ird.observe.entities.longline.SetLongline#1429538714446#0.0876020351424813";
- private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 68;
+ private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 69;
public static final int REFERENCE_DATA_COUNT = 33;
public static final int REFERENTIAL_FORM_COUNT = ENTITY_BINDER_REFERENTIAL_COUNT;
public static final int DATA_FORM_COUNT = 48;
- public static final int VALIDATORS_COUNT = 194;
+ public static final int VALIDATORS_COUNT = 196;
public static final int VALIDATOR_CREATE_DATA_COUNT = 8;
public static final int VALIDATOR_UPDATE_DATA_COUNT = 37;
public static final int VALIDATOR_UPDATE_ENTITY_DATA_COUNT = 29;
@@ -245,6 +245,7 @@ public class ObserveFixtures {
private static final ImmutableMap<String, Long> REFERENTIAL_COMMON_TABLES_COUNT = ImmutableMap
.<String, Long>builder()
.put("observe_common.country", 72L)
+ .put("observe_common.compagnies", 0L)
.put("observe_common.dataquality", 5L)
.put("observe_common.fpazone", 42L)
.put("observe_common.gear", 26L)
@@ -252,7 +253,7 @@ public class ObserveFixtures {
.put("observe_common.gearcaracteristic", 22L)
.put("observe_common.gearcaracteristictype", 6L)
.put("observe_common.harbour", 74L)
- .put("observe_common.lastupdatedate", 106L)
+ .put("observe_common.lastupdatedate", 107L)
.put("observe_common.lengthlengthparameter", 0L)
.put("observe_common.lengthweightparameter", 365L)
.put("observe_common.ocean", 3L)
=====================================
test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/empty_h2.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_h2.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_h2.sql.gz
@@ -1,6 +1,7 @@
CREATE SCHEMA OBSERVE_LONGLINE;
CREATE SCHEMA OBSERVE_COMMON;
CREATE SCHEMA OBSERVE_SEINE;
+create table OBSERVE_COMMON.compagnies (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.country (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), iso2Code varchar(255), iso3Code varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.dataQuality (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.fpaZone (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), startDate timestamp, endDate timestamp, primary key (topiaId));
=====================================
test/src/main/resources/db/8.0/empty_pg.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_pg.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_pg.sql.gz
@@ -1,6 +1,7 @@
CREATE SCHEMA OBSERVE_LONGLINE;
CREATE SCHEMA OBSERVE_COMMON;
CREATE SCHEMA OBSERVE_SEINE;
+create table OBSERVE_COMMON.compagnies (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.country (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), iso2Code varchar(255), iso3Code varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.dataQuality (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.fpaZone (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), startDate timestamp, endDate timestamp, primary key (topiaId));
=====================================
test/src/main/resources/db/8.0/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-create-error-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-create-error-validation.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="code">
+
+ <!-- clef unique sur le code -->
+ <field-validator type="referentialCode" short-circuit="true">
+ <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
+ </field-validator>
+
+ </field>
+
+ <field name="label1"> <!-- pas de libelle 1 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label2">
+ <!-- pas de libelle 2 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label2</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- pas de libelle 3 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-create-warning-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-create-warning-validation.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="status">
+ <!-- objet desactive -->
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ enabled ]]>
+ </param>
+ <message>observe.validation.referentiel.status.desactivated</message>
+ </field-validator>
+ </field>
+
+ <field name="uri">
+ <!-- pas d'uri selectionne -->
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>observe.validation.referentiel.null.uri</message>
+ </field-validator>
+ </field>
+ <field name="label1">
+ <!-- libelle 1 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label1 == null || label1.empty || label1 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- libelle 3 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label3 == null || label3.empty || label3 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-update-error-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-update-error-validation.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="code">
+
+ <!-- clef unique sur le code -->
+ <field-validator type="referentialCode" short-circuit="true">
+ <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
+ </field-validator>
+
+ </field>
+
+ <field name="label1"> <!-- pas de libelle 1 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label2">
+ <!-- pas de libelle 2 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label2</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- pas de libelle 3 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-update-warning-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/CompagniesDto-update-warning-validation.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="status">
+ <!-- objet desactive -->
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ enabled ]]>
+ </param>
+ <message>observe.validation.referentiel.status.desactivated</message>
+ </field-validator>
+ </field>
+
+ <field name="uri">
+ <!-- pas d'uri selectionne -->
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>observe.validation.referentiel.null.uri</message>
+ </field-validator>
+ </field>
+ <field name="label1">
+ <!-- libelle 1 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label1 == null || label1.empty || label1 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- libelle 3 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label3 == null || label3.empty || label3 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
=====================================
--- a/validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
+++ b/validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
@@ -66,6 +66,7 @@ import fr.ird.observe.dto.data.seine.TransmittingBuoyDto;
import fr.ird.observe.dto.data.seine.TripSeineDto;
import fr.ird.observe.dto.data.seine.TripSeineGearUseDto;
import fr.ird.observe.dto.referential.CountryDto;
+import fr.ird.observe.dto.referential.CompagniesDto;
import fr.ird.observe.dto.referential.DataQualityDto;
import fr.ird.observe.dto.referential.FpaZoneDto;
import fr.ird.observe.dto.referential.GearCaracteristicDto;
@@ -206,6 +207,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
BaitSettingStatusDto.class,
BaitTypeDto.class,
CatchFateLonglineDto.class,
+ CompagniesDto.class,
CountryDto.class,
DataQualityDto.class,
DetectionModeDto.class,
@@ -301,6 +303,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
BranchlinesCompositionDto.class,
CatchFateLonglineDto.class,
CatchLonglineDto.class,
+ CompagniesDto.class,
CountryDto.class,
DataQualityDto.class,
DetectionModeDto.class,
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/158824b742285657a5d81626f61…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/158824b742285657a5d81626f61…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Ajout du référentiel observe_longline.WeightCategory - Closes #920
by Tony CHEMIT 20 May '18
by Tony CHEMIT 20 May '18
20 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
57c6f2d5 by Tony CHEMIT at 2018-05-20T00:03:02Z
Ajout du référentiel observe_longline.WeightCategory - Closes #920
- - - - -
29 changed files:
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUI.jaxx
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUIHandler.java
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUIModel.java
- + dto/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
- dto/src/main/models/Observe.model
- dto/src/main/resources/i18n/dto_en_GB.properties
- dto/src/main/resources/i18n/dto_es_ES.properties
- dto/src/main/resources/i18n/dto_fr_FR.properties
- + persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineEntityDtoBinder.java
- + persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/persistence/Entities.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- persistence/src/main/models/Observe.model
- + persistence/src/main/resources/db/migration/8.0/08_add_weight_category-common.sql
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/empty_h2.sql.gz
- test/src/main/resources/db/8.0/empty_pg.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-create-error-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-create-warning-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-update-error-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-update-warning-validation.xml
- validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUI.jaxx
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUI.jaxx
@@ -0,0 +1,90 @@
+<!--
+ #%L
+ ObServe :: Client
+ %%
+ Copyright (C) 2008 - 2018 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%
+ -->
+<fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI
+ i18nFormat="observe.common.WeightCategoryLonglineDto.%s"
+ superGenericType='WeightCategoryLonglineDto, WeightCategoryLonglineReference, WeightCategoryLonglineUI'>
+
+ <style source="../ReferenceEntity.jcss"/>
+
+ <import>
+ fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto
+ fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference
+
+ static fr.ird.observe.client.ui.util.UIHelper.getStringValue
+ fr.ird.observe.dto.referential.ReferenceStatus
+ </import>
+
+ <!-- validator -->
+ <BeanValidator id='validator' autoField='true'
+ beanClass='fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto'
+ context='create' errorTableModel='{getErrorTableModel()}'>
+ <field name='label1' component='label1'/>
+ <field name='label2' component='label2'/>
+ <field name='label3' component='label3'/>
+ </BeanValidator>
+
+ <!-- model -->
+ <WeightCategoryLonglineUIModel id='model'/>
+
+ <!-- edit bean -->
+ <WeightCategoryLonglineDto id='bean'/>
+
+ <Table id='editTable'>
+
+ <!-- uri -->
+ <row>
+ <cell anchor="west">
+ <JLabel id='uriLabel'/>
+ </cell>
+ <cell anchor='east' weightx="1" fill="both">
+ <JTextField id='uri'/>
+ </cell>
+ </row>
+
+ <!-- code / status -->
+ <row>
+ <cell anchor="west">
+ <JLabel id='codeStatusLabel'/>
+ </cell>
+ <cell anchor='east' weightx="1" fill="both">
+ <JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- needComment -->
+ <row>
+ <cell anchor='east' weightx="1" fill="both" columns="2">
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ </cell>
+ </row>
+ </Table>
+
+ <JTextField id='label1'/>
+ <JTextField id='label2'/>
+ <JTextField id='label3'/>
+
+</fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI>
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUIHandler.java
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUIHandler.java
@@ -0,0 +1,37 @@
+package fr.ird.observe.client.ui.content.ref.longline;
+
+/*-
+ * #%L
+ * ObServe :: Client
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.client.ui.content.ref.ContentReferenceUIHandler;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
+import org.nuiton.jaxx.runtime.spi.UIHandler;
+
+/**
+ * Created on 06/12/16.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 6.0
+ */
+class WeightCategoryLonglineUIHandler extends ContentReferenceUIHandler<WeightCategoryLonglineDto, WeightCategoryLonglineReference, WeightCategoryLonglineUI> implements UIHandler<WeightCategoryLonglineUI> {
+}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUIModel.java
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUIModel.java
@@ -0,0 +1,43 @@
+package fr.ird.observe.client.ui.content.ref.longline;
+
+/*
+ * #%L
+ * ObServe :: Client
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.client.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
+
+/**
+ * Created on 9/28/14.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since XXX
+ */
+public class WeightCategoryLonglineUIModel extends ContentReferenceUIModel<WeightCategoryLonglineDto, WeightCategoryLonglineReference> {
+
+ private static final long serialVersionUID = 1L;
+
+ public WeightCategoryLonglineUIModel() {
+ super(WeightCategoryLonglineDto.class, WeightCategoryLonglineReference.class);
+ }
+
+}
=====================================
dto/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineDtoReferenceBinder.java
=====================================
--- /dev/null
+++ b/dto/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineDtoReferenceBinder.java
@@ -0,0 +1,25 @@
+package fr.ird.observe.binder.referential.longline;
+
+import fr.ird.observe.binder.referential.ReferentialDtoReferenceBinder;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
+
+/**
+ * Created by tchemit on 20/05/2018.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class WeightCategoryLonglineDtoReferenceBinder extends ReferentialDtoReferenceBinder<WeightCategoryLonglineDto, WeightCategoryLonglineReference> {
+
+ public WeightCategoryLonglineDtoReferenceBinder() {
+ super(WeightCategoryLonglineDto.class, WeightCategoryLonglineReference.class);
+ }
+
+ @Override
+ public WeightCategoryLonglineReference toReference(ReferentialLocale referentialLocale, WeightCategoryLonglineDto dto) {
+
+ return new WeightCategoryLonglineReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
+
+ }
+}
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
+++ b/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
@@ -203,6 +203,8 @@ import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
import fr.ird.observe.dto.referential.longline.VesselActivityLonglineReference;
import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
import fr.ird.observe.dto.referential.seine.DetectionModeDto;
import fr.ird.observe.dto.referential.seine.DetectionModeReference;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
@@ -809,6 +811,11 @@ public class DecoratorService extends DecoratorProvider {
public void initWeightDeterminationMethodDto() {
registerDefaultReferentialAndReferentialReferenceDecorator(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class, libelle);
}
+
+ @Override
+ public void initWeightCategoryLonglineDto() {
+ registerDefaultReferentialAndReferentialReferenceDecorator(WeightCategoryLonglineDto.class, WeightCategoryLonglineReference.class, libelle);
+ }
@Override
public void initWindDto() {
=====================================
dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
+++ b/dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
@@ -126,6 +126,7 @@ import fr.ird.observe.dto.referential.longline.SensorTypeDto;
import fr.ird.observe.dto.referential.longline.SettingShapeDto;
import fr.ird.observe.dto.referential.longline.StomacFullnessDto;
import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
import fr.ird.observe.dto.referential.seine.DetectionModeDto;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
@@ -236,6 +237,7 @@ public class DtoModelClasses {
StomacFullnessDto.class,
ObservationTripTypeDto.class,
VesselActivityLonglineDto.class,
+ WeightCategoryLonglineDto.class,
WeightDeterminationMethodDto.class);
public static final ImmutableSet<Class<? extends ReferentialDto>> REFERENTIAL_TYPES = ImmutableSet.<Class<? extends ReferentialDto>>builder()
=====================================
dto/src/main/models/Observe.model
=====================================
--- a/dto/src/main/models/Observe.model
+++ b/dto/src/main/models/Observe.model
@@ -553,6 +553,8 @@ referential.longline.ObservationTripType > referential.I18nReferential
referential.longline.VesselActivityLongline > referential.I18nReferential
+referential.longline.WeightCategoryLongline > referential.I18nReferential
+
referential.longline.WeightDeterminationMethod > referential.I18nReferential
referential.seine.DetectionMode > referential.I18nReferential
=====================================
dto/src/main/resources/i18n/dto_en_GB.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_en_GB.properties
+++ b/dto/src/main/resources/i18n/dto_en_GB.properties
@@ -229,6 +229,8 @@ observe.common.VesselTypeDto.type=Vessel type
observe.common.VesselTypeDto.types=Vessel types
observe.common.WeightCategoryDto.type=Weight category
observe.common.WeightCategoryDto.types=Weight categories
+observe.common.WeightCategoryLonglineDto.type=Weight category
+observe.common.WeightCategoryLonglineDto.types=Weight categories
observe.common.WeightDeterminationMethodDto.type=Weight determination method
observe.common.WeightDeterminationMethodDto.types=Weight determination methods
observe.common.WeightMeasureDto.title=Weight measures
=====================================
dto/src/main/resources/i18n/dto_es_ES.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_es_ES.properties
+++ b/dto/src/main/resources/i18n/dto_es_ES.properties
@@ -227,6 +227,8 @@ observe.common.VesselTypeDto.type=Tipo de pesquería
observe.common.VesselTypeDto.types=Tipos de pesquería
observe.common.WeightCategoryDto.type=Categoría de peso
observe.common.WeightCategoryDto.types=Categorías de peso
+observe.common.WeightCategoryLonglineDto.type=Categoría de peso
+observe.common.WeightCategoryLonglineDto.types=Categorías de peso
observe.common.WeightDeterminationMethodDto.type=Weight determination method \#TODO
observe.common.WeightDeterminationMethodDto.types=Weight determination methods \#TODO
observe.common.WeightMeasureDto.title=Medidas de peso
=====================================
dto/src/main/resources/i18n/dto_fr_FR.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_fr_FR.properties
+++ b/dto/src/main/resources/i18n/dto_fr_FR.properties
@@ -229,6 +229,8 @@ observe.common.VesselTypeDto.type=Type de pêcherie
observe.common.VesselTypeDto.types=Types de pêcherie
observe.common.WeightCategoryDto.type=Catégorie de poids
observe.common.WeightCategoryDto.types=Catégories de poids
+observe.common.WeightCategoryLonglineDto.type=Catégorie de poids
+observe.common.WeightCategoryLonglineDto.types=Catégories de poids
observe.common.WeightDeterminationMethodDto.type=Méthode d'estimation de poids
observe.common.WeightDeterminationMethodDto.types=Méthodes d'estimation de poids
observe.common.WeightMeasureDto.title=Mesures de poids
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineEntityDtoBinder.java
=====================================
--- /dev/null
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineEntityDtoBinder.java
@@ -0,0 +1,59 @@
+package fr.ird.observe.binder.referential.longline;
+
+/*-
+ * #%L
+ * ObServe :: Persistence
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.binder.referential.ReferentialEntityDtoBinderSupport;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
+import fr.ird.observe.entities.referentiel.longline.WeightCategoryLongline;
+
+/**
+ * Created on 24/11/15.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class WeightCategoryLonglineEntityDtoBinder extends ReferentialEntityDtoBinderSupport<WeightCategoryLonglineDto, WeightCategoryLongline> {
+
+ public WeightCategoryLonglineEntityDtoBinder() {
+ super(WeightCategoryLongline.class, WeightCategoryLonglineDto.class);
+ }
+
+ @Override
+ public void copyToEntity(ReferentialLocale referentialLocale, WeightCategoryLonglineDto dto, WeightCategoryLongline entity) {
+
+
+ copyDtoReferentialFieldsToEntity(dto, entity);
+ copyDtoI18nFieldsToEntity(dto, entity);
+
+ }
+
+ @Override
+ public void copyToDto(ReferentialLocale referentialLocale, WeightCategoryLongline entity, WeightCategoryLonglineDto dto) {
+
+
+ copyEntityReferentialFieldsToDto(entity, dto);
+ copyEntityI18nFieldsToDto(entity, dto);
+
+ }
+
+}
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineEntityReferenceBinder.java
=====================================
--- /dev/null
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineEntityReferenceBinder.java
@@ -0,0 +1,48 @@
+package fr.ird.observe.binder.referential.longline;
+
+/*-
+ * #%L
+ * ObServe :: Persistence
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.binder.referential.ReferentialEntityReferenceBinderSupport;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
+import fr.ird.observe.entities.referentiel.longline.WeightCategoryLongline;
+
+/**
+ * Created on 24/11/15.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class WeightCategoryLonglineEntityReferenceBinder extends ReferentialEntityReferenceBinderSupport<WeightCategoryLonglineDto, WeightCategoryLonglineReference, WeightCategoryLongline> {
+
+ public WeightCategoryLonglineEntityReferenceBinder() {
+ super(WeightCategoryLonglineDto.class, WeightCategoryLonglineReference.class, WeightCategoryLongline.class);
+ }
+
+ @Override
+ public WeightCategoryLonglineReference toReference(ReferentialLocale referentialLocale, WeightCategoryLongline dto) {
+
+ return new WeightCategoryLonglineReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
+
+ }
+}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/Entities.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/Entities.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/Entities.java
@@ -114,6 +114,7 @@ public class Entities {
ObserveEntityEnum.SensorType,
ObserveEntityEnum.SettingShape,
ObserveEntityEnum.StomacFullness,
+ ObserveEntityEnum.WeightCategoryLongline,
ObserveEntityEnum.WeightDeterminationMethod,
ObserveEntityEnum.VesselActivityLongline
};
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
@@ -73,6 +73,7 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
executor.addScript("06", "fill_vessel_activity");
}
executor.addScript("07", "add_weight_determination_method");
+ executor.addScript("08", "add_weight_category");
}
}
=====================================
persistence/src/main/models/Observe.model
=====================================
--- a/persistence/src/main/models/Observe.model
+++ b/persistence/src/main/models/Observe.model
@@ -655,6 +655,8 @@ referentiel.longline.ObservationTripType > referentiel.I18nReferentialEntity | e
referentiel.longline.VesselActivityLongline > referentiel.I18nReferentialEntity | entity dbName=VesselActivity
+referentiel.longline.WeightCategoryLongline > referentiel.I18nReferentialEntity | entity dbName=WeightCategory
+
referentiel.longline.WeightDeterminationMethod > referentiel.I18nReferentialEntity | entity
referentiel.seine.DetectionMode > referentiel.I18nReferentialEntity | entity
=====================================
persistence/src/main/resources/db/migration/8.0/08_add_weight_category-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/8.0/08_add_weight_category-common.sql
@@ -0,0 +1,3 @@
+CREATE TABLE observe_longline.WeightCategory(topiaid VARCHAR(255) NOT NULL,topiaversion BIGINT NOT NULL, topiacreatedate DATE, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needComment BOOLEAN DEFAULT false, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255),label4 VARCHAR(255),label5 VARCHAR(255),label6 VARCHAR(255),label7 VARCHAR(255),label8 VARCHAR(255));
+ALTER TABLE observe_longline.WeightCategory ADD CONSTRAINT PK_WeightCategory PRIMARY KEY(topiaid);
+INSERT INTO observe_common.LASTUPDATEDATE(topiaId, topiaversion, topiacreatedate, TYPE , LASTUPDATEDATE) values ('fr.ird.observe.entities.LastUpdateDate#666#1005', 0,CURRENT_DATE, 'fr.ird.observe.entities.referentiel.longline.WeightCategory', CURRENT_TIMESTAMP);
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
=====================================
--- a/services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
+++ b/services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
@@ -109,6 +109,9 @@ public class UnidirectionalSynchronizeReferentialTest extends ServiceLocalTestSu
if (ObserveEntityEnum.WeightDeterminationMethod.equals(referenceEntity)) {
//empty
continue;
+ }if (ObserveEntityEnum.WeightCategoryLongline.equals(referenceEntity)) {
+ //empty
+ continue;
}
Class<? extends ReferentialDto> dtoType = DbModelHelper.fromReferentialEntity(referenceEntity).toDtoType();
Assert.assertTrue("can't find type " + dtoType, referentialNames.contains(dtoType));
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
=====================================
--- a/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
+++ b/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
@@ -146,8 +146,8 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport {
ImmutableSet<ValidationResultDtoMessage> messages = result.getMessagesForType(type);
System.out.println("assertValidateResult(result, " + type.getSimpleName() + ".class, " + messages.size() + ");");
}
- // no data of LengthLegnthParameter, WeightDeterminationMethod
- Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 2, types.size());
+ // no data of LengthLegnthParameter, WeightDeterminationMethod, WeightCategoryLongline
+ Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 3, types.size());
assertValidateResult(result, DataQualityDto.class, 1);
assertValidateResult(result, SpeciesGroupReleaseModeDto.class, 2);
=====================================
test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
=====================================
--- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
+++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
@@ -62,13 +62,13 @@ public class ObserveFixtures {
public static final String SET_LONGLINE_ID_1 = "fr.ird.observe.entities.longline.SetLongline#1429538714446#0.0876020351424813";
- private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 67;
+ private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 68;
public static final int REFERENCE_DATA_COUNT = 33;
public static final int REFERENTIAL_FORM_COUNT = ENTITY_BINDER_REFERENTIAL_COUNT;
public static final int DATA_FORM_COUNT = 48;
- public static final int VALIDATORS_COUNT = 192;
+ public static final int VALIDATORS_COUNT = 194;
public static final int VALIDATOR_CREATE_DATA_COUNT = 8;
public static final int VALIDATOR_UPDATE_DATA_COUNT = 37;
public static final int VALIDATOR_UPDATE_ENTITY_DATA_COUNT = 29;
@@ -252,7 +252,7 @@ public class ObserveFixtures {
.put("observe_common.gearcaracteristic", 22L)
.put("observe_common.gearcaracteristictype", 6L)
.put("observe_common.harbour", 74L)
- .put("observe_common.lastupdatedate", 105L)
+ .put("observe_common.lastupdatedate", 106L)
.put("observe_common.lengthlengthparameter", 0L)
.put("observe_common.lengthweightparameter", 365L)
.put("observe_common.ocean", 3L)
@@ -323,6 +323,7 @@ public class ObserveFixtures {
.put("observe_longline.settingshape", 6L)
.put("observe_longline.stomacfullness", 7L)
.put("observe_longline.vesselactivity", 12L)
+ .put("observe_longline.weightcategory", 0L)
.put("observe_longline.weightdeterminationmethod", 0L)
.build();
=====================================
test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/empty_h2.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_h2.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_h2.sql.gz
@@ -75,6 +75,7 @@ create table OBSERVE_LONGLINE.tdr (topiaId varchar(255) not null, topiaVersion b
create table OBSERVE_LONGLINE.tdrRecord (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, timeStamp timestamp, temperature numeric, depth numeric, basket varchar(255), tdr varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.Trip (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment varchar(2147483647), startDate timestamp, endDate timestamp, totalFishingOperationsNumber integer, homeId varchar(255), tripType varchar(255), observer varchar(255), vessel varchar(255), captain varchar(255), dataEntryOperator varchar(255), program varchar(255), ocean varchar(255), departureHarbour varchar(255), landingHarbour varchar(255), dataQuality varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.VesselActivity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
+create table OBSERVE_LONGLINE.WeightCategory (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.weightDeterminationMethod (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.weightMeasure (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, weight numeric, weightMeasureType varchar(255), catch varchar(255), primary key (topiaId));
create table OBSERVE_SEINE.Activity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment varchar(2147483647), time time, latitude numeric, longitude numeric, vesselSpeed numeric, seaSurfaceTemperature numeric, observedSystemDistance numeric, ersId varchar(255), vesselActivity varchar(255), surroundingActivity varchar(255), wind varchar(255), detectionMode varchar(255), reasonForNoFishing varchar(255), set varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), route varchar(255), primary key (topiaId));
=====================================
test/src/main/resources/db/8.0/empty_pg.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_pg.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_pg.sql.gz
@@ -75,6 +75,7 @@ create table OBSERVE_LONGLINE.tdr (topiaId varchar(255) not null, topiaVersion i
create table OBSERVE_LONGLINE.tdrRecord (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, timeStamp timestamp, temperature numeric, depth numeric, basket varchar(255), tdr varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.Trip (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment text, startDate timestamp, endDate timestamp, totalFishingOperationsNumber int4, homeId varchar(255), tripType varchar(255), observer varchar(255), vessel varchar(255), captain varchar(255), dataEntryOperator varchar(255), program varchar(255), ocean varchar(255), departureHarbour varchar(255), landingHarbour varchar(255), dataQuality varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.VesselActivity (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
+create table OBSERVE_LONGLINE.WeightCategory (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.weightDeterminationMethod (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.weightMeasure (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, weight numeric, weightMeasureType varchar(255), catch varchar(255), primary key (topiaId));
create table OBSERVE_SEINE.Activity (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment text, time time, latitude numeric, longitude numeric, vesselSpeed numeric, seaSurfaceTemperature numeric, observedSystemDistance numeric, ersId varchar(255), vesselActivity varchar(255), surroundingActivity varchar(255), wind varchar(255), detectionMode varchar(255), reasonForNoFishing varchar(255), set varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), route varchar(255), primary key (topiaId));
=====================================
test/src/main/resources/db/8.0/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-create-error-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-create-error-validation.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="code">
+
+ <!-- clef unique sur le code -->
+ <field-validator type="referentialCode" short-circuit="true">
+ <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
+ </field-validator>
+
+ </field>
+
+ <field name="label1"> <!-- pas de libelle 1 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label2">
+ <!-- pas de libelle 2 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label2</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- pas de libelle 3 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-create-warning-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-create-warning-validation.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="status">
+ <!-- objet desactive -->
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ enabled ]]>
+ </param>
+ <message>observe.validation.referentiel.status.desactivated</message>
+ </field-validator>
+ </field>
+
+ <field name="uri">
+ <!-- pas d'uri selectionne -->
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>observe.validation.referentiel.null.uri</message>
+ </field-validator>
+ </field>
+ <field name="label1">
+ <!-- libelle 1 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label1 == null || label1.empty || label1 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- libelle 3 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label3 == null || label3.empty || label3 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-update-error-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-update-error-validation.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="code">
+
+ <!-- clef unique sur le code -->
+ <field-validator type="referentialCode" short-circuit="true">
+ <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
+ </field-validator>
+
+ </field>
+
+ <field name="label1"> <!-- pas de libelle 1 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label2">
+ <!-- pas de libelle 2 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label2</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- pas de libelle 3 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-update-warning-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightCategoryLonglineDto-update-warning-validation.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="status">
+ <!-- objet desactive -->
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ enabled ]]>
+ </param>
+ <message>observe.validation.referentiel.status.desactivated</message>
+ </field-validator>
+ </field>
+
+ <field name="uri">
+ <!-- pas d'uri selectionne -->
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>observe.validation.referentiel.null.uri</message>
+ </field-validator>
+ </field>
+ <field name="label1">
+ <!-- libelle 1 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label1 == null || label1.empty || label1 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- libelle 3 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label3 == null || label3.empty || label3 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
=====================================
--- a/validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
+++ b/validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
@@ -113,6 +113,7 @@ import fr.ird.observe.dto.referential.longline.SensorTypeDto;
import fr.ird.observe.dto.referential.longline.SettingShapeDto;
import fr.ird.observe.dto.referential.longline.StomacFullnessDto;
import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
import fr.ird.observe.dto.referential.seine.DetectionModeDto;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
@@ -271,6 +272,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
VesselSizeCategoryDto.class,
VesselTypeDto.class,
WeightCategoryDto.class,
+ WeightCategoryLonglineDto.class,
WeightDeterminationMethodDto.class,
WeightMeasureTypeDto.class,
WindDto.class);
@@ -388,6 +390,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
VesselSizeCategoryDto.class,
VesselTypeDto.class,
WeightCategoryDto.class,
+ WeightCategoryLonglineDto.class,
WeightDeterminationMethodDto.class,
WeightMeasureTypeDto.class,
WindDto.class);
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/57c6f2d5ff69419cedb5a6d1525…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/57c6f2d5ff69419cedb5a6d1525…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Ajout du référentiel observe_longline.WeightDeterminationMethod - Closes #921
by Tony CHEMIT 19 May '18
by Tony CHEMIT 19 May '18
19 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
3486d482 by Tony CHEMIT at 2018-05-19T23:36:38Z
Ajout du référentiel observe_longline.WeightDeterminationMethod - Closes #921
- - - - -
29 changed files:
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUI.jaxx
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIHandler.java
- + client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIModel.java
- + dto/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
- dto/src/main/models/Observe.model
- dto/src/main/resources/i18n/dto_en_GB.properties
- dto/src/main/resources/i18n/dto_es_ES.properties
- dto/src/main/resources/i18n/dto_fr_FR.properties
- + persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityDtoBinder.java
- + persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/persistence/Entities.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- persistence/src/main/models/Observe.model
- + persistence/src/main/resources/db/migration/8.0/07_add_weight_determination_method-common.sql
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/empty_h2.sql.gz
- test/src/main/resources/db/8.0/empty_pg.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-create-error-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-create-warning-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-error-validation.xml
- + validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-warning-validation.xml
- validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUI.jaxx
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUI.jaxx
@@ -0,0 +1,90 @@
+<!--
+ #%L
+ ObServe :: Client
+ %%
+ Copyright (C) 2008 - 2018 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%
+ -->
+<fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI
+ i18nFormat="observe.common.WeightDeterminationMethodDto.%s"
+ superGenericType='WeightDeterminationMethodDto, WeightDeterminationMethodReference, WeightDeterminationMethodUI'>
+
+ <style source="../ReferenceEntity.jcss"/>
+
+ <import>
+ fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto
+ fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference
+
+ static fr.ird.observe.client.ui.util.UIHelper.getStringValue
+ fr.ird.observe.dto.referential.ReferenceStatus
+ </import>
+
+ <!-- validator -->
+ <BeanValidator id='validator' autoField='true'
+ beanClass='fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto'
+ context='create' errorTableModel='{getErrorTableModel()}'>
+ <field name='label1' component='label1'/>
+ <field name='label2' component='label2'/>
+ <field name='label3' component='label3'/>
+ </BeanValidator>
+
+ <!-- model -->
+ <WeightDeterminationMethodUIModel id='model'/>
+
+ <!-- edit bean -->
+ <WeightDeterminationMethodDto id='bean'/>
+
+ <Table id='editTable'>
+
+ <!-- uri -->
+ <row>
+ <cell anchor="west">
+ <JLabel id='uriLabel'/>
+ </cell>
+ <cell anchor='east' weightx="1" fill="both">
+ <JTextField id='uri'/>
+ </cell>
+ </row>
+
+ <!-- code / status -->
+ <row>
+ <cell anchor="west">
+ <JLabel id='codeStatusLabel'/>
+ </cell>
+ <cell anchor='east' weightx="1" fill="both">
+ <JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
+ <JTextField id='code' constraints='BorderLayout.WEST'/>
+ <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
+ onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
+ constraints='BorderLayout.CENTER'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- needComment -->
+ <row>
+ <cell anchor='east' weightx="1" fill="both" columns="2">
+ <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
+ </cell>
+ </row>
+ </Table>
+
+ <JTextField id='label1'/>
+ <JTextField id='label2'/>
+ <JTextField id='label3'/>
+
+</fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI>
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIHandler.java
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIHandler.java
@@ -0,0 +1,37 @@
+package fr.ird.observe.client.ui.content.ref.longline;
+
+/*-
+ * #%L
+ * ObServe :: Client
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.client.ui.content.ref.ContentReferenceUIHandler;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
+import org.nuiton.jaxx.runtime.spi.UIHandler;
+
+/**
+ * Created on 06/12/16.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 6.0
+ */
+class WeightDeterminationMethodUIHandler extends ContentReferenceUIHandler<WeightDeterminationMethodDto, WeightDeterminationMethodReference, WeightDeterminationMethodUI> implements UIHandler<WeightDeterminationMethodUI> {
+}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIModel.java
=====================================
--- /dev/null
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIModel.java
@@ -0,0 +1,43 @@
+package fr.ird.observe.client.ui.content.ref.longline;
+
+/*
+ * #%L
+ * ObServe :: Client
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.client.ui.content.ref.ContentReferenceUIModel;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
+
+/**
+ * Created on 9/28/14.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since XXX
+ */
+public class WeightDeterminationMethodUIModel extends ContentReferenceUIModel<WeightDeterminationMethodDto, WeightDeterminationMethodReference> {
+
+ private static final long serialVersionUID = 1L;
+
+ public WeightDeterminationMethodUIModel() {
+ super(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class);
+ }
+
+}
=====================================
dto/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodDtoReferenceBinder.java
=====================================
--- /dev/null
+++ b/dto/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodDtoReferenceBinder.java
@@ -0,0 +1,25 @@
+package fr.ird.observe.binder.referential.longline;
+
+import fr.ird.observe.binder.referential.ReferentialDtoReferenceBinder;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
+
+/**
+ * Created by tchemit on 20/05/2018.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class WeightDeterminationMethodDtoReferenceBinder extends ReferentialDtoReferenceBinder<WeightDeterminationMethodDto, WeightDeterminationMethodReference> {
+
+ public WeightDeterminationMethodDtoReferenceBinder() {
+ super(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class);
+ }
+
+ @Override
+ public WeightDeterminationMethodReference toReference(ReferentialLocale referentialLocale, WeightDeterminationMethodDto dto) {
+
+ return new WeightDeterminationMethodReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
+
+ }
+}
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
+++ b/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
@@ -201,6 +201,8 @@ import fr.ird.observe.dto.referential.longline.ObservationTripTypeDto;
import fr.ird.observe.dto.referential.longline.ObservationTripTypeReference;
import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
import fr.ird.observe.dto.referential.longline.VesselActivityLonglineReference;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
import fr.ird.observe.dto.referential.seine.DetectionModeDto;
import fr.ird.observe.dto.referential.seine.DetectionModeReference;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
@@ -804,6 +806,11 @@ public class DecoratorService extends DecoratorProvider {
}
@Override
+ public void initWeightDeterminationMethodDto() {
+ registerDefaultReferentialAndReferentialReferenceDecorator(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class, libelle);
+ }
+
+ @Override
public void initWindDto() {
registerReferentialAndReferentialReferenceDecorator(WindDto.class, WindReference.class,
"${code}$s##${" + libelle + "}$s##${speedRange}$s",
=====================================
dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
+++ b/dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
@@ -119,13 +119,14 @@ import fr.ird.observe.dto.referential.longline.LightsticksTypeDto;
import fr.ird.observe.dto.referential.longline.LineTypeDto;
import fr.ird.observe.dto.referential.longline.MaturityStatusDto;
import fr.ird.observe.dto.referential.longline.MitigationTypeDto;
+import fr.ird.observe.dto.referential.longline.ObservationTripTypeDto;
import fr.ird.observe.dto.referential.longline.SensorBrandDto;
import fr.ird.observe.dto.referential.longline.SensorDataFormatDto;
import fr.ird.observe.dto.referential.longline.SensorTypeDto;
import fr.ird.observe.dto.referential.longline.SettingShapeDto;
import fr.ird.observe.dto.referential.longline.StomacFullnessDto;
-import fr.ird.observe.dto.referential.longline.ObservationTripTypeDto;
import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
import fr.ird.observe.dto.referential.seine.DetectionModeDto;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseStatusDto;
@@ -234,7 +235,8 @@ public class DtoModelClasses {
SettingShapeDto.class,
StomacFullnessDto.class,
ObservationTripTypeDto.class,
- VesselActivityLonglineDto.class);
+ VesselActivityLonglineDto.class,
+ WeightDeterminationMethodDto.class);
public static final ImmutableSet<Class<? extends ReferentialDto>> REFERENTIAL_TYPES = ImmutableSet.<Class<? extends ReferentialDto>>builder()
.addAll(COMMON_REFERENTIAL_TYPES)
=====================================
dto/src/main/models/Observe.model
=====================================
--- a/dto/src/main/models/Observe.model
+++ b/dto/src/main/models/Observe.model
@@ -553,6 +553,8 @@ referential.longline.ObservationTripType > referential.I18nReferential
referential.longline.VesselActivityLongline > referential.I18nReferential
+referential.longline.WeightDeterminationMethod > referential.I18nReferential
+
referential.seine.DetectionMode > referential.I18nReferential
referential.seine.NonTargetCatchReleaseConformity > referential.I18nReferential
=====================================
dto/src/main/resources/i18n/dto_en_GB.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_en_GB.properties
+++ b/dto/src/main/resources/i18n/dto_en_GB.properties
@@ -229,6 +229,8 @@ observe.common.VesselTypeDto.type=Vessel type
observe.common.VesselTypeDto.types=Vessel types
observe.common.WeightCategoryDto.type=Weight category
observe.common.WeightCategoryDto.types=Weight categories
+observe.common.WeightDeterminationMethodDto.type=Weight determination method
+observe.common.WeightDeterminationMethodDto.types=Weight determination methods
observe.common.WeightMeasureDto.title=Weight measures
observe.common.WeightMeasureDto.type=Weight measure
observe.common.WeightMeasureDto.types=Weight measures
=====================================
dto/src/main/resources/i18n/dto_es_ES.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_es_ES.properties
+++ b/dto/src/main/resources/i18n/dto_es_ES.properties
@@ -227,6 +227,8 @@ observe.common.VesselTypeDto.type=Tipo de pesquería
observe.common.VesselTypeDto.types=Tipos de pesquería
observe.common.WeightCategoryDto.type=Categoría de peso
observe.common.WeightCategoryDto.types=Categorías de peso
+observe.common.WeightDeterminationMethodDto.type=Weight determination method \#TODO
+observe.common.WeightDeterminationMethodDto.types=Weight determination methods \#TODO
observe.common.WeightMeasureDto.title=Medidas de peso
observe.common.WeightMeasureDto.type=Medida de peso
observe.common.WeightMeasureDto.types=Medidas de peso
=====================================
dto/src/main/resources/i18n/dto_fr_FR.properties
=====================================
--- a/dto/src/main/resources/i18n/dto_fr_FR.properties
+++ b/dto/src/main/resources/i18n/dto_fr_FR.properties
@@ -229,6 +229,8 @@ observe.common.VesselTypeDto.type=Type de pêcherie
observe.common.VesselTypeDto.types=Types de pêcherie
observe.common.WeightCategoryDto.type=Catégorie de poids
observe.common.WeightCategoryDto.types=Catégories de poids
+observe.common.WeightDeterminationMethodDto.type=Méthode d'estimation de poids
+observe.common.WeightDeterminationMethodDto.types=Méthodes d'estimation de poids
observe.common.WeightMeasureDto.title=Mesures de poids
observe.common.WeightMeasureDto.type=Mesure de poids
observe.common.WeightMeasureDto.types=Mesures de poids
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityDtoBinder.java
=====================================
--- /dev/null
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityDtoBinder.java
@@ -0,0 +1,59 @@
+package fr.ird.observe.binder.referential.longline;
+
+/*-
+ * #%L
+ * ObServe :: Persistence
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.binder.referential.ReferentialEntityDtoBinderSupport;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
+import fr.ird.observe.entities.referentiel.longline.WeightDeterminationMethod;
+
+/**
+ * Created on 24/11/15.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class WeightDeterminationMethodEntityDtoBinder extends ReferentialEntityDtoBinderSupport<WeightDeterminationMethodDto, WeightDeterminationMethod> {
+
+ public WeightDeterminationMethodEntityDtoBinder() {
+ super(WeightDeterminationMethod.class, WeightDeterminationMethodDto.class);
+ }
+
+ @Override
+ public void copyToEntity(ReferentialLocale referentialLocale, WeightDeterminationMethodDto dto, WeightDeterminationMethod entity) {
+
+
+ copyDtoReferentialFieldsToEntity(dto, entity);
+ copyDtoI18nFieldsToEntity(dto, entity);
+
+ }
+
+ @Override
+ public void copyToDto(ReferentialLocale referentialLocale, WeightDeterminationMethod entity, WeightDeterminationMethodDto dto) {
+
+
+ copyEntityReferentialFieldsToDto(entity, dto);
+ copyEntityI18nFieldsToDto(entity, dto);
+
+ }
+
+}
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityReferenceBinder.java
=====================================
--- /dev/null
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityReferenceBinder.java
@@ -0,0 +1,48 @@
+package fr.ird.observe.binder.referential.longline;
+
+/*-
+ * #%L
+ * ObServe :: Persistence
+ * %%
+ * Copyright (C) 2008 - 2018 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%
+ */
+
+import fr.ird.observe.binder.referential.ReferentialEntityReferenceBinderSupport;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
+import fr.ird.observe.entities.referentiel.longline.WeightDeterminationMethod;
+
+/**
+ * Created on 24/11/15.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ */
+public class WeightDeterminationMethodEntityReferenceBinder extends ReferentialEntityReferenceBinderSupport<WeightDeterminationMethodDto, WeightDeterminationMethodReference, WeightDeterminationMethod> {
+
+ public WeightDeterminationMethodEntityReferenceBinder() {
+ super(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class, WeightDeterminationMethod.class);
+ }
+
+ @Override
+ public WeightDeterminationMethodReference toReference(ReferentialLocale referentialLocale, WeightDeterminationMethod dto) {
+
+ return new WeightDeterminationMethodReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
+
+ }
+}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/Entities.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/Entities.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/Entities.java
@@ -114,6 +114,7 @@ public class Entities {
ObserveEntityEnum.SensorType,
ObserveEntityEnum.SettingShape,
ObserveEntityEnum.StomacFullness,
+ ObserveEntityEnum.WeightDeterminationMethod,
ObserveEntityEnum.VesselActivityLongline
};
public static final List<ObserveEntityEnum> REFERENCE_ENTITIES_LIST =
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
@@ -72,6 +72,7 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
if (withIds) {
executor.addScript("06", "fill_vessel_activity");
}
+ executor.addScript("07", "add_weight_determination_method");
}
}
=====================================
persistence/src/main/models/Observe.model
=====================================
--- a/persistence/src/main/models/Observe.model
+++ b/persistence/src/main/models/Observe.model
@@ -655,6 +655,8 @@ referentiel.longline.ObservationTripType > referentiel.I18nReferentialEntity | e
referentiel.longline.VesselActivityLongline > referentiel.I18nReferentialEntity | entity dbName=VesselActivity
+referentiel.longline.WeightDeterminationMethod > referentiel.I18nReferentialEntity | entity
+
referentiel.seine.DetectionMode > referentiel.I18nReferentialEntity | entity
referentiel.seine.NonTargetCatchReleaseConformity > referentiel.I18nReferentialEntity | entity
=====================================
persistence/src/main/resources/db/migration/8.0/07_add_weight_determination_method-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/8.0/07_add_weight_determination_method-common.sql
@@ -0,0 +1,3 @@
+CREATE TABLE observe_longline.WeightDeterminationMethod(topiaid VARCHAR(255) NOT NULL,topiaversion BIGINT NOT NULL, topiacreatedate DATE, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needComment BOOLEAN DEFAULT false, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255),label4 VARCHAR(255),label5 VARCHAR(255),label6 VARCHAR(255),label7 VARCHAR(255),label8 VARCHAR(255));
+ALTER TABLE observe_longline.WeightDeterminationMethod ADD CONSTRAINT PK_WeightDeterminationMethod PRIMARY KEY(topiaid);
+INSERT INTO observe_common.LASTUPDATEDATE(topiaId, topiaversion, topiacreatedate, TYPE , LASTUPDATEDATE) values ('fr.ird.observe.entities.LastUpdateDate#666#1004', 0,CURRENT_DATE, 'fr.ird.observe.entities.referentiel.longline.WeightDeterminationMethod', CURRENT_TIMESTAMP);
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
=====================================
--- a/services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
+++ b/services-local/src/test/java/fr/ird/observe/services/local/service/actions/synchro/UnidirectionalSynchronizeReferentialTest.java
@@ -106,6 +106,10 @@ public class UnidirectionalSynchronizeReferentialTest extends ServiceLocalTestSu
//empty
continue;
}
+ if (ObserveEntityEnum.WeightDeterminationMethod.equals(referenceEntity)) {
+ //empty
+ continue;
+ }
Class<? extends ReferentialDto> dtoType = DbModelHelper.fromReferentialEntity(referenceEntity).toDtoType();
Assert.assertTrue("can't find type " + dtoType, referentialNames.contains(dtoType));
Assert.assertTrue(result.getReferentialUpdated(dtoType).isEmpty());
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
=====================================
--- a/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
+++ b/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
@@ -146,8 +146,8 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport {
ImmutableSet<ValidationResultDtoMessage> messages = result.getMessagesForType(type);
System.out.println("assertValidateResult(result, " + type.getSimpleName() + ".class, " + messages.size() + ");");
}
- // no data of LengthLegnthParameter
- Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 1, types.size());
+ // no data of LengthLegnthParameter, WeightDeterminationMethod
+ Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 2, types.size());
assertValidateResult(result, DataQualityDto.class, 1);
assertValidateResult(result, SpeciesGroupReleaseModeDto.class, 2);
=====================================
test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
=====================================
--- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
+++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
@@ -62,13 +62,13 @@ public class ObserveFixtures {
public static final String SET_LONGLINE_ID_1 = "fr.ird.observe.entities.longline.SetLongline#1429538714446#0.0876020351424813";
- public static final int ENTITY_BINDER_REFERENTIAL_COUNT = 66;
+ private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 67;
public static final int REFERENCE_DATA_COUNT = 33;
public static final int REFERENTIAL_FORM_COUNT = ENTITY_BINDER_REFERENTIAL_COUNT;
public static final int DATA_FORM_COUNT = 48;
- public static final int VALIDATORS_COUNT = 190;
+ public static final int VALIDATORS_COUNT = 192;
public static final int VALIDATOR_CREATE_DATA_COUNT = 8;
public static final int VALIDATOR_UPDATE_DATA_COUNT = 37;
public static final int VALIDATOR_UPDATE_ENTITY_DATA_COUNT = 29;
@@ -252,7 +252,7 @@ public class ObserveFixtures {
.put("observe_common.gearcaracteristic", 22L)
.put("observe_common.gearcaracteristictype", 6L)
.put("observe_common.harbour", 74L)
- .put("observe_common.lastupdatedate", 104L)
+ .put("observe_common.lastupdatedate", 105L)
.put("observe_common.lengthlengthparameter", 0L)
.put("observe_common.lengthweightparameter", 365L)
.put("observe_common.ocean", 3L)
@@ -323,6 +323,7 @@ public class ObserveFixtures {
.put("observe_longline.settingshape", 6L)
.put("observe_longline.stomacfullness", 7L)
.put("observe_longline.vesselactivity", 12L)
+ .put("observe_longline.weightdeterminationmethod", 0L)
.build();
public static final ImmutableMap<String, Long> REFERENTIAL_TABLES_COUNT = mergeResults(
=====================================
test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/empty_h2.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_h2.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_h2.sql.gz
@@ -75,6 +75,7 @@ create table OBSERVE_LONGLINE.tdr (topiaId varchar(255) not null, topiaVersion b
create table OBSERVE_LONGLINE.tdrRecord (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, timeStamp timestamp, temperature numeric, depth numeric, basket varchar(255), tdr varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.Trip (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment varchar(2147483647), startDate timestamp, endDate timestamp, totalFishingOperationsNumber integer, homeId varchar(255), tripType varchar(255), observer varchar(255), vessel varchar(255), captain varchar(255), dataEntryOperator varchar(255), program varchar(255), ocean varchar(255), departureHarbour varchar(255), landingHarbour varchar(255), dataQuality varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.VesselActivity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
+create table OBSERVE_LONGLINE.weightDeterminationMethod (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.weightMeasure (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, weight numeric, weightMeasureType varchar(255), catch varchar(255), primary key (topiaId));
create table OBSERVE_SEINE.Activity (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment varchar(2147483647), time time, latitude numeric, longitude numeric, vesselSpeed numeric, seaSurfaceTemperature numeric, observedSystemDistance numeric, ersId varchar(255), vesselActivity varchar(255), surroundingActivity varchar(255), wind varchar(255), detectionMode varchar(255), reasonForNoFishing varchar(255), set varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), route varchar(255), primary key (topiaId));
create table OBSERVE_SEINE.activity_observedsystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem));
=====================================
test/src/main/resources/db/8.0/empty_pg.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_pg.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_pg.sql.gz
@@ -75,6 +75,7 @@ create table OBSERVE_LONGLINE.tdr (topiaId varchar(255) not null, topiaVersion i
create table OBSERVE_LONGLINE.tdrRecord (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, timeStamp timestamp, temperature numeric, depth numeric, basket varchar(255), tdr varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.Trip (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment text, startDate timestamp, endDate timestamp, totalFishingOperationsNumber int4, homeId varchar(255), tripType varchar(255), observer varchar(255), vessel varchar(255), captain varchar(255), dataEntryOperator varchar(255), program varchar(255), ocean varchar(255), departureHarbour varchar(255), landingHarbour varchar(255), dataQuality varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.VesselActivity (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
+create table OBSERVE_LONGLINE.weightDeterminationMethod (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_LONGLINE.weightMeasure (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, weight numeric, weightMeasureType varchar(255), catch varchar(255), primary key (topiaId));
create table OBSERVE_SEINE.Activity (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, comment text, time time, latitude numeric, longitude numeric, vesselSpeed numeric, seaSurfaceTemperature numeric, observedSystemDistance numeric, ersId varchar(255), vesselActivity varchar(255), surroundingActivity varchar(255), wind varchar(255), detectionMode varchar(255), reasonForNoFishing varchar(255), set varchar(255), currentFpaZone varchar(255), previousFpaZone varchar(255), nextFpaZone varchar(255), dataQuality varchar(255), route varchar(255), primary key (topiaId));
create table OBSERVE_SEINE.activity_observedsystem (activity varchar(255) not null, observedSystem varchar(255) not null, primary key (activity, observedSystem));
=====================================
test/src/main/resources/db/8.0/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-create-error-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-create-error-validation.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="code">
+
+ <!-- clef unique sur le code -->
+ <field-validator type="referentialCode" short-circuit="true">
+ <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
+ </field-validator>
+
+ </field>
+
+ <field name="label1"> <!-- pas de libelle 1 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label2">
+ <!-- pas de libelle 2 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label2</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- pas de libelle 3 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-create-warning-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-create-warning-validation.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="status">
+ <!-- objet desactive -->
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ enabled ]]>
+ </param>
+ <message>observe.validation.referentiel.status.desactivated</message>
+ </field-validator>
+ </field>
+
+ <field name="uri">
+ <!-- pas d'uri selectionne -->
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>observe.validation.referentiel.null.uri</message>
+ </field-validator>
+ </field>
+ <field name="label1">
+ <!-- libelle 1 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label1 == null || label1.empty || label1 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- libelle 3 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label3 == null || label3.empty || label3 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-error-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-error-validation.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="code">
+
+ <!-- clef unique sur le code -->
+ <field-validator type="referentialCode" short-circuit="true">
+ <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
+ </field-validator>
+
+ </field>
+
+ <field name="label1"> <!-- pas de libelle 1 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label2">
+ <!-- pas de libelle 2 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label2</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- pas de libelle 3 renseigne -->
+ <field-validator type="requiredstring">
+ <message>observe.validation.referentiel.required.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-warning-validation.xml
=====================================
--- /dev/null
+++ b/validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-warning-validation.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ ObServe :: Validation
+ %%
+ Copyright (C) 2008 - 2018 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="status">
+ <!-- objet desactive -->
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ enabled ]]>
+ </param>
+ <message>observe.validation.referentiel.status.desactivated</message>
+ </field-validator>
+ </field>
+
+ <field name="uri">
+ <!-- pas d'uri selectionne -->
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>observe.validation.referentiel.null.uri</message>
+ </field-validator>
+ </field>
+ <field name="label1">
+ <!-- libelle 1 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label1 == null || label1.empty || label1 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label1</message>
+ </field-validator>
+ </field>
+
+ <field name="label3">
+ <!-- libelle 3 non traduit (egal a label2) -->
+ <field-validator type="fieldexpression">
+ <param name="expression">
+ <![CDATA[ label3 == null || label3.empty || label3 != label2 ]]>
+ </param>
+ <message>observe.validation.referentiel.untranslated.label3</message>
+ </field-validator>
+ </field>
+
+</validators>
=====================================
validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
=====================================
--- a/validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
+++ b/validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
@@ -113,6 +113,7 @@ import fr.ird.observe.dto.referential.longline.SensorTypeDto;
import fr.ird.observe.dto.referential.longline.SettingShapeDto;
import fr.ird.observe.dto.referential.longline.StomacFullnessDto;
import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
+import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
import fr.ird.observe.dto.referential.seine.DetectionModeDto;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseStatusDto;
@@ -270,6 +271,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
VesselSizeCategoryDto.class,
VesselTypeDto.class,
WeightCategoryDto.class,
+ WeightDeterminationMethodDto.class,
WeightMeasureTypeDto.class,
WindDto.class);
}
@@ -386,6 +388,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
VesselSizeCategoryDto.class,
VesselTypeDto.class,
WeightCategoryDto.class,
+ WeightDeterminationMethodDto.class,
WeightMeasureTypeDto.class,
WindDto.class);
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/3486d482aacebd83e349e3f6020…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/3486d482aacebd83e349e3f6020…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Ajout de nouvelles entrées au référentiel observe_longline.VesselActivity - Closes #891
by Tony CHEMIT 19 May '18
by Tony CHEMIT 19 May '18
19 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
b227a2b3 by Tony CHEMIT at 2018-05-19T22:55:55Z
Ajout de nouvelles entrées au référentiel observe_longline.VesselActivity - Closes #891
- - - - -
6 changed files:
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- + persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
Changes:
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
@@ -69,6 +69,9 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
}
executor.removeFK("observe_longline", "Trip", "tripType");
executor.addScript("05", "rename_tripType");
+ if (withIds) {
+ executor.addScript("06", "fill_vessel_activity");
+ }
}
}
=====================================
persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/8.0/06_fill_vessel_activity-common.sql
@@ -0,0 +1,29 @@
+---
+-- #%L
+-- ObServe :: Persistence
+-- %%
+-- Copyright (C) 2008 - 2018 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%
+---
+INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#01' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'CRUISE', 'Cruising', 'Route','Route #TODO');
+INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#02' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'DRIFT', 'Drifting', 'En dérive','En dérive #TODO');
+INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#03' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'PORT', 'At port', 'Au port','Au port #TODO');
+INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#04' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'OUTZEE', 'Out of national EEZ', 'Hors ZEE nationale','Hors ZEE nationale #TODO');
+INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#05' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'REPAIR', 'Under repair', 'En réparation','En réparation #TODO');
+INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#06' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'TRANSSHIP', 'Transshipment', 'Transbordement','Transbordement #TODO');
+INSERT INTO observe_longline.vesselactivity(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#666#07' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'UNK', 'Unknown', 'Inconnue','Inconnue #TODO');
+UPDATE OBSERVE_COMMON.LASTUPDATEDATE SET LASTUPDATEDATE = CURRENT_TIMESTAMP WHERE TYPE ='fr.ird.observe.entities.referentiel.longline.VesselActivityLongline';
\ No newline at end of file
=====================================
test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
=====================================
--- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
+++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
@@ -322,7 +322,7 @@ public class ObserveFixtures {
.put("observe_longline.sensortype", 4L)
.put("observe_longline.settingshape", 6L)
.put("observe_longline.stomacfullness", 7L)
- .put("observe_longline.vesselactivity", 5L)
+ .put("observe_longline.vesselactivity", 12L)
.build();
public static final ImmutableMap<String, Long> REFERENTIAL_TABLES_COUNT = mergeResults(
=====================================
test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b227a2b3835786448c2b0185a2d…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/b227a2b3835786448c2b0185a2d…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Renommage du référentiel observe_longline.TripType - Closes #919
by Tony CHEMIT 19 May '18
by Tony CHEMIT 19 May '18
19 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
740fe94c by Tony CHEMIT at 2018-05-19T22:35:02Z
Renommage du référentiel observe_longline.TripType - Closes #919
- - - - -
30 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TripLonglineUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/TripTypeUI.jaxx → client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/ObservationTripTypeUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/TripTypeUIHandler.java → client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/ObservationTripTypeUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/TripTypeUIModel.java → client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/ObservationTripTypeUIModel.java
- dto/src/main/java/fr/ird/observe/binder/referential/longline/TripTypeDtoReferenceBinder.java → dto/src/main/java/fr/ird/observe/binder/referential/longline/ObservationTripTypeDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
- dto/src/main/models/Observe.model
- dto/src/main/resources/i18n/dto_en_GB.properties
- dto/src/main/resources/i18n/dto_es_ES.properties
- dto/src/main/resources/i18n/dto_fr_FR.properties
- persistence/src/main/java/fr/ird/observe/binder/referential/longline/TripTypeEntityDtoBinder.java → persistence/src/main/java/fr/ird/observe/binder/referential/longline/ObservationTripTypeEntityDtoBinder.java
- persistence/src/main/java/fr/ird/observe/binder/referential/longline/TripTypeEntityReferenceBinder.java → persistence/src/main/java/fr/ird/observe/binder/referential/longline/ObservationTripTypeEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/persistence/Entities.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- persistence/src/main/models/Observe.model
- persistence/src/main/resources/db/migration/5.0/03_add_lastUpdateDate_table-H2.sql
- persistence/src/main/resources/db/migration/5.0/03_add_lastUpdateDate_table-PG.sql
- + persistence/src/main/resources/db/migration/8.0/05_rename_tripType-common.sql
- persistence/src/main/resources/db/migration/old/3.5/V3_5_04_add-longline-references-H2.sql
- persistence/src/main/resources/db/migration/old/3.5/V3_5_04_add-longline-references-PG.sql
- services-client/src/test/java/fr/ird/observe/services/client/service/actions/validate/ValidateServiceClientTest.java
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- services-local/src/test/java/fr/ird/observe/spi/DbModelHelperTest.java
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/empty_h2.sql.gz
- test/src/main/resources/db/8.0/empty_pg.sql.gz
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/740fe94ca10fb868f5fa8238402…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/740fe94ca10fb868f5fa8238402…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Modification du référentiel Person - Closes #890
by Tony CHEMIT 19 May '18
by Tony CHEMIT 19 May '18
19 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
d9ad9a27 by Tony CHEMIT at 2018-05-19T19:21:34Z
Modification du référentiel Person - Closes #890
- - - - -
20 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUIModel.java
- client/src/main/resources/i18n/client_en_GB.properties
- client/src/main/resources/i18n/client_es_ES.properties
- client/src/main/resources/i18n/client_fr_FR.properties
- dto/src/main/java/fr/ird/observe/binder/referential/common/PersonDtoReferenceBinder.java
- dto/src/main/models/Observe.model
- persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityDtoBinder.java
- persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- persistence/src/main/models/Observe.model
- + persistence/src/main/resources/db/migration/8.0/04_update_person-common.sql
- + persistence/src/main/resources/db/migration/8.0/04_update_person2-common.sql
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/empty_h2.sql.gz
- test/src/main/resources/db/8.0/empty_pg.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jaxx
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jaxx
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jaxx
@@ -148,5 +148,11 @@ public void decorateUniqueKeyTable(JTable table,
onStateChanged='getBean().setDataEntryOperator(dataEntryOperator.isSelected())'/>
</cell>
</row>
+ <!-- is dataSource -->
+ <row>
+ <cell columns="2">
+ <JCheckBox id='dataSource2' styleClass="skipI18n" onStateChanged='getBean().setDataSource(dataSource2.isSelected())'/>
+ </cell>
+ </row>
</Table>
</fr.ird.observe.client.ui.content.ref.ContentReferenceUI>
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jcss
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jcss
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUI.jcss
@@ -46,6 +46,11 @@
selected:{bean.isDataEntryOperator()};
}
+#dataSource2 {
+ selected:{bean.isDataSource()};
+ text:"observe.common.PersonDto.dataSource";
+}
+
#country {
property:{PersonDto.PROPERTY_COUNTRY};
selectedItem:{bean.getCountry()};
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUIModel.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUIModel.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/PersonUIModel.java
@@ -45,6 +45,7 @@ public class PersonUIModel extends ContentReferenceUIModel<PersonDto, PersonRefe
PersonDto.PROPERTY_CAPTAIN,
PersonDto.PROPERTY_OBSERVER,
PersonDto.PROPERTY_DATA_ENTRY_OPERATOR,
+ PersonDto.PROPERTY_DATA_SOURCE,
PersonDto.PROPERTY_COUNTRY
},
new String[]{PersonDto.PROPERTY_CODE},
@@ -54,6 +55,7 @@ public class PersonUIModel extends ContentReferenceUIModel<PersonDto, PersonRefe
PersonUI.BINDING_CAPTAIN_SELECTED,
PersonUI.BINDING_OBSERVER_SELECTED,
PersonUI.BINDING_DATA_ENTRY_OPERATOR_SELECTED,
+ PersonUI.BINDING_DATA_SOURCE2_SELECTED,
PersonUI.BINDING_COUNTRY_SELECTED_ITEM,
}
);
=====================================
client/src/main/resources/i18n/client_en_GB.properties
=====================================
--- a/client/src/main/resources/i18n/client_en_GB.properties
+++ b/client/src/main/resources/i18n/client_en_GB.properties
@@ -807,6 +807,7 @@ observe.common.OpenableDto.action.reopen=Re-open
observe.common.OpenableDto.action.reopen.tip=Reopen data
observe.common.PersonDto.captain=Captain
observe.common.PersonDto.dataEntryOperator=Data entry operator
+observe.common.PersonDto.dataSource=Data source
observe.common.PersonDto.observer=Observed
observe.common.ProgramDto.action.goToOpen.short=Open program
observe.common.ProgramDto.action.goToOpen.tip=Go to opened program
=====================================
client/src/main/resources/i18n/client_es_ES.properties
=====================================
--- a/client/src/main/resources/i18n/client_es_ES.properties
+++ b/client/src/main/resources/i18n/client_es_ES.properties
@@ -807,6 +807,7 @@ observe.common.OpenableDto.action.reopen=Reabrir
observe.common.OpenableDto.action.reopen.tip=Reabrir la base de datos
observe.common.PersonDto.captain=Patrón
observe.common.PersonDto.dataEntryOperator=Operador de captación de datos
+observe.common.PersonDto.dataSource=Data source \#TODO
observe.common.PersonDto.observer=Observador
observe.common.ProgramDto.action.goToOpen.short=Programa abierto
observe.common.ProgramDto.action.goToOpen.tip=Acceder al programa abierto
=====================================
client/src/main/resources/i18n/client_fr_FR.properties
=====================================
--- a/client/src/main/resources/i18n/client_fr_FR.properties
+++ b/client/src/main/resources/i18n/client_fr_FR.properties
@@ -807,6 +807,7 @@ observe.common.OpenableDto.action.reopen=Rouvrir
observe.common.OpenableDto.action.reopen.tip=Rouvrir la donnée
observe.common.PersonDto.captain=Capitaine
observe.common.PersonDto.dataEntryOperator=Saisisseur
+observe.common.PersonDto.dataSource=Source d'information
observe.common.PersonDto.observer=Observateur
observe.common.ProgramDto.action.goToOpen.short=Programme ouvert
observe.common.ProgramDto.action.goToOpen.tip=Accéder au programme ouvert
=====================================
dto/src/main/java/fr/ird/observe/binder/referential/common/PersonDtoReferenceBinder.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/binder/referential/common/PersonDtoReferenceBinder.java
+++ b/dto/src/main/java/fr/ird/observe/binder/referential/common/PersonDtoReferenceBinder.java
@@ -45,7 +45,8 @@ public class PersonDtoReferenceBinder extends ReferentialDtoReferenceBinder<Pers
dto.getLastName(),
dto.isCaptain(),
dto.isObserver(),
- dto.isDataEntryOperator());
+ dto.isDataEntryOperator(),
+ dto.isDataSource());
}
}
=====================================
dto/src/main/models/Observe.model
=====================================
--- a/dto/src/main/models/Observe.model
+++ b/dto/src/main/models/Observe.model
@@ -414,12 +414,13 @@ referential.Organism > referential.I18nReferential
description + {*:1} String
country {*:1} fr.ird.observe.dto.referential.CountryReference
-referential.Person > referential.Referential | references=firstName,lastName,captain,observer,dataEntryOperator
+referential.Person > referential.Referential | references=firstName,lastName,captain,observer,dataEntryOperator,dataSource
lastName + {*:1} String
firstName + {*:1} String
observer + {*:1} boolean
captain + {*:1} boolean
dataEntryOperator + {*:1} boolean
+dataSource + {*:1} boolean
country {*:0..1} fr.ird.observe.dto.referential.CountryReference
referential.Program > referential.I18nReferential >> WithComment | references=code,label,gearType,gearTypePrefix,tripCount
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityDtoBinder.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityDtoBinder.java
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityDtoBinder.java
@@ -48,6 +48,7 @@ public class PersonEntityDtoBinder extends ReferentialEntityDtoBinderSupport<Per
entity.setCaptain(dto.isCaptain());
entity.setObserver(dto.isObserver());
entity.setDataEntryOperator(dto.isDataEntryOperator());
+ entity.setDataSource(dto.isDataSource());
entity.setCountry(toEntity(dto.getCountry()));
}
@@ -62,6 +63,7 @@ public class PersonEntityDtoBinder extends ReferentialEntityDtoBinderSupport<Per
dto.setCaptain(entity.isCaptain());
dto.setObserver(entity.isObserver());
dto.setDataEntryOperator(entity.isDataEntryOperator());
+ dto.setDataSource(entity.isDataSource());
dto.setCountry(toReferentialReference(referentialLocale, entity.getCountry()));
}
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityReferenceBinder.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityReferenceBinder.java
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/common/PersonEntityReferenceBinder.java
@@ -46,7 +46,8 @@ public class PersonEntityReferenceBinder extends ReferentialEntityReferenceBinde
dto.getLastName(),
dto.isCaptain(),
dto.isObserver(),
- dto.isDataEntryOperator());
+ dto.isDataEntryOperator(),
+ dto.isDataSource());
}
}
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
@@ -23,10 +23,16 @@ package fr.ird.observe.persistence.migration;
*/
import com.google.auto.service.AutoService;
+import org.nuiton.topia.persistence.support.TopiaSqlQuery;
import org.nuiton.topia.service.migration.resources.MigrationVersionResource;
import org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor;
import org.nuiton.version.Versions;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
/**
* Created by tchemit on 18/05/2018.
*
@@ -46,6 +52,21 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
executor.addScript("01", "move_wind_referential");
executor.addScript("02", "wind_i18n");
executor.addScript("03", "update_vesseltype");
+ executor.addScript("04", "update_person");
+ Boolean withIds = executor.findSingleResult(new TopiaSqlQuery<Boolean>() {
+ @Override
+ public PreparedStatement prepareQuery(Connection connection) throws SQLException {
+ return connection.prepareStatement("SELECT COUNT (*) FROM observe_common.person");
+ }
+
+ @Override
+ public Boolean prepareResult(ResultSet resultSet) throws SQLException {
+ return resultSet.getInt(1) > 0;
+ }
+ });
+ if (withIds) {
+ executor.addScript("04", "update_person2");
+ }
}
}
=====================================
persistence/src/main/models/Observe.model
=====================================
--- a/persistence/src/main/models/Observe.model
+++ b/persistence/src/main/models/Observe.model
@@ -517,6 +517,7 @@ firstName + {*:1} String
observer + {*:1} boolean
captain + {*:1} boolean
dataEntryOperator + {*:1} boolean
+dataSource + {*:1} boolean
country {*:0..1} referentiel.Country
referentiel.Program > referentiel.I18nReferentialEntity | entity
=====================================
persistence/src/main/resources/db/migration/8.0/04_update_person-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/8.0/04_update_person-common.sql
@@ -0,0 +1,25 @@
+---
+-- #%L
+-- ObServe :: Persistence
+-- %%
+-- Copyright (C) 2008 - 2018 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_common.Person ADD COLUMN dataSource BOOLEAN DEFAULT FALSE;
+ALTER TABLE observe_common.Person ALTER COLUMN observer SET DEFAULT FALSE;
+ALTER TABLE observe_common.Person ALTER COLUMN captain SET DEFAULT FALSE;
+ALTER TABLE observe_common.Person ALTER COLUMN dataEntryOperator SET DEFAULT FALSE;
=====================================
persistence/src/main/resources/db/migration/8.0/04_update_person2-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/8.0/04_update_person2-common.sql
@@ -0,0 +1,47 @@
+---
+-- #%L
+-- ObServe :: Persistence
+-- %%
+-- Copyright (C) 2008 - 2018 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%
+---
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#01' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Stephen', 'Andy', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#02' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Vidot', 'Agnes', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#03' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Boniface', 'Breta', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#04' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Theresine', 'Bernard', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#05' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Valentin', 'Bahiri', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#06' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Julienne', 'Cynthia', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#07' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Melanie', 'Cindy', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#08' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Sopha', 'Davis', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#09' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Augustin', 'Emilie', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#10' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Rose', 'Hendricka', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#11' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Melanie', 'Julienne', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#12' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Sinon', 'James', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#13' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Sinon', 'Marie-Claire', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#14' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Savy', 'Marie Stella', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#15' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Bamboche', 'Nattyfa', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#16' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Pothin', 'Nikita', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#17' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Dogley', 'Ruby', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#18' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Quatre', 'Ron', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#19' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Ramkalawan', 'Relix', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#20' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Claude', 'Samantha', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#21' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Pillay', 'Sandra', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#22' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Labrosse', 'Valentina', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#23' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Lagrenade', 'Vanessa', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#24' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Savy', 'Vincent', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+INSERT INTO observe_common.Person(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, dataSource, lastname, firstname, country) values ('fr.ird.observe.entities.referentiel.Person#666#25' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, true, 'Perikanan', 'Pengawas', 'fr.ird.observe.entities.referentiel.Country#1239832675593#0.3601938043845213');
+
=====================================
test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
=====================================
--- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
+++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
@@ -258,7 +258,7 @@ public class ObserveFixtures {
.put("observe_common.ocean", 3L)
.put("observe_common.ocean_species", 500L)
.put("observe_common.organism", 9L)
- .put("observe_common.person", 512L)
+ .put("observe_common.person", 537L)
.put("observe_common.program", 27L)
.put("observe_common.shipowner", 27L)
.put("observe_common.sex", 5L)
=====================================
test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/empty_h2.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_h2.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_h2.sql.gz
@@ -15,7 +15,7 @@ create table OBSERVE_COMMON.lengthWeightParameter (topiaId varchar(255) not null
create table OBSERVE_COMMON.ocean (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.ocean_species (species varchar(255), ocean varchar(255) not null);
create table OBSERVE_COMMON.organism (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), country varchar(255), description varchar(255), primary key (topiaId));
-create table OBSERVE_COMMON.person (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, lastName varchar(255), firstName varchar(255), observer boolean, captain boolean, dataEntryOperator boolean, country varchar(255), primary key (topiaId));
+create table OBSERVE_COMMON.person (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, lastName varchar(255), firstName varchar(255), observer boolean, captain boolean, dataEntryOperator boolean, dataSource boolean, country varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.program (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), organism varchar(255), nonTargetObservation integer, targetDiscardsObservation integer, samplesObservation integer, objectsObservation integer, detailledActivitiesObservation integer, mammalsObservation integer, birdsObservation integer, baitObservation integer, startDate timestamp, endDate timestamp, comment varchar(2147483647), gearType integer, primary key (topiaId));
create table OBSERVE_COMMON.sex (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.shipOwner (topiaId varchar(255) not null, topiaVersion bigint not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status integer, label varchar(255), startDate timestamp, endDate timestamp, country varchar(255), primary key (topiaId));
=====================================
test/src/main/resources/db/8.0/empty_pg.sql.gz
=====================================
--- a/test/src/main/resources/db/8.0/empty_pg.sql.gz
+++ b/test/src/main/resources/db/8.0/empty_pg.sql.gz
@@ -15,7 +15,7 @@ create table OBSERVE_COMMON.lengthWeightParameter (topiaId varchar(255) not null
create table OBSERVE_COMMON.ocean (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.ocean_species (species varchar(255), ocean varchar(255) not null);
create table OBSERVE_COMMON.organism (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), country varchar(255), description varchar(255), primary key (topiaId));
-create table OBSERVE_COMMON.person (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, lastName varchar(255), firstName varchar(255), observer boolean, captain boolean, dataEntryOperator boolean, country varchar(255), primary key (topiaId));
+create table OBSERVE_COMMON.person (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, lastName varchar(255), firstName varchar(255), observer boolean, captain boolean, dataEntryOperator boolean, dataSource boolean, country varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.program (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), organism varchar(255), nonTargetObservation int4, targetDiscardsObservation int4, samplesObservation int4, objectsObservation int4, detailledActivitiesObservation int4, mammalsObservation int4, birdsObservation int4, baitObservation int4, startDate timestamp, endDate timestamp, comment text, gearType int4, primary key (topiaId));
create table OBSERVE_COMMON.sex (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label1 varchar(255), label2 varchar(255), label3 varchar(255), label4 varchar(255), label5 varchar(255), label6 varchar(255), label7 varchar(255), label8 varchar(255), primary key (topiaId));
create table OBSERVE_COMMON.shipOwner (topiaId varchar(255) not null, topiaVersion int8 not null, topiaCreateDate timestamp, lastUpdateDate timestamp not null, code varchar(255), uri varchar(255), needComment boolean not null, status int4, label varchar(255), startDate timestamp, endDate timestamp, country varchar(255), primary key (topiaId));
=====================================
test/src/main/resources/db/8.0/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/d9ad9a278b663578a10dac98a71…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/d9ad9a278b663578a10dac98a71…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Ajout de nouvelles entrées dans le référentiel observe_common.VesselType - Closes #889
by Tony CHEMIT 19 May '18
by Tony CHEMIT 19 May '18
19 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
0d38cd09 by Tony CHEMIT at 2018-05-19T10:26:58Z
Ajout de nouvelles entrées dans le référentiel observe_common.VesselType - Closes #889
- - - - -
7 changed files:
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- + persistence/src/main/resources/db/migration/8.0/03_update_vesseltype-common.sql
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
Changes:
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
@@ -45,6 +45,7 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
executor.removeFK("observe_seine", "Activity", "wind");
executor.addScript("01", "move_wind_referential");
executor.addScript("02", "wind_i18n");
+ executor.addScript("03", "update_vesseltype");
}
}
=====================================
persistence/src/main/resources/db/migration/8.0/03_update_vesseltype-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/8.0/03_update_vesseltype-common.sql
@@ -0,0 +1,23 @@
+---
+-- #%L
+-- ObServe :: Persistence
+-- %%
+-- Copyright (C) 2008 - 2018 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%
+---
+INSERT INTO observe_common.VesselType(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.VesselType#666#1' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, null,'Industrial longliner', 'Palangrier industriel','Industrial longliner #TODO');
+INSERT INTO observe_common.VesselType(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.VesselType#666#2' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, null,'Semi industrial longliner', 'Palangrier semi industriel','Semi industrial longliner #TODO');
\ No newline at end of file
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
=====================================
--- a/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
+++ b/services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
@@ -165,7 +165,7 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport {
assertValidateResult(result, SpeciesListDto.class, 1);
assertValidateResult(result, LightsticksColorDto.class, 2);
assertValidateResult(result, BaitSettingStatusDto.class, 1);
- assertValidateResult(result, VesselTypeDto.class, 3);
+ assertValidateResult(result, VesselTypeDto.class, 4);
assertValidateResult(result, SexDto.class, 2);
assertValidateResult(result, NonTargetCatchReleaseConformityDto.class, 2);
=====================================
test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
=====================================
--- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
+++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
@@ -271,7 +271,7 @@ public class ObserveFixtures {
.put("observe_common.specieslist", 6L)
.put("observe_common.vessel", 1172L)
.put("observe_common.vesselsizecategory", 13L)
- .put("observe_common.vesseltype", 14L)
+ .put("observe_common.vesseltype", 16L)
.put("observe_common.weightmeasuretype", 3L)
.put("observe_common.wind", 13L)
.build();
=====================================
test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/8.0/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/0d38cd0959c0810d3ca0003267a…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/0d38cd0959c0810d3ca0003267a…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 3 commits: set new version + use last toolkit version
by Tony CHEMIT 19 May '18
by Tony CHEMIT 19 May '18
19 May '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
feabbab5 by Tony CHEMIT at 2018-05-19T09:41:38Z
set new version + use last toolkit version
- - - - -
3b5507b2 by Tony CHEMIT at 2018-05-19T09:45:29Z
Modification du référentiel Wind - See #892
- - - - -
a5e03225 by Tony CHEMIT at 2018-05-19T09:50:26Z
Merge branch 'feature/issue_874' into develop - Closes #874
- - - - -
30 changed files:
- client-configuration/pom.xml
- client/pom.xml
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/ActivitySeineUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/ref/seine/WindUI.jaxx → client/src/main/java/fr/ird/observe/client/ui/content/ref/common/WindUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/content/ref/seine/WindUI.jcss → client/src/main/java/fr/ird/observe/client/ui/content/ref/common/WindUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/content/ref/seine/WindUIHandler.java → client/src/main/java/fr/ird/observe/client/ui/content/ref/common/WindUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/seine/WindUIModel.java → client/src/main/java/fr/ird/observe/client/ui/content/ref/common/WindUIModel.java
- dto/pom.xml
- dto/src/main/java/fr/ird/observe/binder/referential/seine/WindDtoReferenceBinder.java → dto/src/main/java/fr/ird/observe/binder/referential/common/WindDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
- dto/src/main/models/Observe.model
- observe/pom.xml
- persistence/pom.xml
- persistence/src/main/java/fr/ird/observe/binder/referential/seine/WindEntityDtoBinder.java → persistence/src/main/java/fr/ird/observe/binder/referential/common/WindEntityDtoBinder.java
- persistence/src/main/java/fr/ird/observe/binder/referential/seine/WindEntityReferenceBinder.java → persistence/src/main/java/fr/ird/observe/binder/referential/common/WindEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/persistence/Entities.java
- + persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
- persistence/src/main/models/Observe.model
- + persistence/src/main/resources/db/migration/8.0/01_move_wind_referential-H2.sql
- + persistence/src/main/resources/db/migration/8.0/01_move_wind_referential-PG.sql
- + persistence/src/main/resources/db/migration/8.0/02_wind_i18n-common.sql
- pom.xml
- server-configuration/pom.xml
- server/pom.xml
- services-client/pom.xml
- services-local/pom.xml
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- services-local/src/test/java/fr/ird/observe/spi/DbModelHelperTest.java
- services/pom.xml
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/1f6f214d89e02e622721c3e840…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/1f6f214d89e02e622721c3e840…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT deleted branch feature/issue_874 at ultreiaio / ird-observe
--
You're receiving this email because of your account on gitlab.com.
1
0