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

Commits:

9 changed files:

Changes:

  • client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/referential/common/SpeciesFateUI.jaxx
    ... ... @@ -25,6 +25,7 @@
    25 25
         fr.ird.observe.dto.referential.ps.common.SpeciesFateDto
    
    26 26
         fr.ird.observe.dto.referential.ps.common.SpeciesFateReference
    
    27 27
         io.ultreia.java4all.jaxx.widgets.choice.BooleanEditor
    
    28
    +    io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
    
    28 29
       </import>
    
    29 30
       <BeanValidator id='validator' autoField='true' context='create' errorTableModel='{getErrorTableModel()}'
    
    30 31
                      beanClass='fr.ird.observe.dto.referential.ps.common.SpeciesFateDto'/>
    
    ... ... @@ -44,7 +45,7 @@
    44 45
             <JLabel id='weightRangeAllowedLabel'/>
    
    45 46
           </cell>
    
    46 47
           <cell anchor='east' weightx="1" fill="both">
    
    47
    -        <BooleanEditor id='weightRangeAllowed'/>
    
    48
    +        <BeanCheckBox id='weightRangeAllowed' styleClass="skipI18n"/>
    
    48 49
           </cell>
    
    49 50
         </row>
    
    50 51
       </Table>
    

  • core/api/dto/src/main/i18n/getters/java.getter
    1 1
     boolean.false
    
    2
    +boolean.null
    
    2 3
     boolean.true
    
    3 4
     observe.Common.haulingIdentifier
    
    4 5
     observe.Common.ocean
    
    ... ... @@ -63,3 +64,5 @@ observe.referential.common.Vessel.flagCountry
    63 64
     observe.referential.common.Vessel.fleetCountry
    
    64 65
     observe.referential.ps.common.AcquisitionStatus.fieldDisabled
    
    65 66
     observe.referential.ps.common.AcquisitionStatus.fieldEnabled
    
    67
    +observe.referential.ps.common.SpeciesFate.discardLabel
    
    68
    +observe.referential.ps.common.SpeciesFate.weightRangeAllowedLabel

  • core/api/dto/src/main/java/fr/ird/observe/spi/decoration/ObserveDefaultDecoratorRenderer.java
    ... ... @@ -26,6 +26,8 @@ import io.ultreia.java4all.i18n.I18n;
    26 26
     
    
    27 27
     import java.util.Locale;
    
    28 28
     
    
    29
    +import static io.ultreia.java4all.i18n.I18n.t;
    
    30
    +
    
    29 31
     /**
    
    30 32
      * Created on 19/10/2021.
    
    31 33
      *
    
    ... ... @@ -51,4 +53,20 @@ public interface ObserveDefaultDecoratorRenderer {
    51 53
         default String fieldEnabler(Locale locale, boolean fieldEnabler) {
    
    52 54
             return fieldEnabler ? I18n.l(locale, "observe.referential.ps.common.AcquisitionStatus.fieldEnabled") : I18n.l(locale, "observe.referential.ps.common.AcquisitionStatus.fieldDisabled");
    
    53 55
         }
    
    56
    +
    
    57
    +
    
    58
    +    default String speciesFateDiscard(Locale locale, Boolean discard) {
    
    59
    +        String value;
    
    60
    +        if (discard==null) {
    
    61
    +            value = t("boolean.null");
    
    62
    +        } else {
    
    63
    +            value = discard ? t("boolean.true") : t("boolean.false");
    
    64
    +        }
    
    65
    +        return I18n.l(locale, "observe.referential.ps.common.SpeciesFate.discardLabel", value);
    
    66
    +    }
    
    67
    +
    
    68
    +    default String speciesFateWeightRangeAllowed(Locale locale, boolean weightRangeAllowed) {
    
    69
    +        String value = weightRangeAllowed ? t("boolean.true") : t("boolean.false");
    
    70
    +        return I18n.l(locale, "observe.referential.ps.common.SpeciesFate.weightRangeAllowedLabel", value);
    
    71
    +    }
    
    54 72
     }

  • core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/DiscardedTargetCatchRecord.java
    ... ... @@ -53,26 +53,23 @@ public class DiscardedTargetCatchRecord {
    53 53
         private final String well;
    
    54 54
         private final long setIdx;
    
    55 55
         private final String weightMeasureMethodId;
    
    56
    -    //FIXME We are not using this value ?
    
    57
    -    private final boolean targetdiscardcatchcompositionestimatedbyobserver;
    
    58 56
     
    
    59 57
         public static PreparedStatement prepareStatement(Connection connection) throws SQLException {
    
    60 58
             return connection.prepareStatement("SELECT" +
    
    61
    -                                                   " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," +
    
    62
    -                                                   " tc.topiaVersion + 1," +
    
    63
    -                                                   " tc.topiaCreateDate," +
    
    64
    -                                                   " tc.homeId," +
    
    65
    -                                                   " tc.catchWeight," +
    
    66
    -                                                   " tc.weightCategory," +
    
    67
    -                                                   " tc.comment," +
    
    68
    -                                                   " tc.reasonForDiscard," +
    
    69
    -                                                   " tc.set," +
    
    70
    -                                                   " tc.lastUpdateDate," +
    
    71
    -                                                   " tc.well," +
    
    72
    -                                                   " -tc.set_idx," +
    
    73
    -                                                   " tc.weightMeasureMethod," +
    
    74
    -                                                   " s.targetdiscardcatchcompositionestimatedbyobserver " +
    
    75
    -                                                   " FROM ps_observation.TargetCatch tc INNER JOIN ps_observation.set s on s.topiaId = tc.set" +
    
    59
    +                                     /* 01 */      " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," +
    
    60
    +                                     /* 02 */      " tc.topiaVersion + 1," +
    
    61
    +                                     /* 03 */      " tc.topiaCreateDate," +
    
    62
    +                                     /* 04 */      " tc.homeId," +
    
    63
    +                                     /* 05 */      " tc.catchWeight," +
    
    64
    +                                     /* 06 */      " tc.weightCategory," +
    
    65
    +                                     /* 07 */      " tc.comment," +
    
    66
    +                                     /* 08 */      " tc.reasonForDiscard," +
    
    67
    +                                     /* 09 */      " tc.set," +
    
    68
    +                                     /* 10 */      " tc.lastUpdateDate," +
    
    69
    +                                     /* 11 */      " tc.well," +
    
    70
    +                                     /* 12 */      " -tc.set_idx," +
    
    71
    +                                     /* 13 */      " tc.weightMeasureMethod" +
    
    72
    +                                                   " FROM ps_observation.TargetCatch tc" +
    
    76 73
                                                        " WHERE tc.discarded");
    
    77 74
         }
    
    78 75
     
    
    ... ... @@ -90,7 +87,6 @@ public class DiscardedTargetCatchRecord {
    90 87
             this.well = resultSet.getString(11);
    
    91 88
             this.setIdx = resultSet.getLong(12);
    
    92 89
             this.weightMeasureMethodId = resultSet.getString(13);
    
    93
    -        this.targetdiscardcatchcompositionestimatedbyobserver = resultSet.getBoolean(14);
    
    94 90
         }
    
    95 91
     
    
    96 92
         public String toCatchSql(Map<String, WeightCategoryRecord> weightCategoryRecordById, Function<String, String> commentFormat) {
    

  • core/persistence/resources/src/main/java/fr/ird/observe/spi/migration/v9/NotDiscardedTargetCatchRecord.java
    ... ... @@ -42,22 +42,21 @@ class NotDiscardedTargetCatchRecord {
    42 42
     
    
    43 43
         public static PreparedStatement prepareStatement(Connection connection) throws SQLException {
    
    44 44
             return connection.prepareStatement("SELECT" +
    
    45
    -                                                   " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," +
    
    46
    -                                                   " tc.topiaVersion + 1," +
    
    47
    -                                                   " tc.topiaCreateDate," +
    
    48
    -                                                   " tc.homeId," +
    
    49
    -                                                   " tc.catchWeight," +
    
    50
    -                                                   " tc.weightCategory," +
    
    51
    -                                                   " tc.comment," +
    
    52
    -                                                   " tc.reasonForDiscard," +
    
    53
    -                                                   " tc.set," +
    
    54
    -                                                   " tc.lastUpdateDate," +
    
    55
    -                                                   " tc.well," +
    
    56
    -                                                   " -tc.set_idx," +
    
    57
    -                                                   " tc.weightMeasureMethod," +
    
    58
    -                                                   " s.targetcatchcompositionestimatedbyobserver " +
    
    45
    +                                       /* 01 */    " REPLACE(tc.topiaId, '.TargetCatch', '.Catch')," +
    
    46
    +                                       /* 02 */    " tc.topiaVersion + 1," +
    
    47
    +                                       /* 03 */    " tc.topiaCreateDate," +
    
    48
    +                                       /* 04 */    " tc.homeId," +
    
    49
    +                                       /* 05 */    " tc.catchWeight," +
    
    50
    +                                       /* 06 */    " tc.weightCategory," +
    
    51
    +                                       /* 07 */    " tc.comment," +
    
    52
    +                                       /* 08 */    " tc.set," +
    
    53
    +                                       /* 09 */    " tc.lastUpdateDate," +
    
    54
    +                                       /* 10 */    " tc.well," +
    
    55
    +                                       /* 11 */    " -tc.set_idx," +
    
    56
    +                                       /* 12 */    " tc.weightMeasureMethod," +
    
    57
    +                                       /* 13 */    " s.targetcatchcompositionestimatedbyobserver " +
    
    59 58
                                                        " FROM ps_observation.TargetCatch tc INNER JOIN ps_observation.set s on s.topiaId = tc.set" +
    
    60
    -                                                   " WHERE NOT tc.discarded AND weightCategory IS NOT NULL AND catchweight IS NOT NULL AND well IS NOT NULL AND broughtondeck IS NOT NULL AND reasonfordiscard IS NOT NULL");
    
    59
    +                                                   " WHERE NOT tc.discarded AND NOT ( weightCategory IS NULL AND catchweight IS NULL AND well IS NULL AND broughtondeck IS NULL AND reasonfordiscard IS NULL )");
    
    61 60
         }
    
    62 61
     
    
    63 62
         private final String id;
    
    ... ... @@ -72,7 +71,7 @@ class NotDiscardedTargetCatchRecord {
    72 71
         private final String well;
    
    73 72
         private final long setIdx;
    
    74 73
         private final String weightMeasureMethodId;
    
    75
    -    private final boolean targetcatchcompositionestimatedbyobserver;
    
    74
    +    private final boolean targetCatchCompositionEstimatedByObserver;
    
    76 75
     
    
    77 76
         public NotDiscardedTargetCatchRecord(ResultSet resultSet) throws SQLException {
    
    78 77
             this.id = resultSet.getString(1);
    
    ... ... @@ -87,7 +86,7 @@ class NotDiscardedTargetCatchRecord {
    87 86
             this.well = resultSet.getString(10);
    
    88 87
             this.setIdx = resultSet.getLong(11);
    
    89 88
             this.weightMeasureMethodId = resultSet.getString(12);
    
    90
    -        this.targetcatchcompositionestimatedbyobserver = resultSet.getBoolean(13);
    
    89
    +        this.targetCatchCompositionEstimatedByObserver = resultSet.getBoolean(13);
    
    91 90
         }
    
    92 91
     
    
    93 92
         public String toCatchSql(Map<String, WeightCategoryRecord> weightCategoryRecordById, Function<String, String> commentFormat) {
    
    ... ... @@ -149,7 +148,7 @@ class NotDiscardedTargetCatchRecord {
    149 148
                     /*15*/         DataDtoEntityContext.escapeString(well),
    
    150 149
                     /*16*/         setIdx,
    
    151 150
                     /*17*/         DataDtoEntityContext.escapeString(weightMeasureMethodId == null ? "fr.ird.referential.common.WeightMeasureMethod#666#03" : weightCategoryId),
    
    152
    -                /*18*/         DataDtoEntityContext.escapeString(targetcatchcompositionestimatedbyobserver ? DataSourceMigrationForVersion_9_0.INFORMATION_SOURCE_P : DataSourceMigrationForVersion_9_0.INFORMATION_SOURCE_U)
    
    151
    +                /*18*/         DataDtoEntityContext.escapeString(targetCatchCompositionEstimatedByObserver ? DataSourceMigrationForVersion_9_0.INFORMATION_SOURCE_P : DataSourceMigrationForVersion_9_0.INFORMATION_SOURCE_U)
    
    153 152
             );
    
    154 153
         }
    
    155 154
     
    

  • core/services/i18n/src/main/i18n/translations/services_en_GB.properties
    ... ... @@ -1702,9 +1702,11 @@ observe.referential.ps.common.SampleType.logbook=Allow in logbook
    1702 1702
     observe.referential.ps.common.SampleType.type=Sample type
    
    1703 1703
     observe.referential.ps.common.SampleType.validation.atLeastOneSelected=At least one domain must be selected.
    
    1704 1704
     observe.referential.ps.common.SchoolType.type=School type
    
    1705
    -observe.referential.ps.common.SpeciesFate.discard=Discard ?
    
    1705
    +observe.referential.ps.common.SpeciesFate.discard=Discard?
    
    1706
    +observe.referential.ps.common.SpeciesFate.discardLabel=Discard\: %s
    
    1706 1707
     observe.referential.ps.common.SpeciesFate.type=Species fate
    
    1707
    -observe.referential.ps.common.SpeciesFate.weightRangeAllowed=Weight range allowed in catches
    
    1708
    +observe.referential.ps.common.SpeciesFate.weightRangeAllowed=Individual weight range allowed?
    
    1709
    +observe.referential.ps.common.SpeciesFate.weightRangeAllowedLabel=Individuals' weight range allowed\: %s
    
    1708 1710
     observe.referential.ps.common.TransmittingBuoyOperation.type=Transmitting buoy operation
    
    1709 1711
     observe.referential.ps.common.TransmittingBuoyOwnership.type=Transmitting buoy ownership
    
    1710 1712
     observe.referential.ps.common.TransmittingBuoyType.technology=Technologies
    

  • core/services/i18n/src/main/i18n/translations/services_es_ES.properties
    ... ... @@ -1702,9 +1702,11 @@ observe.referential.ps.common.SampleType.logbook=Allow in logbook
    1702 1702
     observe.referential.ps.common.SampleType.type=Sample type \#TODO
    
    1703 1703
     observe.referential.ps.common.SampleType.validation.atLeastOneSelected=At least one domain must be selected.
    
    1704 1704
     observe.referential.ps.common.SchoolType.type=Tipo de banco
    
    1705
    -observe.referential.ps.common.SpeciesFate.discard=Rejeté ? \#TODO
    
    1705
    +observe.referential.ps.common.SpeciesFate.discard=Rejeté? \#TODO
    
    1706
    +observe.referential.ps.common.SpeciesFate.discardLabel=Discard\: %s
    
    1706 1707
     observe.referential.ps.common.SpeciesFate.type=Futuro de la especie
    
    1707
    -observe.referential.ps.common.SpeciesFate.weightRangeAllowed=Weight range allowed in catches
    
    1708
    +observe.referential.ps.common.SpeciesFate.weightRangeAllowed=Individual weight range allowed?
    
    1709
    +observe.referential.ps.common.SpeciesFate.weightRangeAllowedLabel=Individuals' weight range allowed\: %s
    
    1708 1710
     observe.referential.ps.common.TransmittingBuoyOperation.type=Operación baliza
    
    1709 1711
     observe.referential.ps.common.TransmittingBuoyOwnership.type=Pertenece de baliza
    
    1710 1712
     observe.referential.ps.common.TransmittingBuoyType.technology=Tecnologías
    

  • core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
    ... ... @@ -1703,8 +1703,10 @@ observe.referential.ps.common.SampleType.type=Type d'échantillon
    1703 1703
     observe.referential.ps.common.SampleType.validation.atLeastOneSelected=Veuillez sélectionner au moins un sous domaine
    
    1704 1704
     observe.referential.ps.common.SchoolType.type=Type de banc
    
    1705 1705
     observe.referential.ps.common.SpeciesFate.discard=Rejeté ?
    
    1706
    +observe.referential.ps.common.SpeciesFate.discardLabel=Rejeté \: %s
    
    1706 1707
     observe.referential.ps.common.SpeciesFate.type=Devenir espèce
    
    1707
    -observe.referential.ps.common.SpeciesFate.weightRangeAllowed=Intervalle de poids autorisé dans les captures
    
    1708
    +observe.referential.ps.common.SpeciesFate.weightRangeAllowed=Plage de poids individuel autorisée ?
    
    1709
    +observe.referential.ps.common.SpeciesFate.weightRangeAllowedLabel=Plage de poids individuel autorisée \: %s
    
    1708 1710
     observe.referential.ps.common.TransmittingBuoyOperation.type=Opération balise
    
    1709 1711
     observe.referential.ps.common.TransmittingBuoyOwnership.type=Appartenance balise
    
    1710 1712
     observe.referential.ps.common.TransmittingBuoyType.technology=Technologies
    

  • model/src/main/models/Observe/dto/class/decorator.properties
    ... ... @@ -114,6 +114,6 @@ referential.common.Wind=${code}##${this::label}##${this::speedRange}##${this::sw
    114 114
     referential.ll.observation.SensorBrand=${code}##${brandName}
    
    115 115
     referential.ps.common.AcquisitionStatus=${code}##${this::label}##${_fieldEnabler::fieldEnabler}
    
    116 116
     referential.ps.common.ObjectMaterial=${code::noCode}##${this::label}
    
    117
    -referential.ps.common.SpeciesFate=${code}##${this::label}##${discard}##${_weightRangeAllowed}
    
    117
    +referential.ps.common.SpeciesFate=${code}##${this::label}##${discard::speciesFateDiscard}##${_weightRangeAllowed::speciesFateWeightRangeAllowed}
    
    118 118
     referential.ps.common.WeightCategory=${this::label}
    
    119 119
     referential.ps.localmarket.Packaging=${code}##${this::label}##${batchComposition::label}##${batchWeightType::label}