Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
6f65d79d
by Tony Chemit at 2024-04-25T20:59:12+02:00
-
710a5ccf
by Tony Chemit at 2024-04-25T20:59:39+02:00
-
597bc1ad
by Tony Chemit at 2024-04-26T10:29:11+02:00
-
55bb8fce
by Tony Chemit at 2024-04-26T10:48:11+02:00
24 changed files:
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUIModelStates.java
- core/api/dto/src/main/java/fr/ird/observe/dto/ProtectedIdsPs.java
- core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SetDto-update-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/observation/SetDto-update-error-validation.xml
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/logbook/Set/validation-create.json
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/logbook/Set/validation-update.json
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/observation/Set/validation-create.json
- core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ll/observation/Set/validation-update.json
- model/src/main/models/Observe/dto/attribute/boundNumber.properties
- pom.xml
- server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-create-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-create.json
- server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-update-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ll/logbook/Set/validation-update.json
- server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-create-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-create.json
- server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-update-error.xml
- server/runner/src/main/webResources/doc/api/public/data/ll/observation/Set/validation-update.json
- toolkit/persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelper.java
- toolkit/persistence/src/main/java/org/nuiton/topia/persistence/jdbc/JdbcHelperH2.java
Changes:
| ... | ... | @@ -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());
|
| ... | ... | @@ -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");
|
| ... | ... | @@ -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 | ]
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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);
|
| ... | ... | @@ -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": [
|
| ... | ... | @@ -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": [
|
| ... | ... | @@ -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 | ]
|
| ... | ... | @@ -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 | ]
|
| ... | ... | @@ -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
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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": [
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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": [
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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 | ]
|
| ... | ... | @@ -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>
|
| ... | ... | @@ -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 | ]
|
| ... | ... | @@ -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);
|
| ... | ... | @@ -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 | /**
|