Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
7126cd18
by Tony Chemit at 2021-01-31T11:22:09+01:00
27 changed files:
- client/core/pom.xml
- client/datasource/actions/pom.xml
- client/datasource/editor/api/pom.xml
- client/datasource/editor/common/pom.xml
- client/datasource/editor/ll/pom.xml
- client/datasource/editor/ps/pom.xml
- client/runner/pom.xml
- pom.xml
- services/client-impl/pom.xml
- services/local-impl/pom.xml
- services/validation-spi/pom.xml
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/AbstractSpeciesFieldDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/ActivityEndOfSearchingExistsDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/ActivitySeineObservedSystemValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/ActivitySimpleSpeedDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/ActivitySpeedDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/NonTargetCatchObservedSystemValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/ObserveLengthFormulaCollectionUniqueKeyDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/OpenableDtoFieldValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/SampleLonglineLogbookSpeciesDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/SetLonglineLogbookUniqueHomeIdDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/SetLonglineLogbookUniqueNumberDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/SetLonglineObsUniqueHomeIdDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/SetLonglineObsUniqueNumberDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/TripVesselDtoValidator.java
- services/validation/pom.xml
- services/validation/src/main/resources/validators.xml
Changes:
| ... | ... | @@ -54,12 +54,6 @@ |
| 54 | 54 |
<version>${project.version}</version>
|
| 55 | 55 |
<scope>runtime</scope>
|
| 56 | 56 |
</dependency>
|
| 57 |
- <!-- <dependency>-->
|
|
| 58 |
- <!-- <groupId>${project.groupId}</groupId>-->
|
|
| 59 |
- <!-- <artifactId>models-persistence-java</artifactId>-->
|
|
| 60 |
- <!-- <version>${project.version}</version>-->
|
|
| 61 |
- <!-- <scope>runtime</scope>-->
|
|
| 62 |
- <!-- </dependency>-->
|
|
| 63 | 57 |
<dependency>
|
| 64 | 58 |
<groupId>${project.groupId}</groupId>
|
| 65 | 59 |
<artifactId>services-api</artifactId>
|
| ... | ... | @@ -114,6 +108,11 @@ |
| 114 | 108 |
<dependency>
|
| 115 | 109 |
<groupId>fr.ird.observe</groupId>
|
| 116 | 110 |
<artifactId>toolkit-validation</artifactId>
|
| 111 |
+ <scope>provided</scope>
|
|
| 112 |
+ </dependency>
|
|
| 113 |
+ <dependency>
|
|
| 114 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 115 |
+ <artifactId>validation-api</artifactId>
|
|
| 117 | 116 |
</dependency>
|
| 118 | 117 |
|
| 119 | 118 |
<dependency>
|
| ... | ... | @@ -88,11 +88,16 @@ |
| 88 | 88 |
</dependency>
|
| 89 | 89 |
<dependency>
|
| 90 | 90 |
<groupId>fr.ird.observe</groupId>
|
| 91 |
- <artifactId>toolkit-validation</artifactId>
|
|
| 91 |
+ <artifactId>toolkit-service</artifactId>
|
|
| 92 | 92 |
</dependency>
|
| 93 | 93 |
<dependency>
|
| 94 | 94 |
<groupId>fr.ird.observe</groupId>
|
| 95 |
- <artifactId>toolkit-service</artifactId>
|
|
| 95 |
+ <artifactId>toolkit-validation</artifactId>
|
|
| 96 |
+ <scope>provided</scope>
|
|
| 97 |
+ </dependency>
|
|
| 98 |
+ <dependency>
|
|
| 99 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 100 |
+ <artifactId>validation-api</artifactId>
|
|
| 96 | 101 |
</dependency>
|
| 97 | 102 |
<dependency>
|
| 98 | 103 |
<groupId>io.ultreia.java4all.topia</groupId>
|
| ... | ... | @@ -93,6 +93,11 @@ |
| 93 | 93 |
<dependency>
|
| 94 | 94 |
<groupId>fr.ird.observe</groupId>
|
| 95 | 95 |
<artifactId>toolkit-validation</artifactId>
|
| 96 |
+ <scope>provided</scope>
|
|
| 97 |
+ </dependency>
|
|
| 98 |
+ <dependency>
|
|
| 99 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 100 |
+ <artifactId>validation-api</artifactId>
|
|
| 96 | 101 |
</dependency>
|
| 97 | 102 |
|
| 98 | 103 |
<dependency>
|
| ... | ... | @@ -86,6 +86,11 @@ |
| 86 | 86 |
<dependency>
|
| 87 | 87 |
<groupId>fr.ird.observe</groupId>
|
| 88 | 88 |
<artifactId>toolkit-validation</artifactId>
|
| 89 |
+ <scope>provided</scope>
|
|
| 90 |
+ </dependency>
|
|
| 91 |
+ <dependency>
|
|
| 92 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 93 |
+ <artifactId>validation-api</artifactId>
|
|
| 89 | 94 |
</dependency>
|
| 90 | 95 |
|
| 91 | 96 |
<dependency>
|
| ... | ... | @@ -108,11 +108,16 @@ |
| 108 | 108 |
</dependency>
|
| 109 | 109 |
<dependency>
|
| 110 | 110 |
<groupId>fr.ird.observe</groupId>
|
| 111 |
- <artifactId>toolkit-validation</artifactId>
|
|
| 111 |
+ <artifactId>toolkit-service</artifactId>
|
|
| 112 | 112 |
</dependency>
|
| 113 | 113 |
<dependency>
|
| 114 | 114 |
<groupId>fr.ird.observe</groupId>
|
| 115 |
- <artifactId>toolkit-service</artifactId>
|
|
| 115 |
+ <artifactId>toolkit-validation</artifactId>
|
|
| 116 |
+ <scope>provided</scope>
|
|
| 117 |
+ </dependency>
|
|
| 118 |
+ <dependency>
|
|
| 119 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 120 |
+ <artifactId>validation-api</artifactId>
|
|
| 116 | 121 |
</dependency>
|
| 117 | 122 |
<dependency>
|
| 118 | 123 |
<groupId>io.ultreia.java4all</groupId>
|
| ... | ... | @@ -112,13 +112,17 @@ |
| 112 | 112 |
</dependency>
|
| 113 | 113 |
<dependency>
|
| 114 | 114 |
<groupId>fr.ird.observe</groupId>
|
| 115 |
- <artifactId>toolkit-validation</artifactId>
|
|
| 115 |
+ <artifactId>toolkit-service</artifactId>
|
|
| 116 | 116 |
</dependency>
|
| 117 | 117 |
<dependency>
|
| 118 | 118 |
<groupId>fr.ird.observe</groupId>
|
| 119 |
- <artifactId>toolkit-service</artifactId>
|
|
| 119 |
+ <artifactId>toolkit-validation</artifactId>
|
|
| 120 |
+ <scope>provided</scope>
|
|
| 121 |
+ </dependency>
|
|
| 122 |
+ <dependency>
|
|
| 123 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 124 |
+ <artifactId>validation-api</artifactId>
|
|
| 120 | 125 |
</dependency>
|
| 121 |
- |
|
| 122 | 126 |
<dependency>
|
| 123 | 127 |
<groupId>io.ultreia.java4all</groupId>
|
| 124 | 128 |
<artifactId>java-util</artifactId>
|
| ... | ... | @@ -131,11 +131,16 @@ |
| 131 | 131 |
</dependency>
|
| 132 | 132 |
<dependency>
|
| 133 | 133 |
<groupId>fr.ird.observe</groupId>
|
| 134 |
- <artifactId>toolkit-validation</artifactId>
|
|
| 134 |
+ <artifactId>toolkit-service</artifactId>
|
|
| 135 | 135 |
</dependency>
|
| 136 | 136 |
<dependency>
|
| 137 | 137 |
<groupId>fr.ird.observe</groupId>
|
| 138 |
- <artifactId>toolkit-service</artifactId>
|
|
| 138 |
+ <artifactId>toolkit-validation</artifactId>
|
|
| 139 |
+ <scope>runtime</scope>
|
|
| 140 |
+ </dependency>
|
|
| 141 |
+ <dependency>
|
|
| 142 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 143 |
+ <artifactId>validation-api</artifactId>
|
|
| 139 | 144 |
</dependency>
|
| 140 | 145 |
<dependency>
|
| 141 | 146 |
<groupId>io.ultreia.java4all.topia</groupId>
|
| ... | ... | @@ -24,7 +24,7 @@ |
| 24 | 24 |
<parent>
|
| 25 | 25 |
<groupId>io.ultreia.maven</groupId>
|
| 26 | 26 |
<artifactId>pom</artifactId>
|
| 27 |
- <version>2021.4</version>
|
|
| 27 |
+ <version>2021.6</version>
|
|
| 28 | 28 |
</parent>
|
| 29 | 29 |
|
| 30 | 30 |
<groupId>fr.ird.observe</groupId>
|
| ... | ... | @@ -146,10 +146,9 @@ |
| 146 | 146 |
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
|
| 147 | 147 |
<buildDate>${maven.build.timestamp}</buildDate>
|
| 148 | 148 |
|
| 149 |
- <toolkit.version>5.0.0</toolkit.version>
|
|
| 149 |
+ <toolkit.version>5.0.1-SNAPSHOT</toolkit.version>
|
|
| 150 | 150 |
|
| 151 | 151 |
<lib.version.ognl>3.1.28</lib.version.ognl>
|
| 152 |
- <lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
|
|
| 153 | 152 |
<!--can't use 1.4.197 (date has changed + blob also)-->
|
| 154 | 153 |
<lib.version.h2>1.4.196</lib.version.h2>
|
| 155 | 154 |
<lib.version.nuiton.utils>3.0</lib.version.nuiton.utils>
|
| ... | ... | @@ -232,25 +231,6 @@ |
| 232 | 231 |
<groupId>fr.ird.observe</groupId>
|
| 233 | 232 |
<artifactId>toolkit-validation</artifactId>
|
| 234 | 233 |
<version>${toolkit.version}</version>
|
| 235 |
- <exclusions>
|
|
| 236 |
- <exclusion>
|
|
| 237 |
- <groupId>org.nuiton</groupId>
|
|
| 238 |
- <artifactId>nuiton-validator</artifactId>
|
|
| 239 |
- </exclusion>
|
|
| 240 |
- </exclusions>
|
|
| 241 |
- </dependency>
|
|
| 242 |
- <dependency>
|
|
| 243 |
- <groupId>fr.ird.observe</groupId>
|
|
| 244 |
- <artifactId>toolkit-validation</artifactId>
|
|
| 245 |
- <version>${toolkit.version}</version>
|
|
| 246 |
- <classifier>tests</classifier>
|
|
| 247 |
- <scope>test</scope>
|
|
| 248 |
- <exclusions>
|
|
| 249 |
- <exclusion>
|
|
| 250 |
- <groupId>org.nuiton</groupId>
|
|
| 251 |
- <artifactId>nuiton-validator</artifactId>
|
|
| 252 |
- </exclusion>
|
|
| 253 |
- </exclusions>
|
|
| 254 | 234 |
</dependency>
|
| 255 | 235 |
|
| 256 | 236 |
<dependency>
|
| ... | ... | @@ -264,51 +244,6 @@ |
| 264 | 244 |
<version>${toolkit.version}</version>
|
| 265 | 245 |
</dependency>
|
| 266 | 246 |
|
| 267 |
- <dependency>
|
|
| 268 |
- <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 269 |
- <artifactId>jaxx-validator</artifactId>
|
|
| 270 |
- <version>${lib.version.java4all.jaxx}</version>
|
|
| 271 |
- <exclusions>
|
|
| 272 |
- <exclusion>
|
|
| 273 |
- <groupId>org.nuiton</groupId>
|
|
| 274 |
- <artifactId>nuiton-validator</artifactId>
|
|
| 275 |
- </exclusion>
|
|
| 276 |
- </exclusions>
|
|
| 277 |
- </dependency>
|
|
| 278 |
- <dependency>
|
|
| 279 |
- <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 280 |
- <artifactId>jaxx-widgets-gis</artifactId>
|
|
| 281 |
- <version>${lib.version.java4all.jaxx}</version>
|
|
| 282 |
- <exclusions>
|
|
| 283 |
- <exclusion>
|
|
| 284 |
- <groupId>org.nuiton</groupId>
|
|
| 285 |
- <artifactId>nuiton-validator</artifactId>
|
|
| 286 |
- </exclusion>
|
|
| 287 |
- </exclusions>
|
|
| 288 |
- </dependency>
|
|
| 289 |
- <dependency>
|
|
| 290 |
- <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 291 |
- <artifactId>jaxx-widgets-temperature</artifactId>
|
|
| 292 |
- <version>${lib.version.java4all.jaxx}</version>
|
|
| 293 |
- <exclusions>
|
|
| 294 |
- <exclusion>
|
|
| 295 |
- <groupId>org.nuiton</groupId>
|
|
| 296 |
- <artifactId>nuiton-validator</artifactId>
|
|
| 297 |
- </exclusion>
|
|
| 298 |
- </exclusions>
|
|
| 299 |
- </dependency>
|
|
| 300 |
- <dependency>
|
|
| 301 |
- <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 302 |
- <artifactId>jaxx-widgets-datetime</artifactId>
|
|
| 303 |
- <version>${lib.version.java4all.jaxx}</version>
|
|
| 304 |
- <exclusions>
|
|
| 305 |
- <exclusion>
|
|
| 306 |
- <groupId>org.nuiton</groupId>
|
|
| 307 |
- <artifactId>nuiton-validator</artifactId>
|
|
| 308 |
- </exclusion>
|
|
| 309 |
- </exclusions>
|
|
| 310 |
- </dependency>
|
|
| 311 |
- |
|
| 312 | 247 |
<dependency>
|
| 313 | 248 |
<groupId>org.nuiton.topia</groupId>
|
| 314 | 249 |
<artifactId>topia-persistence</artifactId>
|
| ... | ... | @@ -49,6 +49,11 @@ |
| 49 | 49 |
<artifactId>services-validation-spi</artifactId>
|
| 50 | 50 |
<version>${project.version}</version>
|
| 51 | 51 |
</dependency>
|
| 52 |
+ <dependency>
|
|
| 53 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 54 |
+ <artifactId>validation-api</artifactId>
|
|
| 55 |
+ </dependency>
|
|
| 56 |
+ |
|
| 52 | 57 |
<dependency>
|
| 53 | 58 |
<groupId>${project.groupId}</groupId>
|
| 54 | 59 |
<artifactId>test</artifactId>
|
| ... | ... | @@ -184,6 +184,11 @@ |
| 184 | 184 |
<artifactId>xwork-core</artifactId>
|
| 185 | 185 |
</dependency>
|
| 186 | 186 |
|
| 187 |
+ <dependency>
|
|
| 188 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 189 |
+ <artifactId>validation-api</artifactId>
|
|
| 190 |
+ </dependency>
|
|
| 191 |
+ |
|
| 187 | 192 |
<dependency>
|
| 188 | 193 |
<groupId>com.h2database</groupId>
|
| 189 | 194 |
<artifactId>h2</artifactId>
|
| ... | ... | @@ -97,7 +97,14 @@ |
| 97 | 97 |
<groupId>org.apache.struts.xwork</groupId>
|
| 98 | 98 |
<artifactId>xwork-core</artifactId>
|
| 99 | 99 |
</dependency>
|
| 100 |
- |
|
| 100 |
+ <dependency>
|
|
| 101 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 102 |
+ <artifactId>validation-api</artifactId>
|
|
| 103 |
+ </dependency>
|
|
| 104 |
+ <dependency>
|
|
| 105 |
+ <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 106 |
+ <artifactId>jaxx-validator</artifactId>
|
|
| 107 |
+ </dependency>
|
|
| 101 | 108 |
<dependency>
|
| 102 | 109 |
<groupId>org.apache.logging.log4j</groupId>
|
| 103 | 110 |
<artifactId>log4j-jcl</artifactId>
|
| ... | ... | @@ -27,13 +27,14 @@ import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport; |
| 27 | 27 |
import fr.ird.observe.dto.referential.common.SpeciesDto;
|
| 28 | 28 |
import fr.ird.observe.dto.referential.common.SpeciesReference;
|
| 29 | 29 |
import io.ultreia.java4all.lang.Numbers;
|
| 30 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 30 | 31 |
|
| 31 | 32 |
import java.util.Objects;
|
| 32 | 33 |
|
| 33 | 34 |
/**
|
| 34 | 35 |
* <!-- START SNIPPET: javadoc -->
|
| 35 |
- * Ce validateur verifie qu'une espece respece bien les tailles ou
|
|
| 36 |
- * les poids définis par les bornes de l'espece :
|
|
| 36 |
+ * Ce validateur vérifie qu'une espèce est bien les tailles ou
|
|
| 37 |
+ * les poids définis par les bornes de l'espèce :
|
|
| 37 | 38 |
* <ul>
|
| 38 | 39 |
* <li>minLength</li>
|
| 39 | 40 |
* <li>maxLength</li>
|
| ... | ... | @@ -41,8 +42,8 @@ import java.util.Objects; |
| 41 | 42 |
* <li>maxWeight</li>
|
| 42 | 43 |
* </ul>
|
| 43 | 44 |
* <p>
|
| 44 |
- * Lorsqu'il s'agit d'une espece faune, si aucune borne n'est trouvée, alors
|
|
| 45 |
- * on se base sur les bornes définis dans son groupe d'espece (si il est défini).
|
|
| 45 |
+ * Lorsqu'il s'agit d'une espèce faune, si aucune borne n'est trouvée, alors
|
|
| 46 |
+ * on se base sur les bornes définis dans son groupe d'espèce (si il est défini).
|
|
| 46 | 47 |
* <p>
|
| 47 | 48 |
* Le paramètre {@link #ratio} permet de spécifier une marge à appliquer sur
|
| 48 | 49 |
* les bornes, il s'agit d'un pourcentage décimal.
|
| ... | ... | @@ -31,7 +31,7 @@ import org.apache.logging.log4j.Logger; |
| 31 | 31 |
|
| 32 | 32 |
/**
|
| 33 | 33 |
* <!-- START SNIPPET: javadoc --> VesselActivityFieldValidator vérifie que
|
| 34 |
- * l'activity vessel d'une activité est cohérente. <!-- END SNIPPET: javadoc
|
|
| 34 |
+ * l'activité vessel d'une activité est cohérente. <!-- END SNIPPET: javadoc
|
|
| 35 | 35 |
* -->
|
| 36 | 36 |
* <p>
|
| 37 | 37 |
* <p>
|
| ... | ... | @@ -95,7 +95,7 @@ public class ActivityEndOfSearchingExistsDtoValidator extends FieldValidatorSupp |
| 95 | 95 |
public void validate(Object object) throws ValidationException {
|
| 96 | 96 |
|
| 97 | 97 |
if (required == null) {
|
| 98 |
- throw new ValidationException("le parametre required est obligatoire");
|
|
| 98 |
+ throw new ValidationException("le paramètre required est obligatoire");
|
|
| 99 | 99 |
}
|
| 100 | 100 |
|
| 101 | 101 |
if (object == null) {
|
| ... | ... | @@ -106,8 +106,8 @@ public class ActivityEndOfSearchingExistsDtoValidator extends FieldValidatorSupp |
| 106 | 106 |
|
| 107 | 107 |
if (object instanceof RouteDto) {
|
| 108 | 108 |
|
| 109 |
- // on verifie qu'il existe bien une activity de fin de veille
|
|
| 110 |
- // parmi les activitys de la route
|
|
| 109 |
+ // on vérifie qu'il existe bien une activity de fin de veille
|
|
| 110 |
+ // parmi les activités de la route
|
|
| 111 | 111 |
|
| 112 | 112 |
RouteDto route = (RouteDto) object;
|
| 113 | 113 |
|
| ... | ... | @@ -117,17 +117,17 @@ public class ActivityEndOfSearchingExistsDtoValidator extends FieldValidatorSupp |
| 117 | 117 |
|
| 118 | 118 |
if (object instanceof ActivityDto) {
|
| 119 | 119 |
|
| 120 |
- // on verifie qu'il n'existe pas d'activity de fin de veille
|
|
| 120 |
+ // on vérifie qu'il n'existe pas d'activité de fin de veille
|
|
| 121 | 121 |
|
| 122 | 122 |
ActivityDto activitySeine = (ActivityDto) object;
|
| 123 | 123 |
|
| 124 | 124 |
if (!activitySeine.isActivityEndOfSearching()) {
|
| 125 | 125 |
|
| 126 |
- // rien a valider (on est pas sur une activity de fin de veille
|
|
| 126 |
+ // rien a valider (on est pas sur une activité de fin de veille
|
|
| 127 | 127 |
return;
|
| 128 | 128 |
}
|
| 129 | 129 |
|
| 130 |
- // l'activity est une activite de fin de veille
|
|
| 130 |
+ // l'activité est une activité de fin de veille
|
|
| 131 | 131 |
// on doit vérifier qu'il n'existe pas déjà une autre activité de
|
| 132 | 132 |
// fin de veille
|
| 133 | 133 |
|
| ... | ... | @@ -144,7 +144,7 @@ public class ActivityEndOfSearchingExistsDtoValidator extends FieldValidatorSupp |
| 144 | 144 |
|
| 145 | 145 |
private void checkAgainstRequired(RouteDto route, Object object) {
|
| 146 | 146 |
|
| 147 |
- log.debug(String.format("check [required : %s?] activity fin de veille sur la route %s:%ssur %d activity(s).",
|
|
| 147 |
+ log.debug(String.format("check [required : %s?] activity fin de veille sur la route %s:%s on %d activity(s).",
|
|
| 148 | 148 |
required, route.getId(), route.getDate(), route.getActivitySize()));
|
| 149 | 149 |
|
| 150 | 150 |
boolean detected = route.isActivityFindDeVeilleFound();
|
| ... | ... | @@ -32,6 +32,7 @@ import fr.ird.observe.dto.decoration.decorators.ReferentialReferenceDecorator; |
| 32 | 32 |
import fr.ird.observe.dto.referential.common.SpeciesReference;
|
| 33 | 33 |
import fr.ird.observe.dto.referential.ps.observation.ObservedSystemReference;
|
| 34 | 34 |
import fr.ird.observe.dto.validation.SeineBycatchObservedSystemConfig;
|
| 35 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 35 | 36 |
|
| 36 | 37 |
import java.util.Collection;
|
| 37 | 38 |
import java.util.LinkedHashSet;
|
| ... | ... | @@ -62,7 +63,7 @@ public class ActivitySeineObservedSystemValidator extends FieldValidatorSupport |
| 62 | 63 |
|
| 63 | 64 |
ActivityDto activitySeineDto = (ActivityDto) object;
|
| 64 | 65 |
if (!activitySeineDto.getNonTargetCatchSpecies().isEmpty()) {
|
| 65 |
- List<ObservedSystemReference> observedSystemReferences = (List<ObservedSystemReference>) getFieldValue("psObservationObservedSystems", object);
|
|
| 66 |
+ @SuppressWarnings("unchecked") List<ObservedSystemReference> observedSystemReferences = (List<ObservedSystemReference>) getFieldValue("psObservationObservedSystems", object);
|
|
| 66 | 67 |
ImmutableMap<String, ObservedSystemReference> map = Maps.uniqueIndex(observedSystemReferences, ObservedSystemReference::getId);
|
| 67 | 68 |
Collection<ObservedSystemReference> observedSystems = activitySeineDto.getObservedSystem();
|
| 68 | 69 |
SeineBycatchObservedSystemConfig seineBycatchObservedSystemConfig = (SeineBycatchObservedSystemConfig) getFieldValue("seineBycatchObservedSystemConfig", object);
|
| ... | ... | @@ -31,6 +31,7 @@ import fr.ird.observe.dto.data.ps.observation.RouteDto; |
| 31 | 31 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 32 | 32 |
import org.apache.logging.log4j.LogManager;
|
| 33 | 33 |
import org.apache.logging.log4j.Logger;
|
| 34 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 34 | 35 |
|
| 35 | 36 |
import java.util.Comparator;
|
| 36 | 37 |
import java.util.LinkedList;
|
| ... | ... | @@ -87,7 +88,7 @@ public class ActivitySimpleSpeedDtoValidator extends FieldValidatorSupport { |
| 87 | 88 |
* Construit un point à partir de l'entité donnée.
|
| 88 | 89 |
*
|
| 89 | 90 |
* @param route la route qui contient le jour
|
| 90 |
- * @param activity l'activite qui contient l'heure et la position géographique
|
|
| 91 |
+ * @param activity l'activité qui contient l'heure et la position géographique
|
|
| 91 | 92 |
* @return le nouveau point instancié
|
| 92 | 93 |
* @since 3.8
|
| 93 | 94 |
*/
|
| ... | ... | @@ -99,7 +100,7 @@ public class ActivitySimpleSpeedDtoValidator extends FieldValidatorSupport { |
| 99 | 100 |
* Construit un point à partir de l'entité donnée.
|
| 100 | 101 |
*
|
| 101 | 102 |
* @param route la route qui contient le jour
|
| 102 |
- * @param activity l'activite qui contient l'heure et la position géographique
|
|
| 103 |
+ * @param activity l'activité qui contient l'heure et la position géographique
|
|
| 103 | 104 |
* @return le nouveau point instancié
|
| 104 | 105 |
* @since 3.8
|
| 105 | 106 |
*/
|
| ... | ... | @@ -30,6 +30,7 @@ import fr.ird.observe.dto.data.ps.observation.RouteDto; |
| 30 | 30 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 31 | 31 |
import org.apache.logging.log4j.LogManager;
|
| 32 | 32 |
import org.apache.logging.log4j.Logger;
|
| 33 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 33 | 34 |
import org.nuiton.validator.xwork2.field.CollectionFieldExpressionValidator;
|
| 34 | 35 |
|
| 35 | 36 |
import static fr.ird.observe.validation.validators.ActivitySimpleSpeedDtoValidator.newPoint;
|
| ... | ... | @@ -32,6 +32,7 @@ import fr.ird.observe.dto.decoration.decorators.ReferentialReferenceDecorator; |
| 32 | 32 |
import fr.ird.observe.dto.referential.common.SpeciesReference;
|
| 33 | 33 |
import fr.ird.observe.dto.referential.ps.observation.ObservedSystemReference;
|
| 34 | 34 |
import fr.ird.observe.dto.validation.SeineBycatchObservedSystemConfig;
|
| 35 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 35 | 36 |
|
| 36 | 37 |
import java.util.Collection;
|
| 37 | 38 |
import java.util.LinkedHashSet;
|
| ... | ... | @@ -110,7 +110,7 @@ public class ObserveLengthFormulaCollectionUniqueKeyDtoValidator extends NuitonF |
| 110 | 110 |
|
| 111 | 111 |
boolean answer = true;
|
| 112 | 112 |
|
| 113 |
- @SuppressWarnings("unchecked")
|
|
| 113 |
+ @SuppressWarnings({"unchecked", "rawtypes"})
|
|
| 114 | 114 |
Function<Object, WithStartEndDate> decoratorService = (Function) getFieldValue("referentialReferenceFunction", object);
|
| 115 | 115 |
WithStartEndDate referentialDtoReference = decoratorService.apply(object);
|
| 116 | 116 |
|
| ... | ... | @@ -195,6 +195,7 @@ public class ObserveLengthFormulaCollectionUniqueKeyDtoValidator extends NuitonF |
| 195 | 195 |
* property
|
| 196 | 196 |
* @throws ValidationException if any pb to retreave the collection
|
| 197 | 197 |
*/
|
| 198 |
+ @SuppressWarnings({"unchecked", "rawtypes"})
|
|
| 198 | 199 |
Collection<? super WithStartEndDate> getCollection(Object object) throws ValidationException {
|
| 199 | 200 |
|
| 200 | 201 |
String fieldName = getCollectionFieldName();
|
| ... | ... | @@ -34,8 +34,8 @@ import org.nuiton.decorator.Decorator; |
| 34 | 34 |
import java.util.Collection;
|
| 35 | 35 |
|
| 36 | 36 |
/**
|
| 37 |
- * <!-- START SNIPPET: javadoc --> OpenableFieldValidator verifie qu'un
|
|
| 38 |
- * objet ou qu'une collection d'objet cloturable est bien
|
|
| 37 |
+ * <!-- START SNIPPET: javadoc --> OpenableFieldValidator vérifie qu'un
|
|
| 38 |
+ * objet ou qu'une collection d'objet éditable est bien
|
|
| 39 | 39 |
* fermée.
|
| 40 | 40 |
* <p>
|
| 41 | 41 |
* <!-- END SNIPPET: javadoc -->
|
| ... | ... | @@ -74,6 +74,7 @@ public class OpenableDtoFieldValidator extends FieldValidatorSupport { |
| 74 | 74 |
|
| 75 | 75 |
private String openValueAsString;
|
| 76 | 76 |
|
| 77 |
+ @SuppressWarnings("unused")
|
|
| 77 | 78 |
public String getOpenValueAsString() {
|
| 78 | 79 |
return openValueAsString;
|
| 79 | 80 |
}
|
| ... | ... | @@ -99,12 +100,11 @@ public class OpenableDtoFieldValidator extends FieldValidatorSupport { |
| 99 | 100 |
for (Object o : (Collection<?>) value) {
|
| 100 | 101 |
dataValue = (DataDto) o;
|
| 101 | 102 |
String id = dataValue.getId();
|
| 102 |
- |
|
| 103 |
- result = (boolean) stack.findValue("!openDataManager.isOpen(\"" + dataValue.getId() + "\")");
|
|
| 103 |
+ result = (boolean) stack.findValue("!openDataManager.isOpen(\"" + id + "\")");
|
|
| 104 | 104 |
|
| 105 | 105 |
if (!result) {
|
| 106 | 106 |
// on objet ouvert a été trouvé
|
| 107 |
- // on peut arréter le parcours
|
|
| 107 |
+ // on peut arrêter le parcours
|
|
| 108 | 108 |
break;
|
| 109 | 109 |
}
|
| 110 | 110 |
}
|
| ... | ... | @@ -133,7 +133,7 @@ public class OpenableDtoFieldValidator extends FieldValidatorSupport { |
| 133 | 133 |
log.debug("decorator message " + openValueAsString);
|
| 134 | 134 |
}
|
| 135 | 135 |
try {
|
| 136 |
- // on a decouvert au moins un objet non fermé
|
|
| 136 |
+ // on a découvert au moins un objet non fermé
|
|
| 137 | 137 |
addFieldError(fieldName, dataValue);
|
| 138 | 138 |
} finally {
|
| 139 | 139 |
openValueAsString = null;
|
| ... | ... | @@ -30,6 +30,7 @@ import fr.ird.observe.dto.data.ll.logbook.SamplePartDto; |
| 30 | 30 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 31 | 31 |
import fr.ird.observe.dto.decoration.decorators.ReferentialReferenceDecorator;
|
| 32 | 32 |
import fr.ird.observe.dto.referential.common.SpeciesReference;
|
| 33 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 33 | 34 |
|
| 34 | 35 |
import java.util.Collection;
|
| 35 | 36 |
import java.util.LinkedHashSet;
|
| ... | ... | @@ -28,6 +28,7 @@ import fr.ird.observe.dto.data.ll.logbook.SetDto; |
| 28 | 28 |
import fr.ird.observe.dto.data.ll.logbook.SetStubDto;
|
| 29 | 29 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 30 | 30 |
import fr.ird.observe.dto.decoration.decorators.DataReferenceDecorator;
|
| 31 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 31 | 32 |
|
| 32 | 33 |
import java.util.Objects;
|
| 33 | 34 |
import java.util.Optional;
|
| ... | ... | @@ -28,6 +28,7 @@ import fr.ird.observe.dto.data.ll.logbook.SetDto; |
| 28 | 28 |
import fr.ird.observe.dto.data.ll.logbook.SetStubDto;
|
| 29 | 29 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 30 | 30 |
import fr.ird.observe.dto.decoration.decorators.DataReferenceDecorator;
|
| 31 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 31 | 32 |
|
| 32 | 33 |
import java.util.Objects;
|
| 33 | 34 |
import java.util.Optional;
|
| ... | ... | @@ -28,6 +28,7 @@ import fr.ird.observe.dto.data.ll.observation.SetDto; |
| 28 | 28 |
import fr.ird.observe.dto.data.ll.observation.SetStubDto;
|
| 29 | 29 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 30 | 30 |
import fr.ird.observe.dto.decoration.decorators.DataReferenceDecorator;
|
| 31 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 31 | 32 |
|
| 32 | 33 |
import java.util.Objects;
|
| 33 | 34 |
import java.util.Optional;
|
| ... | ... | @@ -28,6 +28,7 @@ import fr.ird.observe.dto.data.ll.observation.SetDto; |
| 28 | 28 |
import fr.ird.observe.dto.data.ll.observation.SetStubDto;
|
| 29 | 29 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 30 | 30 |
import fr.ird.observe.dto.decoration.decorators.DataReferenceDecorator;
|
| 31 |
+import org.nuiton.jaxx.validator.ValidatorUtil;
|
|
| 31 | 32 |
|
| 32 | 33 |
import java.util.Objects;
|
| 33 | 34 |
import java.util.Optional;
|
| ... | ... | @@ -70,7 +70,7 @@ public class TripVesselDtoValidator extends FieldValidatorSupport { |
| 70 | 70 |
Date startDate = (Date) getFieldValue("startDate", object);
|
| 71 | 71 |
Date endDate = (Date) getFieldValue("endDate", object);
|
| 72 | 72 |
String id = (String) getFieldValue("id", object);
|
| 73 |
- if (id==null) {
|
|
| 73 |
+ if (id == null) {
|
|
| 74 | 74 |
// object not persisted, no ide, can't do the math
|
| 75 | 75 |
return;
|
| 76 | 76 |
}
|
| ... | ... | @@ -79,7 +79,7 @@ public class TripVesselDtoValidator extends FieldValidatorSupport { |
| 79 | 79 |
|
| 80 | 80 |
private void validate(Object object, String id, VesselReference vessel, Date startDate, Date endDate) throws ValidationException {
|
| 81 | 81 |
|
| 82 |
- TripAwareService tripService = (TripAwareService) Objects.requireNonNull(getFieldValue(serviceName, object), "Can't find " + serviceName);
|
|
| 82 |
+ TripAwareService<?> tripService = (TripAwareService<?>) Objects.requireNonNull(getFieldValue(serviceName, object), "Can't find " + serviceName);
|
|
| 83 | 83 |
Set<? extends TripAware> matchingTrips = tripService.getMatchingTripsVesselWithinDateRange(id,
|
| 84 | 84 |
vessel.getId(),
|
| 85 | 85 |
startDate,
|
| ... | ... | @@ -96,9 +96,13 @@ |
| 96 | 96 |
</dependency>
|
| 97 | 97 |
|
| 98 | 98 |
<dependency>
|
| 99 |
- <groupId>fr.ird.observe</groupId>
|
|
| 100 |
- <artifactId>toolkit-validation</artifactId>
|
|
| 101 |
- <classifier>tests</classifier>
|
|
| 99 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 100 |
+ <artifactId>validation-api</artifactId>
|
|
| 101 |
+ </dependency>
|
|
| 102 |
+ |
|
| 103 |
+ <dependency>
|
|
| 104 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 105 |
+ <artifactId>validation-test</artifactId>
|
|
| 102 | 106 |
</dependency>
|
| 103 | 107 |
|
| 104 | 108 |
<dependency>
|
| ... | ... | @@ -154,6 +158,17 @@ |
| 154 | 158 |
<artifactId>javassist</artifactId>
|
| 155 | 159 |
<version>${lib.version.javassist}</version>
|
| 156 | 160 |
</dependency>
|
| 161 |
+ <dependency>
|
|
| 162 |
+ <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 163 |
+ <artifactId>jaxx-widgets-gis</artifactId>
|
|
| 164 |
+ <version>${lib.version.java4all.jaxx}</version>
|
|
| 165 |
+ </dependency>
|
|
| 166 |
+ <dependency>
|
|
| 167 |
+ <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 168 |
+ <artifactId>jaxx-widgets-temperature</artifactId>
|
|
| 169 |
+ <version>${lib.version.java4all.jaxx}</version>
|
|
| 170 |
+ </dependency>
|
|
| 171 |
+ |
|
| 157 | 172 |
</dependencies>
|
| 158 | 173 |
</plugin>
|
| 159 | 174 |
|
| ... | ... | @@ -70,11 +70,11 @@ |
| 70 | 70 |
<validator name="checkDisabledReferentialOnWarningScope" class="fr.ird.observe.validation.validators.CheckDisabledReferentialOnWarningScopeFieldValidation"/>
|
| 71 | 71 |
<validator name="checkDisabledReferentialOnErrorScope" class="fr.ird.observe.validation.validators.CheckDisabledReferentialOnErrorScopeFieldValidation"/>
|
| 72 | 72 |
|
| 73 |
- <validator name="temperatureBound" class="fr.ird.observe.validation.validators.TemperatureBoundFieldValidator"/>
|
|
| 73 |
+ <validator name="temperatureBound" class="org.nuiton.jaxx.widgets.temperature.validators.TemperatureBoundFieldValidator"/>
|
|
| 74 | 74 |
|
| 75 | 75 |
<validator name="quadrantDto" class="fr.ird.observe.validation.validators.QuadrantFieldDtoValidator"/>
|
| 76 |
- <validator name="coordinateLatitudeDto" class="fr.ird.observe.validation.validators.CoordinateLatitudeDtoFieldValidator"/>
|
|
| 77 |
- <validator name="coordinateLongitudeDto" class="fr.ird.observe.validation.validators.CoordinateLongitudeDtoFieldValidator"/>
|
|
| 76 |
+ <validator name="coordinateLatitudeDto" class="org.nuiton.jaxx.widgets.gis.validators.CoordinateLatitudeDtoFieldValidator"/>
|
|
| 77 |
+ <validator name="coordinateLongitudeDto" class="org.nuiton.jaxx.widgets.gis.validators.CoordinateLongitudeDtoFieldValidator"/>
|
|
| 78 | 78 |
|
| 79 | 79 |
<!-- ObServe validators -->
|
| 80 | 80 |
<validator name="collectionUniqueKeyDto" class="fr.ird.observe.validation.validators.CollectionUniqueKeyDtoValidator"/>
|