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/WeightCategoryLonglineUI.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.WeightCategoryLonglineDto.%s"
    
    24
    +    superGenericType='WeightCategoryLonglineDto, WeightCategoryLonglineReference, WeightCategoryLonglineUI'>
    
    25
    +
    
    26
    +  <style source="../ReferenceEntity.jcss"/>
    
    27
    +
    
    28
    +  <import>
    
    29
    +    fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto
    
    30
    +    fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference
    
    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.WeightCategoryLonglineDto'
    
    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
    +  <WeightCategoryLonglineUIModel id='model'/>
    
    47
    +
    
    48
    +  <!-- edit bean -->
    
    49
    +  <WeightCategoryLonglineDto 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/WeightCategoryLonglineUIHandler.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.WeightCategoryLonglineDto;
    
    27
    +import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
    
    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 WeightCategoryLonglineUIHandler extends ContentReferenceUIHandler<WeightCategoryLonglineDto, WeightCategoryLonglineReference, WeightCategoryLonglineUI> implements UIHandler<WeightCategoryLonglineUI> {
    
    37
    +}

  • client/src/main/java/fr/ird/observe/client/ui/content/ref/longline/WeightCategoryLonglineUIModel.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.WeightCategoryLonglineDto;
    
    27
    +import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
    
    28
    +
    
    29
    +/**
    
    30
    + * Created on 9/28/14.
    
    31
    + *
    
    32
    + * @author Tony Chemit - dev@tchemit.fr
    
    33
    + * @since XXX
    
    34
    + */
    
    35
    +public class WeightCategoryLonglineUIModel extends ContentReferenceUIModel<WeightCategoryLonglineDto, WeightCategoryLonglineReference> {
    
    36
    +
    
    37
    +    private static final long serialVersionUID = 1L;
    
    38
    +
    
    39
    +    public WeightCategoryLonglineUIModel() {
    
    40
    +        super(WeightCategoryLonglineDto.class, WeightCategoryLonglineReference.class);
    
    41
    +    }
    
    42
    +
    
    43
    +}

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

  • dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
    ... ... @@ -203,6 +203,8 @@ import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
    203 203
     import fr.ird.observe.dto.referential.longline.VesselActivityLonglineReference;
    
    204 204
     import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    205 205
     import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodReference;
    
    206
    +import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
    
    207
    +import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
    
    206 208
     import fr.ird.observe.dto.referential.seine.DetectionModeDto;
    
    207 209
     import fr.ird.observe.dto.referential.seine.DetectionModeReference;
    
    208 210
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
    
    ... ... @@ -809,6 +811,11 @@ public class DecoratorService extends DecoratorProvider {
    809 811
             public void initWeightDeterminationMethodDto() {
    
    810 812
                 registerDefaultReferentialAndReferentialReferenceDecorator(WeightDeterminationMethodDto.class, WeightDeterminationMethodReference.class, libelle);
    
    811 813
             }
    
    814
    +        
    
    815
    +        @Override
    
    816
    +        public void initWeightCategoryLonglineDto() {
    
    817
    +            registerDefaultReferentialAndReferentialReferenceDecorator(WeightCategoryLonglineDto.class, WeightCategoryLonglineReference.class, libelle);
    
    818
    +        }
    
    812 819
     
    
    813 820
             @Override
    
    814 821
             public void initWindDto() {
    

  • dto/src/main/java/fr/ird/observe/spi/DtoModelClasses.java
    ... ... @@ -126,6 +126,7 @@ import fr.ird.observe.dto.referential.longline.SensorTypeDto;
    126 126
     import fr.ird.observe.dto.referential.longline.SettingShapeDto;
    
    127 127
     import fr.ird.observe.dto.referential.longline.StomacFullnessDto;
    
    128 128
     import fr.ird.observe.dto.referential.longline.VesselActivityLonglineDto;
    
    129
    +import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineDto;
    
    129 130
     import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    130 131
     import fr.ird.observe.dto.referential.seine.DetectionModeDto;
    
    131 132
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
    
    ... ... @@ -236,6 +237,7 @@ public class DtoModelClasses {
    236 237
                 StomacFullnessDto.class,
    
    237 238
                 ObservationTripTypeDto.class,
    
    238 239
                 VesselActivityLonglineDto.class,
    
    240
    +            WeightCategoryLonglineDto.class,
    
    239 241
                 WeightDeterminationMethodDto.class);
    
    240 242
     
    
    241 243
         public static final ImmutableSet<Class<? extends ReferentialDto>> REFERENTIAL_TYPES = ImmutableSet.<Class<? extends ReferentialDto>>builder()
    

  • 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.WeightCategoryLongline > referential.I18nReferential
    
    557
    +
    
    556 558
     referential.longline.WeightDeterminationMethod > referential.I18nReferential
    
    557 559
     
    
    558 560
     referential.seine.DetectionMode > 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.WeightCategoryLonglineDto.type=Weight category
    
    233
    +observe.common.WeightCategoryLonglineDto.types=Weight categories
    
    232 234
     observe.common.WeightDeterminationMethodDto.type=Weight determination method
    
    233 235
     observe.common.WeightDeterminationMethodDto.types=Weight determination methods
    
    234 236
     observe.common.WeightMeasureDto.title=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.WeightCategoryLonglineDto.type=Categoría de peso
    
    231
    +observe.common.WeightCategoryLonglineDto.types=Categorías de peso
    
    230 232
     observe.common.WeightDeterminationMethodDto.type=Weight determination method \#TODO
    
    231 233
     observe.common.WeightDeterminationMethodDto.types=Weight determination methods \#TODO
    
    232 234
     observe.common.WeightMeasureDto.title=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.WeightCategoryLonglineDto.type=Catégorie de poids
    
    233
    +observe.common.WeightCategoryLonglineDto.types=Catégories de poids
    
    232 234
     observe.common.WeightDeterminationMethodDto.type=Méthode d'estimation de poids
    
    233 235
     observe.common.WeightDeterminationMethodDto.types=Méthodes d'estimation de poids
    
    234 236
     observe.common.WeightMeasureDto.title=Mesures de poids
    

  • persistence/src/main/java/fr/ird/observe/binder/referential/longline/WeightCategoryLonglineEntityDtoBinder.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.WeightCategoryLonglineDto;
    
    28
    +import fr.ird.observe.entities.referentiel.longline.WeightCategoryLongline;
    
    29
    +
    
    30
    +/**
    
    31
    + * Created on 24/11/15.
    
    32
    + *
    
    33
    + * @author Tony Chemit - dev@tchemit.fr
    
    34
    + */
    
    35
    +public class WeightCategoryLonglineEntityDtoBinder extends ReferentialEntityDtoBinderSupport<WeightCategoryLonglineDto, WeightCategoryLongline> {
    
    36
    +
    
    37
    +    public WeightCategoryLonglineEntityDtoBinder() {
    
    38
    +        super(WeightCategoryLongline.class, WeightCategoryLonglineDto.class);
    
    39
    +    }
    
    40
    +
    
    41
    +    @Override
    
    42
    +    public void copyToEntity(ReferentialLocale referentialLocale, WeightCategoryLonglineDto dto, WeightCategoryLongline entity) {
    
    43
    +
    
    44
    +
    
    45
    +        copyDtoReferentialFieldsToEntity(dto, entity);
    
    46
    +        copyDtoI18nFieldsToEntity(dto, entity);
    
    47
    +
    
    48
    +    }
    
    49
    +
    
    50
    +    @Override
    
    51
    +    public void copyToDto(ReferentialLocale referentialLocale, WeightCategoryLongline entity, WeightCategoryLonglineDto 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/WeightCategoryLonglineEntityReferenceBinder.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.WeightCategoryLonglineDto;
    
    28
    +import fr.ird.observe.dto.referential.longline.WeightCategoryLonglineReference;
    
    29
    +import fr.ird.observe.entities.referentiel.longline.WeightCategoryLongline;
    
    30
    +
    
    31
    +/**
    
    32
    + * Created on 24/11/15.
    
    33
    + *
    
    34
    + * @author Tony Chemit - dev@tchemit.fr
    
    35
    + */
    
    36
    +public class WeightCategoryLonglineEntityReferenceBinder extends ReferentialEntityReferenceBinderSupport<WeightCategoryLonglineDto, WeightCategoryLonglineReference, WeightCategoryLongline> {
    
    37
    +
    
    38
    +    public WeightCategoryLonglineEntityReferenceBinder() {
    
    39
    +        super(WeightCategoryLonglineDto.class, WeightCategoryLonglineReference.class, WeightCategoryLongline.class);
    
    40
    +    }
    
    41
    +
    
    42
    +    @Override
    
    43
    +    public WeightCategoryLonglineReference toReference(ReferentialLocale referentialLocale, WeightCategoryLongline dto) {
    
    44
    +
    
    45
    +        return new WeightCategoryLonglineReference(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.WeightCategoryLongline,
    
    117 118
                         ObserveEntityEnum.WeightDeterminationMethod,
    
    118 119
                         ObserveEntityEnum.VesselActivityLongline
    
    119 120
                 };
    

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

  • 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.WeightCategoryLongline > referentiel.I18nReferentialEntity | entity dbName=WeightCategory
    
    659
    +
    
    658 660
     referentiel.longline.WeightDeterminationMethod > referentiel.I18nReferentialEntity | entity
    
    659 661
     
    
    660 662
     referentiel.seine.DetectionMode > referentiel.I18nReferentialEntity | entity
    

  • persistence/src/main/resources/db/migration/8.0/08_add_weight_category-common.sql
    1
    +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));
    
    2
    +ALTER TABLE observe_longline.WeightCategory ADD CONSTRAINT PK_WeightCategory PRIMARY KEY(topiaid);
    
    3
    +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
    ... ... @@ -109,6 +109,9 @@ public class UnidirectionalSynchronizeReferentialTest extends ServiceLocalTestSu
    109 109
                 if (ObserveEntityEnum.WeightDeterminationMethod.equals(referenceEntity)) {
    
    110 110
                     //empty
    
    111 111
                     continue;
    
    112
    +            }if (ObserveEntityEnum.WeightCategoryLongline.equals(referenceEntity)) {
    
    113
    +                //empty
    
    114
    +                continue;
    
    112 115
                 }
    
    113 116
                 Class<? extends ReferentialDto> dtoType = DbModelHelper.fromReferentialEntity(referenceEntity).toDtoType();
    
    114 117
                 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
    ... ... @@ -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, WeightDeterminationMethod
    
    150
    -        Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 2, types.size());
    
    149
    +        // no data of LengthLegnthParameter, WeightDeterminationMethod, WeightCategoryLongline
    
    150
    +        Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 3, 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
    -    private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 67;
    
    65
    +    private static final int ENTITY_BINDER_REFERENTIAL_COUNT = 68;
    
    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 = 192;
    
    71
    +    public static final int VALIDATORS_COUNT = 194;
    
    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", 105L)
    
    255
    +            .put("observe_common.lastupdatedate", 106L)
    
    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.weightcategory", 0L)
    
    326 327
                 .put("observe_longline.weightdeterminationmethod", 0L)
    
    327 328
                 .build();
    
    328 329
     
    

  • 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.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));
    
    78 79
     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));
    
    79 80
     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));
    
    80 81
     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
    ... ... @@ -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.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));
    
    78 79
     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));
    
    79 80
     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));
    
    80 81
     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
    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/WeightCategoryLonglineDto-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/WeightCategoryLonglineDto-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/WeightCategoryLonglineDto-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.WeightCategoryLonglineDto;
    
    116 117
     import fr.ird.observe.dto.referential.longline.WeightDeterminationMethodDto;
    
    117 118
     import fr.ird.observe.dto.referential.seine.DetectionModeDto;
    
    118 119
     import fr.ird.observe.dto.referential.seine.NonTargetCatchReleaseConformityDto;
    
    ... ... @@ -271,6 +272,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
    271 272
                     VesselSizeCategoryDto.class,
    
    272 273
                     VesselTypeDto.class,
    
    273 274
                     WeightCategoryDto.class,
    
    275
    +                WeightCategoryLonglineDto.class,
    
    274 276
                     WeightDeterminationMethodDto.class,
    
    275 277
                     WeightMeasureTypeDto.class,
    
    276 278
                     WindDto.class);
    
    ... ... @@ -388,6 +390,7 @@ public class BeanValidatorDetectorTest extends AbstractValidatorDetectorTest {
    388 390
                     VesselSizeCategoryDto.class,
    
    389 391
                     VesselTypeDto.class,
    
    390 392
                     WeightCategoryDto.class,
    
    393
    +                WeightCategoryLonglineDto.class,
    
    391 394
                     WeightDeterminationMethodDto.class,
    
    392 395
                     WeightMeasureTypeDto.class,
    
    393 396
                     WindDto.class);