Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
e2d892cd
by Tony Chemit at 2023-08-31T16:03:59+02:00
-
c21af7d2
by Tony Chemit at 2023-08-31T16:20:22+02:00
-
e18d911f
by Tony Chemit at 2023-08-31T17:24:40+02:00
-
264938d9
by Tony Chemit at 2023-08-31T17:25:31+02:00
-
c0489aaf
by Tony Chemit at 2023-08-31T17:26:14+02:00
25 changed files:
- client/datasource/actions/src/main/i18n/getters/java-enumeration.getter
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/SelectDataModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateUIHandler.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidationModelMode.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/Start.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-create-warning-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-update-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-update-warning-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-update-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SampleMeasureDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SampleMeasureDto-update-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SchoolEstimateDto-create-error-validation.xml
- core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SchoolEstimateDto-update-error-validation.xml
- core/services/i18n/src/main/i18n/translations/services_en_GB.properties
- core/services/i18n/src/main/i18n/translations/services_es_ES.properties
- core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-dataResult-ps.json
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
- toolkit/api/src/main/java/fr/ird/observe/dto/ToolkitIdLabel.java
- toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/validation/DtoFormValidatorTransformer.java
Changes:
| ... | ... | @@ -23,8 +23,6 @@ observe.constant.AdminStep.VALIDATE.description |
| 23 | 23 | observe.constant.ReferentialSynchronizeMode.BOTH
|
| 24 | 24 | observe.constant.ReferentialSynchronizeMode.FROM_LEFT_TO_RIGHT
|
| 25 | 25 | observe.constant.ReferentialSynchronizeMode.FROM_RIGHT_TO_LEFT
|
| 26 | -observe.constant.ValidationModelMode.ALL
|
|
| 27 | -observe.constant.ValidationModelMode.ALL.description
|
|
| 28 | 26 | observe.constant.ValidationModelMode.DATA
|
| 29 | 27 | observe.constant.ValidationModelMode.DATA.description
|
| 30 | 28 | observe.constant.ValidationModelMode.REFERENTIEL
|
| ... | ... | @@ -129,7 +129,7 @@ public class SelectDataModel extends AdminActionModel { |
| 129 | 129 | case REFERENTIEL:
|
| 130 | 130 | loadData = false;
|
| 131 | 131 | break;
|
| 132 | - case ALL:
|
|
| 132 | + default:
|
|
| 133 | 133 | break;
|
| 134 | 134 | }
|
| 135 | 135 | }
|
| ... | ... | @@ -121,10 +121,6 @@ public class ValidateUIHandler extends AdminTabUIHandler<ValidateUI> implements |
| 121 | 121 | case DATA:
|
| 122 | 122 | selectDataModel.getConfig().setLoadData(true);
|
| 123 | 123 | break;
|
| 124 | - case ALL:
|
|
| 125 | - selectDataModel.getConfig().setLoadReferential(true);
|
|
| 126 | - selectDataModel.getConfig().setLoadData(true);
|
|
| 127 | - break;
|
|
| 128 | 124 | }
|
| 129 | 125 | });
|
| 130 | 126 | Set<ValidatorDto> validators = getValidatorsManager().getValidators();
|
| ... | ... | @@ -46,12 +46,7 @@ public enum ValidationModelMode { |
| 46 | 46 | /**
|
| 47 | 47 | * to validate only referential.
|
| 48 | 48 | */
|
| 49 | - REFERENTIEL(true, false),
|
|
| 50 | - |
|
| 51 | - /**
|
|
| 52 | - * to validate both referential and data.
|
|
| 53 | - */
|
|
| 54 | - ALL(true, false);
|
|
| 49 | + REFERENTIEL(true, false);
|
|
| 55 | 50 | |
| 56 | 51 | private final boolean referential;
|
| 57 | 52 | private final boolean data;
|
| ... | ... | @@ -29,6 +29,7 @@ import fr.ird.observe.client.datasource.api.ObserveSwingDataSource; |
| 29 | 29 | import fr.ird.observe.dto.I18nDecoratorHelper;
|
| 30 | 30 | import fr.ird.observe.dto.ProgressionModel;
|
| 31 | 31 | import fr.ird.observe.dto.ToolkitIdLabel;
|
| 32 | +import fr.ird.observe.dto.data.RootOpenableDto;
|
|
| 32 | 33 | import fr.ird.observe.dto.validation.ValidationRequestConfiguration;
|
| 33 | 34 | import fr.ird.observe.navigation.tree.selection.SelectionTreeModel;
|
| 34 | 35 | import fr.ird.observe.services.service.ValidateService;
|
| ... | ... | @@ -37,6 +38,7 @@ import fr.ird.observe.validation.api.request.ReferentialValidationRequest; |
| 37 | 38 | import fr.ird.observe.validation.api.result.ValidationResult;
|
| 38 | 39 | import fr.ird.observe.validation.api.result.ValidationResultBuilder;
|
| 39 | 40 | import fr.ird.observe.validation.definition.ValidatorDto;
|
| 41 | +import io.ultreia.java4all.decoration.Decorator;
|
|
| 40 | 42 | import org.apache.commons.io.FileUtils;
|
| 41 | 43 | import org.apache.logging.log4j.LogManager;
|
| 42 | 44 | import org.apache.logging.log4j.Logger;
|
| ... | ... | @@ -51,6 +53,8 @@ import java.io.IOException; |
| 51 | 53 | import java.nio.charset.StandardCharsets;
|
| 52 | 54 | import java.util.Collections;
|
| 53 | 55 | import java.util.Date;
|
| 56 | +import java.util.LinkedList;
|
|
| 57 | +import java.util.List;
|
|
| 54 | 58 | import java.util.Set;
|
| 55 | 59 | |
| 56 | 60 | import static io.ultreia.java4all.i18n.I18n.t;
|
| ... | ... | @@ -182,7 +186,11 @@ public class Start extends ValidateUIActionSupport { |
| 182 | 186 | } else if (dataModel.getConfig().isLoadData()) {
|
| 183 | 187 | |
| 184 | 188 | try (ValidationResultBuilder resultBuilder = ValidationResultBuilder.create()) {
|
| 185 | - Set<ToolkitIdLabel> selectedData = dataModel.getSelectedData();
|
|
| 189 | + List<ToolkitIdLabel> selectedData = new LinkedList<>(dataModel.getSelectedData());
|
|
| 190 | + Class<? extends RootOpenableDto> dataType = dataModel.getRequest().getModuleName().equals("ps") ? fr.ird.observe.dto.data.ps.common.TripDto.class : fr.ird.observe.dto.data.ll.common.TripDto.class;
|
|
| 191 | + Decorator decorator = getDecoratorService().getToolkitIdLabelDecoratorByType(dataType);
|
|
| 192 | + selectedData.forEach(d -> d.registerDecorator(decorator));
|
|
| 193 | + decorator.sort(selectedData, 0);
|
|
| 186 | 194 | int max = selectedData.size();
|
| 187 | 195 | int index = 1;
|
| 188 | 196 | for (ToolkitIdLabel datum : selectedData) {
|
| ... | ... | @@ -224,8 +224,6 @@ observe.constant.StorageStep.ROLES=Security |
| 224 | 224 | observe.constant.StorageStep.ROLES.description=Apply security on database roles
|
| 225 | 225 | observe.constant.StorageStep.SELECT_DATA=Data selection
|
| 226 | 226 | observe.constant.StorageStep.SELECT_DATA.description=Select data to export in backup
|
| 227 | -observe.constant.ValidationModelMode.ALL=Data and referential
|
|
| 228 | -observe.constant.ValidationModelMode.ALL.description=Data and referential
|
|
| 229 | 227 | observe.constant.ValidationModelMode.DATA=Only data
|
| 230 | 228 | observe.constant.ValidationModelMode.DATA.description=Only data
|
| 231 | 229 | observe.constant.ValidationModelMode.REFERENTIEL=Only referential
|
| ... | ... | @@ -224,10 +224,8 @@ observe.constant.StorageStep.ROLES=Seguridad |
| 224 | 224 | observe.constant.StorageStep.ROLES.description=Configuración de la seguridad
|
| 225 | 225 | observe.constant.StorageStep.SELECT_DATA=Selección de datos
|
| 226 | 226 | observe.constant.StorageStep.SELECT_DATA.description=Seleccionar los datos a exportar en la copia de seguridad
|
| 227 | -observe.constant.ValidationModelMode.ALL=Datos y referenciales
|
|
| 228 | -observe.constant.ValidationModelMode.ALL.description=Datos y referenciales
|
|
| 229 | -observe.constant.ValidationModelMode.DATA=Datos del observador
|
|
| 230 | -observe.constant.ValidationModelMode.DATA.description=Datos del observador
|
|
| 227 | +observe.constant.ValidationModelMode.DATA=Datos
|
|
| 228 | +observe.constant.ValidationModelMode.DATA.description=Datos
|
|
| 231 | 229 | observe.constant.ValidationModelMode.REFERENTIEL=Referencial
|
| 232 | 230 | observe.constant.ValidationModelMode.REFERENTIEL.description=Todos los referenciales
|
| 233 | 231 | observe.constant.storage.ConnexionStatus.FAILED=Conexión falló
|
| ... | ... | @@ -224,10 +224,8 @@ observe.constant.StorageStep.ROLES=Sécurité |
| 224 | 224 | observe.constant.StorageStep.ROLES.description=Mise en place de la sécurité
|
| 225 | 225 | observe.constant.StorageStep.SELECT_DATA=Sélection données
|
| 226 | 226 | observe.constant.StorageStep.SELECT_DATA.description=Sélectionner les données à exporter dans la sauvegarde
|
| 227 | -observe.constant.ValidationModelMode.ALL=Données et référentiels
|
|
| 228 | -observe.constant.ValidationModelMode.ALL.description=Données et référentiels
|
|
| 229 | -observe.constant.ValidationModelMode.DATA=Données observées
|
|
| 230 | -observe.constant.ValidationModelMode.DATA.description=Données observées
|
|
| 227 | +observe.constant.ValidationModelMode.DATA=Données
|
|
| 228 | +observe.constant.ValidationModelMode.DATA.description=Données
|
|
| 231 | 229 | observe.constant.ValidationModelMode.REFERENTIEL=Référentiel
|
| 232 | 230 | observe.constant.ValidationModelMode.REFERENTIEL.description=Tous les référentiels
|
| 233 | 231 | observe.constant.storage.ConnexionStatus.FAILED=Connexion échouée
|
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <field-validator type="species_lengthDto">
|
| 60 | 60 | <param name="ratio">1.0</param>
|
| 61 | 61 | <param name="expression"><![CDATA[ species != null && length != null ]]></param>
|
| 62 | - <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
|
|
| 62 | + <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
|
|
| 63 | 63 | </field-validator>
|
| 64 | 64 | </field>
|
| 65 | 65 |
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | <field-validator type="species_weightDto">
|
| 58 | 58 | <param name="ratio">1.0</param>
|
| 59 | 59 | <param name="expression"><![CDATA[ acquisitionMode == 1 && species != null && weight != null ]]></param>
|
| 60 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 60 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
|
|
| 61 | 61 | </field-validator>
|
| 62 | 62 | </field>
|
| 63 | 63 |
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <field-validator type="species_lengthDto">
|
| 60 | 60 | <param name="ratio">1.0</param>
|
| 61 | 61 | <param name="expression"><![CDATA[ species != null && length != null ]]></param>
|
| 62 | - <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
|
|
| 62 | + <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
|
|
| 63 | 63 | </field-validator>
|
| 64 | 64 | </field>
|
| 65 | 65 |
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | <field-validator type="species_weightDto">
|
| 58 | 58 | <param name="ratio">1.0</param>
|
| 59 | 59 | <param name="expression"><![CDATA[ acquisitionMode == 1 && species != null && weight != null ]]></param>
|
| 60 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 60 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
|
|
| 61 | 61 | </field-validator>
|
| 62 | 62 | </field>
|
| 63 | 63 |
| ... | ... | @@ -99,7 +99,7 @@ |
| 99 | 99 | <field-validator type="species_lengthDto">
|
| 100 | 100 | <param name="ratio">1.0</param>
|
| 101 | 101 | <param name="expression"><![CDATA[ meanLength != null ]]></param>
|
| 102 | - <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
|
|
| 102 | + <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${meanLength}</message>
|
|
| 103 | 103 | </field-validator>
|
| 104 | 104 | </field>
|
| 105 | 105 | |
| ... | ... | @@ -113,7 +113,7 @@ |
| 113 | 113 | <field-validator type="species_weightDto">
|
| 114 | 114 | <param name="ratio">1.0</param>
|
| 115 | 115 | <param name="expression"><![CDATA[ meanWeight != null ]]></param>
|
| 116 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 116 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
|
|
| 117 | 117 | </field-validator>
|
| 118 | 118 | </field>
|
| 119 | 119 |
| ... | ... | @@ -99,7 +99,7 @@ |
| 99 | 99 | <field-validator type="species_lengthDto">
|
| 100 | 100 | <param name="ratio">1.0</param>
|
| 101 | 101 | <param name="expression"><![CDATA[ meanLength != null ]]></param>
|
| 102 | - <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
|
|
| 102 | + <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${meanLength}</message>
|
|
| 103 | 103 | </field-validator>
|
| 104 | 104 | </field>
|
| 105 | 105 | |
| ... | ... | @@ -113,7 +113,7 @@ |
| 113 | 113 | <field-validator type="species_weightDto">
|
| 114 | 114 | <param name="ratio">1.0</param>
|
| 115 | 115 | <param name="expression"><![CDATA[ meanWeight != null ]]></param>
|
| 116 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 116 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
|
|
| 117 | 117 | </field-validator>
|
| 118 | 118 | </field>
|
| 119 | 119 |
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <field-validator type="species_lengthDto">
|
| 60 | 60 | <param name="ratio">1.0</param>
|
| 61 | 61 | <param name="expression"><![CDATA[ length != null ]]></param>
|
| 62 | - <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
|
|
| 62 | + <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
|
|
| 63 | 63 | </field-validator>
|
| 64 | 64 | </field>
|
| 65 | 65 | |
| ... | ... | @@ -138,7 +138,7 @@ |
| 138 | 138 | <field-validator type="species_weightDto">
|
| 139 | 139 | <param name="ratio">1.0</param>
|
| 140 | 140 | <param name="expression"><![CDATA[ acquisitionMode == 1 && weight != null ]]></param>
|
| 141 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 141 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
|
|
| 142 | 142 | </field-validator>
|
| 143 | 143 | </field>
|
| 144 | 144 |
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <field-validator type="species_lengthDto">
|
| 60 | 60 | <param name="ratio">1.0</param>
|
| 61 | 61 | <param name="expression"><![CDATA[ length != null ]]></param>
|
| 62 | - <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
|
|
| 62 | + <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
|
|
| 63 | 63 | </field-validator>
|
| 64 | 64 | </field>
|
| 65 | 65 | |
| ... | ... | @@ -138,7 +138,7 @@ |
| 138 | 138 | <field-validator type="species_weightDto">
|
| 139 | 139 | <param name="ratio">1.0</param>
|
| 140 | 140 | <param name="expression"><![CDATA[ acquisitionMode == 1 && weight != null ]]></param>
|
| 141 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 141 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
|
|
| 142 | 142 | </field-validator>
|
| 143 | 143 | </field>
|
| 144 | 144 |
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | <field-validator type="species_weightDto">
|
| 48 | 48 | <param name="ratio">1.0</param>
|
| 49 | 49 | <param name="expression"><![CDATA[ meanWeight != null ]]></param>
|
| 50 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 50 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
|
|
| 51 | 51 | </field-validator>
|
| 52 | 52 | </field>
|
| 53 | 53 |
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | <field-validator type="species_weightDto">
|
| 48 | 48 | <param name="ratio">1.0</param>
|
| 49 | 49 | <param name="expression"><![CDATA[ meanWeight != null ]]></param>
|
| 50 | - <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
|
|
| 50 | + <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
|
|
| 51 | 51 | </field-validator>
|
| 52 | 52 | </field>
|
| 53 | 53 |
| ... | ... | @@ -1599,8 +1599,8 @@ observe.referential.common.Species.scientificLabel=Scientific label |
| 1599 | 1599 | observe.referential.common.Species.speciesGroup=Species group
|
| 1600 | 1600 | observe.referential.common.Species.taillePoids.characteristics=Length-Weight characteristics
|
| 1601 | 1601 | observe.referential.common.Species.type=Species
|
| 1602 | -observe.referential.common.Species.validation.length.bound=Length must be bound between %s and %s.
|
|
| 1603 | -observe.referential.common.Species.validation.weight.bound=Weight must be bound between %s and %s.
|
|
| 1602 | +observe.referential.common.Species.validation.length.bound=Length must be bound between %s and %s, but value was %s.
|
|
| 1603 | +observe.referential.common.Species.validation.weight.bound=Weight must be bound between %s and %s, but value was %s.
|
|
| 1604 | 1604 | observe.referential.common.Species.wormsId=Worms id
|
| 1605 | 1605 | observe.referential.common.SpeciesGroup.speciesGroupReleaseMode=Species group release mode
|
| 1606 | 1606 | observe.referential.common.SpeciesGroup.speciesGroupReleaseModeTab=Release modes
|
| ... | ... | @@ -1599,8 +1599,8 @@ observe.referential.common.Species.scientificLabel=Texto científico |
| 1599 | 1599 | observe.referential.common.Species.speciesGroup=Grupo de especie de fauna
|
| 1600 | 1600 | observe.referential.common.Species.taillePoids.characteristics=Características Talla-Peso
|
| 1601 | 1601 | observe.referential.common.Species.type=Especie
|
| 1602 | -observe.referential.common.Species.validation.length.bound=La talla para esta especie debe estár comprendida entre %1$s y %2$s.
|
|
| 1603 | -observe.referential.common.Species.validation.weight.bound=La peso para esta especie debe estar comprendida entre %1$s y %2$s.
|
|
| 1602 | +observe.referential.common.Species.validation.length.bound=La talla para esta especie debe estár comprendida entre %1$s y %2$s, pero vale la pena %3$s.
|
|
| 1603 | +observe.referential.common.Species.validation.weight.bound=La peso para esta especie debe estar comprendida entre %1$s y %2$s, pero vale la pena %3$s.
|
|
| 1604 | 1604 | observe.referential.common.Species.wormsId=Worms
|
| 1605 | 1605 | observe.referential.common.SpeciesGroup.speciesGroupReleaseMode=Modes de libération \#TODO
|
| 1606 | 1606 | observe.referential.common.SpeciesGroup.speciesGroupReleaseModeTab=Modes de libération \#TODO
|
| ... | ... | @@ -1599,8 +1599,8 @@ observe.referential.common.Species.scientificLabel=Libellé scientifique |
| 1599 | 1599 | observe.referential.common.Species.speciesGroup=Groupe espèce
|
| 1600 | 1600 | observe.referential.common.Species.taillePoids.characteristics=Caractéristiques Taille-Poids
|
| 1601 | 1601 | observe.referential.common.Species.type=Espèce
|
| 1602 | -observe.referential.common.Species.validation.length.bound=La taille pour cette espèce doit être comprise entre %1$s et %2$s.
|
|
| 1603 | -observe.referential.common.Species.validation.weight.bound=Le poids pour cette espèce doit être compris entre %1$s et %2$s.
|
|
| 1602 | +observe.referential.common.Species.validation.length.bound=La taille pour cette espèce doit être comprise entre %1$s et %2$s, mais vaut %3$s.
|
|
| 1603 | +observe.referential.common.Species.validation.weight.bound=Le poids pour cette espèce doit être compris entre %1$s et %2$s, mais vaut %3$s.
|
|
| 1604 | 1604 | observe.referential.common.Species.wormsId=Worms
|
| 1605 | 1605 | observe.referential.common.SpeciesGroup.speciesGroupReleaseMode=Mode de libération
|
| 1606 | 1606 | observe.referential.common.SpeciesGroup.speciesGroupReleaseModeTab=Modes de libération
|
| ... | ... | @@ -843,12 +843,12 @@ |
| 843 | 843 | {
|
| 844 | 844 | "fieldName": "length",
|
| 845 | 845 | "scope": "ERROR",
|
| 846 | - "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58."
|
|
| 846 | + "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58, mais vaut 12.0."
|
|
| 847 | 847 | },
|
| 848 | 848 | {
|
| 849 | 849 | "fieldName": "weight",
|
| 850 | 850 | "scope": "ERROR",
|
| 851 | - "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05."
|
|
| 851 | + "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05, mais vaut 12.0."
|
|
| 852 | 852 | }
|
| 853 | 853 | ]
|
| 854 | 854 | },
|
| ... | ... | @@ -864,12 +864,12 @@ |
| 864 | 864 | {
|
| 865 | 865 | "fieldName": "length",
|
| 866 | 866 | "scope": "ERROR",
|
| 867 | - "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58."
|
|
| 867 | + "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58, mais vaut 13.0."
|
|
| 868 | 868 | },
|
| 869 | 869 | {
|
| 870 | 870 | "fieldName": "weight",
|
| 871 | 871 | "scope": "ERROR",
|
| 872 | - "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05."
|
|
| 872 | + "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05, mais vaut 14.0."
|
|
| 873 | 873 | }
|
| 874 | 874 | ]
|
| 875 | 875 | }
|
| ... | ... | @@ -896,7 +896,7 @@ |
| 896 | 896 | {
|
| 897 | 897 | "fieldName": "length",
|
| 898 | 898 | "scope": "ERROR",
|
| 899 | - "message": "La taille pour cette espèce doit être comprise entre 19.8 et 141.4."
|
|
| 899 | + "message": "La taille pour cette espèce doit être comprise entre 19.8 et 141.4, mais vaut 12.0."
|
|
| 900 | 900 | }
|
| 901 | 901 | ]
|
| 902 | 902 | },
|
| ... | ... | @@ -912,7 +912,7 @@ |
| 912 | 912 | {
|
| 913 | 913 | "fieldName": "length",
|
| 914 | 914 | "scope": "ERROR",
|
| 915 | - "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0."
|
|
| 915 | + "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0, mais vaut 12.0."
|
|
| 916 | 916 | }
|
| 917 | 917 | ]
|
| 918 | 918 | },
|
| ... | ... | @@ -928,7 +928,7 @@ |
| 928 | 928 | {
|
| 929 | 929 | "fieldName": "length",
|
| 930 | 930 | "scope": "ERROR",
|
| 931 | - "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0."
|
|
| 931 | + "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0, mais vaut 14.0."
|
|
| 932 | 932 | }
|
| 933 | 933 | ]
|
| 934 | 934 | }
|
| ... | ... | @@ -33,6 +33,7 @@ import java.text.ParseException; |
| 33 | 33 | import java.text.SimpleDateFormat;
|
| 34 | 34 | import java.util.List;
|
| 35 | 35 | import java.util.Locale;
|
| 36 | +import java.util.Objects;
|
|
| 36 | 37 | import java.util.Set;
|
| 37 | 38 | |
| 38 | 39 | /**
|
| ... | ... | @@ -43,8 +44,10 @@ import java.util.Set; |
| 43 | 44 | */
|
| 44 | 45 | public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<ToolkitIdLabel> {
|
| 45 | 46 | private static final Logger log = LogManager.getLogger(ToolkitIdLabelDecoratorRenderer.class);
|
| 46 | - public final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
|
| 47 | - public final SimpleDateFormat timestampFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
|
|
| 47 | + public final SimpleDateFormat frenchDateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
|
| 48 | + public final SimpleDateFormat frenchTimestampFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
|
|
| 49 | + public final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
| 50 | + public final SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
| 48 | 51 | |
| 49 | 52 | public ToolkitIdLabelDecoratorRenderer(Set<String> codeProperties) {
|
| 50 | 53 | super(ToolkitIdLabel.class);
|
| ... | ... | @@ -60,12 +63,12 @@ public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<T |
| 60 | 63 | }
|
| 61 | 64 | if (isDate(propertyName)) {
|
| 62 | 65 | // sort on date, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy)
|
| 63 | - sortByDate(pos, dateFormat, dataList);
|
|
| 66 | + sortByDate(pos, Objects.equals(locale.getLanguage(), "fr") ? frenchDateFormat : dateFormat, dataList);
|
|
| 64 | 67 | return;
|
| 65 | 68 | }
|
| 66 | 69 | if (isTimestamp(propertyName)) {
|
| 67 | 70 | // sort on timestamp, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy HH:mm)
|
| 68 | - sortByDate(pos, timestampFormat, dataList);
|
|
| 71 | + sortByDate(pos, Objects.equals(locale.getLanguage(), "fr") ? frenchTimestampFormat : timestampFormat, dataList);
|
|
| 69 | 72 | return;
|
| 70 | 73 | }
|
| 71 | 74 | // always sort as using natural order from numbers
|
| ... | ... | @@ -82,11 +82,15 @@ public class ToolkitIdLabel extends ToolkitIdDtoBean implements Decorated { |
| 82 | 82 | |
| 83 | 83 | public String[] textParts() {
|
| 84 | 84 | if (textParts == null) {
|
| 85 | - int length = DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR.length();
|
|
| 85 | + String separator = DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR;
|
|
| 86 | + if (!text.contains(separator)) {
|
|
| 87 | + separator = DecoratorDefinition.DEFAULT_RENDERER_SEPARATOR;
|
|
| 88 | + }
|
|
| 89 | + int length = separator.length();
|
|
| 86 | 90 | List<String> tokens = new ArrayList<>();
|
| 87 | 91 | int currentIndex = 0;
|
| 88 | 92 | int nextSeparator;
|
| 89 | - while ((nextSeparator = text.indexOf(DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR, currentIndex)) > -1) {
|
|
| 93 | + while ((nextSeparator = text.indexOf(separator, currentIndex)) > -1) {
|
|
| 90 | 94 | // found a new part
|
| 91 | 95 | tokens.add(text.substring(currentIndex, nextSeparator));
|
| 92 | 96 | currentIndex = nextSeparator + length;
|
| ... | ... | @@ -94,7 +98,7 @@ public class ToolkitIdLabel extends ToolkitIdDtoBean implements Decorated { |
| 94 | 98 | if (currentIndex < text.length()) {
|
| 95 | 99 | tokens.add(text.substring(currentIndex));
|
| 96 | 100 | }
|
| 97 | - if (text.endsWith(DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR)) {
|
|
| 101 | + if (text.endsWith(separator)) {
|
|
| 98 | 102 | tokens.add("");
|
| 99 | 103 | }
|
| 100 | 104 | textParts = tokens.toArray(new String[0]);
|
| ... | ... | @@ -320,14 +320,14 @@ public class DtoFormValidatorTransformer extends ObjectModelTransformerToJava { |
| 320 | 320 | " <field-validator type=\"species_weightDto\">\n" +
|
| 321 | 321 | " <param name=\"ratio\">1.0</param>\n" +
|
| 322 | 322 | " <param name=\"expression\"><![CDATA[ %2$s ]]></param>\n" +
|
| 323 | - " <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>\n" +
|
|
| 323 | + " <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${%1$s}</message>\n" +
|
|
| 324 | 324 | " </field-validator>\n";
|
| 325 | 325 | private static final String SPECIES_LENGTH_FIELD_TEMPLATE =
|
| 326 | 326 | " <!-- check species length bound on %1$s if %2$s -->\n" +
|
| 327 | 327 | " <field-validator type=\"species_lengthDto\">\n" +
|
| 328 | 328 | " <param name=\"ratio\">1.0</param>\n" +
|
| 329 | 329 | " <param name=\"expression\"><![CDATA[ %2$s ]]></param>\n" +
|
| 330 | - " <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>\n" +
|
|
| 330 | + " <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${%1$s}</message>\n" +
|
|
| 331 | 331 | " </field-validator>\n";
|
| 332 | 332 | private static final String COLLECTION_UNIQUE_KEY_FIELD_TEMPLATE =
|
| 333 | 333 | " <!-- check unique value on %1$s for tuple %2$s -->\n" +
|