Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

29 changed files:

Changes:

  • client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUI.jaxx
    1
    +<!--
    
    2
    +  #%L
    
    3
    +  ObServe :: Client
    
    4
    +  %%
    
    5
    +  Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    6
    +  %%
    
    7
    +  This program is free software: you can redistribute it and/or modify
    
    8
    +  it under the terms of the GNU General Public License as
    
    9
    +  published by the Free Software Foundation, either version 3 of the
    
    10
    +  License, or (at your option) any later version.
    
    11
    +  
    
    12
    +  This program is distributed in the hope that it will be useful,
    
    13
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    +  GNU General Public License for more details.
    
    16
    +  
    
    17
    +  You should have received a copy of the GNU General Public
    
    18
    +  License along with this program.  If not, see
    
    19
    +  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    +  #L%
    
    21
    +  -->
    
    22
    +<fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI
    
    23
    +    i18nFormat="observe.common.WeightDeterminationMethodDto.%s"
    
    24
    +    superGenericType='WeightDeterminationMethodDto, WeightDeterminationMethodReference, WeightDeterminationMethodUI'>
    
    25
    +
    
    26
    +  <style source="../ReferenceEntity.jcss"/>
    
    27
    +
    
    28
    +  <import>
    
    29
    +    fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto
    
    30
    +    fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference
    
    31
    +
    
    32
    +    static fr.ird.observe.client.ui.util.UIHelper.getStringValue
    
    33
    +    fr.ird.observe.dto.referential.ReferenceStatus
    
    34
    +  </import>
    
    35
    +
    
    36
    +  <!-- validator -->
    
    37
    +  <BeanValidator id='validator' autoField='true'
    
    38
    +                 beanClass='fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto'
    
    39
    +                 context='create' errorTableModel='{getErrorTableModel()}'>
    
    40
    +    <field name='label1' component='label1'/>
    
    41
    +    <field name='label2' component='label2'/>
    
    42
    +    <field name='label3' component='label3'/>
    
    43
    +  </BeanValidator>
    
    44
    +
    
    45
    +  <!-- model -->
    
    46
    +  <WeightDeterminationMethodUIModel id='model'/>
    
    47
    +
    
    48
    +  <!-- edit bean -->
    
    49
    +  <WeightDeterminationMethodDto id='bean'/>
    
    50
    +
    
    51
    +  <Table id='editTable'>
    
    52
    +
    
    53
    +    <!-- uri -->
    
    54
    +    <row>
    
    55
    +      <cell anchor="west">
    
    56
    +        <JLabel id='uriLabel'/>
    
    57
    +      </cell>
    
    58
    +      <cell anchor='east' weightx="1" fill="both">
    
    59
    +        <JTextField id='uri'/>
    
    60
    +      </cell>
    
    61
    +    </row>
    
    62
    +
    
    63
    +    <!-- code / status -->
    
    64
    +    <row>
    
    65
    +      <cell anchor="west">
    
    66
    +        <JLabel id='codeStatusLabel'/>
    
    67
    +      </cell>
    
    68
    +      <cell anchor='east' weightx="1" fill="both">
    
    69
    +        <JPanel id='codeStatusPanel' layout='{new BorderLayout()}'>
    
    70
    +          <JTextField id='code' constraints='BorderLayout.WEST'/>
    
    71
    +          <EnumEditor id='status' constructorParams='ReferenceStatus.class' genericType='ReferenceStatus'
    
    72
    +                      onItemStateChanged='getBean().setStatus((ReferenceStatus)status.getSelectedItem())'
    
    73
    +                      constraints='BorderLayout.CENTER'/>
    
    74
    +        </JPanel>
    
    75
    +      </cell>
    
    76
    +    </row>
    
    77
    +
    
    78
    +    <!-- needComment -->
    
    79
    +    <row>
    
    80
    +      <cell anchor='east' weightx="1" fill="both" columns="2">
    
    81
    +        <JCheckBox id='needComment' onItemStateChanged='getBean().setNeedComment(needComment.isSelected())'/>
    
    82
    +      </cell>
    
    83
    +    </row>
    
    84
    +  </Table>
    
    85
    +
    
    86
    +  <JTextField id='label1'/>
    
    87
    +  <JTextField id='label2'/>
    
    88
    +  <JTextField id='label3'/>
    
    89
    +
    
    90
    +</fr.ird.observe.client.ui.content.ref.ContentI18nReferenceUI>

  • client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIHandler.java
    1
    +package fr.ird.observe.client.ui.content.ref.longline;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Client
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + * 
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + * 
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.ui.content.ref.ContentReferenceUIHandler;
    
    26
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    27
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
    
    28
    +import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    29
    +
    
    30
    +/**
    
    31
    + * Created on 06/12/16.
    
    32
    + *
    
    33
    + * @author Tony Chemit - dev@tchemit.fr
    
    34
    + * @since 6.0
    
    35
    + */
    
    36
    +class WeightDeterminationMethodUIHandler extends ContentReferenceUIHandler<WeightDeterminationMethodDto, WeightDeterminationMethodReference, WeightDeterminationMethodUI> implements UIHandler<WeightDeterminationMethodUI> {
    
    37
    +}

  • client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightDeterminationMethodUIModel.java
    1
    +package fr.ird.observe.client.ui.content.ref.longline;
    
    2
    +
    
    3
    +/*
    
    4
    + * #%L
    
    5
    + * ObServe :: Client
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.client.ui.content.ref.ContentReferenceUIModel;
    
    26
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    27
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
    
    28
    +
    
    29
    +/**
    
    30
    + * Created on 9/28/14.
    
    31
    + *
    
    32
    + * @author Tony Chemit - dev@tchemit.fr
    
    33
    + * @since XXX
    
    34
    + */
    
    35
    +public class WeightDeterminationMethodUIModel extends ContentReferenceUIModel<WeightDeterminationMethodDto, WeightDeterminationMethodReference> {
    
    36
    +
    
    37
    +    private static final long serialVersionUID = 1L;
    
    38
    +
    
    39
    +    public WeightDeterminationMethodUIModel() {
    
    40
    +        super(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class);
    
    41
    +    }
    
    42
    +
    
    43
    +}

  • dto/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodDtoReferenceBinder.java
    1
    +package fr.ird.observe.binder.referential.longline;
    
    2
    +
    
    3
    +import fr.ird.observe.binder.referential.ReferentialDtoReferenceBinder;
    
    4
    +import fr.ird.observe.dto.referential.ReferentialLocale;
    
    5
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    6
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
    
    7
    +
    
    8
    +/**
    
    9
    + * Created by tchemit on 20/05/2018.
    
    10
    + *
    
    11
    + * @author Tony Chemit - dev@tchemit.fr
    
    12
    + */
    
    13
    +public class WeightDeterminationMethodDtoReferenceBinder extends ReferentialDtoReferenceBinder<WeightDeterminationMethodDto, WeightDeterminationMethodReference> {
    
    14
    +
    
    15
    +    public WeightDeterminationMethodDtoReferenceBinder() {
    
    16
    +        super(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class);
    
    17
    +    }
    
    18
    +
    
    19
    +    @Override
    
    20
    +    public WeightDeterminationMethodReference toReference(ReferentialLocale referentialLocale, WeightDeterminationMethodDto dto) {
    
    21
    +
    
    22
    +        return new WeightDeterminationMethodReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
    
    23
    +
    
    24
    +    }
    
    25
    +}

  • dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
    ... ... @@ -201,6 +201,8 @@ import fr.ird.observe.dto.referential.longline.ObservationTripTypeDto;
    201 201
     import fr.ird.observe.dto.referential.longline.ObservationTripTypeReference;
    
    202 202
     import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
    
    203 203
     import fr.ird.observe.dto.referential.longline.VesselActivityLonglineReference;
    
    204
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    205
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
    
    204 206
     import fr.ird.observe.dto.referential.seine.DetectionModeDto;
    
    205 207
     import fr.ird.observe.dto.referential.seine.DetectionModeReference;
    
    206 208
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
    
    ... ... @@ -804,6 +806,11 @@ public class DecoratorService extends DecoratorProvider {
    804 806
             }
    
    805 807
     
    
    806 808
             @Override
    
    809
    +        public void initWeightDeterminationMethodDto() {
    
    810
    +            registerDefaultReferentialAndReferentialReferenceDecorator(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class, libelle);
    
    811
    +        }
    
    812
    +
    
    813
    +        @Override
    
    807 814
             public void initWindDto() {
    
    808 815
                 registerReferentialAndReferentialReferenceDecorator(WindDto.class, WindReference.class,
    
    809 816
                         "${code}$s##${" + libelle + "}$s##${speedRange}$s",
    

  • dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
    ... ... @@ -119,13 +119,14 @@ import fr.ird.observe.dto.referential.longline.LightsticksTypeDto;
    119 119
     import fr.ird.observe.dto.referential.longline.LineTypeDto;
    
    120 120
     import fr.ird.observe.dto.referential.longline.MaturityStatusDto;
    
    121 121
     import fr.ird.observe.dto.referential.longline.MitigationTypeDto;
    
    122
    +import fr.ird.observe.dto.referential.longline.ObservationTripTypeDto;
    
    122 123
     import fr.ird.observe.dto.referential.longline.SensorBrandDto;
    
    123 124
     import fr.ird.observe.dto.referential.longline.SensorDataFormatDto;
    
    124 125
     import fr.ird.observe.dto.referential.longline.SensorTypeDto;
    
    125 126
     import fr.ird.observe.dto.referential.longline.SettingShapeDto;
    
    126 127
     import fr.ird.observe.dto.referential.longline.StomacFullnessDto;
    
    127
    -import fr.ird.observe.dto.referential.longline.ObservationTripTypeDto;
    
    128 128
     import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
    
    129
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    129 130
     import fr.ird.observe.dto.referential.seine.DetectionModeDto;
    
    130 131
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
    
    131 132
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseStatusDto;
    
    ... ... @@ -234,7 +235,8 @@ public class DtoModelClasses {
    234 235
                 SettingShapeDto.class,
    
    235 236
                 StomacFullnessDto.class,
    
    236 237
                 ObservationTripTypeDto.class,
    
    237
    -            VesselActivityLonglineDto.class);
    
    238
    +            VesselActivityLonglineDto.class,
    
    239
    +            WeightDeterminationMethodDto.class);
    
    238 240
     
    
    239 241
         public static final ImmutableSet<Class<? extends ReferentialDto>> REFERENTIAL_TYPES = ImmutableSet.<Class<? extends ReferentialDto>>builder()
    
    240 242
                 .addAll(COMMON_REFERENTIAL_TYPES)
    

  • dto/src/main/models/Observe.model
    ... ... @@ -553,6 +553,8 @@ referential.longline.ObservationTripType > referential.I18nReferential
    553 553
     
    
    554 554
     referential.longline.VesselActivityLongline > referential.I18nReferential
    
    555 555
     
    
    556
    +referential.longline.WeightDeterminationMethod > referential.I18nReferential
    
    557
    +
    
    556 558
     referential.seine.DetectionMode > referential.I18nReferential
    
    557 559
     
    
    558 560
     referential.seine.NonTargetCatchReleaseConformity > referential.I18nReferential
    

  • dto/src/main/resources/i18n/dto_en_GB.properties
    ... ... @@ -229,6 +229,8 @@ observe.common.VesselTypeDto.type=Vessel type
    229 229
     observe.common.VesselTypeDto.types=Vessel types
    
    230 230
     observe.common.WeightCategoryDto.type=Weight category
    
    231 231
     observe.common.WeightCategoryDto.types=Weight categories
    
    232
    +observe.common.WeightDeterminationMethodDto.type=Weight determination method
    
    233
    +observe.common.WeightDeterminationMethodDto.types=Weight determination methods
    
    232 234
     observe.common.WeightMeasureDto.title=Weight measures
    
    233 235
     observe.common.WeightMeasureDto.type=Weight measure
    
    234 236
     observe.common.WeightMeasureDto.types=Weight measures
    

  • dto/src/main/resources/i18n/dto_es_ES.properties
    ... ... @@ -227,6 +227,8 @@ observe.common.VesselTypeDto.type=Tipo de pesquería
    227 227
     observe.common.VesselTypeDto.types=Tipos de pesquería
    
    228 228
     observe.common.WeightCategoryDto.type=Categoría de peso
    
    229 229
     observe.common.WeightCategoryDto.types=Categorías de peso
    
    230
    +observe.common.WeightDeterminationMethodDto.type=Weight determination method \#TODO
    
    231
    +observe.common.WeightDeterminationMethodDto.types=Weight determination methods \#TODO
    
    230 232
     observe.common.WeightMeasureDto.title=Medidas de peso
    
    231 233
     observe.common.WeightMeasureDto.type=Medida de peso
    
    232 234
     observe.common.WeightMeasureDto.types=Medidas de peso
    

  • dto/src/main/resources/i18n/dto_fr_FR.properties
    ... ... @@ -229,6 +229,8 @@ observe.common.VesselTypeDto.type=Type de pêcherie
    229 229
     observe.common.VesselTypeDto.types=Types de pêcherie
    
    230 230
     observe.common.WeightCategoryDto.type=Catégorie de poids
    
    231 231
     observe.common.WeightCategoryDto.types=Catégories de poids
    
    232
    +observe.common.WeightDeterminationMethodDto.type=Méthode d'estimation de poids
    
    233
    +observe.common.WeightDeterminationMethodDto.types=Méthodes d'estimation de poids
    
    232 234
     observe.common.WeightMeasureDto.title=Mesures de poids
    
    233 235
     observe.common.WeightMeasureDto.type=Mesure de poids
    
    234 236
     observe.common.WeightMeasureDto.types=Mesures de poids
    

  • persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityDtoBinder.java
    1
    +package fr.ird.observe.binder.referential.longline;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Persistence
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + * 
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + * 
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.binder.referential.ReferentialEntityDtoBinderSupport;
    
    26
    +import fr.ird.observe.dto.referential.ReferentialLocale;
    
    27
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    28
    +import fr.ird.observe.entities.referentiel.longline.WeightDeterminationMethod;
    
    29
    +
    
    30
    +/**
    
    31
    + * Created on 24/11/15.
    
    32
    + *
    
    33
    + * @author Tony Chemit - dev@tchemit.fr
    
    34
    + */
    
    35
    +public class WeightDeterminationMethodEntityDtoBinder extends ReferentialEntityDtoBinderSupport<WeightDeterminationMethodDto, WeightDeterminationMethod> {
    
    36
    +
    
    37
    +    public WeightDeterminationMethodEntityDtoBinder() {
    
    38
    +        super(WeightDeterminationMethod.class, WeightDeterminationMethodDto.class);
    
    39
    +    }
    
    40
    +
    
    41
    +    @Override
    
    42
    +    public void copyToEntity(ReferentialLocale referentialLocale, WeightDeterminationMethodDto dto, WeightDeterminationMethod entity) {
    
    43
    +
    
    44
    +
    
    45
    +        copyDtoReferentialFieldsToEntity(dto, entity);
    
    46
    +        copyDtoI18nFieldsToEntity(dto, entity);
    
    47
    +
    
    48
    +    }
    
    49
    +
    
    50
    +    @Override
    
    51
    +    public void copyToDto(ReferentialLocale referentialLocale, WeightDeterminationMethod entity, WeightDeterminationMethodDto dto) {
    
    52
    +
    
    53
    +
    
    54
    +        copyEntityReferentialFieldsToDto(entity, dto);
    
    55
    +        copyEntityI18nFieldsToDto(entity, dto);
    
    56
    +
    
    57
    +    }
    
    58
    +
    
    59
    +}

  • persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightDeterminationMethodEntityReferenceBinder.java
    1
    +package fr.ird.observe.binder.referential.longline;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Persistence
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + * 
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + * 
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.binder.referential.ReferentialEntityReferenceBinderSupport;
    
    26
    +import fr.ird.observe.dto.referential.ReferentialLocale;
    
    27
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    28
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
    
    29
    +import fr.ird.observe.entities.referentiel.longline.WeightDeterminationMethod;
    
    30
    +
    
    31
    +/**
    
    32
    + * Created on 24/11/15.
    
    33
    + *
    
    34
    + * @author Tony Chemit - dev@tchemit.fr
    
    35
    + */
    
    36
    +public class WeightDeterminationMethodEntityReferenceBinder extends ReferentialEntityReferenceBinderSupport<WeightDeterminationMethodDto, WeightDeterminationMethodReference, WeightDeterminationMethod> {
    
    37
    +
    
    38
    +    public WeightDeterminationMethodEntityReferenceBinder() {
    
    39
    +        super(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class, WeightDeterminationMethod.class);
    
    40
    +    }
    
    41
    +
    
    42
    +    @Override
    
    43
    +    public WeightDeterminationMethodReference toReference(ReferentialLocale referentialLocale, WeightDeterminationMethod dto) {
    
    44
    +
    
    45
    +        return new WeightDeterminationMethodReference(dto, dto.getCode(), dto.getLabel(referentialLocale));
    
    46
    +
    
    47
    +    }
    
    48
    +}

  • persistence/src/main/java/fr/ird/observe/persistence/Entities.java
    ... ... @@ -114,6 +114,7 @@ public class Entities {
    114 114
                         ObserveEntityEnum.SensorType,
    
    115 115
                         ObserveEntityEnum.SettingShape,
    
    116 116
                         ObserveEntityEnum.StomacFullness,
    
    117
    +                    ObserveEntityEnum.WeightDeterminationMethod,
    
    117 118
                         ObserveEntityEnum.VesselActivityLongline
    
    118 119
                 };
    
    119 120
         public static final List<ObserveEntityEnum> REFERENCE_ENTITIES_LIST =
    

  • persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_8_0.java
    ... ... @@ -72,6 +72,7 @@ public class DataSourceMigrationForVersion_8_0 extends MigrationVersionResource
    72 72
             if (withIds) {
    
    73 73
                 executor.addScript("06", "fill_vessel_activity");
    
    74 74
             }
    
    75
    +        executor.addScript("07", "add_weight_determination_method");
    
    75 76
         }
    
    76 77
     
    
    77 78
     }
    

  • persistence/src/main/models/Observe.model
    ... ... @@ -655,6 +655,8 @@ referentiel.longline.ObservationTripType > referentiel.I18nReferentialEntity | e
    655 655
     
    
    656 656
     referentiel.longline.VesselActivityLongline > referentiel.I18nReferentialEntity | entity dbName=VesselActivity
    
    657 657
     
    
    658
    +referentiel.longline.WeightDeterminationMethod > referentiel.I18nReferentialEntity | entity
    
    659
    +
    
    658 660
     referentiel.seine.DetectionMode > referentiel.I18nReferentialEntity | entity
    
    659 661
     
    
    660 662
     referentiel.seine.NonTargetCatchReleaseConformity > referentiel.I18nReferentialEntity | entity
    

  • persistence/src/main/resources/db/migration/8.0/07_add_weight_determination_method-common.sql
    1
    +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));
    
    2
    +ALTER TABLE observe_longline.WeightDeterminationMethod ADD CONSTRAINT PK_WeightDeterminationMethod PRIMARY KEY(topiaid);
    
    3
    +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
    ... ... @@ -106,6 +106,10 @@ public class UnidirectionalSynchronizeReferentialTest extends ServiceLocalTestSu
    106 106
                     //empty
    
    107 107
                     continue;
    
    108 108
                 }
    
    109
    +            if (ObserveEntityEnum.WeightDeterminationMethod.equals(referenceEntity)) {
    
    110
    +                //empty
    
    111
    +                continue;
    
    112
    +            }
    
    109 113
                 Class<? extends ReferentialDto> dtoType = DbModelHelper.fromReferentialEntity(referenceEntity).toDtoType();
    
    110 114
                 Assert.assertTrue("can't find type " + dtoType, referentialNames.contains(dtoType));
    
    111 115
                 Assert.assertTrue(result.getReferentialUpdated(dtoType).isEmpty());
    

  • services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
    ... ... @@ -146,8 +146,8 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport {
    146 146
                 ImmutableSet<ValidationResultDtoMessage> messages = result.getMessagesForType(type);
    
    147 147
                 System.out.println("assertValidateResult(result, " + type.getSimpleName() + ".class, " + messages.size() + ");");
    
    148 148
             }
    
    149
    -        // no data of LengthLegnthParameter
    
    150
    -        Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 1, types.size());
    
    149
    +        // no data of LengthLegnthParameter, WeightDeterminationMethod
    
    150
    +        Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 2, types.size());
    
    151 151
     
    
    152 152
             assertValidateResult(result, DataQualityDto.class, 1);
    
    153 153
             assertValidateResult(result, SpeciesGroupReleaseModeDto.class, 2);
    

  • test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
    ... ... @@ -62,13 +62,13 @@ public class ObserveFixtures {
    62 62
     
    
    63 63
         public static final String SET_LONGLINE_ID_1 = "fr.ird.observe.entities.longline.SetLongline#1429538714446#0.0876020351424813";
    
    64 64
     
    
    65
    -    public static final int ENTITY_BINDER_REFERENTIAL_COUNT = 66;
    
    65
    +    private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 67;
    
    66 66
         public static final int REFERENCE_DATA_COUNT = 33;
    
    67 67
     
    
    68 68
         public static final int REFERENTIAL_FORM_COUNT = ENTITY_BINDER_REFERENTIAL_COUNT;
    
    69 69
         public static final int DATA_FORM_COUNT = 48;
    
    70 70
     
    
    71
    -    public static final int VALIDATORS_COUNT = 190;
    
    71
    +    public static final int VALIDATORS_COUNT = 192;
    
    72 72
         public static final int VALIDATOR_CREATE_DATA_COUNT = 8;
    
    73 73
         public static final int VALIDATOR_UPDATE_DATA_COUNT = 37;
    
    74 74
         public static final int VALIDATOR_UPDATE_ENTITY_DATA_COUNT = 29;
    
    ... ... @@ -252,7 +252,7 @@ public class ObserveFixtures {
    252 252
                 .put("observe_common.gearcaracteristic", 22L)
    
    253 253
                 .put("observe_common.gearcaracteristictype", 6L)
    
    254 254
                 .put("observe_common.harbour", 74L)
    
    255
    -            .put("observe_common.lastupdatedate", 104L)
    
    255
    +            .put("observe_common.lastupdatedate", 105L)
    
    256 256
                 .put("observe_common.lengthlengthparameter", 0L)
    
    257 257
                 .put("observe_common.lengthweightparameter", 365L)
    
    258 258
                 .put("observe_common.ocean", 3L)
    
    ... ... @@ -323,6 +323,7 @@ public class ObserveFixtures {
    323 323
                 .put("observe_longline.settingshape", 6L)
    
    324 324
                 .put("observe_longline.stomacfullness", 7L)
    
    325 325
                 .put("observe_longline.vesselactivity", 12L)
    
    326
    +            .put("observe_longline.weightdeterminationmethod", 0L)
    
    326 327
                 .build();
    
    327 328
     
    
    328 329
         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
    ... ... @@ -75,6 +75,7 @@ create table OBSERVE_LONGLINE.tdr (topiaId varchar(255) not null, topiaVersion b
    75 75
     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));
    
    76 76
     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));
    
    77 77
     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));
    
    78
    +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));
    
    78 79
     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));
    
    79 80
     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));
    
    80 81
     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
    ... ... @@ -75,6 +75,7 @@ create table OBSERVE_LONGLINE.tdr (topiaId varchar(255) not null, topiaVersion i
    75 75
     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));
    
    76 76
     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));
    
    77 77
     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));
    
    78
    +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));
    
    78 79
     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));
    
    79 80
     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));
    
    80 81
     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
    1
    +<?xml version="1.0" encoding="UTF-8"?>
    
    2
    +<!--
    
    3
    +  #%L
    
    4
    +  ObServe :: Validation
    
    5
    +  %%
    
    6
    +  Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    7
    +  %%
    
    8
    +  This program is free software: you can redistribute it and/or modify
    
    9
    +  it under the terms of the GNU General Public License as
    
    10
    +  published by the Free Software Foundation, either version 3 of the
    
    11
    +  License, or (at your option) any later version.
    
    12
    +  
    
    13
    +  This program is distributed in the hope that it will be useful,
    
    14
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    15
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    16
    +  GNU General Public License for more details.
    
    17
    +  
    
    18
    +  You should have received a copy of the GNU General Public
    
    19
    +  License along with this program.  If not, see
    
    20
    +  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    21
    +  #L%
    
    22
    +  -->
    
    23
    +
    
    24
    +
    
    25
    +<!DOCTYPE validators PUBLIC
    
    26
    +    "-//Apache Struts//XWork Validator 1.0.3//EN"
    
    27
    +    "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
    
    28
    +<validators>
    
    29
    +
    
    30
    +  <field name="code">
    
    31
    +
    
    32
    +    <!-- clef unique sur le code -->
    
    33
    +    <field-validator type="referentialCode" short-circuit="true">
    
    34
    +      <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
    
    35
    +    </field-validator>
    
    36
    +
    
    37
    +  </field>
    
    38
    +
    
    39
    +  <field name="label1">    <!-- pas de libelle 1 renseigne -->
    
    40
    +    <field-validator type="requiredstring">
    
    41
    +      <message>observe.validation.referentiel.required.label1</message>
    
    42
    +    </field-validator>
    
    43
    +  </field>
    
    44
    +
    
    45
    +  <field name="label2">
    
    46
    +    <!-- pas de libelle 2 renseigne -->
    
    47
    +    <field-validator type="requiredstring">
    
    48
    +      <message>observe.validation.referentiel.required.label2</message>
    
    49
    +    </field-validator>
    
    50
    +  </field>
    
    51
    +
    
    52
    +  <field name="label3">
    
    53
    +    <!-- pas de libelle 3 renseigne -->
    
    54
    +    <field-validator type="requiredstring">
    
    55
    +      <message>observe.validation.referentiel.required.label3</message>
    
    56
    +    </field-validator>
    
    57
    +  </field>
    
    58
    +
    
    59
    +</validators>

  • validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-create-warning-validation.xml
    1
    +<?xml version="1.0" encoding="UTF-8"?>
    
    2
    +<!--
    
    3
    +  #%L
    
    4
    +  ObServe :: Validation
    
    5
    +  %%
    
    6
    +  Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    7
    +  %%
    
    8
    +  This program is free software: you can redistribute it and/or modify
    
    9
    +  it under the terms of the GNU General Public License as
    
    10
    +  published by the Free Software Foundation, either version 3 of the
    
    11
    +  License, or (at your option) any later version.
    
    12
    +  
    
    13
    +  This program is distributed in the hope that it will be useful,
    
    14
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    15
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    16
    +  GNU General Public License for more details.
    
    17
    +  
    
    18
    +  You should have received a copy of the GNU General Public
    
    19
    +  License along with this program.  If not, see
    
    20
    +  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    21
    +  #L%
    
    22
    +  -->
    
    23
    +
    
    24
    +
    
    25
    +<!DOCTYPE validators PUBLIC
    
    26
    +    "-//Apache Struts//XWork Validator 1.0.3//EN"
    
    27
    +    "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
    
    28
    +<validators>
    
    29
    +
    
    30
    +  <field name="status">
    
    31
    +    <!-- objet desactive -->
    
    32
    +    <field-validator type="fieldexpression" short-circuit="true">
    
    33
    +      <param name="expression">
    
    34
    +        <![CDATA[ enabled ]]>
    
    35
    +      </param>
    
    36
    +      <message>observe.validation.referentiel.status.desactivated</message>
    
    37
    +    </field-validator>
    
    38
    +  </field>
    
    39
    +
    
    40
    +  <field name="uri">
    
    41
    +    <!-- pas d'uri selectionne -->
    
    42
    +    <field-validator type="requiredstring" short-circuit="true">
    
    43
    +      <message>observe.validation.referentiel.null.uri</message>
    
    44
    +    </field-validator>
    
    45
    +  </field>
    
    46
    +  <field name="label1">
    
    47
    +    <!-- libelle 1 non traduit (egal a label2) -->
    
    48
    +    <field-validator type="fieldexpression">
    
    49
    +      <param name="expression">
    
    50
    +        <![CDATA[ label1 == null || label1.empty || label1 != label2  ]]>
    
    51
    +      </param>
    
    52
    +      <message>observe.validation.referentiel.untranslated.label1</message>
    
    53
    +    </field-validator>
    
    54
    +  </field>
    
    55
    +
    
    56
    +  <field name="label3">
    
    57
    +    <!-- libelle 3 non traduit (egal a label2) -->
    
    58
    +    <field-validator type="fieldexpression">
    
    59
    +      <param name="expression">
    
    60
    +        <![CDATA[ label3 == null || label3.empty || label3 != label2  ]]>
    
    61
    +      </param>
    
    62
    +      <message>observe.validation.referentiel.untranslated.label3</message>
    
    63
    +    </field-validator>
    
    64
    +  </field>
    
    65
    +
    
    66
    +</validators>

  • validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-error-validation.xml
    1
    +<?xml version="1.0" encoding="UTF-8"?>
    
    2
    +<!--
    
    3
    +  #%L
    
    4
    +  ObServe :: Validation
    
    5
    +  %%
    
    6
    +  Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    7
    +  %%
    
    8
    +  This program is free software: you can redistribute it and/or modify
    
    9
    +  it under the terms of the GNU General Public License as
    
    10
    +  published by the Free Software Foundation, either version 3 of the
    
    11
    +  License, or (at your option) any later version.
    
    12
    +  
    
    13
    +  This program is distributed in the hope that it will be useful,
    
    14
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    15
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    16
    +  GNU General Public License for more details.
    
    17
    +  
    
    18
    +  You should have received a copy of the GNU General Public
    
    19
    +  License along with this program.  If not, see
    
    20
    +  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    21
    +  #L%
    
    22
    +  -->
    
    23
    +
    
    24
    +
    
    25
    +<!DOCTYPE validators PUBLIC
    
    26
    +    "-//Apache Struts//XWork Validator 1.0.3//EN"
    
    27
    +    "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
    
    28
    +<validators>
    
    29
    +
    
    30
    +  <field name="code">
    
    31
    +
    
    32
    +    <!-- clef unique sur le code -->
    
    33
    +    <field-validator type="referentialCode" short-circuit="true">
    
    34
    +      <message>observe.validation.referentiel.invalid.code.uniqueKey##${code}</message>
    
    35
    +    </field-validator>
    
    36
    +
    
    37
    +  </field>
    
    38
    +
    
    39
    +  <field name="label1">    <!-- pas de libelle 1 renseigne -->
    
    40
    +    <field-validator type="requiredstring">
    
    41
    +      <message>observe.validation.referentiel.required.label1</message>
    
    42
    +    </field-validator>
    
    43
    +  </field>
    
    44
    +
    
    45
    +  <field name="label2">
    
    46
    +    <!-- pas de libelle 2 renseigne -->
    
    47
    +    <field-validator type="requiredstring">
    
    48
    +      <message>observe.validation.referentiel.required.label2</message>
    
    49
    +    </field-validator>
    
    50
    +  </field>
    
    51
    +
    
    52
    +  <field name="label3">
    
    53
    +    <!-- pas de libelle 3 renseigne -->
    
    54
    +    <field-validator type="requiredstring">
    
    55
    +      <message>observe.validation.referentiel.required.label3</message>
    
    56
    +    </field-validator>
    
    57
    +  </field>
    
    58
    +
    
    59
    +</validators>

  • validation/src/main/resources/fr/ird/observe/dto/referential/longline/WeightDeterminationMethodDto-update-warning-validation.xml
    1
    +<?xml version="1.0" encoding="UTF-8"?>
    
    2
    +<!--
    
    3
    +  #%L
    
    4
    +  ObServe :: Validation
    
    5
    +  %%
    
    6
    +  Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    7
    +  %%
    
    8
    +  This program is free software: you can redistribute it and/or modify
    
    9
    +  it under the terms of the GNU General Public License as
    
    10
    +  published by the Free Software Foundation, either version 3 of the
    
    11
    +  License, or (at your option) any later version.
    
    12
    +  
    
    13
    +  This program is distributed in the hope that it will be useful,
    
    14
    +  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    15
    +  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    16
    +  GNU General Public License for more details.
    
    17
    +  
    
    18
    +  You should have received a copy of the GNU General Public
    
    19
    +  License along with this program.  If not, see
    
    20
    +  <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    21
    +  #L%
    
    22
    +  -->
    
    23
    +
    
    24
    +
    
    25
    +<!DOCTYPE validators PUBLIC
    
    26
    +    "-//Apache Struts//XWork Validator 1.0.3//EN"
    
    27
    +    "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
    
    28
    +<validators>
    
    29
    +
    
    30
    +  <field name="status">
    
    31
    +    <!-- objet desactive -->
    
    32
    +    <field-validator type="fieldexpression" short-circuit="true">
    
    33
    +      <param name="expression">
    
    34
    +        <![CDATA[ enabled ]]>
    
    35
    +      </param>
    
    36
    +      <message>observe.validation.referentiel.status.desactivated</message>
    
    37
    +    </field-validator>
    
    38
    +  </field>
    
    39
    +
    
    40
    +  <field name="uri">
    
    41
    +    <!-- pas d'uri selectionne -->
    
    42
    +    <field-validator type="requiredstring" short-circuit="true">
    
    43
    +      <message>observe.validation.referentiel.null.uri</message>
    
    44
    +    </field-validator>
    
    45
    +  </field>
    
    46
    +  <field name="label1">
    
    47
    +    <!-- libelle 1 non traduit (egal a label2) -->
    
    48
    +    <field-validator type="fieldexpression">
    
    49
    +      <param name="expression">
    
    50
    +        <![CDATA[ label1 == null || label1.empty || label1 != label2  ]]>
    
    51
    +      </param>
    
    52
    +      <message>observe.validation.referentiel.untranslated.label1</message>
    
    53
    +    </field-validator>
    
    54
    +  </field>
    
    55
    +
    
    56
    +  <field name="label3">
    
    57
    +    <!-- libelle 3 non traduit (egal a label2) -->
    
    58
    +    <field-validator type="fieldexpression">
    
    59
    +      <param name="expression">
    
    60
    +        <![CDATA[ label3 == null || label3.empty || label3 != label2  ]]>
    
    61
    +      </param>
    
    62
    +      <message>observe.validation.referentiel.untranslated.label3</message>
    
    63
    +    </field-validator>
    
    64
    +  </field>
    
    65
    +
    
    66
    +</validators>

  • validation/src/test/java/fr/ird/observe/client/validation/BeanValidatorDetectorTest.java
    ... ... @@ -113,6 +113,7 @@ import fr.ird.observe.dto.referential.longline.SensorTypeDto;
    113 113
     import fr.ird.observe.dto.referential.longline.SettingShapeDto;
    
    114 114
     import fr.ird.observe.dto.referential.longline.StomacFullnessDto;
    
    115 115
     import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
    
    116
    +import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    116 117
     import fr.ird.observe.dto.referential.seine.DetectionModeDto;
    
    117 118
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
    
    118 119
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseStatusDto;
    
    ... ... @@ -270,6 +271,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
    270 271
                     VesselSizeCategoryDto.class,
    
    271 272
                     VesselTypeDto.class,
    
    272 273
                     WeightCategoryDto.class,
    
    274
    +                WeightDeterminationMethodDto.class,
    
    273 275
                     WeightMeasureTypeDto.class,
    
    274 276
                     WindDto.class);
    
    275 277
         }
    
    ... ... @@ -386,6 +388,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
    386 388
                     VesselSizeCategoryDto.class,
    
    387 389
                     VesselTypeDto.class,
    
    388 390
                     WeightCategoryDto.class,
    
    391
    +                WeightDeterminationMethodDto.class,
    
    389 392
                     WeightMeasureTypeDto.class,
    
    390 393
                     WindDto.class);
    
    391 394
         }