Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
5a2cb9fb
by Tony CHEMIT at 2018-09-22T18:50:56Z
21 changed files:
- client/src/main/java/fr/ird/observe/client/ui/actions/content/ShowTechnicalInformationsAction.java
- client/src/main/java/fr/ird/observe/client/ui/content/ContentUIInitializer.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/ActivityLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/ActivitySeineUIHandler.java
- client/src/main/java/fr/ird/observe/client/validation/ClientValidationContext.java
- + dto/src/main/java/fr/ird/observe/dto/data/longline/TripLonglineDto.java
- dto/src/main/models/Observe.model
- persistence/src/main/java/fr/ird/observe/binder/data/longline/TripLonglineActivityEntityDtoBinder.java
- persistence/src/main/java/fr/ird/observe/binder/data/seine/ActivitySeineStubEntityDtoBinder.java
- services/pom.xml
- + services/src/main/java/fr/ird/observe/services/validation/validators/TemperatureBoundFieldValidator.java
- + services/src/main/java/fr/ird/observe/services/validation/validators/TemperatureCompareFieldValidator.java
- validation/pom.xml
- validation/src/main/resources/fr/ird/observe/dto/data/longline/ActivityLonglineDto-create-error-validation.xml
- validation/src/main/resources/fr/ird/observe/dto/data/longline/ActivityLonglineDto-update-error-validation.xml
- validation/src/main/resources/fr/ird/observe/dto/data/seine/ActivitySeineDto-create-error-validation.xml
- validation/src/main/resources/fr/ird/observe/dto/data/seine/ActivitySeineDto-update-error-validation.xml
- validation/src/main/resources/i18n/validation_en_GB.properties
- validation/src/main/resources/i18n/validation_es_ES.properties
- validation/src/main/resources/i18n/validation_fr_FR.properties
- validation/src/main/resources/validators.xml
Changes:
| 1 | 1 |
package fr.ird.observe.client.ui.actions.content;
|
| 2 | 2 |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Client
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 3 | 25 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 4 | 26 |
import fr.ird.observe.client.ui.ObserveKeyStrokes;
|
| 5 | 27 |
import fr.ird.observe.client.ui.ObserveMainUI;
|
| ... | ... | @@ -52,8 +52,8 @@ import fr.ird.observe.dto.reference.DataDtoReference; |
| 52 | 52 |
import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
| 53 | 53 |
import org.apache.commons.lang3.BooleanUtils;
|
| 54 | 54 |
import org.apache.commons.lang3.StringUtils;
|
| 55 |
-import org.apache.logging.log4j.Logger;
|
|
| 56 | 55 |
import org.apache.logging.log4j.LogManager;
|
| 56 |
+import org.apache.logging.log4j.Logger;
|
|
| 57 | 57 |
import org.jdesktop.swingx.JXDatePicker;
|
| 58 | 58 |
import org.jdesktop.swingx.JXMonthView;
|
| 59 | 59 |
import org.jdesktop.swingx.autocomplete.ComboBoxCellEditor;
|
| ... | ... | @@ -63,6 +63,7 @@ import org.nuiton.jaxx.runtime.swing.editor.EnumEditor; |
| 63 | 63 |
import org.nuiton.jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
|
| 64 | 64 |
import org.nuiton.jaxx.runtime.swing.renderer.EnumEditorRenderer;
|
| 65 | 65 |
import org.nuiton.jaxx.validator.JAXXValidator;
|
| 66 |
+import org.nuiton.jaxx.validator.swing.SwingValidator;
|
|
| 66 | 67 |
import org.nuiton.jaxx.validator.swing.SwingValidatorUtil;
|
| 67 | 68 |
import org.nuiton.jaxx.widgets.datetime.DateTimeEditor;
|
| 68 | 69 |
import org.nuiton.jaxx.widgets.datetime.TimeEditor;
|
| ... | ... | @@ -346,6 +347,10 @@ public class ContentUIInitializer<E extends IdDto, UI extends ContentUI<E, UI>> |
| 346 | 347 |
editor.setConfig(new TemperatureEditorConfig(TemperatureFormat.C, getBean(), label.getText(), propertyName));
|
| 347 | 348 |
editor.init(label);
|
| 348 | 349 |
|
| 350 |
+ editor.getModel().addPropertyChangeListener("format", e -> {
|
|
| 351 |
+ ((SwingValidator<?>) ui.getObjectById("validator")).doValidate();
|
|
| 352 |
+ });
|
|
| 353 |
+ |
|
| 349 | 354 |
}
|
| 350 | 355 |
|
| 351 | 356 |
private void init(JLabel editor) {
|
| ... | ... | @@ -251,7 +251,7 @@ class ActivityLonglineUIHandler extends ContentOpenableUIHandler<ActivityLonglin |
| 251 | 251 |
|
| 252 | 252 |
ClientValidationContext validationContext = ObserveSwingApplicationContext.get().getValidationContext();
|
| 253 | 253 |
validationContext.setCoordinatesEditor("coordinate", getUi().getCoordinatesEditor());
|
| 254 |
- |
|
| 254 |
+ validationContext.setTemperatureEditorModel("seaSurfaceTemperature", getUi().getSeaSurfaceTemperature().getModel());
|
|
| 255 | 255 |
}
|
| 256 | 256 |
|
| 257 | 257 |
@Override
|
| ... | ... | @@ -140,7 +140,7 @@ class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySeineDto, |
| 140 | 140 |
|
| 141 | 141 |
ClientValidationContext validationContext = ObserveSwingApplicationContext.get().getValidationContext();
|
| 142 | 142 |
validationContext.setCoordinatesEditor("coordinate", getUi().getCoordinatesEditor());
|
| 143 |
- |
|
| 143 |
+ validationContext.setTemperatureEditorModel("seaSurfaceTemperature", getUi().getSeaSurfaceTemperature().getModel());
|
|
| 144 | 144 |
}
|
| 145 | 145 |
|
| 146 | 146 |
@Override
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU General Public License as
|
| 9 | 9 |
* published by the Free Software Foundation, either version 3 of the
|
| 10 | 10 |
* License, or (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 17 |
* You should have received a copy of the GNU General Public
|
| 18 | 18 |
* License along with this program. If not, see
|
| 19 | 19 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -39,6 +39,7 @@ import fr.ird.observe.services.ObserveServicesProvider; |
| 39 | 39 |
import fr.ird.observe.services.validation.ValidationContext;
|
| 40 | 40 |
import fr.ird.observe.services.validation.ValidationDataContext;
|
| 41 | 41 |
import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
|
| 42 |
+import org.nuiton.jaxx.widgets.temperature.TemperatureEditorModel;
|
|
| 42 | 43 |
|
| 43 | 44 |
import java.util.List;
|
| 44 | 45 |
import java.util.Map;
|
| ... | ... | @@ -52,6 +53,9 @@ import java.util.function.Supplier; |
| 52 | 53 |
*/
|
| 53 | 54 |
public class ClientValidationContext extends ValidationContext {
|
| 54 | 55 |
|
| 56 |
+ private Map<String, CoordinatesEditor> coordinatesEditors = new TreeMap<>();
|
|
| 57 |
+ private Map<String, TemperatureEditorModel> temperatureEditorModels = new TreeMap<>();
|
|
| 58 |
+ |
|
| 55 | 59 |
public ClientValidationContext(ClientConfig config, ValidationDataContext validationDataContext) {
|
| 56 | 60 |
super(validationDataContext,
|
| 57 | 61 |
ObserveSwingApplicationContext.get().getDecoratorService(),
|
| ... | ... | @@ -118,14 +122,13 @@ public class ClientValidationContext extends ValidationContext { |
| 118 | 122 |
public void reset() {
|
| 119 | 123 |
super.reset();
|
| 120 | 124 |
coordinatesEditors.clear();
|
| 125 |
+ temperatureEditorModels.clear();
|
|
| 121 | 126 |
}
|
| 122 | 127 |
|
| 123 | 128 |
public ObserveOpenDataManager getOpenDataManager() {
|
| 124 | 129 |
return ObserveSwingApplicationContext.get().getOpenDataManager();
|
| 125 | 130 |
}
|
| 126 | 131 |
|
| 127 |
- private Map<String, CoordinatesEditor> coordinatesEditors = new TreeMap<>();
|
|
| 128 |
- |
|
| 129 | 132 |
public Map<String, CoordinatesEditor> getCoordinatesEditors() {
|
| 130 | 133 |
return coordinatesEditors;
|
| 131 | 134 |
}
|
| ... | ... | @@ -138,4 +141,16 @@ public class ClientValidationContext extends ValidationContext { |
| 138 | 141 |
coordinatesEditors.put(name, editor);
|
| 139 | 142 |
}
|
| 140 | 143 |
|
| 144 |
+ public Map<String, TemperatureEditorModel> getTemperatureEditorModels() {
|
|
| 145 |
+ return temperatureEditorModels;
|
|
| 146 |
+ }
|
|
| 147 |
+ |
|
| 148 |
+ public TemperatureEditorModel getTemperatureEditorModel(String name) {
|
|
| 149 |
+ return temperatureEditorModels.get(name);
|
|
| 150 |
+ }
|
|
| 151 |
+ |
|
| 152 |
+ public void setTemperatureEditorModel(String name, TemperatureEditorModel editor) {
|
|
| 153 |
+ temperatureEditorModels.put(name, editor);
|
|
| 154 |
+ }
|
|
| 155 |
+ |
|
| 141 | 156 |
}
|
| 1 |
+package fr.ird.observe.dto.data.longline;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Dto
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.common.collect.Iterables;
|
|
| 26 |
+import fr.ird.observe.dto.IdHelper;
|
|
| 27 |
+import org.apache.logging.log4j.LogManager;
|
|
| 28 |
+import org.apache.logging.log4j.Logger;
|
|
| 29 |
+ |
|
| 30 |
+public class TripLonglineDto extends GeneratedTripLonglineDto {
|
|
| 31 |
+ |
|
| 32 |
+ private static final Logger log = LogManager.getLogger(TripLonglineDto.class);
|
|
| 33 |
+ private static final long serialVersionUID = 3977866185675257699L;
|
|
| 34 |
+ |
|
| 35 |
+ public TripLonglineActivityDto getPreviousActivity(String activitySeineId) {
|
|
| 36 |
+ |
|
| 37 |
+ TripLonglineActivityDto previous = null;
|
|
| 38 |
+ |
|
| 39 |
+ if (activitySeineId != null) {
|
|
| 40 |
+ |
|
| 41 |
+ int currentPosition = Iterables.indexOf(getActivityLongline(), IdHelper.newIdPredicate(activitySeineId)::test);
|
|
| 42 |
+ if (currentPosition >= 1) {
|
|
| 43 |
+ previous = Iterables.get(getActivityLongline(), currentPosition - 1);
|
|
| 44 |
+ }
|
|
| 45 |
+ }
|
|
| 46 |
+ |
|
| 47 |
+ if (previous != null) {
|
|
| 48 |
+ log.debug("previous activity " + previous.getTimeStamp());
|
|
| 49 |
+ |
|
| 50 |
+ } else {
|
|
| 51 |
+ log.debug("no previous activity for " + activityLongline);
|
|
| 52 |
+ }
|
|
| 53 |
+ |
|
| 54 |
+ return previous;
|
|
| 55 |
+ }
|
|
| 56 |
+}
|
| ... | ... | @@ -348,6 +348,7 @@ activityLongline + {*} data.longline.TripLonglineActivity | ordered unique |
| 348 | 348 |
|
| 349 | 349 |
data.longline.TripLonglineActivity > data.Data
|
| 350 | 350 |
timeStamp + {*:1} Date
|
| 351 |
+seaSurfaceTemperature + {*:1} Float
|
|
| 351 | 352 |
|
| 352 | 353 |
data.longline.TripLonglineGearUse > data.Data | form=data.longline.GearUseFeaturesLongline
|
| 353 | 354 |
gearUseFeaturesLongline + {*} data.longline.GearUseFeaturesLongline | ordered
|
| ... | ... | @@ -53,6 +53,6 @@ public class TripLonglineActivityEntityDtoBinder extends DataEntityDtoBinderSupp |
| 53 | 53 |
copyEntityDataFieldsToDto(entity, dto);
|
| 54 | 54 |
|
| 55 | 55 |
dto.setTimeStamp(entity.getTimeStamp());
|
| 56 |
- |
|
| 56 |
+ dto.setSeaSurfaceTemperature(entity.getSeaSurfaceTemperature());
|
|
| 57 | 57 |
}
|
| 58 | 58 |
}
|
| ... | ... | @@ -52,6 +52,7 @@ public class ActivitySeineStubEntityDtoBinder extends DataEntityDtoBinderSupport |
| 52 | 52 |
dto.setLastUpdateDate(entity.getLastUpdateDate());
|
| 53 | 53 |
dto.setLatitude(entity.getLatitude());
|
| 54 | 54 |
dto.setLongitude(entity.getLongitude());
|
| 55 |
+ dto.setSeaSurfaceTemperature(entity.getSeaSurfaceTemperature());
|
|
| 55 | 56 |
|
| 56 | 57 |
boolean isFindeVeille = entity.getVesselActivitySeine() != null
|
| 57 | 58 |
&& ActivitySeineImpl.ACTIVITY_FIN_DE_VEILLE.equals(entity.getVesselActivitySeine().getCode());
|
| ... | ... | @@ -88,6 +88,10 @@ |
| 88 | 88 |
<groupId>io.ultreia.java4all.http</groupId>
|
| 89 | 89 |
<artifactId>http-api</artifactId>
|
| 90 | 90 |
</dependency>
|
| 91 |
+ <dependency>
|
|
| 92 |
+ <groupId>io.ultreia.java4all</groupId>
|
|
| 93 |
+ <artifactId>java-lang</artifactId>
|
|
| 94 |
+ </dependency>
|
|
| 91 | 95 |
|
| 92 | 96 |
<dependency>
|
| 93 | 97 |
<groupId>io.ultreia.java4all.jaxx</groupId>
|
| ... | ... | @@ -157,6 +161,10 @@ |
| 157 | 161 |
<groupId>io.ultreia.java4all.topia</groupId>
|
| 158 | 162 |
<artifactId>service-script</artifactId>
|
| 159 | 163 |
</dependency>
|
| 164 |
+ <dependency>
|
|
| 165 |
+ <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 166 |
+ <artifactId>jaxx-widgets-temperature</artifactId>
|
|
| 167 |
+ </dependency>
|
|
| 160 | 168 |
|
| 161 | 169 |
</dependencies>
|
| 162 | 170 |
|
| 1 |
+package fr.ird.observe.services.validation.validators;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Services API
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.opensymphony.xwork2.validator.ValidationException;
|
|
| 26 |
+import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
|
|
| 27 |
+import org.nuiton.jaxx.widgets.temperature.I18nEnumHelper;
|
|
| 28 |
+import org.nuiton.jaxx.widgets.temperature.TemperatureEditorModel;
|
|
| 29 |
+import org.nuiton.jaxx.widgets.temperature.TemperatureFormat;
|
|
| 30 |
+ |
|
| 31 |
+import java.util.Map;
|
|
| 32 |
+ |
|
| 33 |
+/**
|
|
| 34 |
+ * To validate that the temperature is in correct bound.
|
|
| 35 |
+ * <p>
|
|
| 36 |
+ * Created by tchemit on 22/09/2018.
|
|
| 37 |
+ *
|
|
| 38 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 39 |
+ */
|
|
| 40 |
+public class TemperatureBoundFieldValidator extends FieldValidatorSupport {
|
|
| 41 |
+ |
|
| 42 |
+ /**
|
|
| 43 |
+ * Default temperature format (min and max are based on this format).
|
|
| 44 |
+ */
|
|
| 45 |
+ private TemperatureFormat defaultTemperatureFormat;
|
|
| 46 |
+ /**
|
|
| 47 |
+ * Min temperature.
|
|
| 48 |
+ */
|
|
| 49 |
+ private Float min;
|
|
| 50 |
+ /**
|
|
| 51 |
+ * Max temperature.
|
|
| 52 |
+ */
|
|
| 53 |
+ private Float max;
|
|
| 54 |
+ |
|
| 55 |
+ public void setDefaultTemperatureFormat(String defaultTemperatureFormat) {
|
|
| 56 |
+ this.defaultTemperatureFormat = TemperatureFormat.valueOf(defaultTemperatureFormat);
|
|
| 57 |
+ }
|
|
| 58 |
+ |
|
| 59 |
+ public void setMin(String min) {
|
|
| 60 |
+ this.min = Float.valueOf(min);
|
|
| 61 |
+ }
|
|
| 62 |
+ |
|
| 63 |
+ public void setMax(String max) {
|
|
| 64 |
+ this.max = Float.valueOf(max);
|
|
| 65 |
+ }
|
|
| 66 |
+ |
|
| 67 |
+ @Override
|
|
| 68 |
+ public void validate(Object object) throws ValidationException {
|
|
| 69 |
+ |
|
| 70 |
+ if (min == null) {
|
|
| 71 |
+ throw new ValidationException("No parameter 'min' filled");
|
|
| 72 |
+ }
|
|
| 73 |
+ if (max == null) {
|
|
| 74 |
+ throw new ValidationException("No parameter 'max' filled");
|
|
| 75 |
+ }
|
|
| 76 |
+ if (min >= max) {
|
|
| 77 |
+ throw new ValidationException(String.format("No parameter 'min' (%s) is greater than 'max' (%s)", min, max));
|
|
| 78 |
+ }
|
|
| 79 |
+ String fieldName = getFieldName();
|
|
| 80 |
+ if (fieldName == null) {
|
|
| 81 |
+ throw new ValidationException("No parameter 'fieldName' filled");
|
|
| 82 |
+ }
|
|
| 83 |
+ Float temperature = (Float) getFieldValue(fieldName, object);
|
|
| 84 |
+ if (temperature == null) {
|
|
| 85 |
+ return;
|
|
| 86 |
+ }
|
|
| 87 |
+ |
|
| 88 |
+ @SuppressWarnings("unchecked") Map<String, TemperatureEditorModel> map = (Map<String, TemperatureEditorModel>) getFieldValue("temperatureEditorModels", object);
|
|
| 89 |
+ TemperatureFormat temperatureFormat = defaultTemperatureFormat;
|
|
| 90 |
+ if (map != null) {
|
|
| 91 |
+ |
|
| 92 |
+ TemperatureEditorModel temperatureEditorModel = map.get(fieldName);
|
|
| 93 |
+ //FIXME une validation est lancé dans l'ui alors que l'on ne devrait pas et on a pas ce composant alors
|
|
| 94 |
+ if (temperatureEditorModel != null) {
|
|
| 95 |
+ temperatureFormat = temperatureEditorModel.getFormat();
|
|
| 96 |
+ }
|
|
| 97 |
+ }
|
|
| 98 |
+ |
|
| 99 |
+ if (temperature < min || temperature > max) {
|
|
| 100 |
+ float min;
|
|
| 101 |
+ float max;
|
|
| 102 |
+ if (temperatureFormat.equals(defaultTemperatureFormat)) {
|
|
| 103 |
+ min = this.min;
|
|
| 104 |
+ max = this.max;
|
|
| 105 |
+ } else {
|
|
| 106 |
+ min = defaultTemperatureFormat.convert(this.min, temperatureFormat);
|
|
| 107 |
+ max = defaultTemperatureFormat.convert(this.max, temperatureFormat);
|
|
| 108 |
+ }
|
|
| 109 |
+ stack.set(fieldName + "Bound", new TemperatureResult(min, max, I18nEnumHelper.getLabel(temperatureFormat)));
|
|
| 110 |
+ try {
|
|
| 111 |
+ addFieldError(fieldName, object);
|
|
| 112 |
+ } finally {
|
|
| 113 |
+ stack.pop();
|
|
| 114 |
+ }
|
|
| 115 |
+ }
|
|
| 116 |
+ |
|
| 117 |
+ }
|
|
| 118 |
+ |
|
| 119 |
+ @Override
|
|
| 120 |
+ public String getValidatorType() {
|
|
| 121 |
+ return "temperatureBound";
|
|
| 122 |
+ }
|
|
| 123 |
+ |
|
| 124 |
+ static class TemperatureResult {
|
|
| 125 |
+ private final float min;
|
|
| 126 |
+ private final float max;
|
|
| 127 |
+ private final String format;
|
|
| 128 |
+ |
|
| 129 |
+ TemperatureResult(float min, float max, String format) {
|
|
| 130 |
+ this.min = min;
|
|
| 131 |
+ this.max = max;
|
|
| 132 |
+ this.format = format;
|
|
| 133 |
+ }
|
|
| 134 |
+ |
|
| 135 |
+ public float getMin() {
|
|
| 136 |
+ return min;
|
|
| 137 |
+ }
|
|
| 138 |
+ |
|
| 139 |
+ public float getMax() {
|
|
| 140 |
+ return max;
|
|
| 141 |
+ }
|
|
| 142 |
+ |
|
| 143 |
+ public String getFormat() {
|
|
| 144 |
+ return format;
|
|
| 145 |
+ }
|
|
| 146 |
+ }
|
|
| 147 |
+ |
|
| 148 |
+}
|
|
| 149 |
+ |
| 1 |
+package fr.ird.observe.services.validation.validators;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Services API
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.opensymphony.xwork2.validator.ValidationException;
|
|
| 26 |
+import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
|
|
| 27 |
+import io.ultreia.java4all.lang.Numbers;
|
|
| 28 |
+import org.nuiton.jaxx.widgets.temperature.I18nEnumHelper;
|
|
| 29 |
+import org.nuiton.jaxx.widgets.temperature.TemperatureEditorModel;
|
|
| 30 |
+import org.nuiton.jaxx.widgets.temperature.TemperatureFormat;
|
|
| 31 |
+ |
|
| 32 |
+import java.util.Map;
|
|
| 33 |
+ |
|
| 34 |
+/**
|
|
| 35 |
+ * To validate that the temperature is in correct bound.
|
|
| 36 |
+ * <p>
|
|
| 37 |
+ * Created by tchemit on 22/09/2018.
|
|
| 38 |
+ *
|
|
| 39 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 40 |
+ */
|
|
| 41 |
+public class TemperatureCompareFieldValidator extends FieldValidatorSupport {
|
|
| 42 |
+ |
|
| 43 |
+ /**
|
|
| 44 |
+ * Name of the field to compare against.
|
|
| 45 |
+ */
|
|
| 46 |
+ private String compareFieldName;
|
|
| 47 |
+ |
|
| 48 |
+ /**
|
|
| 49 |
+ * Default temperature format (bottom are based on this format).
|
|
| 50 |
+ */
|
|
| 51 |
+ private TemperatureFormat defaultTemperatureFormat;
|
|
| 52 |
+ /**
|
|
| 53 |
+ * Compare temperature format (compare temperature is base on this format).
|
|
| 54 |
+ */
|
|
| 55 |
+ private TemperatureFormat compareTemperatureFormat;
|
|
| 56 |
+ /**
|
|
| 57 |
+ * Delta authorized.
|
|
| 58 |
+ */
|
|
| 59 |
+ private Float delta;
|
|
| 60 |
+ |
|
| 61 |
+ /**
|
|
| 62 |
+ * Min temperature.
|
|
| 63 |
+ */
|
|
| 64 |
+ private Float min;
|
|
| 65 |
+ /**
|
|
| 66 |
+ * Max temperature.
|
|
| 67 |
+ */
|
|
| 68 |
+ private Float max;
|
|
| 69 |
+ |
|
| 70 |
+ public void setDefaultTemperatureFormat(String defaultTemperatureFormat) {
|
|
| 71 |
+ this.defaultTemperatureFormat = TemperatureFormat.valueOf(defaultTemperatureFormat);
|
|
| 72 |
+ }
|
|
| 73 |
+ |
|
| 74 |
+ public void setCompareTemperatureFormat(String compareTemperatureFormat) {
|
|
| 75 |
+ this.compareTemperatureFormat = TemperatureFormat.valueOf(compareTemperatureFormat);
|
|
| 76 |
+ }
|
|
| 77 |
+ |
|
| 78 |
+ public void setMin(String min) {
|
|
| 79 |
+ this.min = Float.valueOf(min);
|
|
| 80 |
+ }
|
|
| 81 |
+ |
|
| 82 |
+ public void setMax(String max) {
|
|
| 83 |
+ this.max = Float.valueOf(max);
|
|
| 84 |
+ }
|
|
| 85 |
+ |
|
| 86 |
+ public void setDelta(String delta) {
|
|
| 87 |
+ this.delta = Float.valueOf(delta);
|
|
| 88 |
+ }
|
|
| 89 |
+ |
|
| 90 |
+ public void setCompareFieldName(String compareFieldName) {
|
|
| 91 |
+ this.compareFieldName = compareFieldName;
|
|
| 92 |
+ }
|
|
| 93 |
+ |
|
| 94 |
+ @Override
|
|
| 95 |
+ public void validate(Object object) throws ValidationException {
|
|
| 96 |
+ if (min == null) {
|
|
| 97 |
+ throw new ValidationException("No parameter 'min' filled");
|
|
| 98 |
+ }
|
|
| 99 |
+ if (max == null) {
|
|
| 100 |
+ throw new ValidationException("No parameter 'max' filled");
|
|
| 101 |
+ }
|
|
| 102 |
+ if (min >= max) {
|
|
| 103 |
+ throw new ValidationException(String.format("No parameter 'min' (%s) is greater than 'max' (%s)", min, max));
|
|
| 104 |
+ }
|
|
| 105 |
+ String fieldName = getFieldName();
|
|
| 106 |
+ if (fieldName == null) {
|
|
| 107 |
+ throw new ValidationException("No parameter 'fieldName' filled");
|
|
| 108 |
+ }
|
|
| 109 |
+ if (compareFieldName == null) {
|
|
| 110 |
+ throw new ValidationException("No parameter 'compareFieldName' filled");
|
|
| 111 |
+ }
|
|
| 112 |
+ if (delta == null) {
|
|
| 113 |
+ throw new ValidationException("No parameter 'bottom' filled");
|
|
| 114 |
+ }
|
|
| 115 |
+ Float temperature = (Float) getFieldValue(fieldName, object);
|
|
| 116 |
+ if (temperature == null) {
|
|
| 117 |
+ return;
|
|
| 118 |
+ }
|
|
| 119 |
+ Float againstTemperature = (Float) getFieldValue(compareFieldName, object);
|
|
| 120 |
+ if (againstTemperature == null) {
|
|
| 121 |
+ return;
|
|
| 122 |
+ }
|
|
| 123 |
+ @SuppressWarnings("unchecked") Map<String, TemperatureEditorModel> map = (Map<String, TemperatureEditorModel>) getFieldValue("temperatureEditorModels", object);
|
|
| 124 |
+ TemperatureFormat temperatureFormat = defaultTemperatureFormat;
|
|
| 125 |
+ if (map != null) {
|
|
| 126 |
+ |
|
| 127 |
+ TemperatureEditorModel temperatureEditorModel = map.get(fieldName);
|
|
| 128 |
+ //FIXME une validation est lancé dans l'ui alors que l'on ne devrait pas et on a pas ce composant alors
|
|
| 129 |
+ if (temperatureEditorModel != null) {
|
|
| 130 |
+ temperatureFormat = temperatureEditorModel.getFormat();
|
|
| 131 |
+ }
|
|
| 132 |
+ }
|
|
| 133 |
+ |
|
| 134 |
+ float bottom = againstTemperature - delta;
|
|
| 135 |
+ if (bottom < min) {
|
|
| 136 |
+ bottom = min;
|
|
| 137 |
+ }
|
|
| 138 |
+ float top = againstTemperature + delta;
|
|
| 139 |
+ if (top > max) {
|
|
| 140 |
+ top = max;
|
|
| 141 |
+ }
|
|
| 142 |
+ if (temperature < bottom || temperature > top) {
|
|
| 143 |
+ if (!temperatureFormat.equals(defaultTemperatureFormat)) {
|
|
| 144 |
+ bottom = Numbers.roundOneDigit(defaultTemperatureFormat.convert(bottom, temperatureFormat));
|
|
| 145 |
+ top = Numbers.roundOneDigit(defaultTemperatureFormat.convert(top, temperatureFormat));
|
|
| 146 |
+ }
|
|
| 147 |
+ if (!temperatureFormat.equals(compareTemperatureFormat)) {
|
|
| 148 |
+ againstTemperature = compareTemperatureFormat.convert(againstTemperature, temperatureFormat);
|
|
| 149 |
+ }
|
|
| 150 |
+ stack.set(fieldName + "Compare", new TemperatureResult(bottom, top, againstTemperature, I18nEnumHelper.getLabel(temperatureFormat)));
|
|
| 151 |
+ try {
|
|
| 152 |
+ addFieldError(fieldName, object);
|
|
| 153 |
+ } finally {
|
|
| 154 |
+ stack.pop();
|
|
| 155 |
+ }
|
|
| 156 |
+ }
|
|
| 157 |
+ |
|
| 158 |
+ }
|
|
| 159 |
+ |
|
| 160 |
+ @Override
|
|
| 161 |
+ public String getValidatorType() {
|
|
| 162 |
+ return "temperatureCompare";
|
|
| 163 |
+ }
|
|
| 164 |
+ |
|
| 165 |
+ static class TemperatureResult {
|
|
| 166 |
+ private final float bottom;
|
|
| 167 |
+ private final float top;
|
|
| 168 |
+ private final Float againstTemperature;
|
|
| 169 |
+ private final String format;
|
|
| 170 |
+ |
|
| 171 |
+ TemperatureResult(float bottom, float top, Float againstTemperature, String format) {
|
|
| 172 |
+ this.bottom = bottom;
|
|
| 173 |
+ this.top = top;
|
|
| 174 |
+ this.againstTemperature = againstTemperature;
|
|
| 175 |
+ this.format = format;
|
|
| 176 |
+ }
|
|
| 177 |
+ |
|
| 178 |
+ public Float getAgainstTemperature() {
|
|
| 179 |
+ return againstTemperature;
|
|
| 180 |
+ }
|
|
| 181 |
+ |
|
| 182 |
+ public float getBottom() {
|
|
| 183 |
+ return bottom;
|
|
| 184 |
+ }
|
|
| 185 |
+ |
|
| 186 |
+ public float getTop() {
|
|
| 187 |
+ return top;
|
|
| 188 |
+ }
|
|
| 189 |
+ |
|
| 190 |
+ public String getFormat() {
|
|
| 191 |
+ return format;
|
|
| 192 |
+ }
|
|
| 193 |
+ }
|
|
| 194 |
+ |
|
| 195 |
+}
|
|
| 196 |
+ |
| ... | ... | @@ -191,6 +191,11 @@ |
| 191 | 191 |
<artifactId>jaxx-widgets-gis</artifactId>
|
| 192 | 192 |
<version>${lib.version.java4all.jaxx}</version>
|
| 193 | 193 |
</dependency>
|
| 194 |
+ <dependency>
|
|
| 195 |
+ <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 196 |
+ <artifactId>jaxx-widgets-temperature</artifactId>
|
|
| 197 |
+ <version>${lib.version.java4all.jaxx}</version>
|
|
| 198 |
+ </dependency>
|
|
| 194 | 199 |
<dependency>
|
| 195 | 200 |
<groupId>org.javassist</groupId>
|
| 196 | 201 |
<artifactId>javassist</artifactId>
|
| ... | ... | @@ -77,16 +77,14 @@ |
| 77 | 77 |
<field name="seaSurfaceTemperature">
|
| 78 | 78 |
|
| 79 | 79 |
<!-- temperature surface non saisie || 12.0 <= temperature surface <= 35.0 -->
|
| 80 |
- <field-validator type="fieldexpressionwithparams" short-circuit="true">
|
|
| 81 |
- <param name="doubleParams">min:12.0|max:35.0</param>
|
|
| 82 |
- <param name="expression">
|
|
| 83 |
- <![CDATA[ seaSurfaceTemperature == null || (doubles.min <= seaSurfaceTemperature && seaSurfaceTemperature <= doubles.max)]]>
|
|
| 84 |
- </param>
|
|
| 80 |
+ <field-validator type="temperatureBound" short-circuit="true">
|
|
| 81 |
+ <param name="min">12.0</param>
|
|
| 82 |
+ <param name="max">35.0</param>
|
|
| 83 |
+ <param name="defaultTemperatureFormat">C</param>
|
|
| 85 | 84 |
<message>
|
| 86 |
- observe.validation.activity.bound.seaSurfaceTemperature##${doubles.min}##${doubles.max}
|
|
| 85 |
+ observe.validation.activity.bound.seaSurfaceTemperature##${seaSurfaceTemperatureBound.min}##${seaSurfaceTemperatureBound.max}##${seaSurfaceTemperatureBound.format}
|
|
| 87 | 86 |
</message>
|
| 88 | 87 |
</field-validator>
|
| 89 |
- |
|
| 90 | 88 |
</field>
|
| 91 | 89 |
|
| 92 | 90 |
<field name="quadrant">
|
| ... | ... | @@ -62,13 +62,24 @@ |
| 62 | 62 |
<field name="seaSurfaceTemperature">
|
| 63 | 63 |
|
| 64 | 64 |
<!-- temperature surface non saisie || 12.0 <= temperature surface <= 35.0 -->
|
| 65 |
- <field-validator type="fieldexpressionwithparams" short-circuit="true">
|
|
| 66 |
- <param name="doubleParams">min:12.0|max:35.0</param>
|
|
| 67 |
- <param name="expression">
|
|
| 68 |
- <![CDATA[ seaSurfaceTemperature == null || (doubles.min <= seaSurfaceTemperature && seaSurfaceTemperature <= doubles.max)]]>
|
|
| 69 |
- </param>
|
|
| 65 |
+ <field-validator type="temperatureBound" short-circuit="true">
|
|
| 66 |
+ <param name="min">12.0</param>
|
|
| 67 |
+ <param name="max">35.0</param>
|
|
| 68 |
+ <param name="defaultTemperatureFormat">C</param>
|
|
| 69 |
+ <message>
|
|
| 70 |
+ observe.validation.activity.bound.seaSurfaceTemperature##${seaSurfaceTemperatureBound.min}##${seaSurfaceTemperatureBound.max}##${seaSurfaceTemperatureBound.format}
|
|
| 71 |
+ </message>
|
|
| 72 |
+ </field-validator>
|
|
| 73 |
+ <!-- coherence temperature surface (delta de 12° par rapport a celle de l'activity precedente) -->
|
|
| 74 |
+ <field-validator type="temperatureCompare" short-circuit="true">
|
|
| 75 |
+ <param name="min">12.0</param>
|
|
| 76 |
+ <param name="max">35.0</param>
|
|
| 77 |
+ <param name="delta">12.0</param>
|
|
| 78 |
+ <param name="defaultTemperatureFormat">C</param>
|
|
| 79 |
+ <param name="compareTemperatureFormat">C</param>
|
|
| 80 |
+ <param name="compareFieldName">currentTrip.getPreviousActivity(id).seaSurfaceTemperature</param>
|
|
| 70 | 81 |
<message>
|
| 71 |
- observe.validation.activity.bound.seaSurfaceTemperature##${doubles.min}##${doubles.max}
|
|
| 82 |
+ observe.validation.activity.invalid.seaSurfaceTemperature##${currentTrip.getPreviousActivity(id).timeStamp}##${seaSurfaceTemperatureCompare.againstTemperature}##${seaSurfaceTemperatureCompare.bottom}##${seaSurfaceTemperatureCompare.top}##${seaSurfaceTemperatureCompare.format}
|
|
| 72 | 83 |
</message>
|
| 73 | 84 |
</field-validator>
|
| 74 | 85 |
|
| ... | ... | @@ -251,28 +251,12 @@ |
| 251 | 251 |
<field name="seaSurfaceTemperature">
|
| 252 | 252 |
|
| 253 | 253 |
<!-- temperature surface non saisie || 12.0 <= temperature surface <= 35.0 -->
|
| 254 |
- <field-validator type="fieldexpressionwithparams" short-circuit="true">
|
|
| 255 |
- <param name="doubleParams">min:12.0|max:35.0</param>
|
|
| 256 |
- <param name="expression">
|
|
| 257 |
- <![CDATA[ seaSurfaceTemperature == null || (doubles.min <= seaSurfaceTemperature && seaSurfaceTemperature <= doubles.max)]]>
|
|
| 258 |
- </param>
|
|
| 259 |
- <message>
|
|
| 260 |
- observe.validation.activity.bound.seaSurfaceTemperature##${doubles.min}##${doubles.max}
|
|
| 261 |
- </message>
|
|
| 262 |
- </field-validator>
|
|
| 263 |
- |
|
| 264 |
- <!-- coherence temperature surface (delta de 12° par rapport a celle de l'activity precedente) -->
|
|
| 265 |
- <field-validator type="fieldexpression">
|
|
| 266 |
- <param name="expression"><![CDATA[
|
|
| 267 |
- seaSurfaceTemperature == null || previousActivity == null || previousActivity.seaSurfaceTemperature == null ||
|
|
| 268 |
- (previousActivity.seaSurfaceTemperature > seaSurfaceTemperature ?
|
|
| 269 |
- previousActivity.seaSurfaceTemperature - seaSurfaceTemperature <= 12.0
|
|
| 270 |
- : seaSurfaceTemperature - previousActivity.seaSurfaceTemperature <= 12.0
|
|
| 271 |
- )
|
|
| 272 |
- ]]>
|
|
| 273 |
- </param>
|
|
| 254 |
+ <field-validator type="temperatureBound" short-circuit="true">
|
|
| 255 |
+ <param name="min">12.0</param>
|
|
| 256 |
+ <param name="max">35.0</param>
|
|
| 257 |
+ <param name="defaultTemperatureFormat">C</param>
|
|
| 274 | 258 |
<message>
|
| 275 |
- observe.validation.activity.invalid.seaSurfaceTemperature##${seaSurfaceTemperature}##${previousActivity.seaSurfaceTemperature}##${previousActivity.time}
|
|
| 259 |
+ observe.validation.activity.bound.seaSurfaceTemperature##${seaSurfaceTemperatureBound.min}##${seaSurfaceTemperatureBound.max}##${seaSurfaceTemperatureBound.format}
|
|
| 276 | 260 |
</message>
|
| 277 | 261 |
</field-validator>
|
| 278 | 262 |
|
| ... | ... | @@ -180,28 +180,24 @@ |
| 180 | 180 |
<field name="seaSurfaceTemperature">
|
| 181 | 181 |
|
| 182 | 182 |
<!-- temperature surface non saisie || 12.0 <= temperature surface <= 35.0 -->
|
| 183 |
- <field-validator type="fieldexpressionwithparams" short-circuit="true">
|
|
| 184 |
- <param name="doubleParams">min:12.0|max:35.0</param>
|
|
| 185 |
- <param name="expression">
|
|
| 186 |
- <![CDATA[ seaSurfaceTemperature == null || (doubles.min <= seaSurfaceTemperature && seaSurfaceTemperature <= doubles.max)]]>
|
|
| 187 |
- </param>
|
|
| 183 |
+ <field-validator type="temperatureBound" short-circuit="true">
|
|
| 184 |
+ <param name="min">12.0</param>
|
|
| 185 |
+ <param name="max">35.0</param>
|
|
| 186 |
+ <param name="defaultTemperatureFormat">C</param>
|
|
| 188 | 187 |
<message>
|
| 189 |
- observe.validation.activity.bound.seaSurfaceTemperature##${doubles.min}##${doubles.max}
|
|
| 188 |
+ observe.validation.activity.bound.seaSurfaceTemperature##${seaSurfaceTemperatureBound.min}##${seaSurfaceTemperatureBound.max}##${seaSurfaceTemperatureBound.format}
|
|
| 190 | 189 |
</message>
|
| 191 | 190 |
</field-validator>
|
| 192 |
- |
|
| 193 | 191 |
<!-- coherence temperature surface (delta de 12° par rapport a celle de l'activity precedente) -->
|
| 194 |
- <field-validator type="fieldexpression">
|
|
| 195 |
- <param name="expression"><![CDATA[
|
|
| 196 |
- seaSurfaceTemperature == null || previousActivity == null || previousActivity.seaSurfaceTemperature == null ||
|
|
| 197 |
- (previousActivity.seaSurfaceTemperature > seaSurfaceTemperature ?
|
|
| 198 |
- previousActivity.seaSurfaceTemperature - seaSurfaceTemperature <= 12.0
|
|
| 199 |
- : seaSurfaceTemperature - previousActivity.seaSurfaceTemperature <= 12.0
|
|
| 200 |
- )
|
|
| 201 |
- ]]>
|
|
| 202 |
- </param>
|
|
| 192 |
+ <field-validator type="temperatureCompare" short-circuit="true">
|
|
| 193 |
+ <param name="min">12.0</param>
|
|
| 194 |
+ <param name="max">35.0</param>
|
|
| 195 |
+ <param name="delta">12.0</param>
|
|
| 196 |
+ <param name="defaultTemperatureFormat">C</param>
|
|
| 197 |
+ <param name="compareTemperatureFormat">C</param>
|
|
| 198 |
+ <param name="compareFieldName">currentRoute.getPreviousActivity(id).seaSurfaceTemperature</param>
|
|
| 203 | 199 |
<message>
|
| 204 |
- observe.validation.activity.invalid.seaSurfaceTemperature##${seaSurfaceTemperature}##${previousActivity.seaSurfaceTemperature}##${previousActivity.time}
|
|
| 200 |
+ observe.validation.activity.invalid.seaSurfaceTemperature##${currentRoute.getPreviousActivity(id).time}##${seaSurfaceTemperatureCompare.againstTemperature}##${seaSurfaceTemperatureCompare.bottom}##${seaSurfaceTemperatureCompare.top}##${seaSurfaceTemperatureCompare.format}
|
|
| 205 | 201 |
</message>
|
| 206 | 202 |
</field-validator>
|
| 207 | 203 |
|
| ... | ... | @@ -325,7 +325,7 @@ observe.common.WindDto.speedRange=Speed range |
| 325 | 325 |
observe.common.WindDto.waveHeight=Wave weight
|
| 326 | 326 |
observe.validation.activity.bound.latitude=Latitude must be between %1$s and %2$s.
|
| 327 | 327 |
observe.validation.activity.bound.longitude=Longitude must be between %1$s and %2$s.
|
| 328 |
-observe.validation.activity.bound.seaSurfaceTemperature=Temperature must be between %1$s and %2$s.
|
|
| 328 |
+observe.validation.activity.bound.seaSurfaceTemperature=Temperature must be between %1$s%3$s and %2$s%3$s.
|
|
| 329 | 329 |
observe.validation.activity.bound.vesselSpeed=Vessel speed must be between %1$s and %2$s.
|
| 330 | 330 |
observe.validation.activity.comment.tobig=Comment size is bound to 1024 characters.
|
| 331 | 331 |
observe.validation.activity.desactivated.currentFpaZone=Selected current Fpa zone is disabled.
|
| ... | ... | @@ -340,7 +340,7 @@ observe.validation.activity.desactivated.vesselActivity=Selected vessel activity |
| 340 | 340 |
observe.validation.activity.desactivated.wind=Selected wind is disabled.
|
| 341 | 341 |
observe.validation.activity.duplicated.time=There is already another activity at this time.
|
| 342 | 342 |
observe.validation.activity.invalid.quadrant=Quadrant is not coherent with ocean (%1$s) of trip (indian\: 1,2, atlantic 1,2,3,4).
|
| 343 |
-observe.validation.activity.invalid.seaSurfaceTemperature=Sea temperature (%1$s) can't vary to more than 12° from surface temperature (%2$s) of the previous activity %3$s.
|
|
| 343 |
+observe.validation.activity.invalid.seaSurfaceTemperature=Previous activity (%1$s) sea temperature was %2$s%5$s, current temperature must be between %3$s%5$s and %4$s%5$s.
|
|
| 344 | 344 |
observe.validation.activity.invalid.speed=Activity speed is %s nb, which is more than the maximum authorized which is %s nd.
|
| 345 | 345 |
observe.validation.activity.null.dcp=No floating object selected.
|
| 346 | 346 |
observe.validation.activity.null.fpaZone=Fpa zone is not filled.
|
| ... | ... | @@ -327,7 +327,7 @@ observe.common.WindDto.speedRange=Texto velocidad del viento |
| 327 | 327 |
observe.common.WindDto.waveHeight=Texto descriptivo de «altura media de la ola»
|
| 328 | 328 |
observe.validation.activity.bound.latitude=La latitud dada debe estar comprendida entre %1$s y %2$s.
|
| 329 | 329 |
observe.validation.activity.bound.longitude=La longitud dada debe estar comprendida entre %1$s y %2$s.
|
| 330 |
-observe.validation.activity.bound.seaSurfaceTemperature=La temperatura debe estar comprendida entre %1$s y %2$s.
|
|
| 330 |
+observe.validation.activity.bound.seaSurfaceTemperature=La temperatura debe estar comprendida entre %1$s%3$s y %2$s%3$s.
|
|
| 331 | 331 |
observe.validation.activity.bound.vesselSpeed=La Velocidad del viento estar comprendida entre %1$s y %2$s.
|
| 332 | 332 |
observe.validation.activity.comment.tobig=La longitud del campo comentarios está limitada a 1024 carácteres.
|
| 333 | 333 |
observe.validation.activity.desactivated.currentFpaZone=La zona actual debe ser desactivada
|
| ... | ... | @@ -342,7 +342,7 @@ observe.validation.activity.desactivated.vesselActivity=Actividad del barco sele |
| 342 | 342 |
observe.validation.activity.desactivated.wind=La fuerza del viento seleccionada está desactivada.
|
| 343 | 343 |
observe.validation.activity.duplicated.time=Ya existe una actividad a esa hora.
|
| 344 | 344 |
observe.validation.activity.invalid.quadrant=El cuadrante no es coherente con el informe del oceano (%1$s) de la marea (indico \: 1,2, atlantico \: 1, 2, 3, 4)
|
| 345 |
-observe.validation.activity.invalid.seaSurfaceTemperature=La temperatura superficial (%1$s) no puede variar mas de 12° con respecto a la temperatura superficial (%2$s) de la actividad anterio %3$s.
|
|
| 345 |
+observe.validation.activity.invalid.seaSurfaceTemperature=Previous activity (%1$s) sea temperature was %2$s%5$s, current temperature must be between %3$s%5$s and %4$s%5$s. \#TODO
|
|
| 346 | 346 |
observe.validation.activity.invalid.speed=La velocidad de la actividad actual es %s nudos, mientras que la velocidad máxima es %s nudos.
|
| 347 | 347 |
observe.validation.activity.null.dcp=No se ha introducido objeto flotante.
|
| 348 | 348 |
observe.validation.activity.null.fpaZone=La selección de una zona FPA es obligatoria.
|
| ... | ... | @@ -325,7 +325,7 @@ observe.common.WindDto.speedRange=Libellé vitesse vent |
| 325 | 325 |
observe.common.WindDto.waveHeight=Libellé Hauteur moyenne vagues
|
| 326 | 326 |
observe.validation.activity.bound.latitude=La latitude doit être comprise entre %1$s et %2$s.
|
| 327 | 327 |
observe.validation.activity.bound.longitude=La longitude doit être comprise entre %1$s et %2$s.
|
| 328 |
-observe.validation.activity.bound.seaSurfaceTemperature=La température doit être comprise entre %1$s et %2$s.
|
|
| 328 |
+observe.validation.activity.bound.seaSurfaceTemperature=La température doit être comprise entre %1$s%3$s et %2$s%3$s.
|
|
| 329 | 329 |
observe.validation.activity.bound.vesselSpeed=La vitesse navire doit être comprise entre %1$s et %2$s.
|
| 330 | 330 |
observe.validation.activity.comment.tobig=La taille du commentaire est limitée à 1024 caractères.
|
| 331 | 331 |
observe.validation.activity.desactivated.currentFpaZone=La zone courante est désactivée.
|
| ... | ... | @@ -340,7 +340,7 @@ observe.validation.activity.desactivated.vesselActivity=L'activité bateau séle |
| 340 | 340 |
observe.validation.activity.desactivated.wind=Le vent Beaufort sélectionné est désactivé.
|
| 341 | 341 |
observe.validation.activity.duplicated.time=Il existe déjà une autre activité à cette heure.
|
| 342 | 342 |
observe.validation.activity.invalid.quadrant=Le quadrant n'est pas cohérent par rapport à l'océan (%1$s) de la marée (indien \: 1
|
| 343 |
-observe.validation.activity.invalid.seaSurfaceTemperature=La température surface (%1$s) ne peut pas varier de plus de 12° par rapport à la température surface (%2$s) de l'activité précédente %3$s.
|
|
| 343 |
+observe.validation.activity.invalid.seaSurfaceTemperature=La température surface de l'activité précédente (%1$s) est de %2$s%5$s, la température doit être comprise entre %3$s%5$s et %4$s%5$s.
|
|
| 344 | 344 |
observe.validation.activity.invalid.speed=La vitesse de l'activité courante est de %s nd, alors que la vitesse maximale autorisée est %s nd
|
| 345 | 345 |
observe.validation.activity.null.dcp=Aucun objet flottant saisi.
|
| 346 | 346 |
observe.validation.activity.null.fpaZone=La sélection d'une zone FPA est obligatoire.
|
| ... | ... | @@ -69,5 +69,7 @@ |
| 69 | 69 |
<validator name="referentialCode" class="fr.ird.observe.services.validation.validators.ReferentialCodeValidator"/>
|
| 70 | 70 |
<validator name="nonTargetCatchObservedSystem" class="fr.ird.observe.services.validation.validators.NonTargetCatchObservedSystemValidator"/>
|
| 71 | 71 |
<validator name="activitySeine_observedSystem" class="fr.ird.observe.services.validation.validators.ActivitySeineObservedSystemValidator"/>
|
| 72 |
+ <validator name="temperatureBound" class="fr.ird.observe.services.validation.validators.TemperatureBoundFieldValidator"/>
|
|
| 73 |
+ <validator name="temperatureCompare" class="fr.ird.observe.services.validation.validators.TemperatureCompareFieldValidator"/>
|
|
| 72 | 74 |
|
| 73 | 75 |
</validators>
|