Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- 7199 discussions
[Git][ultreiaio/ird-observe][develop] 2 commits: Centralisdation de l'utilisation de formatter pour les dates et horodatage...
by Tony CHEMIT (@tchemit) 05 Sep '23
by Tony CHEMIT (@tchemit) 05 Sep '23
05 Sep '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
a9b945a9 by Tony Chemit at 2023-09-05T13:19:59+02:00
Centralisdation de l'utilisation de formatter pour les dates et horodatage suivant la locale utilisée
- - - - -
383d2cc2 by Tony Chemit at 2023-09-05T13:42:15+02:00
Ajout de la configuration dans le rapport de validation - See #2215
- - - - -
9 changed files:
- client/datasource/actions/src/main/i18n/templates/validationReport_en_GB.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_es_ES.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_fr_FR.ftl
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateConfigUI.jaxx
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/Start.java
- client/runner/src/test/java/fr/ird/observe/client/ObserveTextGeneratorTest.java
- toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
- toolkit/api/src/main/java/fr/ird/observe/dto/I18nDecoratorHelper.java
Changes:
=====================================
client/datasource/actions/src/main/i18n/templates/validationReport_en_GB.ftl
=====================================
@@ -60,7 +60,7 @@
<meta charset="UTF-8">
<meta lang="en">
<meta content="text/html">
- <title>Rapport de validation</title>
+ <title>Validation report</title>
<style>
#result {
list-style-type: none;
@@ -79,7 +79,6 @@
.caret::before {
content: "\1f5c0";
- /*content: "\25B6";*/
color: #027BFF;
display: inline-block;
margin-right: 6px;
@@ -87,7 +86,6 @@
.caretSymbol::before {
content: "\1f5c0";
- /*content: "\25B6";*/
color: #027BFF;
display: inline-block;
margin-right: 6px;
@@ -106,7 +104,6 @@
.caret-down::before {
content: "\1f5c1";
color: #027BFF;
- /*transform: rotate(90deg);*/
}
#result .nested {
@@ -122,10 +119,8 @@
}
table {
- /*font-family: arial, sans-serif;*/
border-collapse: collapse;
width: 90%;
- /*margin-left: 20px;*/
margin-top: 10px;
margin-bottom: 10px;
}
@@ -171,26 +166,30 @@
</style>
</head>
<body>
-<b>TODO</b>
-<h1>Rapport de validation</h1>
+<h1>Validation report</h1>
<h2>Configuration</h2>
<ul>
- <li>Rapport de validation généré le ${.data_model.now}</li>
- <li>Niveau(x) de validation :
+ <li>Validation report generated at ${.data_model.now}</li>
+ <li>Type of data to validate: <#if .data_model.modelMode.name()=="DATA">Business data<#else>Referential</#if></li>
+ <li>Validation scope(s):
<#list .data_model.scopes as scope>
<span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
</#list>
</li>
- <li>Context : ${.data_model.contextName}</li>
+ <li>Max speed value used in activities speed validation: ${.data_model.validationSpeedMaxValue}</li>
+ <li>Force validation of activities speed: ${.data_model.validationSpeedEnable?string("yes", "no")}</li>
+ <li>Force validation of species length max: ${.data_model.validationLengthWeightEnable?string("yes", "no")}</li>
+ <li>To bypass validation of disabled referential (display them as warnings): ${.data_model.validationUseDisabledReferential?string("yes", "no")}</li>
+ <li>Dictionary of required observed systems per species on senne set: ...</li>
</ul>
-<h2>Résultat</h2>
+<h2>Results</h2>
<h3>Notes</h3>
-<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
-<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
-<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
+<div class="information">To expand a node, click on icon <span class="caretSymbol"></span> (Combination with key <b>Shift</b> will also expand his inner sub-tree).</div>
+<div class="information">To collapse a note, click on icon <span class="caret-down"></span> (Combination with key <b>Shift</b> will also collapse his inner sub-tree).</div>
+<div class="information">A click on a id will select it automatically.</div>
<br/>
<#assign rootNode = .data_model.rootNode />
<ul id="result">
@@ -202,7 +201,6 @@
<script>
function expand(node) {
- // console.info("will expand child " + node.id);
node.classList.add("caret-down");
node.parentElement.querySelector(".nested").classList.add("active");
}
@@ -224,11 +222,9 @@
for (const caret of document.getElementsByClassName("caret")) {
caret.addEventListener("click", function (event) {
let expanded = this.classList.contains("caret-down");
- // console.info("do click on " + this.id+", was expanded? "+expanded);
toggle(expanded, this);
if (event.shiftKey) {
- // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
toggle(expanded, child);
}
=====================================
client/datasource/actions/src/main/i18n/templates/validationReport_es_ES.ftl
=====================================
@@ -60,7 +60,7 @@
<meta charset="UTF-8">
<meta lang="es">
<meta content="text/html">
- <title>Rapport de validation</title>
+ <title>Validation report</title>
<style>
#result {
list-style-type: none;
@@ -79,7 +79,6 @@
.caret::before {
content: "\1f5c0";
- /*content: "\25B6";*/
color: #027BFF;
display: inline-block;
margin-right: 6px;
@@ -87,7 +86,6 @@
.caretSymbol::before {
content: "\1f5c0";
- /*content: "\25B6";*/
color: #027BFF;
display: inline-block;
margin-right: 6px;
@@ -106,7 +104,6 @@
.caret-down::before {
content: "\1f5c1";
color: #027BFF;
- /*transform: rotate(90deg);*/
}
#result .nested {
@@ -122,10 +119,8 @@
}
table {
- /*font-family: arial, sans-serif;*/
border-collapse: collapse;
width: 90%;
- /*margin-left: 20px;*/
margin-top: 10px;
margin-bottom: 10px;
}
@@ -171,25 +166,31 @@
</style>
</head>
<body>
-<h1>Rapport de validation</h1>
+<b>TODO</b>
+<h1>Validation report</h1>
<h2>Configuration</h2>
<ul>
- <li>Rapport de validation généré le ${.data_model.now}</li>
- <li>Niveau(x) de validation :
+ <li>Validation report generated at ${.data_model.now}</li>
+ <li>Tipo de datos a validar: <#if .data_model.modelMode.name()=="DATA">Datos<#else>Referencial</#if></li>
+ <li>Validation scope(s):
<#list .data_model.scopes as scope>
<span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
</#list>
</li>
- <li>Context : ${.data_model.contextName}</li>
+ <li>Velocidad máxima autorizada en el control de las velocidades de las actividades: ${.data_model.validationSpeedMaxValue}</li>
+ <li>Forzar la validación de las velocidades de las actividades: ${.data_model.validationSpeedEnable?string("yes", "no")}</li>
+ <li>Forzar la validación de la talla de especies min/max: ${.data_model.validationLengthWeightEnable?string("yes", "no")}</li>
+ <li>Para que la utilización de referenciales obsoletos sea autorizado (se advertirá en los mensajes de validación): ${.data_model.validationUseDisabledReferential?string("yes", "no")}</li>
+ <li>Diccionario de sistemas observados requeridos por especies en la modalidad de cerco: ...</li>
</ul>
-<h2>Résultat</h2>
+<h2>Results</h2>
<h3>Notes</h3>
-<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
-<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
-<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
+<div class="information">To expand a node, click on icon <span class="caretSymbol"></span> (Combination with key <b>Shift</b> will also expand his inner sub-tree).</div>
+<div class="information">To collapse a note, click on icon <span class="caret-down"></span> (Combination with key <b>Shift</b> will also collapse his inner sub-tree).</div>
+<div class="information">A click on a id will select it automatically.</div>
<br/>
<#assign rootNode = .data_model.rootNode />
<ul id="result">
@@ -201,7 +202,6 @@
<script>
function expand(node) {
- // console.info("will expand child " + node.id);
node.classList.add("caret-down");
node.parentElement.querySelector(".nested").classList.add("active");
}
@@ -223,11 +223,9 @@
for (const caret of document.getElementsByClassName("caret")) {
caret.addEventListener("click", function (event) {
let expanded = this.classList.contains("caret-down");
- // console.info("do click on " + this.id+", was expanded? "+expanded);
toggle(expanded, this);
if (event.shiftKey) {
- // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
toggle(expanded, child);
}
=====================================
client/datasource/actions/src/main/i18n/templates/validationReport_fr_FR.ftl
=====================================
@@ -79,7 +79,6 @@
.caret::before {
content: "\1f5c0";
- /*content: "\25B6";*/
color: #027BFF;
display: inline-block;
margin-right: 6px;
@@ -87,7 +86,6 @@
.caretSymbol::before {
content: "\1f5c0";
- /*content: "\25B6";*/
color: #027BFF;
display: inline-block;
margin-right: 6px;
@@ -106,7 +104,6 @@
.caret-down::before {
content: "\1f5c1";
color: #027BFF;
- /*transform: rotate(90deg);*/
}
#result .nested {
@@ -122,7 +119,6 @@
}
table {
- /*font-family: arial, sans-serif;*/
border-collapse: collapse;
width: 90%;
margin-left: 20px;
@@ -177,12 +173,17 @@
<ul>
<li>Rapport de validation généré le ${.data_model.now}</li>
+ <li>Type de données à valider : <#if .data_model.modelMode.name()=="DATA">Données métiers<#else>Référentiel</#if></li>
<li>Niveau(x) de validation :
<#list .data_model.scopes as scope>
<span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
</#list>
</li>
- <li>Context : ${.data_model.contextName}</li>
+ <li>Vitesse maximale autorisée dans le contrôle des vitesses d'activités : ${.data_model.validationSpeedMaxValue}</li>
+ <li>Forcer la validation des vitesses d'activités : ${.data_model.validationSpeedEnable?string("Oui", "Non")}</li>
+ <li>Forcer la validation des bornes min/max de taille d'espèce : ${.data_model.validationLengthWeightEnable?string("Oui", "Non")}</li>
+ <li>Pour autoriser l'utilisation de référentiels obsolètes (les messages de validation passent en avertissement): ${.data_model.validationUseDisabledReferential?string("Oui", "Non")}</li>
+ <li>Dictionnaire des systèmes observées requis par espèces dans le modèle Seine: ...</li>
</ul>
<h2>Résultat</h2>
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateConfigUI.jaxx
=====================================
@@ -104,7 +104,6 @@ public void destroy() {
<JSeparator orientation='{JSeparator.HORIZONTAL}'/>
</cell>
</row>
- <!-- TODO See https://gitlab.com/ultreiaio/ird-observe/-/issues/2212-->
<row>
<cell anchor="west">
<JLabel id='validationSpeedMaxValueLabel' styleClass="skipI18n"/>
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateModel.java
=====================================
@@ -30,6 +30,7 @@ import fr.ird.observe.client.datasource.editor.api.wizard.connexion.DataSourceSe
import fr.ird.observe.datasource.configuration.ObserveDataSourceInformation;
import fr.ird.observe.decoration.DecoratorService;
import fr.ird.observe.dto.BusinessDto;
+import fr.ird.observe.dto.I18nDecoratorHelper;
import fr.ird.observe.dto.ToolkitIdLabel;
import fr.ird.observe.dto.referential.ReferentialDto;
import fr.ird.observe.dto.validation.DtoValidationContext;
@@ -42,6 +43,7 @@ import fr.ird.observe.validation.definition.ValidatorDto;
import io.ultreia.java4all.application.template.spi.GenerateTemplate;
import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
import io.ultreia.java4all.decoration.Decorator;
+import io.ultreia.java4all.i18n.I18n;
import io.ultreia.java4all.lang.Strings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -76,7 +78,10 @@ public class ValidateModel extends AdminActionModel {
*/
private static final String REPORT_PATTERN = "report-%1$tF--%1$tk-%1$tM-%1$tS.html";
private static final Logger log = LogManager.getLogger(ValidateModel.class);
- private static final SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyy HH:mm");
+ /**
+ * Timestamp formatter.
+ */
+ private final SimpleDateFormat timestampFormatter;
/**
* les scopes a utiliser
*/
@@ -133,6 +138,7 @@ public class ValidateModel extends AdminActionModel {
public ValidateModel() {
super(AdminStep.VALIDATE);
scopes = EnumSet.noneOf(NuitonValidatorScope.class);
+ timestampFormatter = I18nDecoratorHelper.newTimestampFormat(I18n.getDefaultLocale());
}
@Override
@@ -369,7 +375,7 @@ public class ValidateModel extends AdminActionModel {
}
public String getNow() {
- return df.format(new Date());
+ return timestampFormatter.format(new Date());
}
public boolean withoutMessages() {
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/Start.java
=====================================
@@ -168,8 +168,6 @@ public class Start extends ValidateUIActionSupport {
ValidationResult result;
- //FIXME Ajouter la configuration dans le rapport généré
- //FIXME Ajouter la configuration de la base dans le rapport généré
ValidationRequestConfiguration configuration = stepModel.toValidationRequestConfiguration();
if (dataModel.getConfig().isLoadReferential()) {
=====================================
client/runner/src/test/java/fr/ird/observe/client/ObserveTextGeneratorTest.java
=====================================
@@ -66,6 +66,7 @@ public class ObserveTextGeneratorTest extends ClientTestSupport implements WithC
request.setScopes(new LinkedHashSet<>(Arrays.asList(NuitonValidatorScope.ERROR, NuitonValidatorScope.WARNING)));
request.setValidationContext(DtoValidationContext.UPDATE_VALIDATION_CONTEXT);
configuration.setValidationSpeedEnable(true);
+ configuration.setValidationSpeedMaxValue(30f);
configuration.setValidationLengthWeightEnable(true);
ValidationResult result = dataSource.getValidateService().validateData(configuration, request);
@@ -76,6 +77,7 @@ public class ObserveTextGeneratorTest extends ClientTestSupport implements WithC
model.addScope(NuitonValidatorScope.ERROR);
model.addScope(NuitonValidatorScope.WARNING);
model.setContextName(request.getValidationContext());
+ model.setValidationSpeedMaxValue(configuration.getValidationSpeedMaxValue());
model.setModelMode(ValidationModelMode.DATA);
model.setValidationResult(result);
String content = ValidateModelTemplate.generate(model);
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
=====================================
@@ -24,6 +24,7 @@ package fr.ird.observe.decoration;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
+import fr.ird.observe.dto.I18nDecoratorHelper;
import fr.ird.observe.dto.ToolkitIdLabel;
import io.ultreia.java4all.decoration.DecoratorDefinition;
import org.apache.logging.log4j.LogManager;
@@ -33,7 +34,6 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Locale;
-import java.util.Objects;
import java.util.Set;
/**
@@ -44,10 +44,6 @@ import java.util.Set;
*/
public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<ToolkitIdLabel> {
private static final Logger log = LogManager.getLogger(ToolkitIdLabelDecoratorRenderer.class);
- public final SimpleDateFormat frenchDateFormat = new SimpleDateFormat("dd/MM/yyyy");
- public final SimpleDateFormat frenchTimestampFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
- public final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- public final SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
public ToolkitIdLabelDecoratorRenderer(Set<String> codeProperties) {
super(ToolkitIdLabel.class);
@@ -63,12 +59,12 @@ public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<T
}
if (isDate(propertyName)) {
// sort on date, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy)
- sortByDate(pos, Objects.equals(locale.getLanguage(), "fr") ? frenchDateFormat : dateFormat, dataList);
+ sortByDate(pos, I18nDecoratorHelper.newDateFormat(locale), dataList);
return;
}
if (isTimestamp(propertyName)) {
// sort on timestamp, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy HH:mm)
- sortByDate(pos, Objects.equals(locale.getLanguage(), "fr") ? frenchTimestampFormat : timestampFormat, dataList);
+ sortByDate(pos, I18nDecoratorHelper.newTimestampFormat(locale), dataList);
return;
}
// always sort as using natural order from numbers
=====================================
toolkit/api/src/main/java/fr/ird/observe/dto/I18nDecoratorHelper.java
=====================================
@@ -28,9 +28,11 @@ import io.ultreia.java4all.i18n.spi.bean.BeanPropertyI18nKeyProducerProvider;
import io.ultreia.java4all.lang.Numbers;
import io.ultreia.java4all.lang.Strings;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.Locale;
+import java.util.Objects;
import java.util.ServiceLoader;
import static io.ultreia.java4all.i18n.I18n.getDefaultLocale;
@@ -77,6 +79,12 @@ public abstract class I18nDecoratorHelper extends BeanPropertyI18nKeyProducerPro
return INSTANCE;
}
+ public static SimpleDateFormat newDateFormat(Locale locale) {
+ return Objects.equals(locale.getLanguage(), "fr") ? new SimpleDateFormat("dd/MM/yyyy") : new SimpleDateFormat("yyyy-MM-dd");
+ }
+ public static SimpleDateFormat newTimestampFormat(Locale locale) {
+ return Objects.equals(locale.getLanguage(), "fr") ? new SimpleDateFormat("dd/MM/yyyy HH:mm") : new SimpleDateFormat("yyyy-MM-dd HH:mm");
+ }
public static String getTypeKey(Class<?> key) {
return getPropertyI18nKey(key, "type");
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/d6a58f5b5550a2a739be1a32…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/d6a58f5b5550a2a739be1a32…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 12 commits: Rajouter un type 'Liste de choix' dans GearCharacteristicType et une nouvelle...
by Tony CHEMIT (@tchemit) 01 Sep '23
by Tony CHEMIT (@tchemit) 01 Sep '23
01 Sep '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
6f30ef06 by Tony Chemit at 2023-09-01T18:55:37+02:00
Rajouter un type 'Liste de choix' dans GearCharacteristicType et une nouvelle table gearCharacteristicListItem et remplissage des listes utilisées à l'AZTI - Closes #2764
- - - - -
ec25f0ff by Tony Chemit at 2023-09-01T18:55:37+02:00
Renommage I18n ValidationModelMode.DATA et suppression de ValidationModelMode.ALL
- - - - -
95d1abf9 by Tony Chemit at 2023-09-01T18:55:37+02:00
Sur les validateurs de poids/taille d'espèce, rajouter dans le message de validation la valeur incriminée - Closes #2771
- - - - -
68ce791c by Tony Chemit at 2023-09-01T18:55:37+02:00
Pouvoir trier par date (ou timestamp) des ToolkitIdLabel non en français
- - - - -
7e56a98d by Tony Chemit at 2023-09-01T18:55:37+02:00
Pouvoir découper un ToolkitIdLabel même si son texte n'est pas comme prévu séparé par le # (mais pas un « - »)
- - - - -
70d57dd0 by Tony Chemit at 2023-09-01T18:55:37+02:00
Trier les marées sélectionnées pour toujours obtenir l'ordre chronologique sur les marées - See #2706
- - - - -
0d1041c1 by Tony Chemit at 2023-09-01T18:55:37+02:00
Reordonner les numéros d'ordre des activités Logbook si on passe en mode horodaté lors de la sauvegarde de la marée - See #2729
- - - - -
80df174e by Tony Chemit at 2023-09-01T18:55:37+02:00
Alignement des identifiants de la table LastUpdateDate
- - - - -
9dd37758 by Tony Chemit at 2023-09-01T18:55:37+02:00
Rajouter un type Date (simple et sans time zone) dans GearCharacteristicType (correction de la caractéristique ajoutée)
- See #2763
Mise à jour de la date de migration de la version 9.2
- - - - -
d0034c0f by Tony Chemit at 2023-09-01T18:55:37+02:00
Ajout d'un décorateur «Long» pour GearCharacteristicListItem - See #2764
- - - - -
7b30e533 by Tony Chemit at 2023-09-01T18:57:46+02:00
Ne pas autoriser l'utilisation d'une caractéristique plus d'une fois sur le formulaire équipement - Closes #2772
- - - - -
d6a58f5b by Tony Chemit at 2023-09-01T19:46:56+02:00
Rajouter un type 'Liste de choix' dans GearCharacteristicType et une nouvelle table gearCharacteristicListItem et remplissage des listes utilisées à l'AZTI - Closes #2764
- - - - -
30 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/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearCharacteristicEditor.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearUseFeaturesMeasurementsTableModelSupport.java
- client/datasource/editor/common/src/main/resources/fr/ird/observe/client/datasource/editor/common/referential/common/GearCharacteristicListItemUINavigationNode.scope
- 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/dto-decoration/src/main/java/fr/ird/observe/dto/referential/common/GearCharacteristicListItemDtoLongDecoratorDefinition.java
- + core/api/dto-decoration/src/main/java/fr/ird/observe/dto/referential/common/GearCharacteristicListItemReferenceLongDecoratorDefinition.java
- 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/persistence/decoration/src/main/java/fr/ird/observe/entities/referential/common/GearCharacteristicListItemLongDecoratorDefinition.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ll/common/TripSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/common/TripSpi.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/logbook/RouteSpi.java
- core/persistence/migration/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_2.java
- core/persistence/migration/src/main/resources/db/migration/v9/9.2/10_issue-2763-tck-common.sql
- core/persistence/migration/src/main/resources/db/migration/v9/9.2/11_02_issue-2764_fill-table-common_gearcharacteristiclistitem-common.sql
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c0489aaf18324efa751c8b77…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c0489aaf18324efa751c8b77…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 5 commits: Renommage I18n ValidationModelMode.DATA et suppression de ValidationModelMode.ALL
by Tony CHEMIT (@tchemit) 31 Aug '23
by Tony CHEMIT (@tchemit) 31 Aug '23
31 Aug '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
e2d892cd by Tony Chemit at 2023-08-31T16:03:59+02:00
Renommage I18n ValidationModelMode.DATA et suppression de ValidationModelMode.ALL
- - - - -
c21af7d2 by Tony Chemit at 2023-08-31T16:20:22+02:00
Sur les validateurs de poids/taille d'espèce, rajouter dans le message de validation la valeur incriminée
- - - - -
e18d911f by Tony Chemit at 2023-08-31T17:24:40+02:00
Pouvoir trier par date (ou timestamp) des ToolkitIdLabel non en français
- - - - -
264938d9 by Tony Chemit at 2023-08-31T17:25:31+02:00
Pouvoir découper un ToolkitIdLabel même si son texte n'est pas comme prévu séparé par le # (mais pas un « - »)
- - - - -
c0489aaf by Tony Chemit at 2023-08-31T17:26:14+02:00
Trier les marées sélectionnées pour toujours obtenir l'ordre chronologique sur les marées
- - - - -
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:
=====================================
client/datasource/actions/src/main/i18n/getters/java-enumeration.getter
=====================================
@@ -23,8 +23,6 @@ observe.constant.AdminStep.VALIDATE.description
observe.constant.ReferentialSynchronizeMode.BOTH
observe.constant.ReferentialSynchronizeMode.FROM_LEFT_TO_RIGHT
observe.constant.ReferentialSynchronizeMode.FROM_RIGHT_TO_LEFT
-observe.constant.ValidationModelMode.ALL
-observe.constant.ValidationModelMode.ALL.description
observe.constant.ValidationModelMode.DATA
observe.constant.ValidationModelMode.DATA.description
observe.constant.ValidationModelMode.REFERENTIEL
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/SelectDataModel.java
=====================================
@@ -129,7 +129,7 @@ public class SelectDataModel extends AdminActionModel {
case REFERENTIEL:
loadData = false;
break;
- case ALL:
+ default:
break;
}
}
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateUIHandler.java
=====================================
@@ -121,10 +121,6 @@ public class ValidateUIHandler extends AdminTabUIHandler<ValidateUI> implements
case DATA:
selectDataModel.getConfig().setLoadData(true);
break;
- case ALL:
- selectDataModel.getConfig().setLoadReferential(true);
- selectDataModel.getConfig().setLoadData(true);
- break;
}
});
Set<ValidatorDto> validators = getValidatorsManager().getValidators();
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidationModelMode.java
=====================================
@@ -46,12 +46,7 @@ public enum ValidationModelMode {
/**
* to validate only referential.
*/
- REFERENTIEL(true, false),
-
- /**
- * to validate both referential and data.
- */
- ALL(true, false);
+ REFERENTIEL(true, false);
private final boolean referential;
private final boolean data;
=====================================
client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/Start.java
=====================================
@@ -29,6 +29,7 @@ import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
import fr.ird.observe.dto.I18nDecoratorHelper;
import fr.ird.observe.dto.ProgressionModel;
import fr.ird.observe.dto.ToolkitIdLabel;
+import fr.ird.observe.dto.data.RootOpenableDto;
import fr.ird.observe.dto.validation.ValidationRequestConfiguration;
import fr.ird.observe.navigation.tree.selection.SelectionTreeModel;
import fr.ird.observe.services.service.ValidateService;
@@ -37,6 +38,7 @@ import fr.ird.observe.validation.api.request.ReferentialValidationRequest;
import fr.ird.observe.validation.api.result.ValidationResult;
import fr.ird.observe.validation.api.result.ValidationResultBuilder;
import fr.ird.observe.validation.definition.ValidatorDto;
+import io.ultreia.java4all.decoration.Decorator;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -51,6 +53,8 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
import static io.ultreia.java4all.i18n.I18n.t;
@@ -182,7 +186,11 @@ public class Start extends ValidateUIActionSupport {
} else if (dataModel.getConfig().isLoadData()) {
try (ValidationResultBuilder resultBuilder = ValidationResultBuilder.create()) {
- Set<ToolkitIdLabel> selectedData = dataModel.getSelectedData();
+ List<ToolkitIdLabel> selectedData = new LinkedList<>(dataModel.getSelectedData());
+ 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;
+ Decorator decorator = getDecoratorService().getToolkitIdLabelDecoratorByType(dataType);
+ selectedData.forEach(d -> d.registerDecorator(decorator));
+ decorator.sort(selectedData, 0);
int max = selectedData.size();
int index = 1;
for (ToolkitIdLabel datum : selectedData) {
=====================================
client/runner/src/main/i18n/translations/client-runner_en_GB.properties
=====================================
@@ -224,8 +224,6 @@ observe.constant.StorageStep.ROLES=Security
observe.constant.StorageStep.ROLES.description=Apply security on database roles
observe.constant.StorageStep.SELECT_DATA=Data selection
observe.constant.StorageStep.SELECT_DATA.description=Select data to export in backup
-observe.constant.ValidationModelMode.ALL=Data and referential
-observe.constant.ValidationModelMode.ALL.description=Data and referential
observe.constant.ValidationModelMode.DATA=Only data
observe.constant.ValidationModelMode.DATA.description=Only data
observe.constant.ValidationModelMode.REFERENTIEL=Only referential
=====================================
client/runner/src/main/i18n/translations/client-runner_es_ES.properties
=====================================
@@ -224,10 +224,8 @@ observe.constant.StorageStep.ROLES=Seguridad
observe.constant.StorageStep.ROLES.description=Configuración de la seguridad
observe.constant.StorageStep.SELECT_DATA=Selección de datos
observe.constant.StorageStep.SELECT_DATA.description=Seleccionar los datos a exportar en la copia de seguridad
-observe.constant.ValidationModelMode.ALL=Datos y referenciales
-observe.constant.ValidationModelMode.ALL.description=Datos y referenciales
-observe.constant.ValidationModelMode.DATA=Datos del observador
-observe.constant.ValidationModelMode.DATA.description=Datos del observador
+observe.constant.ValidationModelMode.DATA=Datos
+observe.constant.ValidationModelMode.DATA.description=Datos
observe.constant.ValidationModelMode.REFERENTIEL=Referencial
observe.constant.ValidationModelMode.REFERENTIEL.description=Todos los referenciales
observe.constant.storage.ConnexionStatus.FAILED=Conexión falló
=====================================
client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
=====================================
@@ -224,10 +224,8 @@ observe.constant.StorageStep.ROLES=Sécurité
observe.constant.StorageStep.ROLES.description=Mise en place de la sécurité
observe.constant.StorageStep.SELECT_DATA=Sélection données
observe.constant.StorageStep.SELECT_DATA.description=Sélectionner les données à exporter dans la sauvegarde
-observe.constant.ValidationModelMode.ALL=Données et référentiels
-observe.constant.ValidationModelMode.ALL.description=Données et référentiels
-observe.constant.ValidationModelMode.DATA=Données observées
-observe.constant.ValidationModelMode.DATA.description=Données observées
+observe.constant.ValidationModelMode.DATA=Données
+observe.constant.ValidationModelMode.DATA.description=Données
observe.constant.ValidationModelMode.REFERENTIEL=Référentiel
observe.constant.ValidationModelMode.REFERENTIEL.description=Tous les référentiels
observe.constant.storage.ConnexionStatus.FAILED=Connexion échouée
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-create-error-validation.xml
=====================================
@@ -59,7 +59,7 @@
<field-validator type="species_lengthDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ species != null && length != null ]]></param>
- <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-create-warning-validation.xml
=====================================
@@ -57,7 +57,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ acquisitionMode == 1 && species != null && weight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-update-error-validation.xml
=====================================
@@ -59,7 +59,7 @@
<field-validator type="species_lengthDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ species != null && length != null ]]></param>
- <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ll/logbook/SamplePartDto-update-warning-validation.xml
=====================================
@@ -57,7 +57,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ acquisitionMode == 1 && species != null && weight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-create-error-validation.xml
=====================================
@@ -99,7 +99,7 @@
<field-validator type="species_lengthDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ meanLength != null ]]></param>
- <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${meanLength}</message>
</field-validator>
</field>
@@ -113,7 +113,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ meanWeight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/CatchDto-update-error-validation.xml
=====================================
@@ -99,7 +99,7 @@
<field-validator type="species_lengthDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ meanLength != null ]]></param>
- <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${meanLength}</message>
</field-validator>
</field>
@@ -113,7 +113,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ meanWeight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SampleMeasureDto-create-error-validation.xml
=====================================
@@ -59,7 +59,7 @@
<field-validator type="species_lengthDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ length != null ]]></param>
- <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
</field-validator>
</field>
@@ -138,7 +138,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ acquisitionMode == 1 && weight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SampleMeasureDto-update-error-validation.xml
=====================================
@@ -59,7 +59,7 @@
<field-validator type="species_lengthDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ length != null ]]></param>
- <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${length}</message>
</field-validator>
</field>
@@ -138,7 +138,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ acquisitionMode == 1 && weight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${weight}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SchoolEstimateDto-create-error-validation.xml
=====================================
@@ -47,7 +47,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ meanWeight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
</field-validator>
</field>
=====================================
core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/SchoolEstimateDto-update-error-validation.xml
=====================================
@@ -47,7 +47,7 @@
<field-validator type="species_weightDto">
<param name="ratio">1.0</param>
<param name="expression"><![CDATA[ meanWeight != null ]]></param>
- <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>
+ <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${meanWeight}</message>
</field-validator>
</field>
=====================================
core/services/i18n/src/main/i18n/translations/services_en_GB.properties
=====================================
@@ -1599,8 +1599,8 @@ observe.referential.common.Species.scientificLabel=Scientific label
observe.referential.common.Species.speciesGroup=Species group
observe.referential.common.Species.taillePoids.characteristics=Length-Weight characteristics
observe.referential.common.Species.type=Species
-observe.referential.common.Species.validation.length.bound=Length must be bound between %s and %s.
-observe.referential.common.Species.validation.weight.bound=Weight must be bound between %s and %s.
+observe.referential.common.Species.validation.length.bound=Length must be bound between %s and %s, but value was %s.
+observe.referential.common.Species.validation.weight.bound=Weight must be bound between %s and %s, but value was %s.
observe.referential.common.Species.wormsId=Worms id
observe.referential.common.SpeciesGroup.speciesGroupReleaseMode=Species group release mode
observe.referential.common.SpeciesGroup.speciesGroupReleaseModeTab=Release modes
=====================================
core/services/i18n/src/main/i18n/translations/services_es_ES.properties
=====================================
@@ -1599,8 +1599,8 @@ observe.referential.common.Species.scientificLabel=Texto científico
observe.referential.common.Species.speciesGroup=Grupo de especie de fauna
observe.referential.common.Species.taillePoids.characteristics=Características Talla-Peso
observe.referential.common.Species.type=Especie
-observe.referential.common.Species.validation.length.bound=La talla para esta especie debe estár comprendida entre %1$s y %2$s.
-observe.referential.common.Species.validation.weight.bound=La peso para esta especie debe estar comprendida entre %1$s y %2$s.
+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.
+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.
observe.referential.common.Species.wormsId=Worms
observe.referential.common.SpeciesGroup.speciesGroupReleaseMode=Modes de libération \#TODO
observe.referential.common.SpeciesGroup.speciesGroupReleaseModeTab=Modes de libération \#TODO
=====================================
core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
=====================================
@@ -1599,8 +1599,8 @@ observe.referential.common.Species.scientificLabel=Libellé scientifique
observe.referential.common.Species.speciesGroup=Groupe espèce
observe.referential.common.Species.taillePoids.characteristics=Caractéristiques Taille-Poids
observe.referential.common.Species.type=Espèce
-observe.referential.common.Species.validation.length.bound=La taille pour cette espèce doit être comprise entre %1$s et %2$s.
-observe.referential.common.Species.validation.weight.bound=Le poids pour cette espèce doit être compris entre %1$s et %2$s.
+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.
+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.
observe.referential.common.Species.wormsId=Worms
observe.referential.common.SpeciesGroup.speciesGroupReleaseMode=Mode de libération
observe.referential.common.SpeciesGroup.speciesGroupReleaseModeTab=Modes de libération
=====================================
core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-dataResult-ps.json
=====================================
@@ -843,12 +843,12 @@
{
"fieldName": "length",
"scope": "ERROR",
- "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58."
+ "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58, mais vaut 12.0."
},
{
"fieldName": "weight",
"scope": "ERROR",
- "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05."
+ "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05, mais vaut 12.0."
}
]
},
@@ -864,12 +864,12 @@
{
"fieldName": "length",
"scope": "ERROR",
- "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58."
+ "message": "La taille pour cette espèce doit être comprise entre 19.8 et 58.58, mais vaut 13.0."
},
{
"fieldName": "weight",
"scope": "ERROR",
- "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05."
+ "message": "Le poids pour cette espèce doit être compris entre 0.0198 et 5.05, mais vaut 14.0."
}
]
}
@@ -896,7 +896,7 @@
{
"fieldName": "length",
"scope": "ERROR",
- "message": "La taille pour cette espèce doit être comprise entre 19.8 et 141.4."
+ "message": "La taille pour cette espèce doit être comprise entre 19.8 et 141.4, mais vaut 12.0."
}
]
},
@@ -912,7 +912,7 @@
{
"fieldName": "length",
"scope": "ERROR",
- "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0."
+ "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0, mais vaut 12.0."
}
]
},
@@ -928,7 +928,7 @@
{
"fieldName": "length",
"scope": "ERROR",
- "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0."
+ "message": "La taille pour cette espèce doit être comprise entre 19.8 et 202.0, mais vaut 14.0."
}
]
}
=====================================
toolkit/api-decoration/src/main/java/fr/ird/observe/decoration/ToolkitIdLabelDecoratorRenderer.java
=====================================
@@ -33,6 +33,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Locale;
+import java.util.Objects;
import java.util.Set;
/**
@@ -43,8 +44,10 @@ import java.util.Set;
*/
public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<ToolkitIdLabel> {
private static final Logger log = LogManager.getLogger(ToolkitIdLabelDecoratorRenderer.class);
- public final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
- public final SimpleDateFormat timestampFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
+ public final SimpleDateFormat frenchDateFormat = new SimpleDateFormat("dd/MM/yyyy");
+ public final SimpleDateFormat frenchTimestampFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
+ public final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ public final SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
public ToolkitIdLabelDecoratorRenderer(Set<String> codeProperties) {
super(ToolkitIdLabel.class);
@@ -60,12 +63,12 @@ public class ToolkitIdLabelDecoratorRenderer extends JavaBeanDecoratorRenderer<T
}
if (isDate(propertyName)) {
// sort on date, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy)
- sortByDate(pos, dateFormat, dataList);
+ sortByDate(pos, Objects.equals(locale.getLanguage(), "fr") ? frenchDateFormat : dateFormat, dataList);
return;
}
if (isTimestamp(propertyName)) {
// sort on timestamp, can not use toString render to sort (wrong order when using date pattern dd/MM/yyyy HH:mm)
- sortByDate(pos, timestampFormat, dataList);
+ sortByDate(pos, Objects.equals(locale.getLanguage(), "fr") ? frenchTimestampFormat : timestampFormat, dataList);
return;
}
// always sort as using natural order from numbers
=====================================
toolkit/api/src/main/java/fr/ird/observe/dto/ToolkitIdLabel.java
=====================================
@@ -82,11 +82,15 @@ public class ToolkitIdLabel extends ToolkitIdDtoBean implements Decorated {
public String[] textParts() {
if (textParts == null) {
- int length = DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR.length();
+ String separator = DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR;
+ if (!text.contains(separator)) {
+ separator = DecoratorDefinition.DEFAULT_RENDERER_SEPARATOR;
+ }
+ int length = separator.length();
List<String> tokens = new ArrayList<>();
int currentIndex = 0;
int nextSeparator;
- while ((nextSeparator = text.indexOf(DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR, currentIndex)) > -1) {
+ while ((nextSeparator = text.indexOf(separator, currentIndex)) > -1) {
// found a new part
tokens.add(text.substring(currentIndex, nextSeparator));
currentIndex = nextSeparator + length;
@@ -94,7 +98,7 @@ public class ToolkitIdLabel extends ToolkitIdDtoBean implements Decorated {
if (currentIndex < text.length()) {
tokens.add(text.substring(currentIndex));
}
- if (text.endsWith(DecoratorDefinition.DEFAULT_CONTEXT_SEPARATOR)) {
+ if (text.endsWith(separator)) {
tokens.add("");
}
textParts = tokens.toArray(new String[0]);
=====================================
toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/validation/DtoFormValidatorTransformer.java
=====================================
@@ -320,14 +320,14 @@ public class DtoFormValidatorTransformer extends ObjectModelTransformerToJava {
" <field-validator type=\"species_weightDto\">\n" +
" <param name=\"ratio\">1.0</param>\n" +
" <param name=\"expression\"><![CDATA[ %2$s ]]></param>\n" +
- " <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}</message>\n" +
+ " <message>observe.referential.common.Species.validation.weight.bound##${min}##${max}##${%1$s}</message>\n" +
" </field-validator>\n";
private static final String SPECIES_LENGTH_FIELD_TEMPLATE =
" <!-- check species length bound on %1$s if %2$s -->\n" +
" <field-validator type=\"species_lengthDto\">\n" +
" <param name=\"ratio\">1.0</param>\n" +
" <param name=\"expression\"><![CDATA[ %2$s ]]></param>\n" +
- " <message>observe.referential.common.Species.validation.length.bound##${min}##${max}</message>\n" +
+ " <message>observe.referential.common.Species.validation.length.bound##${min}##${max}##${%1$s}</message>\n" +
" </field-validator>\n";
private static final String COLLECTION_UNIQUE_KEY_FIELD_TEMPLATE =
" <!-- check unique value on %1$s for tuple %2$s -->\n" +
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/338ee303448d861ff88bde33…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/338ee303448d861ff88bde33…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 2 commits: Contraindre les caractéristiques d'équipement (common.gearcharacteristic)...
by Tony CHEMIT (@tchemit) 31 Aug '23
by Tony CHEMIT (@tchemit) 31 Aug '23
31 Aug '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
9324ead4 by Tony Chemit at 2023-08-31T14:26:54+02:00
Contraindre les caractéristiques d'équipement (common.gearcharacteristic) autorisées pour un équipement (common.gear) donné - Closes #2765
- - - - -
338ee303 by Tony Chemit at 2023-08-31T14:26:54+02:00
Rajouter un type 'Liste de choix' dans GearCharacteristicType et une nouvelle table gearCharacteristicListItem et remplissage des listes utilisées à l'AZTI - Closes #2764
- - - - -
2 changed files:
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearUseFeaturesMeasurementsTableModelSupport.java
- core/persistence/migration/src/main/resources/db/migration/v9/9.2/11_02_issue-2764_fill-table-common_gearcharacteristiclistitem-common.sql
Changes:
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearUseFeaturesMeasurementsTableModelSupport.java
=====================================
@@ -72,9 +72,15 @@ public abstract class GearUseFeaturesMeasurementsTableModelSupport<E extends Bus
GearUseFeaturesMeasurementsTableModelSupport<E, P> model = (GearUseFeaturesMeasurementsTableModelSupport<E, P>) table.getModel();
ui.getTableModel().registerInlineModel(model, table);
+ ContentTableUITableModel<?, P, ?> tableUIModel = ui.getTableModel();
@SuppressWarnings("unchecked") P tableEditBean = (P) ui.getTableEditBean();
- tableEditBean.addPropertyChangeListener("gear", evt -> model.onGearChanged(ui.getTableModel(), (GearReference) evt.getNewValue()));
-
+ tableEditBean.addPropertyChangeListener("gear", evt -> model.onGearChanged(tableUIModel, (GearReference) evt.getNewValue()));
+ tableUIModel.addPropertyChangeListener(ContentTableUITableModel.SELECTED_ROW_PROPERTY, evt -> {
+ int newValue = (int) evt.getNewValue();
+ if (newValue != -1) {
+ model.onGearChanged(tableUIModel, tableEditBean.getGear());
+ }
+ });
model.gearsById = Maps.uniqueIndex(ui.getHandler().getReferentialService().loadDtoList(GearDto.class), GearDto::getId);
model.gearCharacteristicListItemsById = Maps.uniqueIndex(ui.getHandler().getReferentialReferences(GearCharacteristicListItemReference.class), GearCharacteristicListItemReference::getId);
JXTableUtil.setI18nTableHeaderRenderer(table, GearUseFeaturesMeasurementAware.class, "gearCharacteristic", "measurementValue");
@@ -99,15 +105,19 @@ public abstract class GearUseFeaturesMeasurementsTableModelSupport<E extends Bus
}
private void onGearChanged(ContentTableUITableModel<?, P, ?> tableModel, GearReference newGear) {
- if (!tableModel.isCreate()) {
+ if (!tableModel.isEditable()) {
return;
}
if (tableModel.isAdjusting()) {
return;
}
String gearId = newGear == null ? null : newGear.getId();
+ log.info("Use gear: {}", gearId);
updateAllowedCharacteristics(gearId);
- setDefaultMeasurementsOnSelectedRow(gearId, tableModel.getSelectedRow());
+ if (tableModel.isCreate()) {
+ // add default measurements
+ setDefaultMeasurementsOnSelectedRow(gearId, tableModel.getSelectedRow());
+ }
}
// public void onAfterLoadRowBeanToEdit(int editingRow, P tableEditBean, boolean newRow) {
@@ -167,6 +177,7 @@ public abstract class GearUseFeaturesMeasurementsTableModelSupport<E extends Bus
public void setDefaultMeasurementsOnSelectedRow(String gearId, int editingRow) {
List<E> measurements = getDefaultGearUseFeaturesMeasurement(gearId);
log.info(String.format("Create mode, use default measurements: %d", measurements.size()));
+ //FIXME Error no list for row -1
cache().replace(editingRow, measurements);
setData(measurements);
setModified(false);
=====================================
core/persistence/migration/src/main/resources/db/migration/v9/9.2/11_02_issue-2764_fill-table-common_gearcharacteristiclistitem-common.sql
=====================================
@@ -183,13 +183,13 @@ INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreat
INSERT INTO common.GearCharacteristic (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, gearCharacteristicType) VALUES ('fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, 'L013', null, null, false, 1, 'Brand and model (Sonda desconocida ?)', 'Marque et modèle (Sonda desconocida ?)', 'Marca y modelo (Sonda desconocida)', 'fr.ird.referential.common.GearCharacteristicType#1464000000000#0.8');
-- INSERT INTO common.Gear_GearCharacteristic(gear, gearCharacteristic) VALUES('fr.ird.referential.common.Gear#1239832686125#0.16', 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-- UPDATE common.Gear SET topiaVersion = topiaVersion + 1, lastUpdateDate = ${CURRENT_TIMESTAMP} WHERE topiaId = 'fr.ird.referential.common.Gear#1239832686125#0.16';
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013001', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'CRAME - 828', 'CRAME - 828', 'CRAME - 828', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013002', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013003', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013004', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013005', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013006', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'SKIPPER - 802', 'SKIPPER - 802', 'SKIPPER - 802', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013007', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'SIMRAD - ST15', 'SIMRAD - ST15', 'SIMRAD - ST15', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013001', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_001', null, null, false, 1, 'CRAME - 828', 'CRAME - 828', 'CRAME - 828', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013002', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_002', null, null, false, 1, 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013003', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_003', null, null, false, 1, 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013004', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_004', null, null, false, 1, 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013005', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_005', null, null, false, 1, 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013006', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_006', null, null, false, 1, 'SKIPPER - 802', 'SKIPPER - 802', 'SKIPPER - 802', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013007', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_007', null, null, false, 1, 'SIMRAD - ST15', 'SIMRAD - ST15', 'SIMRAD - ST15', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-- LIST 014 Sonda (38)
INSERT INTO common.GearCharacteristic (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, gearCharacteristicType) VALUES ('fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}014', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, 'L014', null, null, false, 1, 'Brand and model (Sonda ?)', 'Marque et modèle (Sonda ?)', 'Marca y modelo (Sonda)', 'fr.ird.referential.common.GearCharacteristicType#1464000000000#0.8');
INSERT INTO common.Gear_GearCharacteristic(gear, gearCharacteristic) VALUES('fr.ird.referential.common.Gear#1239832686125#0.16', 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}014');
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/cb86501eaf7d373e30b2a2e8…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/cb86501eaf7d373e30b2a2e8…
You're receiving this email because of your account on gitlab.com.
1
0
31 Aug '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
1a0f5077 by Tony Chemit at 2023-08-31T11:09:10+02:00
update pom
- - - - -
d8bbdba4 by Tony Chemit at 2023-08-31T11:09:10+02:00
La valeur de configuration instance.security.key n'est pas bien enregistrée même si elle est présente dans les fichiers de configuration commun (/var/local/observe-server/.conf/9.x) - Closes #2769
- - - - -
d6d04bde by Tony Chemit at 2023-08-31T11:09:10+02:00
Contraindre les caractéristiques d'équipement (common.gearcharacteristic) autorisées pour un équipement (common.gear) donné - Closes #2765
- - - - -
cb86501e by Tony Chemit at 2023-08-31T11:09:10+02:00
Rajouter un type 'Liste de choix' dans GearCharacteristicType et une nouvelle table gearCharacteristicListItem et remplissage des listes utilisées à l'AZTI - Closes #2764
- - - - -
5 changed files:
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearUseFeaturesMeasurementsTableModelSupport.java
- core/persistence/migration/src/main/resources/db/migration/v9/9.2/11_02_issue-2764_fill-table-common_gearcharacteristiclistitem-common.sql
- pom.xml
- server/configuration/src/main/java/fr/ird/observe/server/configuration/ServerConfig.java
Changes:
=====================================
client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
=====================================
@@ -141,9 +141,9 @@ public class ClientConfig extends GeneratedClientConfig implements TripMapConfig
*
* @since 1.5
*/
- private final String[] doNotSave = new String[]{
+ private final Set<String> doNotSave = Set.of(
// ClientConfigOption.OBSTUNA_PASSWORD.getKey(),
- ClientConfigOption.H2_PASSWORD.getKey(), ClientConfigOption.OBSTUNA_CAN_MIGRATE.getKey(),};
+ ClientConfigOption.H2_PASSWORD.getKey(), ClientConfigOption.OBSTUNA_CAN_MIGRATE.getKey());
private final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm z");
/**
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearUseFeaturesMeasurementsTableModelSupport.java
=====================================
@@ -72,9 +72,10 @@ public abstract class GearUseFeaturesMeasurementsTableModelSupport<E extends Bus
GearUseFeaturesMeasurementsTableModelSupport<E, P> model = (GearUseFeaturesMeasurementsTableModelSupport<E, P>) table.getModel();
ui.getTableModel().registerInlineModel(model, table);
+ ContentTableUITableModel<?, P, ?> tableUIModel = ui.getTableModel();
@SuppressWarnings("unchecked") P tableEditBean = (P) ui.getTableEditBean();
- tableEditBean.addPropertyChangeListener("gear", evt -> model.onGearChanged(ui.getTableModel(), (GearReference) evt.getNewValue()));
-
+ tableEditBean.addPropertyChangeListener("gear", evt -> model.onGearChanged(tableUIModel, (GearReference) evt.getNewValue()));
+ tableUIModel.addPropertyChangeListener(ContentTableUITableModel.SELECTED_ROW_PROPERTY, evt-> model.onGearChanged(tableUIModel, tableEditBean.getGear()));
model.gearsById = Maps.uniqueIndex(ui.getHandler().getReferentialService().loadDtoList(GearDto.class), GearDto::getId);
model.gearCharacteristicListItemsById = Maps.uniqueIndex(ui.getHandler().getReferentialReferences(GearCharacteristicListItemReference.class), GearCharacteristicListItemReference::getId);
JXTableUtil.setI18nTableHeaderRenderer(table, GearUseFeaturesMeasurementAware.class, "gearCharacteristic", "measurementValue");
@@ -99,15 +100,19 @@ public abstract class GearUseFeaturesMeasurementsTableModelSupport<E extends Bus
}
private void onGearChanged(ContentTableUITableModel<?, P, ?> tableModel, GearReference newGear) {
- if (!tableModel.isCreate()) {
+ if (!tableModel.isEditable()) {
return;
}
if (tableModel.isAdjusting()) {
return;
}
String gearId = newGear == null ? null : newGear.getId();
+ log.info("Use gear: {}", gearId);
updateAllowedCharacteristics(gearId);
- setDefaultMeasurementsOnSelectedRow(gearId, tableModel.getSelectedRow());
+ if (tableModel.isCreate()) {
+ // add default measurements
+ setDefaultMeasurementsOnSelectedRow(gearId, tableModel.getSelectedRow());
+ }
}
// public void onAfterLoadRowBeanToEdit(int editingRow, P tableEditBean, boolean newRow) {
=====================================
core/persistence/migration/src/main/resources/db/migration/v9/9.2/11_02_issue-2764_fill-table-common_gearcharacteristiclistitem-common.sql
=====================================
@@ -183,13 +183,13 @@ INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreat
INSERT INTO common.GearCharacteristic (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, gearCharacteristicType) VALUES ('fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, 'L013', null, null, false, 1, 'Brand and model (Sonda desconocida ?)', 'Marque et modèle (Sonda desconocida ?)', 'Marca y modelo (Sonda desconocida)', 'fr.ird.referential.common.GearCharacteristicType#1464000000000#0.8');
-- INSERT INTO common.Gear_GearCharacteristic(gear, gearCharacteristic) VALUES('fr.ird.referential.common.Gear#1239832686125#0.16', 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-- UPDATE common.Gear SET topiaVersion = topiaVersion + 1, lastUpdateDate = ${CURRENT_TIMESTAMP} WHERE topiaId = 'fr.ird.referential.common.Gear#1239832686125#0.16';
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013001', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'CRAME - 828', 'CRAME - 828', 'CRAME - 828', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013002', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013003', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013004', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013005', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013006', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'SKIPPER - 802', 'SKIPPER - 802', 'SKIPPER - 802', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013007', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'SIMRAD - ST15', 'SIMRAD - ST15', 'SIMRAD - ST15', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013001', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_001', null, null, false, 1, 'CRAME - 828', 'CRAME - 828', 'CRAME - 828', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013002', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_002', null, null, false, 1, 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013003', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_003', null, null, false, 1, 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013004', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_004', null, null, false, 1, 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013005', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_005', null, null, false, 1, 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013006', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_006', null, null, false, 1, 'SKIPPER - 802', 'SKIPPER - 802', 'SKIPPER - 802', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013007', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_007', null, null, false, 1, 'SIMRAD - ST15', 'SIMRAD - ST15', 'SIMRAD - ST15', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-- LIST 014 Sonda (38)
INSERT INTO common.GearCharacteristic (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, gearCharacteristicType) VALUES ('fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}014', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, 'L014', null, null, false, 1, 'Brand and model (Sonda ?)', 'Marque et modèle (Sonda ?)', 'Marca y modelo (Sonda)', 'fr.ird.referential.common.GearCharacteristicType#1464000000000#0.8');
INSERT INTO common.Gear_GearCharacteristic(gear, gearCharacteristic) VALUES('fr.ird.referential.common.Gear#1239832686125#0.16', 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}014');
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2023.37</version>
+ <version>2023.41</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
=====================================
server/configuration/src/main/java/fr/ird/observe/server/configuration/ServerConfig.java
=====================================
@@ -42,6 +42,8 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
/**
* Web server configuration.
@@ -90,9 +92,13 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar
ServerConfig fakeConfig = new ServerConfig(setCommonExtraConfigDirectory(setConfigFileName(init)), true);
fakeConfig.initFirst();
+ // Get extra scope options (if any)
+ Properties extraProperties = new Properties();
+ fakeConfig.get().putAll(extraProperties, ApplicationConfigScope.EXTRA);
+ extraProperties.put(ServerConfigOption.CONTEXT_PATH.getKey(), contextPath);
// Now that common files are ready, starts a normal configuration without system file and without migration possible
ApplicationConfigInit realInit = ApplicationConfigInit.forAllScopesWithout(ApplicationConfigScope.HOME, ApplicationConfigScope.ENV, ApplicationConfigScope.SYSTEM)
- .addDefaults(ServerConfigOption.CONTEXT_PATH.getKey(), contextPath);
+ .setDefaults(extraProperties);
ServerConfig config = new ServerConfig(setInstanceExtraConfigDirectory(setConfigFileName(realInit)));
config.init(true);
@@ -143,7 +149,7 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar
File extraConfigFile = get().getExtraConfigFile();
if (Files.notExists(extraConfigFile.toPath())) {
log.info(String.format("Save common configuration file to: %s", extraConfigFile));
- ConfigHelper.save(get(), extraConfigFile, new String[0], ServerResources.APPLICATION_CONFIGURATION, options());
+ ConfigHelper.save(get(), extraConfigFile, Set.of(), ServerResources.APPLICATION_CONFIGURATION, options());
}
File log4jConfigurationFile = getCommonLog4jConfigurationFile();
@@ -174,7 +180,7 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar
// See https://gitlab.com/ultreiaio/ird-observe/-/issues/2735
log.info(String.format("Save instance configuration file to: %s", extraConfigFile));
- ConfigHelper.save(get(), extraConfigFile, new String[0], ServerResources.APPLICATION_CONFIGURATION, options());
+ ConfigHelper.save(get(), extraConfigFile, Set.of(), ServerResources.APPLICATION_CONFIGURATION, options());
if (log.isInfoEnabled()) {
String message = getConfigurationDescription();
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/8a7748a7d3455f7f9f9a9484…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/8a7748a7d3455f7f9f9a9484…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 3 commits: Contraindre les caractéristiques d'équipement (common.gearcharacteristic)...
by Tony CHEMIT (@tchemit) 31 Aug '23
by Tony CHEMIT (@tchemit) 31 Aug '23
31 Aug '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
49246aa8 by Tony Chemit at 2023-08-31T09:17:03+02:00
Contraindre les caractéristiques d'équipement (common.gearcharacteristic) autorisées pour un équipement (common.gear) donné - Closes #2765
- - - - -
6bc68ac7 by Tony Chemit at 2023-08-31T09:32:34+02:00
update pom
- - - - -
8a7748a7 by Tony Chemit at 2023-08-31T10:14:37+02:00
Rajouter un type 'Liste de choix' dans GearCharacteristicType et une nouvelle table gearCharacteristicListItem et remplissage des listes utilisées à l'AZTI - Closes #2764
- - - - -
3 changed files:
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearUseFeaturesMeasurementsTableModelSupport.java
- core/persistence/migration/src/main/resources/db/migration/v9/9.2/11_02_issue-2764_fill-table-common_gearcharacteristiclistitem-common.sql
- pom.xml
Changes:
=====================================
client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/GearUseFeaturesMeasurementsTableModelSupport.java
=====================================
@@ -99,15 +99,15 @@ public abstract class GearUseFeaturesMeasurementsTableModelSupport<E extends Bus
}
private void onGearChanged(ContentTableUITableModel<?, P, ?> tableModel, GearReference newGear) {
- if (!tableModel.isCreate()) {
- return;
- }
if (tableModel.isAdjusting()) {
return;
}
String gearId = newGear == null ? null : newGear.getId();
updateAllowedCharacteristics(gearId);
- setDefaultMeasurementsOnSelectedRow(gearId, tableModel.getSelectedRow());
+ if (tableModel.isCreate()) {
+ // add default measurements
+ setDefaultMeasurementsOnSelectedRow(gearId, tableModel.getSelectedRow());
+ }
}
// public void onAfterLoadRowBeanToEdit(int editingRow, P tableEditBean, boolean newRow) {
=====================================
core/persistence/migration/src/main/resources/db/migration/v9/9.2/11_02_issue-2764_fill-table-common_gearcharacteristiclistitem-common.sql
=====================================
@@ -183,13 +183,13 @@ INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreat
INSERT INTO common.GearCharacteristic (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, gearCharacteristicType) VALUES ('fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, 'L013', null, null, false, 1, 'Brand and model (Sonda desconocida ?)', 'Marque et modèle (Sonda desconocida ?)', 'Marca y modelo (Sonda desconocida)', 'fr.ird.referential.common.GearCharacteristicType#1464000000000#0.8');
-- INSERT INTO common.Gear_GearCharacteristic(gear, gearCharacteristic) VALUES('fr.ird.referential.common.Gear#1239832686125#0.16', 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-- UPDATE common.Gear SET topiaVersion = topiaVersion + 1, lastUpdateDate = ${CURRENT_TIMESTAMP} WHERE topiaId = 'fr.ird.referential.common.Gear#1239832686125#0.16';
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013001', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'CRAME - 828', 'CRAME - 828', 'CRAME - 828', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013002', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013003', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013004', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013005', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013006', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'SKIPPER - 802', 'SKIPPER - 802', 'SKIPPER - 802', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013007', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '002_001', null, null, false, 1, 'SIMRAD - ST15', 'SIMRAD - ST15', 'SIMRAD - ST15', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013001', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_001', null, null, false, 1, 'CRAME - 828', 'CRAME - 828', 'CRAME - 828', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013002', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_002', null, null, false, 1, 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', 'FURUNO - FCV-220/221T', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013003', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_003', null, null, false, 1, 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', 'HONDEX - HE-301 A/N', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013004', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_004', null, null, false, 1, 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', 'HONDEX - HE-710 MARK II', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013005', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_005', null, null, false, 1, 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', 'HONDEX - HE-710 MARK III', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013006', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_006', null, null, false, 1, 'SKIPPER - 802', 'SKIPPER - 802', 'SKIPPER - 802', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
+INSERT INTO common.GearCharacteristicListItem (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, comment, gearCharacteristic) VALUES ('fr.ird.referential.common.GearCharacteristicListItem#${REFERENTIAL_PREFIX}013007', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, '013_007', null, null, false, 1, 'SIMRAD - ST15', 'SIMRAD - ST15', 'SIMRAD - ST15', null, 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}013');
-- LIST 014 Sonda (38)
INSERT INTO common.GearCharacteristic (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, gearCharacteristicType) VALUES ('fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}014', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, 'L014', null, null, false, 1, 'Brand and model (Sonda ?)', 'Marque et modèle (Sonda ?)', 'Marca y modelo (Sonda)', 'fr.ird.referential.common.GearCharacteristicType#1464000000000#0.8');
INSERT INTO common.Gear_GearCharacteristic(gear, gearCharacteristic) VALUES('fr.ird.referential.common.Gear#1239832686125#0.16', 'fr.ird.referential.common.GearCharacteristic#${REFERENTIAL_PREFIX}014');
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2023.40</version>
+ <version>2023.41</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/3d7b7b7028daf4ae7d595129…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/3d7b7b7028daf4ae7d595129…
You're receiving this email because of your account on gitlab.com.
1
0
17 Aug '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
9fdd4573 by Tony Chemit at 2023-08-17T18:31:51+02:00
update pom
- - - - -
3d7b7b70 by Tony Chemit at 2023-08-17T18:31:51+02:00
La valeur de configuration instance.security.key n'est pas bien enregistrée même si elle est présente dans les fichiers de configuration commun (/var/local/observe-server/.conf/9.x) - Closes #2769
- - - - -
3 changed files:
- client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- pom.xml
- server/configuration/src/main/java/fr/ird/observe/server/configuration/ServerConfig.java
Changes:
=====================================
client/configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
=====================================
@@ -141,9 +141,9 @@ public class ClientConfig extends GeneratedClientConfig implements TripMapConfig
*
* @since 1.5
*/
- private final String[] doNotSave = new String[]{
+ private final Set<String> doNotSave = Set.of(
// ClientConfigOption.OBSTUNA_PASSWORD.getKey(),
- ClientConfigOption.H2_PASSWORD.getKey(), ClientConfigOption.OBSTUNA_CAN_MIGRATE.getKey(),};
+ ClientConfigOption.H2_PASSWORD.getKey(), ClientConfigOption.OBSTUNA_CAN_MIGRATE.getKey());
private final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm z");
/**
=====================================
pom.xml
=====================================
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2023.37</version>
+ <version>2023.40</version>
</parent>
<groupId>fr.ird.observe</groupId>
<artifactId>ird-observe</artifactId>
=====================================
server/configuration/src/main/java/fr/ird/observe/server/configuration/ServerConfig.java
=====================================
@@ -42,6 +42,8 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
/**
* Web server configuration.
@@ -90,9 +92,13 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar
ServerConfig fakeConfig = new ServerConfig(setCommonExtraConfigDirectory(setConfigFileName(init)), true);
fakeConfig.initFirst();
+ // Get extra scope options (if any)
+ Properties extraProperties = new Properties();
+ fakeConfig.get().putAll(extraProperties, ApplicationConfigScope.EXTRA);
+ extraProperties.put(ServerConfigOption.CONTEXT_PATH.getKey(), contextPath);
// Now that common files are ready, starts a normal configuration without system file and without migration possible
ApplicationConfigInit realInit = ApplicationConfigInit.forAllScopesWithout(ApplicationConfigScope.HOME, ApplicationConfigScope.ENV, ApplicationConfigScope.SYSTEM)
- .addDefaults(ServerConfigOption.CONTEXT_PATH.getKey(), contextPath);
+ .setDefaults(extraProperties);
ServerConfig config = new ServerConfig(setInstanceExtraConfigDirectory(setConfigFileName(realInit)));
config.init(true);
@@ -143,7 +149,7 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar
File extraConfigFile = get().getExtraConfigFile();
if (Files.notExists(extraConfigFile.toPath())) {
log.info(String.format("Save common configuration file to: %s", extraConfigFile));
- ConfigHelper.save(get(), extraConfigFile, new String[0], ServerResources.APPLICATION_CONFIGURATION, options());
+ ConfigHelper.save(get(), extraConfigFile, Set.of(), ServerResources.APPLICATION_CONFIGURATION, options());
}
File log4jConfigurationFile = getCommonLog4jConfigurationFile();
@@ -174,7 +180,7 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar
// See https://gitlab.com/ultreiaio/ird-observe/-/issues/2735
log.info(String.format("Save instance configuration file to: %s", extraConfigFile));
- ConfigHelper.save(get(), extraConfigFile, new String[0], ServerResources.APPLICATION_CONFIGURATION, options());
+ ConfigHelper.save(get(), extraConfigFile, Set.of(), ServerResources.APPLICATION_CONFIGURATION, options());
if (log.isInfoEnabled()) {
String message = getConfigurationDescription();
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/38138697cd596f3c7016983d…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/38138697cd596f3c7016983d…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Améliorer le rapport de validation - Closes #2215
by Tony CHEMIT (@tchemit) 31 Jul '23
by Tony CHEMIT (@tchemit) 31 Jul '23
31 Jul '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
38138697 by Tony Chemit at 2023-07-31T13:09:08+02:00
Améliorer le rapport de validation - Closes #2215
- - - - -
3 changed files:
- client/datasource/actions/src/main/i18n/templates/validationReport_en_GB.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_es_ES.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_fr_FR.ftl
Changes:
=====================================
client/datasource/actions/src/main/i18n/templates/validationReport_en_GB.ftl
=====================================
@@ -1,4 +1,5 @@
-<#-- @ftlvariable name=".data_model" type="fr.ird.observe.client.datasource.actions.validate.ValidateModel" --><#--
+<#-- @ftlvariable name=".data_model" type="fr.ird.observe.client.datasource.actions.validate.ValidateModel" -->
+<#--
#%L
ObServe Client :: DataSource :: Actions
%%
@@ -17,44 +18,232 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<html>
+<!doctype html>
+<html lang="en">
+<#macro displayNode node>
+<#-- @ftlvariable name="node" type="fr.ird.observe.client.datasource.actions.validate.tree.ValidationNode" -->
+ <#assign withChildren = node.childCount != 0 />
+ <#assign withMessages = node.messagesCount != 0 />
+ <li>
+ <span id="${node.id}" class="<#if withChildren>caret<#else>leaf</#if>"></span>
+ <span class="datum">${node.label}</span> <#if node.id?starts_with("fr.ird.referential") || node.id?starts_with("fr.ird.data") > - <span
+ class="topiaId">${node.id}</span></#if>
+ <#if withChildren || withMessages>
+ <ul class="nested">
+ <#if withMessages>
+ <#assign messages = node.messagesByLabel />
+ <table>
+ <#list messages as fieldName, fieldMessages>
+ <tr>
+ <td style="width:25%">${fieldName}</td>
+ <td>
+ <ul class="messages">
+ <#list fieldMessages as message>
+ <li class="<#if message.scope.name() == "ERROR">error<#else>warning</#if>">${message.message}</li>
+ </#list>
+ </ul>
+ </td>
+ </tr>
+ </#list>
+ </table>
+ </#if>
+ <#if withChildren>
+ <#list node.getChildren() as childNode>
+ <@displayNode childNode/>
+ </#list>
+ </#if>
+ </ul>
+ </#if>
+ </li>
+</#macro>
+<head>
+ <meta charset="UTF-8">
+ <meta lang="en">
+ <meta content="text/html">
+ <title>Rapport de validation</title>
+ <style>
+ #result {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ }
+
+ #result ul {
+ list-style-type: none;
+ }
+
+ .caret {
+ cursor: pointer;
+ user-select: none;
+ }
+
+ .caret::before {
+ content: "\1f5c0";
+ /*content: "\25B6";*/
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .caretSymbol::before {
+ content: "\1f5c0";
+ /*content: "\25B6";*/
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+ .leaf {
+ margin-top: 6px;
+ }
+
+ .leaf::before {
+ content: "\25CB";
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .caret-down::before {
+ content: "\1f5c1";
+ color: #027BFF;
+ /*transform: rotate(90deg);*/
+ }
+
+ #result .nested {
+ display: none;
+ }
+
+ #result .active {
+ display: block;
+ }
+
+ .datum {
+
+ }
+
+ table {
+ /*font-family: arial, sans-serif;*/
+ border-collapse: collapse;
+ width: 90%;
+ /*margin-left: 20px;*/
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+
+ td, th {
+ border: 1px solid #027BFF;
+ text-align: left;
+ padding: 4px;
+ }
+
+ tr:nth-child(even) {
+ background-color: #dddddd;
+ }
+
+ .error:before {
+ padding-right: 8px;
+ content: "\26D4";
+ }
+
+ .warning:before {
+ padding-right: 8px;
+ content: "\26A0";
+ font-style: normal;
+ }
+
+ .information::before {
+ content: "\1F6C8";
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .topiaId {
+ -moz-user-select: all;
+ -webkit-user-select: all;
+ -ms-user-select: all;
+ user-select: all;
+ }
+
+ ul.messages {
+ list-style-type: none;
+ }
+ </style>
+</head>
<body>
-<b>#TODO</b>
+<b>TODO</b>
<h1>Rapport de validation</h1>
<h2>Configuration</h2>
<ul>
<li>Rapport de validation généré le ${.data_model.now}</li>
- <li>Scopes : ${.data_model.scopes?join(", ")}</li>
+ <li>Niveau(x) de validation :
+ <#list .data_model.scopes as scope>
+ <span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
+ </#list>
+ </li>
<li>Context : ${.data_model.contextName}</li>
</ul>
-<#assign nodes = .data_model.validationResult.nodes />
-<#list nodes as node>
-<#--<h2>${decorateType(type)} : ${count}</h2>-->
-<#--<table>-->
-<#-- <thead>-->
-<#-- <tr>-->
-<#-- <th>Identifiant</th>-->
-<#-- <th>Libellé</th>-->
-<#-- <th>Scope</th>-->
-<#-- <th>Champs</th>-->
-<#-- <th>Message</th>-->
-<#-- </tr>-->
-<#-- </thead>-->
-<#-- <#list validationResult.getResultsForType(type) as dto>-->
-<#-- <#list validationResult.getMessagesForId(dto.id) as message>-->
-<#-- <tr>-->
-<#-- <td>${dto.id}</td>-->
-<#-- <td>${dto.reference}</td>-->
-<#-- <td>${message.scope}</td>-->
-<#-- <td>${decorateProperty(type, message.fieldName)}</td>-->
-<#-- <td>${message.message}</td>-->
-<#-- </tr>-->
-<#-- </#list>-->
-<#-- </#list>-->
-<#--</table>-->
-</#list>
+<h2>Résultat</h2>
+<h3>Notes</h3>
+<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
+<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
+<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
+<br/>
+<#assign rootNode = .data_model.rootNode />
+<ul id="result">
+ <#list rootNode.getChildren() as node>
+ <@displayNode node/>
+ <br/>
+ </#list>
+</ul>
+
+<script>
+ function expand(node) {
+ // console.info("will expand child " + node.id);
+ node.classList.add("caret-down");
+ node.parentElement.querySelector(".nested").classList.add("active");
+ }
+
+ function collapse(node) {
+ // console.info("will collapse child " + node.id);
+ node.classList.remove("caret-down");
+ node.parentElement.querySelector(".nested").classList.remove("active");
+ }
+
+ function toggle(expanded, node) {
+ if (expanded) {
+ collapse(node);
+ } else {
+ expand(node);
+ }
+ }
+
+ for (const caret of document.getElementsByClassName("caret")) {
+ caret.addEventListener("click", function (event) {
+ let expanded = this.classList.contains("caret-down");
+ // console.info("do click on " + this.id+", was expanded? "+expanded);
+ toggle(expanded, this);
+
+ if (event.shiftKey) {
+ // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
+ for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
+ toggle(expanded, child);
+ }
+ }
+ });
+ <#if .data_model.modelMode.name() == "REFERENTIEL">
+ caret.click();
+ </#if>
+ }
+ for (const caret of document.getElementsByClassName("leaf")) {
+ let element = caret.parentElement.querySelector(".nested");
+ if (element != null) {
+ element.classList.toggle("active");
+ }
+ }
+</script>
</body>
</html>
=====================================
client/datasource/actions/src/main/i18n/templates/validationReport_es_ES.ftl
=====================================
@@ -18,44 +18,231 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<html>
-<body>
+<!doctype html>
+<html lang="es">
+<#macro displayNode node>
+<#-- @ftlvariable name="node" type="fr.ird.observe.client.datasource.actions.validate.tree.ValidationNode" -->
+ <#assign withChildren = node.childCount != 0 />
+ <#assign withMessages = node.messagesCount != 0 />
+ <li>
+ <span id="${node.id}" class="<#if withChildren>caret<#else>leaf</#if>"></span>
+ <span class="datum">${node.label}</span> <#if node.id?starts_with("fr.ird.referential") || node.id?starts_with("fr.ird.data") > - <span
+ class="topiaId">${node.id}</span></#if>
+ <#if withChildren || withMessages>
+ <ul class="nested">
+ <#if withMessages>
+ <#assign messages = node.messagesByLabel />
+ <table>
+ <#list messages as fieldName, fieldMessages>
+ <tr>
+ <td style="width:25%">${fieldName}</td>
+ <td>
+ <ul class="messages">
+ <#list fieldMessages as message>
+ <li class="<#if message.scope.name() == "ERROR">error<#else>warning</#if>">${message.message}</li>
+ </#list>
+ </ul>
+ </td>
+ </tr>
+ </#list>
+ </table>
+ </#if>
+ <#if withChildren>
+ <#list node.getChildren() as childNode>
+ <@displayNode childNode/>
+ </#list>
+ </#if>
+ </ul>
+ </#if>
+ </li>
+</#macro>
+<head>
+ <meta charset="UTF-8">
+ <meta lang="es">
+ <meta content="text/html">
+ <title>Rapport de validation</title>
+ <style>
+ #result {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ }
+
+ #result ul {
+ list-style-type: none;
+ }
+
+ .caret {
+ cursor: pointer;
+ user-select: none;
+ }
+
+ .caret::before {
+ content: "\1f5c0";
+ /*content: "\25B6";*/
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .caretSymbol::before {
+ content: "\1f5c0";
+ /*content: "\25B6";*/
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+ .leaf {
+ margin-top: 6px;
+ }
+
+ .leaf::before {
+ content: "\25CB";
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .caret-down::before {
+ content: "\1f5c1";
+ color: #027BFF;
+ /*transform: rotate(90deg);*/
+ }
+
+ #result .nested {
+ display: none;
+ }
+
+ #result .active {
+ display: block;
+ }
+
+ .datum {
+
+ }
+
+ table {
+ /*font-family: arial, sans-serif;*/
+ border-collapse: collapse;
+ width: 90%;
+ /*margin-left: 20px;*/
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+
+ td, th {
+ border: 1px solid #027BFF;
+ text-align: left;
+ padding: 4px;
+ }
-<h1>Informe de validación</h1>
+ tr:nth-child(even) {
+ background-color: #dddddd;
+ }
-<h2>Configuración</h2>
+ .error:before {
+ padding-right: 8px;
+ content: "\26D4";
+ }
+
+ .warning:before {
+ padding-right: 8px;
+ content: "\26A0";
+ font-style: normal;
+ }
+
+ .information::before {
+ content: "\1F6C8";
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .topiaId {
+ -moz-user-select: all;
+ -webkit-user-select: all;
+ -ms-user-select: all;
+ user-select: all;
+ }
+
+ ul.messages {
+ list-style-type: none;
+ }
+ </style>
+</head>
+<body>
+<h1>Rapport de validation</h1>
+
+<h2>Configuration</h2>
<ul>
- <li>Informe de validación generado el ${.data_model.now}</li>
- <li>Scopes : ${.data_model.scopes?join(", ")}</li>
+ <li>Rapport de validation généré le ${.data_model.now}</li>
+ <li>Niveau(x) de validation :
+ <#list .data_model.scopes as scope>
+ <span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
+ </#list>
+ </li>
<li>Context : ${.data_model.contextName}</li>
</ul>
-<#assign nodes = .data_model.validationResult.nodes />
-<#list nodes as node>
-<#--<h2>${decorateType(type)} : ${count}</h2>-->
-<#--<table>-->
-<#-- <thead>-->
-<#-- <tr>-->
-<#-- <th>Identifiant</th>-->
-<#-- <th>Libellé</th>-->
-<#-- <th>Scope</th>-->
-<#-- <th>Champs</th>-->
-<#-- <th>Message</th>-->
-<#-- </tr>-->
-<#-- </thead>-->
-<#-- <#list validationResult.getResultsForType(type) as dto>-->
-<#-- <#list validationResult.getMessagesForId(dto.id) as message>-->
-<#-- <tr>-->
-<#-- <td>${dto.id}</td>-->
-<#-- <td>${dto.reference}</td>-->
-<#-- <td>${message.scope}</td>-->
-<#-- <td>${decorateProperty(type, message.fieldName)}</td>-->
-<#-- <td>${message.message}</td>-->
-<#-- </tr>-->
-<#-- </#list>-->
-<#-- </#list>-->
-<#--</table>-->
-</#list>
+<h2>Résultat</h2>
+<h3>Notes</h3>
+<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
+<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
+<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
+<br/>
+<#assign rootNode = .data_model.rootNode />
+<ul id="result">
+ <#list rootNode.getChildren() as node>
+ <@displayNode node/>
+ <br/>
+ </#list>
+</ul>
+
+<script>
+ function expand(node) {
+ // console.info("will expand child " + node.id);
+ node.classList.add("caret-down");
+ node.parentElement.querySelector(".nested").classList.add("active");
+ }
+
+ function collapse(node) {
+ // console.info("will collapse child " + node.id);
+ node.classList.remove("caret-down");
+ node.parentElement.querySelector(".nested").classList.remove("active");
+ }
+
+ function toggle(expanded, node) {
+ if (expanded) {
+ collapse(node);
+ } else {
+ expand(node);
+ }
+ }
+
+ for (const caret of document.getElementsByClassName("caret")) {
+ caret.addEventListener("click", function (event) {
+ let expanded = this.classList.contains("caret-down");
+ // console.info("do click on " + this.id+", was expanded? "+expanded);
+ toggle(expanded, this);
+
+ if (event.shiftKey) {
+ // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
+ for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
+ toggle(expanded, child);
+ }
+ }
+ });
+ <#if .data_model.modelMode.name() == "REFERENTIEL">
+ caret.click();
+ </#if>
+ }
+ for (const caret of document.getElementsByClassName("leaf")) {
+ let element = caret.parentElement.querySelector(".nested");
+ if (element != null) {
+ element.classList.toggle("active");
+ }
+ }
+</script>
</body>
</html>
=====================================
client/datasource/actions/src/main/i18n/templates/validationReport_fr_FR.ftl
=====================================
@@ -18,43 +18,231 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<html>
-<body>
+<!doctype html>
+<html lang="fr">
+<#macro displayNode node>
+<#-- @ftlvariable name="node" type="fr.ird.observe.client.datasource.actions.validate.tree.ValidationNode" -->
+ <#assign withChildren = node.childCount != 0 />
+ <#assign withMessages = node.messagesCount != 0 />
+ <li>
+ <span id="${node.id}" class="<#if withChildren>caret<#else>leaf</#if>"></span>
+ <span class="datum">${node.label}</span> <#if node.id?starts_with("fr.ird.referential") || node.id?starts_with("fr.ird.data") > - <span
+ class="topiaId">${node.id}</span></#if>
+ <#if withChildren || withMessages>
+ <ul class="nested">
+ <#if withMessages>
+ <#assign messages = node.messagesByLabel />
+ <table>
+ <#list messages as fieldName, fieldMessages>
+ <tr>
+ <td style="width:25%">${fieldName}</td>
+ <td>
+ <ul class="messages">
+ <#list fieldMessages as message>
+ <li class="<#if message.scope.name() == "ERROR">error<#else>warning</#if>">${message.message}</li>
+ </#list>
+ </ul>
+ </td>
+ </tr>
+ </#list>
+ </table>
+ </#if>
+ <#if withChildren>
+ <#list node.getChildren() as childNode>
+ <@displayNode childNode/>
+ </#list>
+ </#if>
+ </ul>
+ </#if>
+ </li>
+</#macro>
+<head>
+ <meta charset="UTF-8">
+ <meta lang="fr">
+ <meta content="text/html">
+ <title>Rapport de validation</title>
+ <style>
+ #result {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ }
+
+ #result ul {
+ list-style-type: none;
+ }
+
+ .caret {
+ cursor: pointer;
+ user-select: none;
+ }
+
+ .caret::before {
+ content: "\1f5c0";
+ /*content: "\25B6";*/
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .caretSymbol::before {
+ content: "\1f5c0";
+ /*content: "\25B6";*/
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+ .leaf {
+ margin-top: 6px;
+ }
+
+ .leaf::before {
+ content: "\25CB";
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .caret-down::before {
+ content: "\1f5c1";
+ color: #027BFF;
+ /*transform: rotate(90deg);*/
+ }
+
+ #result .nested {
+ display: none;
+ }
+
+ #result .active {
+ display: block;
+ }
+
+ .datum {
+
+ }
+
+ table {
+ /*font-family: arial, sans-serif;*/
+ border-collapse: collapse;
+ width: 90%;
+ margin-left: 20px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+
+ td, th {
+ border: 1px solid #027BFF;
+ text-align: left;
+ padding: 4px;
+ }
+ tr:nth-child(even) {
+ background-color: #dddddd;
+ }
+
+ .error:before {
+ padding-right: 8px;
+ content: "\26D4";
+ }
+
+ .warning:before {
+ padding-right: 8px;
+ content: "\26A0";
+ font-style: normal;
+ }
+
+ .information::before {
+ content: "\1F6C8";
+ color: #027BFF;
+ display: inline-block;
+ margin-right: 6px;
+ }
+
+ .topiaId {
+ -moz-user-select: all;
+ -webkit-user-select: all;
+ -ms-user-select: all;
+ user-select: all;
+ }
+
+ ul.messages {
+ list-style-type: none;
+ }
+ </style>
+</head>
+<body>
<h1>Rapport de validation</h1>
<h2>Configuration</h2>
<ul>
- <li>Rapport de validation généré le ${now}</li>
- <li>Scopes : ${.data_model.scopes?join(", ")}</li>
+ <li>Rapport de validation généré le ${.data_model.now}</li>
+ <li>Niveau(x) de validation :
+ <#list .data_model.scopes as scope>
+ <span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
+ </#list>
+ </li>
<li>Context : ${.data_model.contextName}</li>
</ul>
-<#assign nodes = .data_model.validationResult.nodes />
-<#list nodes as node>
-<#--<h2>${decorateType(type)} : ${count}</h2>-->
-<#--<table>-->
-<#-- <thead>-->
-<#-- <tr>-->
-<#-- <th>Identifiant</th>-->
-<#-- <th>Libellé</th>-->
-<#-- <th>Scope</th>-->
-<#-- <th>Champs</th>-->
-<#-- <th>Message</th>-->
-<#-- </tr>-->
-<#-- </thead>-->
-<#-- <#list validationResult.getResultsForType(type) as dto>-->
-<#-- <#list validationResult.getMessagesForId(dto.id) as message>-->
-<#-- <tr>-->
-<#-- <td>${dto.id}</td>-->
-<#-- <td>${dto.reference}</td>-->
-<#-- <td>${message.scope}</td>-->
-<#-- <td>${decorateProperty(type, message.fieldName)}</td>-->
-<#-- <td>${message.message}</td>-->
-<#-- </tr>-->
-<#-- </#list>-->
-<#-- </#list>-->
-<#--</table>-->
-</#list>
+
+<h2>Résultat</h2>
+<h3>Notes</h3>
+<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
+<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
+<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
+<br/>
+<#assign rootNode = .data_model.rootNode />
+<ul id="result">
+ <#list rootNode.getChildren() as node>
+ <@displayNode node/>
+ <br/>
+ </#list>
+</ul>
+
+<script>
+ function expand(node) {
+ // console.info("will expand child " + node.id);
+ node.classList.add("caret-down");
+ node.parentElement.querySelector(".nested").classList.add("active");
+ }
+
+ function collapse(node) {
+ // console.info("will collapse child " + node.id);
+ node.classList.remove("caret-down");
+ node.parentElement.querySelector(".nested").classList.remove("active");
+ }
+
+ function toggle(expanded, node) {
+ if (expanded) {
+ collapse(node);
+ } else {
+ expand(node);
+ }
+ }
+
+ for (const caret of document.getElementsByClassName("caret")) {
+ caret.addEventListener("click", function (event) {
+ let expanded = this.classList.contains("caret-down");
+ // console.info("do click on " + this.id+", was expanded? "+expanded);
+ toggle(expanded, this);
+
+ if (event.shiftKey) {
+ // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
+ for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
+ toggle(expanded, child);
+ }
+ }
+ });
+ <#if .data_model.modelMode.name() == "REFERENTIEL">
+ caret.click();
+ </#if>
+ }
+ for (const caret of document.getElementsByClassName("leaf")) {
+ let element = caret.parentElement.querySelector(".nested");
+ if (element != null) {
+ element.classList.toggle("active");
+ }
+ }
+</script>
</body>
</html>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/38138697cd596f3c7016983d5…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/38138697cd596f3c7016983d5…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Merge branch 'feature/issue_2706' into develop
by Tony CHEMIT (@tchemit) 31 Jul '23
by Tony CHEMIT (@tchemit) 31 Jul '23
31 Jul '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
fb9eafa9 by Tony Chemit at 2023-07-31T13:06:22+02:00
Merge branch 'feature/issue_2706' into develop
Revoir la validation pour produire un résultat en forme d'arbre - Closes #2211
Améliorer l'identification des enregistrements dans l'UI de validation batch - Closes #2706
- - - - -
0 changed files:
Changes:
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/fb9eafa99319110ed32b28192…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/fb9eafa99319110ed32b28192…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 16 commits: Low log level on XxxReportDefinitionsBuilder
by Tony CHEMIT (@tchemit) 31 Jul '23
by Tony CHEMIT (@tchemit) 31 Jul '23
31 Jul '23
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
a812ba3e by Tony Chemit at 2023-07-30T09:15:05+02:00
Low log level on XxxReportDefinitionsBuilder
- - - - -
6cdf9f0b by Tony Chemit at 2023-07-30T09:15:05+02:00
Service tests - Fix bad serialization to json (was using unicode inside String...)
- - - - -
d517c1ee by Tony Chemit at 2023-07-30T09:15:05+02:00
Service tests - Improve loadJson method (using now Type instead of Class to be able to load parametrized classes)
- - - - -
8355c1bc by Tony Chemit at 2023-07-31T11:42:26+02:00
Permettre de rejouer l'assistant (à partir de l'onglet Sélection de données pour l'assistant de validation)
- - - - -
2b964ef7 by Tony Chemit at 2023-07-31T11:42:26+02:00
Validation UI - Remove mainRequest in code, never used!
- - - - -
acc17d54 by Tony Chemit at 2023-07-31T11:42:26+02:00
improve decoration of data.ps.observation.Sample
- - - - -
2ffd197b by Tony Chemit at 2023-07-31T11:42:26+02:00
Fix selection model for loadReferential: we can see the configuration panel and then always add the *common* business module
- - - - -
862c5e3f by Tony Chemit at 2023-07-31T11:42:26+02:00
update pom
- - - - -
7d07a019 by Tony Chemit at 2023-07-31T11:42:26+02:00
low log level
- - - - -
b821bcc0 by Tony Chemit at 2023-07-31T11:42:26+02:00
Validation Context - add more stuff in the ValidationContextSupport
- - - - -
771e8482 by Tony Chemit at 2023-07-31T13:03:53+02:00
SelectData UI - fix focus when select tree is displayed
- - - - -
a4819af5 by Tony Chemit at 2023-07-31T13:03:59+02:00
Validation API - Replace in ValidationResultDto DtoReference by the path of the data (composed by ToolkitIdLabel) to the root data (means from data to his Trip, for referential just one item)
- - - - -
67a5add8 by Tony Chemit at 2023-07-31T13:03:59+02:00
Validation Persistence - Review API and make some improvements (some code goes now to the toolkit modules
- - - - -
1433b447 by Tony Chemit at 2023-07-31T13:03:59+02:00
Validation Services test - Review it, update then new results using the changes in ValidationResultDto
- - - - -
3cbfaaab by Tony Chemit at 2023-07-31T13:03:59+02:00
Validation UI - adapt ui to display more information on each ValidationResultDto
- - - - -
980df6e6 by Tony Chemit at 2023-07-31T13:04:17+02:00
Merge branch 'feature/issue_2706' into develop
Revoir la validation pour produire un résultat en forme d'arbre - Closes
Améliorer l'identification des enregistrements dans l'UI de validation batch
- - - - -
30 changed files:
- client/datasource/actions/src/main/i18n/getters/java.getter
- client/datasource/actions/src/main/i18n/templates/validationReport_en_GB.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_es_ES.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_fr_FR.ftl
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/AdminTabUIHandler.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/ConfigUIHandler.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/config/SelectDataUIHandler.java
- − client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateEntityListCellRenderer.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateUI.jaxx
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidateUI.jcss
- 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/ValidationMessageTableModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ObserveValidationMessageTableRenderer.java → client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidationMessageTableRenderer.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/ValidationTreeCellRenderer.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/CollapseAll.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/CopySelectedNodeId.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/ExpandAll.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/actions/Start.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/tree/DataValidationNode.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/tree/ReferentialPackageValidationNode.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/tree/ReferentialTypeValidationNode.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/tree/ReferentialValidationNode.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/tree/RootValidationNode.java
- + client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/validate/tree/ValidationNode.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/config/TreeConfigUIHandler.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
- client/runner/src/test/java/fr/ird/observe/client/ObserveTextGeneratorTest.java
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/82b0c64ea26d406869a77ac1…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/82b0c64ea26d406869a77ac1…
You're receiving this email because of your account on gitlab.com.
1
0