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

Commits:

16 changed files:

Changes:

  • dto/src/main/i18n/getters/java.getter
    ... ... @@ -36,6 +36,12 @@ observe.common.SetLonglineDetailCompositionDto.type
    36 36
     observe.common.SetLonglineDto.type
    
    37 37
     observe.common.SetLonglineGlobalCompositionDto.type
    
    38 38
     observe.common.SetSeineDto.type
    
    39
    +observe.common.WithFormula.coefficients
    
    40
    +observe.common.WithFormula.coefficientsInformation
    
    41
    +observe.common.WithFormula.equation
    
    42
    +observe.common.WithFormula.source
    
    43
    +observe.common.WithFormula.speciesFaoCode
    
    44
    +observe.common.WithFormula.speciesLabel
    
    39 45
     observe.common.gps.activity
    
    40 46
     observe.common.gps.gpsPoint
    
    41 47
     observe.common.inconnu
    

  • dto/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterDtoReferenceBinder.java
    ... ... @@ -50,6 +50,7 @@ public class LengthLengthParameterDtoReferenceBinder extends ReferentialDtoRefer
    50 50
             return new LengthLengthParameterReference(dto,
    
    51 51
                                                       dto.getUri(),
    
    52 52
                                                       Optional.ofNullable(dto.getOcean()).map(OceanReference::getLabel).orElse(null),
    
    53
    +                                                  Optional.ofNullable(dto.getSpecies()).map(SpeciesReference::getFaoCode).orElse(null),
    
    53 54
                                                       Optional.ofNullable(dto.getSpecies()).map(SpeciesReference::getScientificLabel).orElse(null),
    
    54 55
                                                       Optional.ofNullable(dto.getSex()).map(SexReference::getLabel).orElse(null),
    
    55 56
                                                       dto.getStartDate(),
    

  • dto/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterDtoReferenceBinder.java
    ... ... @@ -49,6 +49,7 @@ public class LengthWeightParameterDtoReferenceBinder extends ReferentialDtoRefer
    49 49
             return new LengthWeightParameterReference(dto,
    
    50 50
                                                       dto.getUri(),
    
    51 51
                                                       Optional.ofNullable(dto.getOcean()).map(OceanReference::getLabel).orElse(null),
    
    52
    +                                                  Optional.ofNullable(dto.getSpecies()).map(SpeciesReference::getFaoCode).orElse(null),
    
    52 53
                                                       Optional.ofNullable(dto.getSpecies()).map(SpeciesReference::getScientificLabel).orElse(null),
    
    53 54
                                                       Optional.ofNullable(dto.getSex()).map(SexReference::getLabel).orElse(null),
    
    54 55
                                                       dto.getStartDate(),
    

  • dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
    ... ... @@ -561,13 +561,13 @@ public class DecoratorService extends DecoratorProvider {
    561 561
             @Override
    
    562 562
             public void initLengthLengthParameterDto() {
    
    563 563
                 registerDecorator(new LengthLengthParameterDecorator(libelle));
    
    564
    -            registerReferentialReferenceDecorator(LengthLengthParameterReference.class, "${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${inputSizeMeasureTypeCode}$s##${outputSizeMeasureTypeCode}$s");
    
    564
    +            registerReferentialReferenceDecorator(LengthLengthParameterReference.class, "${speciesFaoCode}$s##${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%5$tm/%5$tY##${endDate}$td/%6$tm/%6$tY##${inputSizeMeasureTypeCode}$s##${outputSizeMeasureTypeCode}$s");
    
    565 565
             }
    
    566 566
     
    
    567 567
             @Override
    
    568 568
             public void initLengthWeightParameterDto() {
    
    569 569
                 registerDecorator(new LengthWeightParameterDecorator(libelle));
    
    570
    -            registerReferentialReferenceDecorator(LengthWeightParameterReference.class, "${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${sizeMeasureTypeCode}$s");
    
    570
    +            registerReferentialReferenceDecorator(LengthWeightParameterReference.class, "${speciesFaoCode}$s##${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%5$tm/%5$tY##${endDate}$td/%6$tm/%6$tY##${sizeMeasureTypeCode}$s");
    
    571 571
             }
    
    572 572
     
    
    573 573
             @Override
    

  • dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java
    ... ... @@ -23,14 +23,21 @@ package fr.ird.observe.dto.decoration;
    23 23
      */
    
    24 24
     
    
    25 25
     import com.google.common.collect.ImmutableMap;
    
    26
    +import com.google.common.collect.ImmutableSet;
    
    26 27
     import fr.ird.observe.dto.IdDto;
    
    27 28
     import fr.ird.observe.dto.IdHelper;
    
    28 29
     import fr.ird.observe.dto.data.DataDto;
    
    29 30
     import fr.ird.observe.dto.referential.I18nReferentialDto;
    
    31
    +import fr.ird.observe.dto.referential.LengthLengthParameterDto;
    
    32
    +import fr.ird.observe.dto.referential.LengthLengthParameterReference;
    
    30 33
     import fr.ird.observe.dto.referential.ReferentialDto;
    
    34
    +import fr.ird.observe.dto.referential.SpeciesDto;
    
    35
    +import fr.ird.observe.dto.referential.WithFormula;
    
    31 36
     import io.ultreia.java4all.i18n.spi.bean.BeanPropertyI18nKeyProducerSupport;
    
    37
    +import org.apache.commons.lang3.StringUtils;
    
    32 38
     
    
    33 39
     import java.util.Map;
    
    40
    +import java.util.Objects;
    
    34 41
     
    
    35 42
     import static io.ultreia.java4all.i18n.I18n.n;
    
    36 43
     
    
    ... ... @@ -84,11 +91,26 @@ public class ObserveI18nLabelsBuilder extends BeanPropertyI18nKeyProducerSupport
    84 91
             n("observe.common.ReferentialDto.uri");
    
    85 92
             n("observe.common.SetLonglineGlobalCompositionDto.type");
    
    86 93
             n("observe.common.SetLonglineDetailCompositionDto.type");
    
    94
    +
    
    95
    +        n("observe.common.WithFormula.equation");
    
    96
    +        n("observe.common.WithFormula.coefficients");
    
    97
    +        n("observe.common.WithFormula.coefficientsInformation");
    
    98
    +        n("observe.common.WithFormula.source");
    
    99
    +        n("observe.common.WithFormula.speciesLabel");
    
    100
    +        n("observe.common.WithFormula.speciesFaoCode");
    
    87 101
         }
    
    88 102
     
    
    89
    -    public ObserveI18nLabelsBuilder() {
    
    103
    +    ObserveI18nLabelsBuilder() {
    
    90 104
             super(ObserveI18nDecoratorHelper.OBSERVE_COMMON_PREFIX);
    
    91 105
         }
    
    106
    +    @Override
    
    107
    +    protected Map<String, String> createPropertyKeyMapping() {
    
    108
    +        return ImmutableMap.<String, String>builder()
    
    109
    +                .put("sizeMeasureTypeCode", "sizeMeasureType")
    
    110
    +                .put("inputSizeMeasureTypeCode", "inputSizeMeasureType")
    
    111
    +                .put("outputSizeMeasureTypeCode", "outputSizeMeasureType")
    
    112
    +                .build();
    
    113
    +    }
    
    92 114
     
    
    93 115
         @Override
    
    94 116
         protected Map<String, String> createMapping() {
    
    ... ... @@ -141,11 +163,35 @@ public class ObserveI18nLabelsBuilder extends BeanPropertyI18nKeyProducerSupport
    141 163
                     .put("traceCutOff", DataDto.class.getSimpleName() + ".")
    
    142 164
                     .put("baitHaulingStatus", DataDto.class.getSimpleName() + ".")
    
    143 165
     
    
    166
    +                .put("coefficientsInformation", WithFormula.class.getSimpleName() + ".")
    
    167
    +                .put(WithFormula.PROPERTY_COEFFICIENTS, WithFormula.class.getSimpleName() + ".")
    
    168
    +                .put("equation", WithFormula.class.getSimpleName() + ".")
    
    169
    +                .put(WithFormula.PROPERTY_SOURCE, WithFormula.class.getSimpleName() + ".")
    
    170
    +
    
    171
    +                .put("speciesLabel", WithFormula.class.getSimpleName() + ".")
    
    172
    +                .put("speciesFaoCode", WithFormula.class.getSimpleName() + ".")
    
    173
    +
    
    144 174
                     .build();
    
    145 175
         }
    
    146 176
     
    
    177
    +    private static final ImmutableSet<String> SKIP_LABEL = ImmutableSet.of(
    
    178
    +            "speciesLabel",
    
    179
    +            "scientificLabel",
    
    180
    +            "capacityLabel",
    
    181
    +            "gaugeLabel"
    
    182
    +    );
    
    183
    +
    
    184
    +    @Override
    
    185
    +    public String getPropertyMapping(String property) {
    
    186
    +        if (Objects.requireNonNull(property).endsWith("Label") && !SKIP_LABEL.contains(property)) {
    
    187
    +            property = StringUtils.removeEnd(property, "Label");
    
    188
    +        }
    
    189
    +        return super.getPropertyMapping(property);
    
    190
    +    }
    
    191
    +
    
    147 192
         @Override
    
    148 193
         public String getI18nTypeKey(Class type) {
    
    149 194
             return IdHelper.getDtoShortName(type) + "Dto";
    
    150 195
         }
    
    196
    +
    
    151 197
     }

  • dto/src/main/java/fr/ird/observe/dto/referential/LengthLengthParameterReference.java
    ... ... @@ -28,8 +28,8 @@ import java.util.Date;
    28 28
     
    
    29 29
     public class LengthLengthParameterReference extends GeneratedLengthLengthParameterReference implements WithStartEndDate {
    
    30 30
     
    
    31
    -    public LengthLengthParameterReference(ReferentialDtoReferenceAware dto, String uri, String oceanLabel, String speciesLabel, String sexLabel, Date startDate, Date endDate, String inputSizeMeasureTypeCode, String inputSizeMeasureTypeLabel, String outputSizeMeasureTypeCode, String outputSizeMeasureTypeLabel, String inputOutputFormula, String outputInputFormula) {
    
    32
    -        super(dto, uri, oceanLabel, speciesLabel, sexLabel, startDate, endDate, inputSizeMeasureTypeCode, inputSizeMeasureTypeLabel, outputSizeMeasureTypeCode, outputSizeMeasureTypeLabel, inputOutputFormula, outputInputFormula);
    
    31
    +    public LengthLengthParameterReference(ReferentialDtoReferenceAware dto, String uri, String oceanLabel, String speciesFaoCode, String speciesLabel, String sexLabel, Date startDate, Date endDate, String inputSizeMeasureTypeCode, String inputSizeMeasureTypeLabel, String outputSizeMeasureTypeCode, String outputSizeMeasureTypeLabel, String inputOutputFormula, String outputInputFormula) {
    
    32
    +        super(dto, uri, oceanLabel, speciesFaoCode, speciesLabel, sexLabel, startDate, endDate, inputSizeMeasureTypeCode, inputSizeMeasureTypeLabel, outputSizeMeasureTypeCode, outputSizeMeasureTypeLabel, inputOutputFormula, outputInputFormula);
    
    33 33
         }
    
    34 34
     
    
    35 35
     }

  • dto/src/main/java/fr/ird/observe/dto/referential/LengthWeightParameterReference.java
    ... ... @@ -28,8 +28,8 @@ import java.util.Date;
    28 28
     
    
    29 29
     public class LengthWeightParameterReference extends GeneratedLengthWeightParameterReference implements WithStartEndDate {
    
    30 30
     
    
    31
    -    public LengthWeightParameterReference(ReferentialDtoReferenceAware dto, String uri, String oceanLabel, String speciesLabel, String sexLabel, Date startDate, Date endDate, String lengthWeightFormula, String weightLengthFormula, String sizeMeasureTypeCode) {
    
    32
    -        super(dto, uri, oceanLabel, speciesLabel, sexLabel, startDate, endDate, lengthWeightFormula, weightLengthFormula, sizeMeasureTypeCode);
    
    31
    +    public LengthWeightParameterReference(ReferentialDtoReferenceAware dto, String uri, String oceanLabel, String speciesFaoCode, String speciesLabel, String sexLabel, Date startDate, Date endDate, String lengthWeightFormula, String weightLengthFormula, String sizeMeasureTypeCode) {
    
    32
    +        super(dto, uri, oceanLabel, speciesFaoCode,speciesLabel, sexLabel, startDate, endDate, lengthWeightFormula, weightLengthFormula, sizeMeasureTypeCode);
    
    33 33
     }
    
    34 34
     
    
    35 35
     }

  • dto/src/main/java/fr/ird/observe/dto/referential/PersonHelper.java
    ... ... @@ -25,40 +25,20 @@ package fr.ird.observe.dto.referential;
    25 25
     
    
    26 26
     import java.util.Collection;
    
    27 27
     import java.util.List;
    
    28
    -import java.util.Objects;
    
    29
    -import java.util.function.Predicate;
    
    30 28
     import java.util.stream.Collectors;
    
    31 29
     
    
    32 30
     public class PersonHelper extends GeneratedPersonHelper {
    
    33 31
     
    
    34 32
         public static List<PersonReference> filterCaptainReferences(Collection<PersonReference> incoming) {
    
    35
    -        return incoming.stream().filter(newCaptainReferencePredicate()).collect(Collectors.toList());
    
    33
    +        return incoming.stream().filter(PersonReference::isCaptain).collect(Collectors.toList());
    
    36 34
         }
    
    37 35
     
    
    38 36
         public static List<PersonReference> filterObserverReferences(Collection<PersonReference> incoming) {
    
    39
    -        return incoming.stream().filter(newObserverReferencePredicate()).collect(Collectors.toList());
    
    37
    +        return incoming.stream().filter(PersonReference::isObserver).collect(Collectors.toList());
    
    40 38
         }
    
    41 39
     
    
    42 40
         public static List<PersonReference> filterDataEntryOperatorReferences(Collection<PersonReference> incoming) {
    
    43
    -        return incoming.stream().filter(newDataEntryOperatorReferencePredicate()).collect(Collectors.toList());
    
    44
    -    }
    
    45
    -
    
    46
    -    public static Predicate<PersonReference> newCaptainReferencePredicate() {
    
    47
    -        return input -> input.getPropertyNames().contains(PersonDto.PROPERTY_CAPTAIN)
    
    48
    -                && Objects.equals(true, input.isCaptain());
    
    49
    -
    
    50
    -    }
    
    51
    -
    
    52
    -    public static Predicate<PersonReference> newDataEntryOperatorReferencePredicate() {
    
    53
    -        return input -> input.getPropertyNames().contains(PersonDto.PROPERTY_DATA_ENTRY_OPERATOR)
    
    54
    -                && Objects.equals(true, input.isDataEntryOperator());
    
    55
    -
    
    56
    -    }
    
    57
    -
    
    58
    -    public static Predicate<PersonReference> newObserverReferencePredicate() {
    
    59
    -        return input -> input.getPropertyNames().contains(PersonDto.PROPERTY_OBSERVER)
    
    60
    -                && Objects.equals(true, input.isObserver());
    
    61
    -
    
    41
    +        return incoming.stream().filter(PersonReference::isDataEntryOperator).collect(Collectors.toList());
    
    62 42
         }
    
    63 43
     
    
    64 44
         public static String getNames(PersonDto person) {
    

  • dto/src/main/models/Observe.model
    ... ... @@ -385,7 +385,7 @@ longitude + {*:1} Float
    385 385
     quadrant + {*:1} Integer
    
    386 386
     country {*:0..1} fr.ird.observe.dto.referential.CountryReference
    
    387 387
     
    
    388
    -referential.LengthLengthParameter > referential.LengthFormulaSupport | references=uri,oceanLabel,speciesLabel,sexLabel,startDate,endDate,inputSizeMeasureTypeCode,inputSizeMeasureTypeLabel,outputSizeMeasureTypeCode,outputSizeMeasureTypeLabel,inputOutputFormula,outputInputFormula
    
    388
    +referential.LengthLengthParameter > referential.LengthFormulaSupport | references=uri,oceanLabel,speciesFaoCode,speciesLabel,sexLabel,startDate,endDate,inputSizeMeasureTypeCode,inputSizeMeasureTypeLabel,outputSizeMeasureTypeCode,outputSizeMeasureTypeLabel,inputOutputFormula,outputInputFormula
    
    389 389
     inputOutputFormula + {*:1} String
    
    390 390
     inputOutputFormulaValid + {*:1} boolean
    
    391 391
     outputInputFormula + {*:1} String
    
    ... ... @@ -393,7 +393,7 @@ outputInputFormulaValid + {*:1} boolean
    393 393
     inputSizeMeasureType {*:1} fr.ird.observe.dto.referential.SizeMeasureTypeReference
    
    394 394
     outputSizeMeasureType {*:1} fr.ird.observe.dto.referential.SizeMeasureTypeReference
    
    395 395
     
    
    396
    -referential.LengthWeightParameter > referential.LengthFormulaSupport | references=uri,oceanLabel,speciesLabel,sexLabel,startDate,endDate,lengthWeightFormula,weightLengthFormula,sizeMeasureTypeCode
    
    396
    +referential.LengthWeightParameter > referential.LengthFormulaSupport | references=uri,oceanLabel,speciesFaoCode,speciesLabel,sexLabel,startDate,endDate,lengthWeightFormula,weightLengthFormula,sizeMeasureTypeCode
    
    397 397
     lengthWeightFormula + {*:1} String
    
    398 398
     weightLengthFormula + {*:1} String
    
    399 399
     meanLength + {*:1} Float
    

  • observe-i18n/src/main/i18n/translations/observe_en_GB.properties
    ... ... @@ -1627,6 +1627,8 @@ observe.common.WithFormula.coefficients=Coefficients
    1627 1627
     observe.common.WithFormula.coefficientsInformation=Coefficients of relations msut follow the syntax name\=value and are separated by \: (example \: a\=1\:b\=2\:c\=3)
    
    1628 1628
     observe.common.WithFormula.equation=Equation
    
    1629 1629
     observe.common.WithFormula.source=Source
    
    1630
    +observe.common.WithFormula.speciesFaoCode=Species - FAO Code
    
    1631
    +observe.common.WithFormula.speciesLabel=Species - Scientific label
    
    1630 1632
     observe.common.acquisitionMode=Acquisition mode
    
    1631 1633
     observe.common.action.moveCatchDown=Move down
    
    1632 1634
     observe.common.action.moveCatchDown.tip=Move down the catch
    

  • observe-i18n/src/main/i18n/translations/observe_es_ES.properties
    ... ... @@ -1627,6 +1627,8 @@ observe.common.WithFormula.coefficients=Coeficientes
    1627 1627
     observe.common.WithFormula.coefficientsInformation=Los coeficientes de relaciones son de la forma texto\=valor y están separados por \: (ejemplo \: a\=1\:b\=2\:c\=3)
    
    1628 1628
     observe.common.WithFormula.equation=Relación talla-peso
    
    1629 1629
     observe.common.WithFormula.source=Fuente
    
    1630
    +observe.common.WithFormula.speciesFaoCode=Especie - Codigo FAO
    
    1631
    +observe.common.WithFormula.speciesLabel=Especie - Texto científico
    
    1630 1632
     observe.common.acquisitionMode=Modo de entrada de datos
    
    1631 1633
     observe.common.action.moveCatchDown=Descender
    
    1632 1634
     observe.common.action.moveCatchDown.tip=Descender la captura
    

  • observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
    ... ... @@ -1627,6 +1627,8 @@ observe.common.WithFormula.coefficients=Coefficients
    1627 1627
     observe.common.WithFormula.coefficientsInformation=Les coefficients des relations sont de la forme nom\=valeur et sont séparé par des \: (exemple \: a\=1\:b\=2\:c\=3)
    
    1628 1628
     observe.common.WithFormula.equation=Relation Taille-Poids
    
    1629 1629
     observe.common.WithFormula.source=Source
    
    1630
    +observe.common.WithFormula.speciesFaoCode=Espèce - Code FAO
    
    1631
    +observe.common.WithFormula.speciesLabel=Espèce - Libéllé scientifique
    
    1630 1632
     observe.common.acquisitionMode=Mode de saisie
    
    1631 1633
     observe.common.action.moveCatchDown=Descendre
    
    1632 1634
     observe.common.action.moveCatchDown.tip=Descendre la capture
    

  • persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterEntityReferenceBinder.java
    ... ... @@ -47,6 +47,7 @@ public class LengthLengthParameterEntityReferenceBinder extends ReferentialEntit
    47 47
             return new LengthLengthParameterReference(dto,
    
    48 48
                                                       dto.getUri(),
    
    49 49
                                                       dto.getOcean().getLabel(referentialLocale),
    
    50
    +                                                  dto.getSpecies().getFaoCode(),
    
    50 51
                                                       dto.getSpecies().getScientificLabel(),
    
    51 52
                                                       dto.getSex().getLabel(referentialLocale),
    
    52 53
                                                       dto.getStartDate(),
    

  • persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterEntityReferenceBinder.java
    ... ... @@ -48,6 +48,7 @@ public class LengthWeightParameterEntityReferenceBinder extends ReferentialEntit
    48 48
             return new LengthWeightParameterReference(dto,
    
    49 49
                                                       dto.getUri(),
    
    50 50
                                                       dto.getOcean().getLabel(referentialLocale),
    
    51
    +                                                  dto.getSpecies().getFaoCode(),
    
    51 52
                                                       dto.getSpecies().getScientificLabel(),
    
    52 53
                                                       dto.getSex().getLabel(referentialLocale),
    
    53 54
                                                       dto.getStartDate(),
    

  • pom.xml
    ... ... @@ -26,7 +26,7 @@
    26 26
       <parent>
    
    27 27
         <groupId>io.ultreia.maven</groupId>
    
    28 28
         <artifactId>pom</artifactId>
    
    29
    -    <version>2019.8.18</version>
    
    29
    +    <version>2019.8.22</version>
    
    30 30
       </parent>
    
    31 31
     
    
    32 32
       <groupId>fr.ird.observe</groupId>
    
    ... ... @@ -163,7 +163,7 @@
    163 163
         <!--can't use 1.4.197 (date has changed + blob also-->
    
    164 164
         <lib.version.h2>1.4.196</lib.version.h2>
    
    165 165
         <lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene>
    
    166
    -    <lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx>
    
    166
    +    <!--lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx-->
    
    167 167
         <!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>-->
    
    168 168
         <lib.version.java4all.topia>1.1.14</lib.version.java4all.topia>
    
    169 169
     
    

  • validation/src/main/i18n/getters/validation-fields.getter
    ... ... @@ -254,3 +254,4 @@ observe.common.VesselSizeCategoryDto.capacityLabel
    254 254
     observe.common.VesselSizeCategoryDto.gaugeLabel
    
    255 255
     observe.common.WindDto.speedRange
    
    256 256
     observe.common.WindDto.waveHeight
    
    257
    +observe.common.WithFormula.coefficients