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

Commits:

24 changed files:

Changes:

  • client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUIModelStates.java
    ... ... @@ -105,10 +105,6 @@ public class TripUIModelStates extends GeneratedTripUIModelStates {
    105 105
         @Override
    
    106 106
         protected void copyFormToBean(Form<TripDto> form) {
    
    107 107
             super.copyFormToBean(form);
    
    108
    -        if (isCreatingMode()) {
    
    109
    -            // reset logbook default values
    
    110
    -            setDefaultLogbookValues(true);
    
    111
    -        }
    
    112 108
             // set end date to current day if necessary
    
    113 109
             if (isUpdatingMode() && getBean().getEndDate() == null) {
    
    114 110
                 Date date = Dates.getEndOfDay(new Date());
    

  • core/api/dto/src/main/java/fr/ird/observe/dto/ProtectedIdsPs.java
    ... ... @@ -63,6 +63,7 @@ public interface ProtectedIdsPs {
    63 63
         String PS_COMMON_REASON_FOR_NUL_SET_0 = "fr.ird.referential.ps.common.ReasonForNullSet#1239832683529#0.10743661058036036";
    
    64 64
         String PS_COMMON_ACTIVITY_HARBOUR_ID = "fr.ird.referential.ps.common.VesselActivity#1239832675349#0.363119635949572";
    
    65 65
         String PS_COMMON_DEFAULT_ACQUISITION_STATUS_ID = "fr.ird.referential.ps.common.AcquisitionStatus#1464000000000#099";
    
    66
    +    String PS_COMMON_DONE_ACQUISITION_STATUS_ID = "fr.ird.referential.ps.common.AcquisitionStatus#1464000000000#001";
    
    66 67
         String PS_LOGBOOK_DEFAULT_WELL_CONTENT_STATUS_ID = "fr.ird.referential.ps.logbook.WellContentStatus#1464000000000#03";
    
    67 68
         String PS_OBSERVATION_FOB_OBSERVED_SYSTEM = "fr.ird.referential.ps.common.ObservedSystem#0#1.2";
    
    68 69
         Set<String> PS_OBSERVATION_FOB_OBSERVED_SYSTEM_EXCLUDE_OPERATIONS = Set.of("fr.ird.referential.ps.common.ObjectOperation#0#10", "fr.ird.referential.ps.common.ObjectOperation#0#1");
    

  • core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
    ... ... @@ -3042,7 +3042,7 @@
    3042 3042
           {
    
    3043 3043
             "name": "branchlinesPerBasketCount",
    
    3044 3044
             "comments": [
    
    3045
    -          "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    3045
    +          "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    3046 3046
               "branchlinesPerBasketCount is a positive number"
    
    3047 3047
             ]
    
    3048 3048
           },
    
    ... ... @@ -3455,7 +3455,7 @@
    3455 3455
           {
    
    3456 3456
             "name": "branchlinesPerBasketCount",
    
    3457 3457
             "comments": [
    
    3458
    -          "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    3458
    +          "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    3459 3459
               "branchlinesPerBasketCount is a positive number"
    
    3460 3460
             ]
    
    3461 3461
           },
    
    ... ... @@ -6179,7 +6179,7 @@
    6179 6179
           {
    
    6180 6180
             "name": "branchlinesPerBasketCount",
    
    6181 6181
             "comments": [
    
    6182
    -          "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    6182
    +          "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    6183 6183
               "branchlinesPerBasketCount is a positive number",
    
    6184 6184
               "branchlinesPerBasketCount is mandatory"
    
    6185 6185
             ]
    
    ... ... @@ -6505,7 +6505,7 @@
    6505 6505
           {
    
    6506 6506
             "name": "branchlinesPerBasketCount",
    
    6507 6507
             "comments": [
    
    6508
    -          "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    6508
    +          "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    6509 6509
               "branchlinesPerBasketCount is a positive number",
    
    6510 6510
               "branchlinesPerBasketCount is mandatory"
    
    6511 6511
             ]
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetDto-create-error-validation.xml
    ... ... @@ -51,10 +51,10 @@
    51 51
           <message/>
    
    52 52
         </field-validator>
    
    53 53
     
    
    54
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    54
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    55 55
         <field-validator type="boundNumber">
    
    56 56
           <param name="min">0.0</param>
    
    57
    -      <param name="max">50.0</param>
    
    57
    +      <param name="max">1000.0</param>
    
    58 58
           <message/>
    
    59 59
         </field-validator>
    
    60 60
       </field>
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetDto-update-error-validation.xml
    ... ... @@ -51,10 +51,10 @@
    51 51
           <message/>
    
    52 52
         </field-validator>
    
    53 53
     
    
    54
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    54
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    55 55
         <field-validator type="boundNumber">
    
    56 56
           <param name="min">0.0</param>
    
    57
    -      <param name="max">50.0</param>
    
    57
    +      <param name="max">1000.0</param>
    
    58 58
           <message/>
    
    59 59
         </field-validator>
    
    60 60
       </field>
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDto-create-error-validation.xml
    ... ... @@ -55,10 +55,10 @@
    55 55
           <message/>
    
    56 56
         </field-validator>
    
    57 57
     
    
    58
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    58
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    59 59
         <field-validator type="boundNumber">
    
    60 60
           <param name="min">0.0</param>
    
    61
    -      <param name="max">50.0</param>
    
    61
    +      <param name="max">1000.0</param>
    
    62 62
           <message/>
    
    63 63
         </field-validator>
    
    64 64
       </field>
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDto-update-error-validation.xml
    ... ... @@ -55,10 +55,10 @@
    55 55
           <message/>
    
    56 56
         </field-validator>
    
    57 57
     
    
    58
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    58
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    59 59
         <field-validator type="boundNumber">
    
    60 60
           <param name="min">0.0</param>
    
    61
    -      <param name="max">50.0</param>
    
    61
    +      <param name="max">1000.0</param>
    
    62 62
           <message/>
    
    63 63
         </field-validator>
    
    64 64
       </field>
    

  • core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java
    ... ... @@ -111,15 +111,20 @@ public class TripSpi extends GeneratedTripSpi {
    111 111
                 preCreated.setStartDate(date);
    
    112 112
                 preCreated.setEndDate(date);
    
    113 113
             }
    
    114
    +        AcquisitionStatus acquisitionStatus = AcquisitionStatus.loadEntity(context, ProtectedIdsPs.PS_COMMON_DEFAULT_ACQUISITION_STATUS_ID);
    
    115
    +        AcquisitionStatus acquisitionStatusDone = AcquisitionStatus.loadEntity(context, ProtectedIdsPs.PS_COMMON_DONE_ACQUISITION_STATUS_ID);
    
    114 116
             if (preCreated.getObservationsProgram() != null) {
    
    115 117
                 //FIXME Should we add some default values?
    
    118
    +            preCreated.setObservationsAcquisitionStatus(acquisitionStatusDone);
    
    119
    +        } else {
    
    120
    +            preCreated.setObservationsAcquisitionStatus(acquisitionStatus);
    
    116 121
             }
    
    117 122
             if (preCreated.getLogbookProgram() != null) {
    
    118 123
                 //FIXME Should we add some default values?
    
    124
    +            preCreated.setLogbookAcquisitionStatus(acquisitionStatusDone);
    
    125
    +        }else {
    
    126
    +            preCreated.setLogbookAcquisitionStatus(acquisitionStatus);
    
    119 127
             }
    
    120
    -        AcquisitionStatus acquisitionStatus = AcquisitionStatus.loadEntity(context, ProtectedIdsPs.PS_COMMON_DEFAULT_ACQUISITION_STATUS_ID);
    
    121
    -        preCreated.setObservationsAcquisitionStatus(acquisitionStatus);
    
    122
    -        preCreated.setLogbookAcquisitionStatus(acquisitionStatus);
    
    123 128
             preCreated.setTargetWellsSamplingAcquisitionStatus(acquisitionStatus);
    
    124 129
             preCreated.setLandingAcquisitionStatus(acquisitionStatus);
    
    125 130
             preCreated.setLocalMarketAcquisitionStatus(acquisitionStatus);
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/logbook/Set/validation-create.json
    ... ... @@ -15,7 +15,7 @@
    15 15
       },
    
    16 16
       "branchlinesPerBasketCount": {
    
    17 17
         "errors": [
    
    18
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    18
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    19 19
           "branchlinesPerBasketCount is a positive number"
    
    20 20
         ],
    
    21 21
         "warnings": [
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/logbook/Set/validation-update.json
    ... ... @@ -15,7 +15,7 @@
    15 15
       },
    
    16 16
       "branchlinesPerBasketCount": {
    
    17 17
         "errors": [
    
    18
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    18
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    19 19
           "branchlinesPerBasketCount is a positive number"
    
    20 20
         ],
    
    21 21
         "warnings": [
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/observation/Set/validation-create.json
    ... ... @@ -8,7 +8,7 @@
    8 8
       },
    
    9 9
       "branchlinesPerBasketCount": {
    
    10 10
         "errors": [
    
    11
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    11
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    12 12
           "branchlinesPerBasketCount is a positive number",
    
    13 13
           "branchlinesPerBasketCount is mandatory"
    
    14 14
         ]
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/observation/Set/validation-update.json
    ... ... @@ -8,7 +8,7 @@
    8 8
       },
    
    9 9
       "branchlinesPerBasketCount": {
    
    10 10
         "errors": [
    
    11
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    11
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    12 12
           "branchlinesPerBasketCount is a positive number",
    
    13 13
           "branchlinesPerBasketCount is mandatory"
    
    14 14
         ]
    

  • model/src/main/models/Observe/dto/attribute/boundNumber.properties
    ... ... @@ -27,7 +27,7 @@ data.ll.logbook.BaitsComposition.attribute.individualWeight=0.0:5.0
    27 27
     data.ll.logbook.Catch.attribute.depredatedProportion=1.0:100.0
    
    28 28
     data.ll.logbook.HooksComposition.attribute.hookOffset=0.0:100.0
    
    29 29
     data.ll.logbook.Set.attribute.basketsPerSectionCount=0.0:100.0
    
    30
    -data.ll.logbook.Set.attribute.branchlinesPerBasketCount=0.0:50.0
    
    30
    +data.ll.logbook.Set.attribute.branchlinesPerBasketCount=0.0:1000.0
    
    31 31
     data.ll.logbook.Set.attribute.settingVesselSpeed=0.0:30.0
    
    32 32
     data.ll.logbook.Set.attribute.shooterSpeed=0.0:15.0
    
    33 33
     data.ll.logbook.Set.attribute.snapWeight=0.0:0.2
    
    ... ... @@ -44,7 +44,7 @@ data.ll.observation.Branchline.attribute.swivelWeight=0.0:0.2
    44 44
     data.ll.observation.Catch.attribute.gonadeWeight=0.0:2000.0
    
    45 45
     data.ll.observation.HooksComposition.attribute.hookOffset=0.0:100.0
    
    46 46
     data.ll.observation.Set.attribute.basketsPerSectionCount=0.0:100.0
    
    47
    -data.ll.observation.Set.attribute.branchlinesPerBasketCount=0.0:50.0
    
    47
    +data.ll.observation.Set.attribute.branchlinesPerBasketCount=0.0:1000.0
    
    48 48
     data.ll.observation.Set.attribute.lightsticksPerBasketCount=0.0:50.0
    
    49 49
     data.ll.observation.Set.attribute.settingVesselSpeed=0.0:30.0
    
    50 50
     data.ll.observation.Set.attribute.shooterSpeed=0.0:15.0
    

  • pom.xml
    ... ... @@ -23,7 +23,7 @@
    23 23
       <parent>
    
    24 24
         <groupId>io.ultreia.maven</groupId>
    
    25 25
         <artifactId>pom</artifactId>
    
    26
    -    <version>2024.21</version>
    
    26
    +    <version>2024.22</version>
    
    27 27
       </parent>
    
    28 28
       <groupId>fr.ird.observe</groupId>
    
    29 29
       <artifactId>ird-observe</artifactId>
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-create-error.xml
    ... ... @@ -51,10 +51,10 @@
    51 51
           <message/>
    
    52 52
         </field-validator>
    
    53 53
     
    
    54
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    54
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    55 55
         <field-validator type="boundNumber">
    
    56 56
           <param name="min">0.0</param>
    
    57
    -      <param name="max">50.0</param>
    
    57
    +      <param name="max">1000.0</param>
    
    58 58
           <message/>
    
    59 59
         </field-validator>
    
    60 60
       </field>
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-create.json
    ... ... @@ -15,7 +15,7 @@
    15 15
       },
    
    16 16
       "branchlinesPerBasketCount": {
    
    17 17
         "errors": [
    
    18
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    18
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    19 19
           "branchlinesPerBasketCount is a positive number"
    
    20 20
         ],
    
    21 21
         "warnings": [
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-update-error.xml
    ... ... @@ -51,10 +51,10 @@
    51 51
           <message/>
    
    52 52
         </field-validator>
    
    53 53
     
    
    54
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    54
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    55 55
         <field-validator type="boundNumber">
    
    56 56
           <param name="min">0.0</param>
    
    57
    -      <param name="max">50.0</param>
    
    57
    +      <param name="max">1000.0</param>
    
    58 58
           <message/>
    
    59 59
         </field-validator>
    
    60 60
       </field>
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-update.json
    ... ... @@ -15,7 +15,7 @@
    15 15
       },
    
    16 16
       "branchlinesPerBasketCount": {
    
    17 17
         "errors": [
    
    18
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    18
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    19 19
           "branchlinesPerBasketCount is a positive number"
    
    20 20
         ],
    
    21 21
         "warnings": [
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-create-error.xml
    ... ... @@ -55,10 +55,10 @@
    55 55
           <message/>
    
    56 56
         </field-validator>
    
    57 57
     
    
    58
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    58
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    59 59
         <field-validator type="boundNumber">
    
    60 60
           <param name="min">0.0</param>
    
    61
    -      <param name="max">50.0</param>
    
    61
    +      <param name="max">1000.0</param>
    
    62 62
           <message/>
    
    63 63
         </field-validator>
    
    64 64
       </field>
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-create.json
    ... ... @@ -8,7 +8,7 @@
    8 8
       },
    
    9 9
       "branchlinesPerBasketCount": {
    
    10 10
         "errors": [
    
    11
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    11
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    12 12
           "branchlinesPerBasketCount is a positive number",
    
    13 13
           "branchlinesPerBasketCount is mandatory"
    
    14 14
         ]
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-update-error.xml
    ... ... @@ -55,10 +55,10 @@
    55 55
           <message/>
    
    56 56
         </field-validator>
    
    57 57
     
    
    58
    -    <!-- 0.0 <= branchlinesPerBasketCount <= 50.0 -->
    
    58
    +    <!-- 0.0 <= branchlinesPerBasketCount <= 1000.0 -->
    
    59 59
         <field-validator type="boundNumber">
    
    60 60
           <param name="min">0.0</param>
    
    61
    -      <param name="max">50.0</param>
    
    61
    +      <param name="max">1000.0</param>
    
    62 62
           <message/>
    
    63 63
         </field-validator>
    
    64 64
       </field>
    

  • server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-update.json
    ... ... @@ -8,7 +8,7 @@
    8 8
       },
    
    9 9
       "branchlinesPerBasketCount": {
    
    10 10
         "errors": [
    
    11
    -      "0.0 <= branchlinesPerBasketCount <= 50.0",
    
    11
    +      "0.0 <= branchlinesPerBasketCount <= 1000.0",
    
    12 12
           "branchlinesPerBasketCount is a positive number",
    
    13 13
           "branchlinesPerBasketCount is mandatory"
    
    14 14
         ]
    

  • toolkit/persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelper.java
    ... ... @@ -171,6 +171,18 @@ public abstract class JdbcHelper {
    171 171
             }
    
    172 172
         }
    
    173 173
     
    
    174
    +    public void runQuery(String sql) {
    
    175
    +        try {
    
    176
    +            consume(connection -> {
    
    177
    +                try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
    
    178
    +                    preparedStatement.executeQuery();
    
    179
    +                }
    
    180
    +            });
    
    181
    +        } catch (SQLException e) {
    
    182
    +            throw new RuntimeException(e);
    
    183
    +        }
    
    184
    +    }
    
    185
    +
    
    174 186
         public void consume(SqlWork consumer) throws SQLException {
    
    175 187
             try (Connection connection = openConnection()) {
    
    176 188
                 consumer.execute(connection);
    

  • toolkit/persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelperH2.java
    ... ... @@ -78,11 +78,11 @@ public class JdbcHelperH2 extends JdbcHelper {
    78 78
          * @param compress if true then use gzip to compress file
    
    79 79
          */
    
    80 80
         public void backup(File file, boolean compress) {
    
    81
    -        String options = " BLOCKSIZE 2048 CHARSET 'UTF-8'";
    
    81
    +        String options = "";
    
    82 82
             if (compress) {
    
    83 83
                 options += " COMPRESSION GZIP";
    
    84 84
             }
    
    85
    -        runUpdate("SCRIPT TO '" + file.getAbsolutePath() + "'" + options);
    
    85
    +        runQuery("SCRIPT NOPASSWORDS NOSETTINGS BLOCKSIZE 2048 TO '" + file.getAbsolutePath() + "'" + options);
    
    86 86
         }
    
    87 87
     
    
    88 88
         /**