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
May 2020
- 1 participants
- 77 discussions
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
b6d281e9 by Tony Chemit at 2020-05-12T14:14:57+02:00
improve ci jobs tags
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -12,14 +12,23 @@ image: registry.gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/docker:lat
stage: Build
tags:
- build
+ - docker
+ - gitlab-org
+ - gitlab-org-docker
.stage_test: &stage_test
stage: Test
tags:
- build
+ - docker
+ - gitlab-org
+ - gitlab-org-docker
.stage_release: &stage_release
stage: Release
tags:
- build
+ - docker
+ - gitlab-org
+ - gitlab-org-docker
.create-docker: &create-docker
environment:
name: docker
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b6d281e94cdd45c1bd44dc326…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b6d281e94cdd45c1bd44dc326…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 3 commits: remove bad unsued imports (breaks java 11 build)
by Tony CHEMIT 12 May '20
by Tony CHEMIT 12 May '20
12 May '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
6fc013e0 by Tony Chemit at 2020-05-12T12:00:18+02:00
remove bad unsued imports (breaks java 11 build)
- - - - -
4577d39a by Tony Chemit at 2020-05-12T12:00:35+02:00
now build with java 11 image
- - - - -
c0682285 by Tony Chemit at 2020-05-12T12:20:16+02:00
Use last pom (to use java 11)
- - - - -
3 changed files:
- .gitlab-ci.yml
- client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/longline/pairing/tree/ActivityLonglinePairingTreeTableModel.java
- pom.xml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -27,7 +27,7 @@ image: registry.gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/docker:lat
services:
- docker:dind
script:
- - if [ -n "${CREATE_DOCKER}" ]; then ultreiaio-docker-generate-image-10 gitlab-ci-token $CI_BUILD_TOKEN; fi
+ - if [ -n "${CREATE_DOCKER}" ]; then ultreiaio-docker-generate-image-11 gitlab-ci-token $CI_BUILD_TOKEN; fi
.build-for-release: &build-for-release
environment:
=====================================
client-datasource-actions/src/main/java/fr/ird/observe/client/datasource/actions/longline/pairing/tree/ActivityLonglinePairingTreeTableModel.java
=====================================
@@ -29,7 +29,6 @@ import fr.ird.observe.client.datasource.actions.longline.pairing.tree.node.Activ
import fr.ird.observe.services.service.data.ll.pairing.ActivityLonglinePairingResultItem;
import io.ultreia.java4all.i18n.I18n;
import org.jdesktop.swingx.treetable.DefaultTreeTableModel;
-import sun.awt.image.ImageWatched;
import java.util.Arrays;
import java.util.LinkedList;
@@ -41,7 +40,7 @@ import java.util.stream.Collectors;
/**
* Created by tchemit on 20/11/2018.
*
- * @author Tony Chemit - dev(a)tchemit.fr
+ * @author Tony Chemit - dev(a)tchemit.fgit stashr
*/
public class ActivityLonglinePairingTreeTableModel extends DefaultTreeTableModel {
=====================================
pom.xml
=====================================
@@ -24,7 +24,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.23</version>
+ <version>2020.24</version>
</parent>
<groupId>fr.ird.observe</groupId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/34f5d1f4b7799ad6f4eb6f0a…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/34f5d1f4b7799ad6f4eb6f0a…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Comportement sidérant d'H2 - Closes #1463
by Tony CHEMIT 10 May '20
by Tony CHEMIT 10 May '20
10 May '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
34f5d1f4 by Tony Chemit at 2020-05-10T23:36:39+02:00
Comportement sidérant d'H2 - Closes #1463
- - - - -
16 changed files:
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- + persistence/.mvn/i18n/parse-java
- persistence/pom.xml
- + persistence/src/main/i18n/getters/java.getter
- persistence/src/main/java/fr/ird/observe/entities/referential/DuplicateLengthLengthParameterException.java
- persistence/src/main/java/fr/ird/observe/entities/referential/DuplicateLengthWeightParameterException.java
- persistence/src/main/java/fr/ird/observe/entities/referential/LengthLengthParameterNotFoundException.java
- persistence/src/main/java/fr/ird/observe/entities/referential/LengthWeightParameterNotFoundException.java
- persistence/src/main/java/fr/ird/observe/entities/referential/common/LengthLengthParameters.java
- persistence/src/main/java/fr/ird/observe/entities/referential/common/LengthWeightParameters.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidateDataServiceLocal.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidationActivitySeineDataContext.java
- services-local/src/test/java/fr/ird/observe/services/local/entity/LengthWeightParemetersTest.java
Changes:
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
=====================================
@@ -23,6 +23,7 @@ package fr.ird.observe.dto.decoration;
*/
import fr.ird.observe.dto.DtoToReference;
+import fr.ird.observe.dto.reference.DataDtoReference;
import fr.ird.observe.dto.reference.ReferentialDtoReference;
import fr.ird.observe.dto.referential.ReferentialDto;
import fr.ird.observe.spi.DtoModelHelper;
@@ -67,4 +68,17 @@ public class DecoratorService extends DecoratorServiceSupport<DecoratorServiceIn
protected void init(DecoratorServiceInitializer initializer) {
ObserveGlobalModelInitializer.run(initializer);
}
+
+ public String toString(Object o) {
+ if (o==null) {
+ return null;
+ }
+ if (o instanceof ReferentialDtoReference) {
+ return getReferentialReferenceDecorator(((ReferentialDtoReference<?,?>) o).getReferenceType()).toString(o);
+ }
+ if (o instanceof DataDtoReference) {
+ return getDataReferenceDecorator(((DataDtoReference<?,?>) o).getReferenceType()).toString(o);
+ }
+ return getDecoratorByType(o.getClass()).toString(o);
+ }
}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -2293,6 +2293,10 @@ observe.data.ps.observation.TransmittingBuoy.types=Transmitting buoys
observe.entity.message.creating=Creating object '%1$s'.
observe.entity.message.reading=Object '%1$s' is not open, no modification allowed.
observe.entity.message.updating=Updating object '%1$s'.
+observe.error.DuplicateLengthLengthParameterException=Found multiple length length relation for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s
+observe.error.DuplicateLengthWeightParameterException=Found multiple length weight paramters for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s
+observe.error.LengthLengthParameterNotFoundException=No length length relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s
+observe.error.LengthWeightParameterNotFoundException=No length weight relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s
observe.error.can.not.create.directory=Can't create directory %&$s\!
observe.error.storage.could.not.backup.unsane.local.db=Can not save an borken database
observe.error.storage.could.not.load.local.db=Could not open local database for reason\: %s
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -2293,6 +2293,10 @@ observe.data.ps.observation.TransmittingBuoy.types=Balizas leidas
observe.entity.message.creating=Se está crear el objeto actual '%1$s'.
observe.entity.message.reading=Object '%1$s' is not open, no modification allowed.
observe.entity.message.updating=Se está modificando el objeto actual '%1$s'.
+observe.error.DuplicateLengthLengthParameterException=Found multiple length length relation for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s \#TODO
+observe.error.DuplicateLengthWeightParameterException=Found multiple length weight relation for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s \#TODO
+observe.error.LengthLengthParameterNotFoundException=No length length relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s \#TODO
+observe.error.LengthWeightParameterNotFoundException=No length weight relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s \#TODO
observe.error.can.not.create.directory=¡Imposible crear el directorio %1$s\!
observe.error.storage.could.not.backup.unsane.local.db=Impossible grabar una base dañada
observe.error.storage.could.not.load.local.db=Impossible grabar la base local por la razón siguiente \: %s
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -2293,6 +2293,10 @@ observe.data.ps.observation.TransmittingBuoy.types=Balises lues
observe.entity.message.creating=L'objet '%1$s' est en cours de création.
observe.entity.message.reading=L'objet '%1$s' n'est pas ouvert, aucune modification possible.
observe.entity.message.updating=L'objet '%1$s' est en cours de modification.
+observe.error.DuplicateLengthLengthParameterException=Plusieurs relations taille-taille ont été trouvées pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s \:\n * %s
+observe.error.DuplicateLengthWeightParameterException=Plusieurs relations taille-poids ont été trouvées pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s \:\n * %s
+observe.error.LengthLengthParameterNotFoundException=Aucune relation taille-taille trouvée pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s
+observe.error.LengthWeightParameterNotFoundException=Aucune relation taille-poids trouvée pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s
observe.error.can.not.create.directory=Création du répertoire %1$s impossible\!
observe.error.storage.could.not.backup.unsane.local.db=Impossible d'enregistrer une base non endommagée
observe.error.storage.could.not.load.local.db=Impossible d'ouvrir la base locale pour la raison suivante \: %s
=====================================
persistence/.mvn/i18n/parse-java
=====================================
=====================================
persistence/pom.xml
=====================================
@@ -97,7 +97,10 @@
<artifactId>nuiton-csv</artifactId>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>io.ultreia.java4all.i18n</groupId>
+ <artifactId>i18n-runtime</artifactId>
+ </dependency>
<dependency>
<groupId>io.ultreia.java4all.http</groupId>
<artifactId>http-api</artifactId>
=====================================
persistence/src/main/i18n/getters/java.getter
=====================================
@@ -0,0 +1,3 @@
+observe.error.DuplicateLengthWeightParameterException
+observe.error.LengthLengthParameterNotFoundException
+observe.error.LengthWeightParameterNotFoundException
=====================================
persistence/src/main/java/fr/ird/observe/entities/referential/DuplicateLengthLengthParameterException.java
=====================================
@@ -22,13 +22,21 @@ package fr.ird.observe.entities.referential;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.common.LengthLengthParameterDto;
+import fr.ird.observe.dto.referential.common.LengthLengthParameterReference;
import fr.ird.observe.entities.referential.common.LengthLengthParameter;
import fr.ird.observe.entities.referential.common.Ocean;
import fr.ird.observe.entities.referential.common.Sex;
import fr.ird.observe.entities.referential.common.Species;
+import fr.ird.observe.spi.DbModelHelper;
import java.util.Date;
import java.util.List;
+import java.util.stream.Collectors;
+
+import static io.ultreia.java4all.i18n.I18n.t;
/**
* Created on 28/08/15.
@@ -49,7 +57,8 @@ public class DuplicateLengthLengthParameterException extends RuntimeException {
protected final List<LengthLengthParameter> foundLengthLengthParameters;
- public DuplicateLengthLengthParameterException(Species species, Ocean ocean, Sex sex, Date date, List<LengthLengthParameter> foundLengthLengthParameters) {
+ public DuplicateLengthLengthParameterException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthLengthParameter> foundLengthLengthParameters) {
+ super(buildMessage(decoratorService, species, ocean, sex, date, foundLengthLengthParameters));
this.species = species;
this.ocean = ocean;
this.sex = sex;
@@ -57,6 +66,18 @@ public class DuplicateLengthLengthParameterException extends RuntimeException {
this.foundLengthLengthParameters = foundLengthLengthParameters;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthLengthParameter> foundLengthLengthParameters) {
+ ReferentialLocale referentialLocale = decoratorService.getReferentialLocale();
+ return t("observe.error.DuplicateLengthWeightParameterException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date,
+ foundLengthLengthParameters.stream().map(e -> e.toReference(referentialLocale)).map(decoratorService::toString).collect(Collectors.joining("\n * "))
+ );
+ }
+
+
public Species getSpecies() {
return species;
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referential/DuplicateLengthWeightParameterException.java
=====================================
@@ -22,13 +22,21 @@ package fr.ird.observe.entities.referential;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.dto.referential.common.LengthWeightParameterDto;
+import fr.ird.observe.dto.referential.common.LengthWeightParameterReference;
import fr.ird.observe.entities.referential.common.LengthWeightParameter;
import fr.ird.observe.entities.referential.common.Ocean;
import fr.ird.observe.entities.referential.common.Sex;
import fr.ird.observe.entities.referential.common.Species;
+import fr.ird.observe.spi.DbModelHelper;
import java.util.Date;
import java.util.List;
+import java.util.stream.Collectors;
+
+import static io.ultreia.java4all.i18n.I18n.t;
/**
* Created on 28/08/15.
@@ -49,7 +57,8 @@ public class DuplicateLengthWeightParameterException extends RuntimeException {
protected final List<LengthWeightParameter> foundLengthWeightParameters;
- public DuplicateLengthWeightParameterException(Species species, Ocean ocean, Sex sex, Date date, List<LengthWeightParameter> foundLengthWeightParameters) {
+ public DuplicateLengthWeightParameterException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthWeightParameter> foundLengthWeightParameters) {
+ super(buildMessage(decoratorService, species, ocean, sex, date, foundLengthWeightParameters));
this.species = species;
this.ocean = ocean;
this.sex = sex;
@@ -57,6 +66,17 @@ public class DuplicateLengthWeightParameterException extends RuntimeException {
this.foundLengthWeightParameters = foundLengthWeightParameters;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthWeightParameter> foundLengthWeightParameters) {
+ ReferentialLocale referentialLocale = decoratorService.getReferentialLocale();
+ return t("observe.error.DuplicateLengthWeightParameterException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date,
+ foundLengthWeightParameters.stream().map(e -> e.toReference(referentialLocale)).map(decoratorService::toString).collect(Collectors.joining("\n * "))
+ );
+ }
+
public Species getSpecies() {
return species;
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referential/LengthLengthParameterNotFoundException.java
=====================================
@@ -22,12 +22,16 @@ package fr.ird.observe.entities.referential;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.entities.referential.common.Ocean;
import fr.ird.observe.entities.referential.common.Sex;
import fr.ird.observe.entities.referential.common.Species;
+import fr.ird.observe.spi.DbModelHelper;
import java.util.Date;
+import static io.ultreia.java4all.i18n.I18n.t;
+
/**
* Created on 29/08/15.
*
@@ -45,13 +49,23 @@ public class LengthLengthParameterNotFoundException extends RuntimeException {
protected final Date date;
- public LengthLengthParameterNotFoundException(Species species, Ocean ocean, Sex sex, Date date) {
+ public LengthLengthParameterNotFoundException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+ super(buildMessage(decoratorService, species, ocean, sex, date));
this.species = species;
this.ocean = ocean;
this.sex = sex;
this.date = date;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+
+ return t("observe.error.LengthLengthParameterNotFoundException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date);
+ }
+
public Species getSpecies() {
return species;
}
@@ -68,4 +82,11 @@ public class LengthLengthParameterNotFoundException extends RuntimeException {
return date;
}
+
+ static <E extends ReferentialEntity<?, ?>> String toString(DecoratorService decoratorService, E entity) {
+ if (entity == null) {
+ return null;
+ }
+ return decoratorService.toString(entity.toReference(decoratorService.getReferentialLocale()));
+ }
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referential/LengthWeightParameterNotFoundException.java
=====================================
@@ -22,12 +22,16 @@ package fr.ird.observe.entities.referential;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.entities.referential.LengthLengthParameterNotFoundException;
import fr.ird.observe.entities.referential.common.Ocean;
import fr.ird.observe.entities.referential.common.Sex;
import fr.ird.observe.entities.referential.common.Species;
import java.util.Date;
+import static io.ultreia.java4all.i18n.I18n.t;
+
/**
* Created on 29/08/15.
*
@@ -45,13 +49,23 @@ public class LengthWeightParameterNotFoundException extends RuntimeException {
protected final Date date;
- public LengthWeightParameterNotFoundException(Species species, Ocean ocean, Sex sex, Date date) {
+ public LengthWeightParameterNotFoundException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+ super(buildMessage(decoratorService, species, ocean, sex, date));
this.species = species;
this.ocean = ocean;
this.sex = sex;
this.date = date;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+
+ return t("observe.error.LengthWeightParameterNotFoundException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date);
+ }
+
public Species getSpecies() {
return species;
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referential/common/LengthLengthParameters.java
=====================================
@@ -22,6 +22,7 @@ package fr.ird.observe.entities.referential.common;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.entities.referential.DuplicateLengthLengthParameterException;
import fr.ird.observe.entities.referential.LengthLengthParameterNotFoundException;
import fr.ird.observe.entities.ObserveTopiaDaoSupplier;
@@ -50,6 +51,7 @@ public class LengthLengthParameters {
* <p>
* Si non trouvé sur le sexe (et que le sexe n'est pas indéterminé) , alors on recherche avec le sexe indéterminé (sexe=0).
*
+ * @param decoratorService le service de décoration
* @param daoSupplier la transaction en cours d'utilisation
* @param species l'espèce sur lequel on recherche le paramétrage
* @param ocean l'ocean recherché (peut être null)
@@ -60,7 +62,8 @@ public class LengthLengthParameters {
* @return le paramétrage adéquate
* @since 1.5
*/
- public static Optional<LengthLengthParameter> findLengthLengthParameter(ObserveTopiaDaoSupplier daoSupplier,
+ public static Optional<LengthLengthParameter> findLengthLengthParameter(DecoratorService decoratorService,
+ ObserveTopiaDaoSupplier daoSupplier,
Species species,
Ocean ocean,
Sex sex,
@@ -85,7 +88,7 @@ public class LengthLengthParameters {
}
if (CollectionUtils.isEmpty(list)) {
- throw new LengthLengthParameterNotFoundException(species, ocean, sex, date);
+ throw new LengthLengthParameterNotFoundException(decoratorService, species, ocean, sex, date);
}
// if (inputSizeMeasureType != null) {
@@ -116,192 +119,14 @@ public class LengthLengthParameters {
// au final il ne devrait en rester qu'un
if (list.size() > 1) {
- throw new DuplicateLengthLengthParameterException(species, ocean, sex, date, list);
+ throw new DuplicateLengthLengthParameterException(decoratorService, species, ocean, sex, date, list);
}
return Optional.of(list.get(0));
}
-//
-// /**
-// * Recherche de la liste des {@link LengthLengthParameter} à partir des paramètres donnés.
-// * <p>
-// * La recherche peut ne peut être aussi exacte que les paramètres donnés :
-// * <p>
-// * Dans le cas d'une espèce faune, si non trouvé alors on recherche sur son
-// * speciesGroup d'espèce.
-// * <p>
-// * Si non trouvé pour l'océan donné (et que celui-ci est non null), alors on
-// * recherche avec un ocean vide.
-// *
-// * @param daoSupplier la transaction en cours d'utilisation
-// * @param species l'espèce sur lequel on recherche le paramétrage
-// * @param ocean l'ocean recherché (peut être null)
-// * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
-// * @param date le jour recherché
-// * @return le paramétrage adéquate
-// * @since 1.5
-// */
-// public static List<LengthLengthParameter> findLengthLengthParameter0(ObserveTopiaDaoSupplier daoSupplier,
-// Species species,
-// Ocean ocean,
-// Sex sex,
-// Date date) {
-//
-// Objects.requireNonNull(daoSupplier, "daoSupplier parameter can't be null");
-// Objects.requireNonNull(species, "species parameter can't be null");
-// Objects.requireNonNull(sex, "sex parameter can't be null");
-//
-// List<LengthLengthParameter> list = findBySpecies(daoSupplier, species);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // aucun parametrage pour le type donne
-// return null;
-// }
-//
-// // filtrage par ocean
-// List<LengthLengthParameter> filterByOcean = filterByOcean(list, ocean);
-//
-// if (CollectionUtils.isEmpty(filterByOcean) && ocean != null) {
-//
-// // filtre par ocean null
-// filterByOcean = filterByOcean(list, null);
-// }
-// list = filterByOcean;
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas d'ocean adequate
-// return null;
-// }
-//
-// // filtrage par sexe
-// list = filterBySexe(list, sex);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de sexe adequate
-// return null;
-// }
-//
-// // filtrage par startDate de validite
-// list = filterByDateDebutValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de debut adequate
-// return null;
-// }
-//
-// // filtrage par endDate de validite
-// list = filterByDateFinValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de fin adequate
-// return null;
-// }
-//
-// return list;
-//
-// }
private static Sex getUnknownSex(ObserveTopiaDaoSupplier daoSupplier) {
return daoSupplier.getCommonSexDao().forCodeEquals("0").findUnique();
}
-
-// public static List<LengthLengthParameter> findBySpecies(ObserveTopiaDaoSupplier daoSupplier, Species species) {
-//
-// LengthLengthParameterTopiaDao dao = daoSupplier.getCommonLengthLengthParameterDao();
-//
-// List<LengthLengthParameter> list = dao.forSpeciesEquals(species).findAll();
-//
-// // on supprime les paramétrages qui ont a=0 ou a=null ou b=0 ou b = null
-// Iterator<LengthLengthParameter> itr = list.iterator();
-// while (itr.hasNext()) {
-// LengthLengthParameter p = itr.next();
-// Double a = p.getCoefficientValue(FormulaHelper.COEFFICIENT_A);
-// if (a == null || a == 0) {
-// itr.remove();
-// continue;
-// }
-//
-// Double b = p.getCoefficientValue(FormulaHelper.COEFFICIENT_B);
-// // on autorise d'avoir b à 0 (mais cela ne permet plus de calculer la taille à partir du poids)
-//// if (b == null || b == 0) {
-// if (b == null) {
-// itr.remove();
-// }
-// }
-// return list;
-//
-// }
-
-// public static List<LengthLengthParameter> filterByOcean(List<LengthLengthParameter> list, Ocean ocean) {
-// List<LengthLengthParameter> result = new ArrayList<>();
-// if (ocean == null) {
-//
-// // on n'accepte que les parametrage sans ocean
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-// if (parametrageLengthWeight.getOcean() == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-// if (ocean.equals(parametrageLengthWeight.getOcean())) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
-//
-// public static List<LengthLengthParameter> filterBySexe(List<LengthLengthParameter> list, Sex sex) {
-// return list.stream().filter(l -> l.getSex() == sex).collect(Collectors.toList());
-// }
-//
-// public static List<LengthLengthParameter> filterByInputSizeMeasureType(List<LengthLengthParameter> list, SizeMeasureType sizeMeasureType) {
-// return list.stream().filter(l -> l.getInputSizeMeasureType() == sizeMeasureType).collect(Collectors.toList());
-// }
-//public static List<LengthLengthParameter> filterByOutputSizeMeasureType(List<LengthLengthParameter> list, SizeMeasureType sizeMeasureType) {
-// return list.stream().filter(l -> l.getOutputSizeMeasureType() == sizeMeasureType).collect(Collectors.toList());
-// }
-//
-// public static List<LengthLengthParameter> filterByDateDebutValidite(List<LengthLengthParameter> list, Date startDate) {
-// return list.stream()
-// .filter(l -> l.getStartDate() == null || l.getStartDate().before(startDate) || l.getStartDate().equals(startDate))
-// .collect(Collectors.toList());
-// }
-//
-// public static List<LengthLengthParameter> filterByDateFinValidite(List<LengthLengthParameter> list, Date endDate) {
-// List<LengthLengthParameter> result = new ArrayList<>();
-//
-// if (endDate == null) {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// // - ceux dont la date de fin est avant la date de fin donnée
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null ||
-// date.after(endDate) ||
-// date.equals(endDate)) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referential/common/LengthWeightParameters.java
=====================================
@@ -22,6 +22,7 @@ package fr.ird.observe.entities.referential.common;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.entities.referential.DuplicateLengthWeightParameterException;
import fr.ird.observe.entities.referential.LengthWeightParameterNotFoundException;
import fr.ird.observe.entities.ObserveTopiaDaoSupplier;
@@ -49,16 +50,18 @@ public class LengthWeightParameters {
* <p>
* Si non trouvé sur le sexe (et que le sexe n'est pas indéterminé) , alors on recherche avec le sexe indéterminé (sexe=0).
*
- * @param daoSupplier la transaction en cours d'utilisation
- * @param species l'espèce sur lequel on recherche le paramétrage
- * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
- * @param ocean l'ocean recherché (peut être null)
- * @param date le jour recherché
- * @param sizeMeasureType le type de mensuration recherché
+ * @param decoratorService le service de décoration
+ * @param daoSupplier la transaction en cours d'utilisation
+ * @param species l'espèce sur lequel on recherche le paramétrage
+ * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
+ * @param ocean l'ocean recherché (peut être null)
+ * @param date le jour recherché
+ * @param sizeMeasureType le type de mensuration recherché
* @return le paramétrage adéquate
* @since 1.5
*/
- public static LengthWeightParameter findLengthWeightParameter(ObserveTopiaDaoSupplier daoSupplier,
+ public static LengthWeightParameter findLengthWeightParameter(DecoratorService decoratorService,
+ ObserveTopiaDaoSupplier daoSupplier,
Species species, Sex sex, Ocean ocean, Date date, SizeMeasureType sizeMeasureType) {
// Sex unknownSex = getUnknownSex(daoSupplier);
@@ -79,7 +82,7 @@ public class LengthWeightParameters {
// }
if (CollectionUtils.isEmpty(list)) {
- throw new LengthWeightParameterNotFoundException(species, ocean, sex, date);
+ throw new LengthWeightParameterNotFoundException(decoratorService, species, ocean, sex, date);
}
// if (sizeMeasureType != null) {
@@ -98,190 +101,11 @@ public class LengthWeightParameters {
// au final il ne devrait en rester qu'un
if (list.size() > 1) {
- throw new DuplicateLengthWeightParameterException(species, ocean, sex, date, list);
+ throw new DuplicateLengthWeightParameterException(decoratorService, species, ocean, sex, date, list);
}
return Objects.requireNonNull(list.get(0));
}
-// /**
-// * Recherche de la liste des {@link LengthWeightParameter} à partir des paramètres donnés.
-// * <p>
-// * La recherche peut ne peut être aussi exacte que les paramètres donnés :
-// * <p>
-// * Dans le cas d'une espèce faune, si non trouvé alors on recherche sur son
-// * speciesGroup d'espèce.
-// * <p>
-// * Si non trouvé pour l'océan donné (et que celui-ci est non null), alors on
-// * recherche avec un ocean vide.
-// *
-// * @param daoSupplier la transaction en cours d'utilisation
-// * @param species l'espèce sur lequel on recherche le paramétrage
-// * @param ocean l'ocean recherché (peut être null)
-// * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
-// * @param date le jour recherché
-// * @return le paramétrage adéquate
-// * @since 1.5
-// */
-// public static List<LengthWeightParameter> findLengthWeightParameter0(ObserveTopiaDaoSupplier daoSupplier,
-// Species species,
-// Ocean ocean,
-// Sex sex,
-// Date date) {
-//
-// Objects.requireNonNull(daoSupplier, "daoSupplier parameter can't be null");
-// Objects.requireNonNull(species, "species parameter can't be null");
-// Objects.requireNonNull(sex, "sex parameter can't be null");
-//
-// List<LengthWeightParameter> list = findBySpecies(daoSupplier, species);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // aucun parametrage pour le type donne
-// return null;
-// }
-//
-// // filtrage par ocean
-// List<LengthWeightParameter> filterByOcean = filterByOcean(list, ocean);
-//
-// if (CollectionUtils.isEmpty(filterByOcean) && ocean != null) {
-//
-// // filtre par ocean null
-// filterByOcean = filterByOcean(list, null);
-// }
-// list = filterByOcean;
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas d'ocean adequate
-// return null;
-// }
-//
-// // filtrage par sexe
-// list = filterBySexe(list, sex);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de sexe adequate
-// return null;
-// }
-//
-// // filtrage par startDate de validite
-// list = filterByDateDebutValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de debut adequate
-// return null;
-// }
-//
-// // filtrage par endDate de validite
-// list = filterByDateFinValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de fin adequate
-// return null;
-// }
-//
-// return list;
-//
-// }
-
-// private static Sex getUnknownSex(ObserveTopiaDaoSupplier daoSupplier) {
-// return daoSupplier.getCommonSexDao().forCodeEquals("0").findUnique();
-// }
-
-// public static List<LengthWeightParameter> findBySpecies(ObserveTopiaDaoSupplier daoSupplier, Species species) {
-//
-// LengthWeightParameterTopiaDao dao = daoSupplier.getCommonLengthWeightParameterDao();
-//
-// List<LengthWeightParameter> list = dao.forSpeciesEquals(species).findAll();
-//
-// // on supprime les paramétrages qui ont a=0 ou a=null ou b=0 ou b = null
-// Iterator<LengthWeightParameter> itr = list.iterator();
-// while (itr.hasNext()) {
-// LengthWeightParameter p = itr.next();
-// Double a = p.getCoefficientValue(FormulaHelper.COEFFICIENT_A);
-// if (a == null || a == 0) {
-// itr.remove();
-// continue;
-// }
-//
-// Double b = p.getCoefficientValue(FormulaHelper.COEFFICIENT_B);
-// // on autorise d'avoir b à 0 (mais cela ne permet plus de calculer la taille à partir du poids)
-//// if (b == null || b == 0) {
-// if (b == null) {
-// itr.remove();
-// }
-// }
-// return list;
-//
-// }
-//
-// public static List<LengthWeightParameter> filterByOcean(List<LengthWeightParameter> list, Ocean ocean) {
-// List<LengthWeightParameter> result = new ArrayList<>();
-// if (ocean == null) {
-//
-// // on n'accepte que les parametrage sans ocean
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-// if (parametrageLengthWeight.getOcean() == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-// if (ocean.equals(parametrageLengthWeight.getOcean())) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
-//
-// public static List<LengthWeightParameter> filterBySexe(List<LengthWeightParameter> list, Sex sex) {
-// return list.stream().filter(l -> l.getSex() == sex).collect(Collectors.toList());
-// }
-//
-// public static List<LengthWeightParameter> filterBySizeMeasureType(List<LengthWeightParameter> list, SizeMeasureType sizeMeasureType) {
-// return list.stream().filter(l -> l.getSizeMeasureType() == sizeMeasureType).collect(Collectors.toList());
-// }
-//
-// public static List<LengthWeightParameter> filterByDateDebutValidite(List<LengthWeightParameter> list, Date startDate) {
-// return list.stream()
-// .filter(l -> l.getStartDate() == null || l.getStartDate().before(startDate) || l.getStartDate().equals(startDate))
-// .collect(Collectors.toList());
-// }
-//
-// public static List<LengthWeightParameter> filterByDateFinValidite(List<LengthWeightParameter> list, Date endDate) {
-// List<LengthWeightParameter> result = new ArrayList<>();
-//
-// if (endDate == null) {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// // - ceux dont la date de fin est avant la date de fin donnée
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null ||
-// date.after(endDate) ||
-// date.equals(endDate)) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
-
}
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidateDataServiceLocal.java
=====================================
@@ -27,6 +27,8 @@ import com.google.common.collect.ImmutableSet;
import fr.ird.observe.dto.data.ps.NonTargetCatchComputedValueSource;
import fr.ird.observe.dto.data.ps.observation.FloatingObjectDto;
import fr.ird.observe.dto.data.ps.observation.FloatingObjectPartDto;
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.decoration.DecoratorServiceApplicationComponent;
import fr.ird.observe.dto.referential.I18nReferentialHelper;
import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.entities.EntityHelper;
@@ -152,8 +154,8 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
SimplifiedObjectTypeManager simplifiedObjectTypeManager = newSimplifiedObjectTypeManager(simplifiedObjectTypeSpecializedRules);
FloatingObjectConsolidateEngine floatingObjectConsolidateEngine = new FloatingObjectConsolidateEngine(simplifiedObjectTypeManager);
-
- Optional<ConsolidateTripSeineDataResult> consolidateTripSeineDataResult = consolidateTripSeine(referenceLocale, floatingObjectConsolidateEngine, request.getTripSeineId(), failIfLengthWeightParameterNotFound, failIfLengthLengthParameterNotFound);
+ DecoratorService decoratorService = DecoratorServiceApplicationComponent.value();
+ Optional<ConsolidateTripSeineDataResult> consolidateTripSeineDataResult = consolidateTripSeine(decoratorService,referenceLocale, floatingObjectConsolidateEngine, request.getTripSeineId(), failIfLengthWeightParameterNotFound, failIfLengthLengthParameterNotFound);
return consolidateTripSeineDataResult.orElse(null);
}
@@ -174,7 +176,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
return new SimplifiedObjectTypeManager(materialMapping, simplifiedObjectTypeSpecializedRules);
}
- private Optional<ConsolidateTripSeineDataResult> consolidateTripSeine(ReferentialLocale referenceLocale, FloatingObjectConsolidateEngine floatingObjectConsolidateEngine, String tripSeineId, boolean failIfLengthWeightParameterNotFound, boolean failIfLengthLengthParameterNotFound) {
+ private Optional<ConsolidateTripSeineDataResult> consolidateTripSeine(DecoratorService decoratorService, ReferentialLocale referenceLocale, FloatingObjectConsolidateEngine floatingObjectConsolidateEngine, String tripSeineId, boolean failIfLengthWeightParameterNotFound, boolean failIfLengthLengthParameterNotFound) {
log.info(String.format("Start consolidate trip: %s", tripSeineId));
@@ -235,6 +237,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
ConsolidationActivitySeineDataContext activityContext = new ConsolidationActivitySeineDataContext();
activityContext.locale = applicationLocale;
+ activityContext.decoratorService = decoratorService;
activityContext.failIfLengthWeightParameterNotFound = failIfLengthWeightParameterNotFound;
activityContext.failIfLengthLengthParameterNotFound = failIfLengthLengthParameterNotFound;
activityContext.daoSupplier = persistenceContext;
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidationActivitySeineDataContext.java
=====================================
@@ -24,6 +24,7 @@ package fr.ird.observe.services.local.service.actions.consolidate;
import fr.ird.observe.dto.data.ps.DcpComputedValue;
import fr.ird.observe.dto.data.ps.observation.FloatingObjectDto;
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.entities.ObserveTopiaDaoSupplier;
import fr.ird.observe.entities.data.ps.common.Trip;
import fr.ird.observe.entities.data.ps.observation.Activity;
@@ -67,6 +68,7 @@ class ConsolidationActivitySeineDataContext {
boolean failIfLengthWeightParameterNotFound;
boolean failIfLengthLengthParameterNotFound;
BeanMonitor targetLengthMonitor;
+ DecoratorService decoratorService;
String activityPrefix;
BeanMonitor nonTargetLengthMonitor;
@@ -93,7 +95,7 @@ class ConsolidationActivitySeineDataContext {
Ocean ocean = getOcean();
Date routeDate = getRouteDate();
try {
- return Optional.ofNullable(LengthWeightParameters.findLengthWeightParameter(daoSupplier, species, sex, ocean, routeDate, sizeMeasureType));
+ return Optional.ofNullable(LengthWeightParameters.findLengthWeightParameter(decoratorService, daoSupplier, species, sex, ocean, routeDate, sizeMeasureType));
} catch (LengthWeightParameterNotFoundException e) {
if (failIfLengthWeightParameterNotFound) {
throw e;
@@ -107,7 +109,7 @@ class ConsolidationActivitySeineDataContext {
Ocean ocean = getOcean();
Date routeDate = getRouteDate();
try {
- return LengthLengthParameters.findLengthLengthParameter(daoSupplier, species, ocean, sex, routeDate, inputSizeMeasureType, outputSizeMeasureType);
+ return LengthLengthParameters.findLengthLengthParameter(decoratorService, daoSupplier, species, ocean, sex, routeDate, inputSizeMeasureType, outputSizeMeasureType);
} catch (LengthLengthParameterNotFoundException e) {
if (failIfLengthLengthParameterNotFound) {
throw e;
=====================================
services-local/src/test/java/fr/ird/observe/services/local/entity/LengthWeightParemetersTest.java
=====================================
@@ -22,6 +22,8 @@
package fr.ird.observe.services.local.entity;
import com.opensymphony.xwork2.interceptor.annotations.After;
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.decoration.DecoratorServiceApplicationComponent;
import fr.ird.observe.dto.referential.ReferenceStatus;
import fr.ird.observe.entities.ObserveTopiaDaoSupplier;
import fr.ird.observe.entities.ObserveTopiaPersistenceContext;
@@ -61,6 +63,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
private static final Logger log = LogManager.getLogger(LengthWeightParemetersTest.class);
private ObserveTopiaPersistenceContext persistenceContext;
+ private DecoratorService decoratorService;
protected static void createLengthWeightParameter(LengthWeightParameterTopiaDao lengthWeightParameterDao,
Species species,
@@ -93,6 +96,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
persistenceContext = localTestMethodResource.newPersistenceContext();
+ decoratorService = DecoratorServiceApplicationComponent.value();
SpeciesTopiaDao speciesDAO = persistenceContext.getCommonSpeciesDao();
OceanTopiaDao oceanDAO = persistenceContext.getCommonOceanDao();
SexTopiaDao sexDao = persistenceContext.getCommonSexDao();
@@ -239,7 +243,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
if (log.isInfoEnabled()) {
log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date);
}
- LengthWeightParameter lengthWeightParameter = LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, expectedSizeMeasureType);
+ LengthWeightParameter lengthWeightParameter = LengthWeightParameters.findLengthWeightParameter(decoratorService, supplier, species, sex, ocean, date, expectedSizeMeasureType);
Assert.assertNotNull("length weith parameter not found for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date, lengthWeightParameter);
Assert.assertEquals("Expected sex is " + expectedSex.getLabel1() + " but the one found was " + lengthWeightParameter.getSex().getLabel1(), expectedSex, lengthWeightParameter.getSex());
@@ -255,7 +259,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date);
}
try {
- LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, expectedSizeMeasureType);
+ LengthWeightParameters.findLengthWeightParameter(decoratorService, supplier, species, sex, ocean, date, expectedSizeMeasureType);
Assert.fail();
} catch (LengthWeightParameterNotFoundException e) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/34f5d1f4b7799ad6f4eb6f0ae…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/34f5d1f4b7799ad6f4eb6f0ae…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] Comportement sidérant d'H2 - Closes #1463
by Tony CHEMIT 10 May '20
by Tony CHEMIT 10 May '20
10 May '20
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
36e112a1 by Tony Chemit at 2020-05-10T18:47:33+02:00
Comportement sidérant d'H2 - Closes #1463
- - - - -
16 changed files:
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- + persistence/.mvn/i18n/parse-java
- persistence/pom.xml
- + persistence/src/main/i18n/getters/java.getter
- persistence/src/main/java/fr/ird/observe/entities/referentiel/DuplicateLengthLengthParameterException.java
- persistence/src/main/java/fr/ird/observe/entities/referentiel/DuplicateLengthWeightParameterException.java
- persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthLengthParameterNotFoundException.java
- persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthLengthParameters.java
- persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthWeightParameterNotFoundException.java
- persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthWeightParameters.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidateDataServiceLocal.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidationActivitySeineDataContext.java
- services-local/src/test/java/fr/ird/observe/services/local/entity/LengthWeightParemetersTest.java
Changes:
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
=====================================
@@ -1084,4 +1084,17 @@ public class DecoratorService extends DecoratorProvider {
}
};
+
+ public String toString(Object o) {
+ if (o==null) {
+ return null;
+ }
+ if (o instanceof ReferentialDtoReference) {
+ return getReferentialReferenceDecorator(((ReferentialDtoReference<?,?>) o).getReferenceType()).toString(o);
+ }
+ if (o instanceof DataDtoReference) {
+ return getDataReferenceDecorator(((DataDtoReference<?,?>) o).getReferenceType()).toString(o);
+ }
+ return getDecoratorByType(o.getClass()).toString(o);
+ }
}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -1951,6 +1951,10 @@ observe.converter.error.float.format=Decimal format not correct for value %s
observe.converter.error.no.convertor=could not convert decimal %s using convertor %s
observe.converter.error.noValue=No value to convert using convertor %s
observe.entity.message.updating=object '%1$s' is in editing mode.
+observe.error.DuplicateLengthLengthParameterException=Found multiple length length relation for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s
+observe.error.DuplicateLengthWeightParameterException=Found multiple length weight paramters for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s
+observe.error.LengthLengthParameterNotFoundException=No length length relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s
+observe.error.LengthWeightParameterNotFoundException=No length weight relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s
observe.error.can.not.create.directory=Can't create directory %&$s\!
observe.error.storage.could.not.backup.unsane.local.db=Can not save an borken database
observe.error.storage.could.not.load.local.db=Could not open local database for reason\: %s
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -1951,6 +1951,10 @@ observe.converter.error.float.format=Formato de decimal incorrecto para el valor
observe.converter.error.no.convertor=Impossible de convertir el decimal %s con el convertidor %s
observe.converter.error.noValue=Ningún valor necesita ser convertida con el convertidor %s
observe.entity.message.updating=Se está modificando el objeto actual '%1$s'.
+observe.error.DuplicateLengthLengthParameterException=Found multiple length length relation for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s \#TODO
+observe.error.DuplicateLengthWeightParameterException=Found multiple length weight relation for species\: %s, ocean\: %s, sex\: %s, date\: %s \:\n * %s \#TODO
+observe.error.LengthLengthParameterNotFoundException=No length length relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s \#TODO
+observe.error.LengthWeightParameterNotFoundException=No length weight relation found for species\: %s, ocean\: %s, sex\: %s, date\: %s \: %s \#TODO
observe.error.can.not.create.directory=¡Imposible crear el directorio %1$s\!
observe.error.storage.could.not.backup.unsane.local.db=Impossible grabar una base dañada
observe.error.storage.could.not.load.local.db=Impossible grabar la base local por la razón siguiente \: %s
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -1951,6 +1951,10 @@ observe.converter.error.float.format=Format de décimal incorrecte pour la valeu
observe.converter.error.no.convertor=Impossible de convertir le décimal %s depuis le convertisseur %s
observe.converter.error.noValue=Aucune valeur à convertir pour le convertisseur %s
observe.entity.message.updating=L'objet '%1$s' est en cours de modification.
+observe.error.DuplicateLengthLengthParameterException=Plusieurs relations taille-taille ont été trouvées pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s \:\n * %s
+observe.error.DuplicateLengthWeightParameterException=Plusieurs relations taille-poids ont été trouvées pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s \:\n * %s
+observe.error.LengthLengthParameterNotFoundException=Aucune relation taille-taille trouvée pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s
+observe.error.LengthWeightParameterNotFoundException=Aucune relation taille-poids trouvée pour l'espèce\: %s, l'ocean\: %s, le sexe\: %s et la date\: %s
observe.error.can.not.create.directory=Création du répertoire %1$s impossible\!
observe.error.storage.could.not.backup.unsane.local.db=Impossible d'enregistrer une base non endommagée
observe.error.storage.could.not.load.local.db=Impossible d'ouvrir la base locale pour la raison suivante \: %s
=====================================
persistence/.mvn/i18n/parse-java
=====================================
=====================================
persistence/pom.xml
=====================================
@@ -86,7 +86,10 @@
<artifactId>nuiton-csv</artifactId>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>io.ultreia.java4all.i18n</groupId>
+ <artifactId>i18n-runtime</artifactId>
+ </dependency>
<dependency>
<groupId>io.ultreia.java4all.http</groupId>
<artifactId>http-api</artifactId>
=====================================
persistence/src/main/i18n/getters/java.getter
=====================================
@@ -0,0 +1,3 @@
+observe.error.DuplicateLengthWeightParameterException
+observe.error.LengthLengthParameterNotFoundException
+observe.error.LengthWeightParameterNotFoundException
=====================================
persistence/src/main/java/fr/ird/observe/entities/referentiel/DuplicateLengthLengthParameterException.java
=====================================
@@ -22,8 +22,20 @@ package fr.ird.observe.entities.referentiel;
* #L%
*/
+import fr.ird.observe.binder.referential.ReferentialEntityReferenceBinderSupport;
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.referential.LengthLengthParameterDto;
+import fr.ird.observe.dto.referential.LengthLengthParameterReference;
+import fr.ird.observe.dto.referential.LengthWeightParameterDto;
+import fr.ird.observe.dto.referential.LengthWeightParameterReference;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.spi.DbModelHelper;
+
import java.util.Date;
import java.util.List;
+import java.util.stream.Collectors;
+
+import static io.ultreia.java4all.i18n.I18n.t;
/**
* Created on 28/08/15.
@@ -44,7 +56,8 @@ public class DuplicateLengthLengthParameterException extends RuntimeException {
protected final List<LengthLengthParameter> foundLengthLengthParameters;
- public DuplicateLengthLengthParameterException(Species species, Ocean ocean, Sex sex, Date date, List<LengthLengthParameter> foundLengthLengthParameters) {
+ public DuplicateLengthLengthParameterException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthLengthParameter> foundLengthLengthParameters) {
+ super(buildMessage(decoratorService, species, ocean, sex, date, foundLengthLengthParameters));
this.species = species;
this.ocean = ocean;
this.sex = sex;
@@ -52,6 +65,18 @@ public class DuplicateLengthLengthParameterException extends RuntimeException {
this.foundLengthLengthParameters = foundLengthLengthParameters;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthLengthParameter> foundLengthLengthParameters) {
+ ReferentialEntityReferenceBinderSupport<LengthLengthParameterDto, LengthLengthParameterReference, LengthLengthParameter> entityContext = DbModelHelper.fromReferentialEntity(LengthLengthParameter.class).toEntityReferenceBinder();
+ ReferentialLocale referentialLocale = decoratorService.getReferentialLocale();
+ return t("observe.error.DuplicateLengthWeightParameterException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date,
+ foundLengthLengthParameters.stream().map(e -> entityContext.toReference(referentialLocale, e)).map(decoratorService::toString).collect(Collectors.joining("\n * "))
+ );
+ }
+
public Species getSpecies() {
return species;
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referentiel/DuplicateLengthWeightParameterException.java
=====================================
@@ -22,8 +22,20 @@ package fr.ird.observe.entities.referentiel;
* #L%
*/
+import fr.ird.observe.binder.referential.ReferentialEntityReferenceBinderSupport;
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.referential.LengthWeightParameterDto;
+import fr.ird.observe.dto.referential.LengthWeightParameterReference;
+import fr.ird.observe.dto.referential.ReferentialDto;
+import fr.ird.observe.dto.referential.ReferentialLocale;
+import fr.ird.observe.spi.DbModelHelper;
+import fr.ird.observe.spi.context.ReferentialEntityContext;
+
import java.util.Date;
import java.util.List;
+import java.util.stream.Collectors;
+
+import static io.ultreia.java4all.i18n.I18n.t;
/**
* Created on 28/08/15.
@@ -44,7 +56,8 @@ public class DuplicateLengthWeightParameterException extends RuntimeException {
protected final List<LengthWeightParameter> foundLengthWeightParameters;
- public DuplicateLengthWeightParameterException(Species species, Ocean ocean, Sex sex, Date date, List<LengthWeightParameter> foundLengthWeightParameters) {
+ public DuplicateLengthWeightParameterException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthWeightParameter> foundLengthWeightParameters) {
+ super(buildMessage(decoratorService, species, ocean, sex, date, foundLengthWeightParameters));
this.species = species;
this.ocean = ocean;
this.sex = sex;
@@ -52,6 +65,18 @@ public class DuplicateLengthWeightParameterException extends RuntimeException {
this.foundLengthWeightParameters = foundLengthWeightParameters;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date, List<LengthWeightParameter> foundLengthWeightParameters) {
+ ReferentialEntityReferenceBinderSupport<LengthWeightParameterDto, LengthWeightParameterReference, LengthWeightParameter> entityContext = DbModelHelper.fromReferentialEntity(LengthWeightParameter.class).toEntityReferenceBinder();
+ ReferentialLocale referentialLocale = decoratorService.getReferentialLocale();
+ return t("observe.error.DuplicateLengthWeightParameterException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date,
+ foundLengthWeightParameters.stream().map(e -> entityContext.toReference(referentialLocale, e)).map(decoratorService::toString).collect(Collectors.joining("\n * "))
+ );
+ }
+
public Species getSpecies() {
return species;
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthLengthParameterNotFoundException.java
=====================================
@@ -22,8 +22,15 @@ package fr.ird.observe.entities.referentiel;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.reference.ReferentialDtoReference;
+import fr.ird.observe.dto.referential.ReferentialDto;
+import fr.ird.observe.spi.DbModelHelper;
+
import java.util.Date;
+import static io.ultreia.java4all.i18n.I18n.t;
+
/**
* Created on 29/08/15.
*
@@ -41,13 +48,23 @@ public class LengthLengthParameterNotFoundException extends RuntimeException {
protected final Date date;
- public LengthLengthParameterNotFoundException(Species species, Ocean ocean, Sex sex, Date date) {
+ public LengthLengthParameterNotFoundException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+ super(buildMessage(decoratorService, species, ocean, sex, date));
this.species = species;
this.ocean = ocean;
this.sex = sex;
this.date = date;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+
+ return t("observe.error.LengthLengthParameterNotFoundException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date);
+ }
+
public Species getSpecies() {
return species;
}
@@ -64,4 +81,10 @@ public class LengthLengthParameterNotFoundException extends RuntimeException {
return date;
}
+ static <E extends ObserveReferentialEntity> String toString(DecoratorService decoratorService, E entity) {
+ if (entity == null) {
+ return null;
+ }
+ return decoratorService.toString(DbModelHelper.fromReferentialEntity(entity).toEntityReferenceBinder().toReference(decoratorService.getReferentialLocale(), entity));
+ }
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthLengthParameters.java
=====================================
@@ -22,6 +22,7 @@ package fr.ird.observe.entities.referentiel;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.persistence.ObserveTopiaDaoSupplier;
import org.apache.commons.collections4.CollectionUtils;
@@ -49,6 +50,7 @@ public class LengthLengthParameters {
* <p>
* Si non trouvé sur le sexe (et que le sexe n'est pas indéterminé) , alors on recherche avec le sexe indéterminé (sexe=0).
*
+ * @param decoratorService decorator service
* @param daoSupplier la transaction en cours d'utilisation
* @param species l'espèce sur lequel on recherche le paramétrage
* @param ocean l'ocean recherché (peut être null)
@@ -59,7 +61,7 @@ public class LengthLengthParameters {
* @return le paramétrage adéquate
* @since 1.5
*/
- public static Optional<LengthLengthParameter> findLengthLengthParameter(ObserveTopiaDaoSupplier daoSupplier,
+ public static Optional<LengthLengthParameter> findLengthLengthParameter(DecoratorService decoratorService, ObserveTopiaDaoSupplier daoSupplier,
Species species,
Ocean ocean,
Sex sex,
@@ -85,7 +87,7 @@ public class LengthLengthParameters {
}
if (CollectionUtils.isEmpty(list)) {
- throw new LengthLengthParameterNotFoundException(species, ocean, sex, date);
+ throw new LengthLengthParameterNotFoundException(decoratorService, species, ocean, sex, date);
}
// if (inputSizeMeasureType != null) {
@@ -116,193 +118,14 @@ public class LengthLengthParameters {
// au final il ne devrait en rester qu'un
if (list.size() > 1) {
- throw new DuplicateLengthLengthParameterException(species, ocean, sex, date, list);
+ throw new DuplicateLengthLengthParameterException(decoratorService, species, ocean, sex, date, list);
}
return Optional.of(list.get(0));
-
}
-//
-// /**
-// * Recherche de la liste des {@link LengthLengthParameter} à partir des paramètres donnés.
-// * <p>
-// * La recherche peut ne peut être aussi exacte que les paramètres donnés :
-// * <p>
-// * Dans le cas d'une espèce faune, si non trouvé alors on recherche sur son
-// * speciesGroup d'espèce.
-// * <p>
-// * Si non trouvé pour l'océan donné (et que celui-ci est non null), alors on
-// * recherche avec un ocean vide.
-// *
-// * @param daoSupplier la transaction en cours d'utilisation
-// * @param species l'espèce sur lequel on recherche le paramétrage
-// * @param ocean l'ocean recherché (peut être null)
-// * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
-// * @param date le jour recherché
-// * @return le paramétrage adéquate
-// * @since 1.5
-// */
-// public static List<LengthLengthParameter> findLengthLengthParameter0(ObserveTopiaDaoSupplier daoSupplier,
-// Species species,
-// Ocean ocean,
-// Sex sex,
-// Date date) {
-//
-// Objects.requireNonNull(daoSupplier, "daoSupplier parameter can't be null");
-// Objects.requireNonNull(species, "species parameter can't be null");
-// Objects.requireNonNull(sex, "sex parameter can't be null");
-//
-// List<LengthLengthParameter> list = findBySpecies(daoSupplier, species);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // aucun parametrage pour le type donne
-// return null;
-// }
-//
-// // filtrage par ocean
-// List<LengthLengthParameter> filterByOcean = filterByOcean(list, ocean);
-//
-// if (CollectionUtils.isEmpty(filterByOcean) && ocean != null) {
-//
-// // filtre par ocean null
-// filterByOcean = filterByOcean(list, null);
-// }
-// list = filterByOcean;
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas d'ocean adequate
-// return null;
-// }
-//
-// // filtrage par sexe
-// list = filterBySexe(list, sex);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de sexe adequate
-// return null;
-// }
-//
-// // filtrage par startDate de validite
-// list = filterByDateDebutValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de debut adequate
-// return null;
-// }
-//
-// // filtrage par endDate de validite
-// list = filterByDateFinValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de fin adequate
-// return null;
-// }
-//
-// return list;
-//
-// }
private static Sex getUnknownSex(ObserveTopiaDaoSupplier daoSupplier) {
return daoSupplier.getSexDao().forCodeEquals("0").findUnique();
}
-// public static List<LengthLengthParameter> findBySpecies(ObserveTopiaDaoSupplier daoSupplier, Species species) {
-//
-// LengthLengthParameterTopiaDao dao = daoSupplier.getLengthLengthParameterDao();
-//
-// List<LengthLengthParameter> list = dao.forSpeciesEquals(species).findAll();
-//
-// // on supprime les paramétrages qui ont a=0 ou a=null ou b=0 ou b = null
-// Iterator<LengthLengthParameter> itr = list.iterator();
-// while (itr.hasNext()) {
-// LengthLengthParameter p = itr.next();
-// Double a = p.getCoefficientValue(FormulaHelper.COEFFICIENT_A);
-// if (a == null || a == 0) {
-// itr.remove();
-// continue;
-// }
-//
-// Double b = p.getCoefficientValue(FormulaHelper.COEFFICIENT_B);
-// // on autorise d'avoir b à 0 (mais cela ne permet plus de calculer la taille à partir du poids)
-//// if (b == null || b == 0) {
-// if (b == null) {
-// itr.remove();
-// }
-// }
-// return list;
-//
-// }
-
-// public static List<LengthLengthParameter> filterByOcean(List<LengthLengthParameter> list, Ocean ocean) {
-// List<LengthLengthParameter> result = new ArrayList<>();
-// if (ocean == null) {
-//
-// // on n'accepte que les parametrage sans ocean
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-// if (parametrageLengthWeight.getOcean() == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-// if (ocean.equals(parametrageLengthWeight.getOcean())) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
-//
-// public static List<LengthLengthParameter> filterBySexe(List<LengthLengthParameter> list, Sex sex) {
-// return list.stream().filter(l -> l.getSex() == sex).collect(Collectors.toList());
-// }
-//
-// public static List<LengthLengthParameter> filterByInputSizeMeasureType(List<LengthLengthParameter> list, SizeMeasureType sizeMeasureType) {
-// return list.stream().filter(l -> l.getInputSizeMeasureType() == sizeMeasureType).collect(Collectors.toList());
-// }
-//public static List<LengthLengthParameter> filterByOutputSizeMeasureType(List<LengthLengthParameter> list, SizeMeasureType sizeMeasureType) {
-// return list.stream().filter(l -> l.getOutputSizeMeasureType() == sizeMeasureType).collect(Collectors.toList());
-// }
-//
-// public static List<LengthLengthParameter> filterByDateDebutValidite(List<LengthLengthParameter> list, Date startDate) {
-// return list.stream()
-// .filter(l -> l.getStartDate() == null || l.getStartDate().before(startDate) || l.getStartDate().equals(startDate))
-// .collect(Collectors.toList());
-// }
-//
-// public static List<LengthLengthParameter> filterByDateFinValidite(List<LengthLengthParameter> list, Date endDate) {
-// List<LengthLengthParameter> result = new ArrayList<>();
-//
-// if (endDate == null) {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// // - ceux dont la date de fin est avant la date de fin donnée
-// for (LengthLengthParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null ||
-// date.after(endDate) ||
-// date.equals(endDate)) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
-
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthWeightParameterNotFoundException.java
=====================================
@@ -22,7 +22,15 @@ package fr.ird.observe.entities.referentiel;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
+import fr.ird.observe.dto.referential.SpeciesDto;
+import fr.ird.observe.spi.DbModelHelper;
+import fr.ird.observe.spi.DtoModelHelper;
+
import java.util.Date;
+import java.util.stream.Collectors;
+
+import static io.ultreia.java4all.i18n.I18n.t;
/**
* Created on 29/08/15.
@@ -41,13 +49,23 @@ public class LengthWeightParameterNotFoundException extends RuntimeException {
protected final Date date;
- public LengthWeightParameterNotFoundException(Species species, Ocean ocean, Sex sex, Date date) {
+ public LengthWeightParameterNotFoundException(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+ super(buildMessage(decoratorService, species, ocean, sex, date));
this.species = species;
this.ocean = ocean;
this.sex = sex;
this.date = date;
}
+ private static String buildMessage(DecoratorService decoratorService, Species species, Ocean ocean, Sex sex, Date date) {
+
+ return t("observe.error.LengthWeightParameterNotFoundException",
+ LengthLengthParameterNotFoundException.toString(decoratorService, species),
+ LengthLengthParameterNotFoundException.toString(decoratorService, ocean),
+ LengthLengthParameterNotFoundException.toString(decoratorService, sex),
+ date);
+ }
+
public Species getSpecies() {
return species;
}
=====================================
persistence/src/main/java/fr/ird/observe/entities/referentiel/LengthWeightParameters.java
=====================================
@@ -22,6 +22,7 @@ package fr.ird.observe.entities.referentiel;
* #L%
*/
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.persistence.ObserveTopiaDaoSupplier;
import org.apache.commons.collections4.CollectionUtils;
@@ -47,16 +48,17 @@ public class LengthWeightParameters {
* <p>
* Si non trouvé sur le sexe (et que le sexe n'est pas indéterminé) , alors on recherche avec le sexe indéterminé (sexe=0).
*
- * @param daoSupplier la transaction en cours d'utilisation
- * @param species l'espèce sur lequel on recherche le paramétrage
- * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
- * @param ocean l'ocean recherché (peut être null)
- * @param date le jour recherché
- * @param sizeMeasureType le type de mensuration recherché
+ * @param decoratorService decorator service
+ * @param daoSupplier la transaction en cours d'utilisation
+ * @param species l'espèce sur lequel on recherche le paramétrage
+ * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
+ * @param ocean l'ocean recherché (peut être null)
+ * @param date le jour recherché
+ * @param sizeMeasureType le type de mensuration recherché
* @return le paramétrage adéquate
* @since 1.5
*/
- public static LengthWeightParameter findLengthWeightParameter(ObserveTopiaDaoSupplier daoSupplier,
+ public static LengthWeightParameter findLengthWeightParameter(DecoratorService decoratorService, ObserveTopiaDaoSupplier daoSupplier,
Species species, Sex sex, Ocean ocean, Date date, SizeMeasureType sizeMeasureType) {
// Sex unknownSex = getUnknownSex(daoSupplier);
@@ -77,7 +79,7 @@ public class LengthWeightParameters {
// }
if (CollectionUtils.isEmpty(list)) {
- throw new LengthWeightParameterNotFoundException(species, ocean, sex, date);
+ throw new LengthWeightParameterNotFoundException(decoratorService, species, ocean, sex, date);
}
// if (sizeMeasureType != null) {
@@ -96,190 +98,11 @@ public class LengthWeightParameters {
// au final il ne devrait en rester qu'un
if (list.size() > 1) {
- throw new DuplicateLengthWeightParameterException(species, ocean, sex, date, list);
+ throw new DuplicateLengthWeightParameterException(decoratorService, species, ocean, sex, date, list);
}
return Objects.requireNonNull(list.get(0));
}
-// /**
-// * Recherche de la liste des {@link LengthWeightParameter} à partir des paramètres donnés.
-// * <p>
-// * La recherche peut ne peut être aussi exacte que les paramètres donnés :
-// * <p>
-// * Dans le cas d'une espèce faune, si non trouvé alors on recherche sur son
-// * speciesGroup d'espèce.
-// * <p>
-// * Si non trouvé pour l'océan donné (et que celui-ci est non null), alors on
-// * recherche avec un ocean vide.
-// *
-// * @param daoSupplier la transaction en cours d'utilisation
-// * @param species l'espèce sur lequel on recherche le paramétrage
-// * @param ocean l'ocean recherché (peut être null)
-// * @param sex le sexe recherché (on essayera sans sexe (sexe.code=0) si non trouvé)
-// * @param date le jour recherché
-// * @return le paramétrage adéquate
-// * @since 1.5
-// */
-// public static List<LengthWeightParameter> findLengthWeightParameter0(ObserveTopiaDaoSupplier daoSupplier,
-// Species species,
-// Ocean ocean,
-// Sex sex,
-// Date date) {
-//
-// Objects.requireNonNull(daoSupplier, "daoSupplier parameter can't be null");
-// Objects.requireNonNull(species, "species parameter can't be null");
-// Objects.requireNonNull(sex, "sex parameter can't be null");
-//
-// List<LengthWeightParameter> list = findBySpecies(daoSupplier, species);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // aucun parametrage pour le type donne
-// return null;
-// }
-//
-// // filtrage par ocean
-// List<LengthWeightParameter> filterByOcean = filterByOcean(list, ocean);
-//
-// if (CollectionUtils.isEmpty(filterByOcean) && ocean != null) {
-//
-// // filtre par ocean null
-// filterByOcean = filterByOcean(list, null);
-// }
-// list = filterByOcean;
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas d'ocean adequate
-// return null;
-// }
-//
-// // filtrage par sexe
-// list = filterBySexe(list, sex);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de sexe adequate
-// return null;
-// }
-//
-// // filtrage par startDate de validite
-// list = filterByDateDebutValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de debut adequate
-// return null;
-// }
-//
-// // filtrage par endDate de validite
-// list = filterByDateFinValidite(list, date);
-//
-// if (CollectionUtils.isEmpty(list)) {
-//
-// // pas de date de fin adequate
-// return null;
-// }
-//
-// return list;
-//
-// }
-
-// private static Sex getUnknownSex(ObserveTopiaDaoSupplier daoSupplier) {
-// return daoSupplier.getSexDao().forCodeEquals("0").findUnique();
-// }
-
-// public static List<LengthWeightParameter> findBySpecies(ObserveTopiaDaoSupplier daoSupplier, Species species) {
-//
-// LengthWeightParameterTopiaDao dao = daoSupplier.getLengthWeightParameterDao();
-//
-// List<LengthWeightParameter> list = dao.forSpeciesEquals(species).findAll();
-//
-// // on supprime les paramétrages qui ont a=0 ou a=null ou b=0 ou b = null
-// Iterator<LengthWeightParameter> itr = list.iterator();
-// while (itr.hasNext()) {
-// LengthWeightParameter p = itr.next();
-// Double a = p.getCoefficientValue(FormulaHelper.COEFFICIENT_A);
-// if (a == null || a == 0) {
-// itr.remove();
-// continue;
-// }
-//
-// Double b = p.getCoefficientValue(FormulaHelper.COEFFICIENT_B);
-// // on autorise d'avoir b à 0 (mais cela ne permet plus de calculer la taille à partir du poids)
-//// if (b == null || b == 0) {
-// if (b == null) {
-// itr.remove();
-// }
-// }
-// return list;
-//
-// }
-//
-// public static List<LengthWeightParameter> filterByOcean(List<LengthWeightParameter> list, Ocean ocean) {
-// List<LengthWeightParameter> result = new ArrayList<>();
-// if (ocean == null) {
-//
-// // on n'accepte que les parametrage sans ocean
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-// if (parametrageLengthWeight.getOcean() == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-// if (ocean.equals(parametrageLengthWeight.getOcean())) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
-//
-// public static List<LengthWeightParameter> filterBySexe(List<LengthWeightParameter> list, Sex sex) {
-// return list.stream().filter(l -> l.getSex() == sex).collect(Collectors.toList());
-// }
-//
-// public static List<LengthWeightParameter> filterBySizeMeasureType(List<LengthWeightParameter> list, SizeMeasureType sizeMeasureType) {
-// return list.stream().filter(l -> l.getSizeMeasureType() == sizeMeasureType).collect(Collectors.toList());
-// }
-//
-// public static List<LengthWeightParameter> filterByDateDebutValidite(List<LengthWeightParameter> list, Date startDate) {
-// return list.stream()
-// .filter(l -> l.getStartDate() == null || l.getStartDate().before(startDate) || l.getStartDate().equals(startDate))
-// .collect(Collectors.toList());
-// }
-//
-// public static List<LengthWeightParameter> filterByDateFinValidite(List<LengthWeightParameter> list, Date endDate) {
-// List<LengthWeightParameter> result = new ArrayList<>();
-//
-// if (endDate == null) {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// } else {
-// // on n'accepte que les parametrages selon les critères suivants :
-// // - sans date de fin (i.e en cours de validite)
-// // - ceux dont la date de fin est avant la date de fin donnée
-// for (LengthWeightParameter parametrageLengthWeight : list) {
-//
-// Date date = parametrageLengthWeight.getEndDate();
-// if (date == null ||
-// date.after(endDate) ||
-// date.equals(endDate)) {
-// result.add(parametrageLengthWeight);
-// }
-// }
-// }
-// return result;
-// }
-
}
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidateDataServiceLocal.java
=====================================
@@ -29,6 +29,7 @@ import fr.ird.observe.dto.data.seine.FloatingObjectDto;
import fr.ird.observe.dto.data.seine.FloatingObjectPartDto;
import fr.ird.observe.dto.data.seine.NonTargetCatchComputedValueSource;
import fr.ird.observe.dto.data.seine.SchoolType;
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.entities.LengthWeightComputable;
import fr.ird.observe.entities.referentiel.LengthLengthParameter;
@@ -157,7 +158,8 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
FloatingObjectConsolidateEngine floatingObjectConsolidateEngine = new FloatingObjectConsolidateEngine(simplifiedObjectTypeManager);
- Optional<ConsolidateTripSeineDataResult> consolidateTripSeineDataResult = consolidateTripSeine(referenceLocale, floatingObjectConsolidateEngine, request.getTripSeineId(), failIfLengthWeightParameterNotFound, failIfLengthLengthParameterNotFound);
+ DecoratorService decoratorService = new DecoratorService(getReferentialLocale());
+ Optional<ConsolidateTripSeineDataResult> consolidateTripSeineDataResult = consolidateTripSeine(decoratorService, referenceLocale, floatingObjectConsolidateEngine, request.getTripSeineId(), failIfLengthWeightParameterNotFound, failIfLengthLengthParameterNotFound);
return consolidateTripSeineDataResult.orElse(null);
}
@@ -178,7 +180,7 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
return new SimplifiedObjectTypeManager(materialMapping, simplifiedObjectTypeSpecializedRules);
}
- private Optional<ConsolidateTripSeineDataResult> consolidateTripSeine(ReferentialLocale referenceLocale, FloatingObjectConsolidateEngine floatingObjectConsolidateEngine, String tripSeineId, boolean failIfLengthWeightParameterNotFound, boolean failIfLengthLengthParameterNotFound) {
+ private Optional<ConsolidateTripSeineDataResult> consolidateTripSeine(DecoratorService decoratorService, ReferentialLocale referenceLocale, FloatingObjectConsolidateEngine floatingObjectConsolidateEngine, String tripSeineId, boolean failIfLengthWeightParameterNotFound, boolean failIfLengthLengthParameterNotFound) {
log.info(String.format("Start consolidate trip: %s", tripSeineId));
@@ -223,24 +225,25 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
int routeMax = tripSeine.sizeRoute();
for (Route route : tripSeine.getRoute()) {
- String routePrefix =String.format("Route [%s/%s] ", ++routeIndex, routeMax);
+ String routePrefix = String.format("Route [%s/%s] ", ++routeIndex, routeMax);
log.info(String.format("%s Start consolidate route: %s", routePrefix, route.getTopiaId()));
int activityIndex = 0;
int activityMax = route.sizeActivitySeine();
for (ActivitySeine activitySeine : route.getActivitySeine()) {
- String activityPrefix =String.format("%s - Activity [%s/%s] ", routePrefix, ++activityIndex, activityMax);
+ String activityPrefix = String.format("%s - Activity [%s/%s] ", routePrefix, ++activityIndex, activityMax);
boolean floatingObjectEmpty = activitySeine.isFloatingObjectEmpty();
if (!activitySeine.isSetOperation() && floatingObjectEmpty) {
- log.info(String.format("%s Skip activity (No set nor dcp found): %s", activityPrefix, activitySeine.getTopiaId()));
- continue;
+ log.info(String.format("%s Skip activity (No set nor dcp found): %s", activityPrefix, activitySeine.getTopiaId()));
+ continue;
}
ConsolidateActivitySeineDataResultBuilder resultBuilder = new ConsolidateActivitySeineDataResultBuilder(applicationLocale, referenceLocale, activitySeine.getTopiaId(), ActivitySeines.decorate(referenceLocale.ordinal(), activitySeine));
ConsolidationActivitySeineDataContext activityContext = new ConsolidationActivitySeineDataContext();
activityContext.locale = applicationLocale;
+ activityContext.decoratorService = decoratorService;
activityContext.failIfLengthWeightParameterNotFound = failIfLengthWeightParameterNotFound;
activityContext.failIfLengthLengthParameterNotFound = failIfLengthLengthParameterNotFound;
activityContext.daoSupplier = persistenceContext;
@@ -331,9 +334,9 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
activityContext.watchTargetLength(targetLength);
updateLengthWeightAble(activityContext,
- targetLength.getSpecies(),
- null, /* pas de sexe precise */
- targetLength);
+ targetLength.getSpecies(),
+ null, /* pas de sexe precise */
+ targetLength);
activityContext.flushTargetLength();
@@ -353,9 +356,9 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
activityContext.watchNonTargetLenght(nonTargetLength);
updateLengthWeightAble(activityContext,
- nonTargetLength.getSpecies(),
- nonTargetLength.getSex(),
- nonTargetLength);
+ nonTargetLength.getSpecies(),
+ nonTargetLength.getSex(),
+ nonTargetLength);
activityContext.flushNonTargetLength();
@@ -411,11 +414,11 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
boolean notWhenArriving = !dcp.getObjectOperation().isWhenArriving();
boolean notWhenLeaving = !dcp.getObjectOperation().isWhenLeaving();
for (FloatingObjectPart floatingObjectPart : dcp.getFloatingObjectPart()) {
- if (floatingObjectPart.getWhenArriving()!=null && notWhenArriving) {
+ if (floatingObjectPart.getWhenArriving() != null && notWhenArriving) {
log.info(String.format("Set whenArriving to null for part: %s", floatingObjectPart.getTopiaId()));
floatingObjectPart.setWhenArriving(null);
}
- if (floatingObjectPart.getWhenLeaving()!=null && notWhenLeaving) {
+ if (floatingObjectPart.getWhenLeaving() != null && notWhenLeaving) {
log.info(String.format("Set whenLeaving to null for part: %s", floatingObjectPart.getTopiaId()));
floatingObjectPart.setWhenLeaving(null);
}
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidationActivitySeineDataContext.java
=====================================
@@ -27,6 +27,7 @@ import fr.ird.observe.dto.data.seine.DcpComputedValue;
import fr.ird.observe.dto.data.seine.FloatingObjectDto;
import fr.ird.observe.dto.data.seine.FloatingObjectPartDto;
import fr.ird.observe.dto.data.seine.SchoolType;
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.entities.referentiel.LengthLengthParameter;
import fr.ird.observe.entities.referentiel.LengthLengthParameterNotFoundException;
import fr.ird.observe.entities.referentiel.LengthLengthParameters;
@@ -72,6 +73,7 @@ class ConsolidationActivitySeineDataContext {
boolean failIfLengthLengthParameterNotFound;
BeanMonitor targetLengthMonitor;
String activityPrefix;
+ DecoratorService decoratorService;
BeanMonitor nonTargetLengthMonitor;
@@ -99,7 +101,7 @@ class ConsolidationActivitySeineDataContext {
Ocean ocean = getOcean();
Date routeDate = getRouteDate();
try {
- return Optional.ofNullable(LengthWeightParameters.findLengthWeightParameter(daoSupplier, species, sex, ocean, routeDate, sizeMeasureType));
+ return Optional.ofNullable(LengthWeightParameters.findLengthWeightParameter(decoratorService, daoSupplier, species, sex, ocean, routeDate, sizeMeasureType));
} catch (LengthWeightParameterNotFoundException e) {
if (failIfLengthWeightParameterNotFound) {
throw e;
@@ -113,7 +115,7 @@ class ConsolidationActivitySeineDataContext {
Ocean ocean = getOcean();
Date routeDate = getRouteDate();
try {
- return LengthLengthParameters.findLengthLengthParameter(daoSupplier, species, ocean, sex, routeDate, inputSizeMeasureType, outputSizeMeasureType);
+ return LengthLengthParameters.findLengthLengthParameter(decoratorService, daoSupplier, species, ocean, sex, routeDate, inputSizeMeasureType, outputSizeMeasureType);
} catch (LengthLengthParameterNotFoundException e) {
if (failIfLengthLengthParameterNotFound) {
throw e;
=====================================
services-local/src/test/java/fr/ird/observe/services/local/entity/LengthWeightParemetersTest.java
=====================================
@@ -22,7 +22,9 @@
package fr.ird.observe.services.local.entity;
import com.opensymphony.xwork2.interceptor.annotations.After;
+import fr.ird.observe.dto.decoration.DecoratorService;
import fr.ird.observe.dto.referential.ReferenceStatus;
+import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.entities.referentiel.LengthWeightParameter;
import fr.ird.observe.entities.referentiel.LengthWeightParameterNotFoundException;
import fr.ird.observe.entities.referentiel.LengthWeightParameterTopiaDao;
@@ -61,6 +63,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
private static final Logger log = LogManager.getLogger(LengthWeightParemetersTest.class);
private ObserveTopiaPersistenceContext persistenceContext;
+ private DecoratorService decoratorService;
protected static void createLengthWeightParameter(LengthWeightParameterTopiaDao lengthWeightParameterDao,
Species species,
@@ -91,6 +94,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
@Before
public void setUp() {
+ decoratorService =new DecoratorService(ReferentialLocale.FR);
persistenceContext = localTestMethodResource.newPersistenceContext();
SpeciesTopiaDao speciesDAO = persistenceContext.getSpeciesDao();
@@ -239,7 +243,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
if (log.isInfoEnabled()) {
log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date);
}
- LengthWeightParameter lengthWeightParameter = LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, expectedSizeMeasureType);
+ LengthWeightParameter lengthWeightParameter = LengthWeightParameters.findLengthWeightParameter(decoratorService, supplier, species, sex, ocean, date, expectedSizeMeasureType);
Assert.assertNotNull("length weith parameter not found for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date, lengthWeightParameter);
Assert.assertEquals("Expected sex is " + expectedSex.getLabel1() + " but the one found was " + lengthWeightParameter.getSex().getLabel1(), expectedSex, lengthWeightParameter.getSex());
@@ -255,7 +259,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date);
}
try {
- LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, expectedSizeMeasureType);
+ LengthWeightParameters.findLengthWeightParameter(decoratorService, supplier, species, sex, ocean, date, expectedSizeMeasureType);
Assert.fail();
} catch (LengthWeightParameterNotFoundException e) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/36e112a1111ef927bbadf77dd…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/36e112a1111ef927bbadf77dd…
You're receiving this email because of your account on gitlab.com.
1
0
10 May '20
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
21c928dd by Tony Chemit at 2020-05-10T13:04:00+02:00
Report form v8 - Closes #1472
* Dans le gestionnaire de connexions, un bouton 'dupliquer le profil' serait pratique - Closes #1477
* Quelques améliorations dans le gestionnaire de connexion - Closes #1479
* L'écran de gestion des connexions pourrait être présenté en partage horizontal - Closes #1480
- - - - -
14 changed files:
- client-core/src/main/i18n/getters/java.getter
- client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelRemoteUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelServerUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteRemoteUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteServerUIAction.java
- + client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateRemoteUIAction.java
- + client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateServerUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jcss
- client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUIHandler.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
Changes:
=====================================
client-core/src/main/i18n/getters/java.getter
=====================================
@@ -44,6 +44,9 @@ observe.action.delete.remote.tip
observe.action.delete.server.tip
observe.action.delete.tip
observe.action.detail
+observe.action.duplicate
+observe.action.duplicate.remote.tip
+observe.action.duplicate.server.tip
observe.action.exit
observe.action.exit.tip
observe.action.floatingObjectPresets
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java
=====================================
@@ -86,6 +86,7 @@ public abstract class ObserveKeyStrokes {
public static final KeyStroke KEY_STROKE_RESET_DATA = KeyStroke.getKeyStroke("pressed F7");
public static final KeyStroke KEY_STROKE_NEW_NEXT_DATA = KeyStroke.getKeyStroke("pressed F4");
public static final KeyStroke KEY_STROKE_DELETE_DATA_GLOBAL = KeyStroke.getKeyStroke("pressed F6");
+ public static final KeyStroke KEY_STROKE_DUPLICATE = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_OPEN_DATA = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_CLOSE_DATA = KeyStroke.getKeyStroke("pressed F3");
public static final KeyStroke KEY_STROKE_SAVE_DATA = KeyStroke.getKeyStroke("pressed F5");
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelRemoteUIAction.java
=====================================
@@ -57,6 +57,8 @@ public class CancelRemoteUIAction extends PresetsUIActionSupport {
ObserveSwingApplicationContext.get().getConfig().removeRemoteDataSourceConfiguration(configuration);
ui.getModel().setRemoteDataSourceConfiguration(null);
ui.getModel().setRemoteCreateMode(false);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getRemoteConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelServerUIAction.java
=====================================
@@ -57,6 +57,8 @@ public class CancelServerUIAction extends PresetsUIActionSupport {
ObserveSwingApplicationContext.get().getConfig().removeServerDataSourceConfiguration(configuration);
ui.getModel().setServerDataSourceConfiguration(null);
ui.getModel().setServerCreateMode(false);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getServerConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteRemoteUIAction.java
=====================================
@@ -69,6 +69,8 @@ public class DeleteRemoteUIAction extends PresetsUIActionSupport {
ui.getModel().setRemoteDataSourceConfigurations(configurations);
ObserveSwingApplicationContext.get().getConfig().removeRemoteDataSourceConfiguration(configuration);
ui.getModel().setRemoteDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getRemoteConfigurations().setSelectedIndex(newConfiguration);
}
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteServerUIAction.java
=====================================
@@ -71,6 +71,8 @@ public class DeleteServerUIAction extends PresetsUIActionSupport {
ui.getModel().setServerDataSourceConfigurations(configurations);
ObserveSwingApplicationContext.get().getConfig().removeServerDataSourceConfiguration(configuration);
ui.getModel().setServerDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getServerConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateRemoteUIAction.java
=====================================
@@ -0,0 +1,61 @@
+package fr.ird.observe.client.ui.actions.storage.presets;
+
+/*-
+ * #%L
+ * ObServe :: Client core
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.ui.ObserveKeyStrokes;
+import fr.ird.observe.client.ui.ObserveMainUI;
+import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI;
+import fr.ird.observe.dto.presets.RemoteDataSourceConfiguration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateRemoteUIAction extends PresetsUIActionSupport {
+
+ public static final String ACTION_NAME = DuplicateRemoteUIAction.class.getName();
+
+ public DuplicateRemoteUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, n("observe.action.duplicate"), n("observe.action.duplicate.remote.tip"), "mode-create", ObserveKeyStrokes.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(RemotePresetsUI ui) {
+
+ RemoteDataSourceConfiguration incomingConfiguration = ui.getModel().getRemoteDataSourceConfiguration();
+
+ RemoteDataSourceConfiguration configuration = new RemoteDataSourceConfiguration();
+
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName() + " (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<RemoteDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getRemoteDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setRemoteDataSourceConfigurations(configurations);
+ ui.getModel().setRemoteCreateMode(true);
+ ui.getRemoteConfigurations().setSelectedValue(configuration, true);
+ }
+}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateServerUIAction.java
=====================================
@@ -0,0 +1,62 @@
+package fr.ird.observe.client.ui.actions.storage.presets;
+
+/*-
+ * #%L
+ * ObServe :: Client core
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.ui.ObserveKeyStrokes;
+import fr.ird.observe.client.ui.ObserveMainUI;
+import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI;
+import fr.ird.observe.dto.presets.ServerDataSourceConfiguration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateServerUIAction extends PresetsUIActionSupport {
+
+ public static final String ACTION_NAME = DuplicateServerUIAction.class.getName();
+
+ public DuplicateServerUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, n("observe.action.duplicate"), n("observe.action.duplicate.server.tip"), "mode-create", ObserveKeyStrokes.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(RemotePresetsUI ui) {
+
+ ServerDataSourceConfiguration incomingConfiguration = ui.getModel().getServerDataSourceConfiguration();
+ ServerDataSourceConfiguration configuration = new ServerDataSourceConfiguration();
+
+ configuration.setDatabaseName(incomingConfiguration.getDatabaseName());
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName() + " (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<ServerDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getServerDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setServerDataSourceConfigurations(configurations);
+ ui.getModel().setServerCreateMode(true);
+ ui.getServerConfigurations().setSelectedValue(configuration, true);
+
+ }
+}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jaxx
=====================================
@@ -19,7 +19,7 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<JPanel layout="{new BorderLayout()}">
+<org.jdesktop.swingx.JXTitledPanel id="dataSourcePresets">
<import>
fr.ird.observe.dto.presets.RemoteDataSourceConfiguration
@@ -28,6 +28,8 @@
fr.ird.observe.client.ui.actions.storage.presets.CreatePresetUIAction
fr.ird.observe.client.ui.actions.storage.presets.DeleteRemoteUIAction
fr.ird.observe.client.ui.actions.storage.presets.DeleteServerUIAction
+ fr.ird.observe.client.ui.actions.storage.presets.DuplicateRemoteUIAction
+ fr.ird.observe.client.ui.actions.storage.presets.DuplicateServerUIAction
fr.ird.observe.client.ui.actions.storage.presets.QuitPresetsUIAction
fr.ird.observe.client.ui.actions.storage.presets.CancelRemoteUIAction
fr.ird.observe.client.ui.actions.storage.presets.ResetRemoteUIAction
@@ -39,24 +41,26 @@
fr.ird.observe.client.ui.actions.storage.presets.TestServerUIAction
org.nuiton.jaxx.widgets.select.BeanComboBox
-
+ java.awt.CardLayout
</import>
<RemotePresetsUIModel id="model" initializer="getContextValue(RemotePresetsUIModel.class)"/>
<JTabbedPane id='tabs' constraints='BorderLayout.CENTER'>
<tab id='remoteTab' title="observe.storage.remote.presets.title">
- <JSplitPane id="remotePanel">
- <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
- <JPanel id="remoteContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noRemoteSelected" constraints='BorderLayout.CENTER'/>
- <Table id="remoteForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="remotePanel" layout="{new BorderLayout()}">
+ <JScrollPane id='remoteConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="remoteContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noRemoteSelected" constraints='"empty"'/>
+ <Table id="remoteForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteName" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteName" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -64,7 +68,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteUrl" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteUrl" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -72,7 +76,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteLogin" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteLogin" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -80,7 +84,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remotePassword" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remotePassword" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -97,26 +101,29 @@
<JButton id="saveRemoteAction"/>
<JButton id="deleteRemoteAction"/>
<JButton id="testRemoteAction"/>
+ <JButton id="duplicateRemoteAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
<tab id='serverTab' title="observe.storage.server.presets.title">
- <JSplitPane id="serverPanel">
- <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
- <JPanel id="serverContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noServerSelected" constraints='BorderLayout.CENTER'/>
- <Table id="serverForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="serverPanel" layout="{new BorderLayout()}" >
+ <JScrollPane id='serverConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="serverContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noServerSelected" constraints='"empty"'/>
+ <Table id="serverForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverName" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverName" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -124,7 +131,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverUrl" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverUrl" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -132,7 +139,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverLogin" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverLogin" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -140,7 +147,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverPassword" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverPassword" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -148,7 +155,7 @@
<JLabel id="serverDataBaseLabel" text='observe.storage.server.dataBase'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverDataBase" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverDataBase" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
@@ -160,12 +167,13 @@
<JButton id="saveServerAction"/>
<JButton id="deleteServerAction"/>
<JButton id="testServerAction"/>
+ <JButton id="duplicateServerAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
</JTabbedPane>
@@ -174,4 +182,4 @@
<JButton id="quitAction"/>
</JPanel>
-</JPanel>
+</org.jdesktop.swingx.JXTitledPanel>
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jcss
=====================================
@@ -21,15 +21,10 @@
*/
#noRemoteSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#remoteForm {
- visible: false;
-}
-
#remoteName {
text:{SwingUtil.getStringValue(model.getRemoteDataSourceConfiguration().getName())};
}
@@ -52,15 +47,10 @@
}
#noServerSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#serverForm {
- visible: false;
-}
-
#serverName {
text:{SwingUtil.getStringValue(model.getServerDataSourceConfiguration().getName())};
}
@@ -87,6 +77,7 @@
#resetRemoteAction {
_observeAction:{ResetRemoteUIAction.ACTION_NAME};
+ enabled:{model.isRemoteModified()};
}
#saveRemoteAction {
@@ -98,6 +89,10 @@
_observeAction:{DeleteRemoteUIAction.ACTION_NAME};
}
+#duplicateRemoteAction {
+ _observeAction:{DuplicateRemoteUIAction.ACTION_NAME};
+}
+
#testRemoteAction {
_observeAction:{TestRemoteUIAction.ACTION_NAME};
}
@@ -120,6 +115,10 @@
_observeAction:{DeleteServerUIAction.ACTION_NAME};
}
+#duplicateServerAction {
+ _observeAction:{DuplicateServerUIAction.ACTION_NAME};
+}
+
#testServerAction {
_observeAction:{TestServerUIAction.ACTION_NAME};
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUIHandler.java
=====================================
@@ -44,7 +44,7 @@ import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
-import java.awt.BorderLayout;
+import java.awt.CardLayout;
import java.awt.event.KeyEvent;
import java.util.List;
import java.util.Objects;
@@ -105,6 +105,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getModel().setRemoteModified(false);
} else {
ui.getModel().setRemoteDataSourceConfiguration(ui.getRemoteConfigurations().getSelectedValue());
+ ui.getRemoteName().requestFocusInWindow();
}
});
@@ -124,17 +125,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getModel().addPropertyChangeListener("remoteDataSourceConfiguration", evt -> {
RemoteDataSourceConfiguration oldValue = (RemoteDataSourceConfiguration) evt.getOldValue();
-
if (ui.getModel().getRemoteDataSourceConfiguration() == null) {
- ui.getRemoteContentPanel().remove(ui.getRemoteForm());
- ui.getRemoteContentPanel().add(ui.getNoRemoteSelected(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getCreateAction());
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "empty");
+ ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getRemoteForm().setVisible(true);
- ui.getRemoteContentPanel().remove(ui.getNoRemoteSelected());
- ui.getRemoteContentPanel().add(ui.getRemoteForm(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getRemoteName());
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "form");
}
ui.getModel().setRemoteModified(false);
}
@@ -146,10 +142,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
if ((Boolean) evt.getNewValue()) {
remoteActions.remove(ui.getResetRemoteAction());
remoteActions.remove(ui.getDeleteRemoteAction());
+ remoteActions.remove(ui.getDuplicateRemoteAction());
remoteActions.add(ui.getCancelRemoteAction(), 0);
} else {
remoteActions.add(ui.getResetRemoteAction(), 0);
remoteActions.add(ui.getDeleteRemoteAction(), 2);
+ remoteActions.add(ui.getDuplicateRemoteAction());
remoteActions.remove(ui.getCancelRemoteAction());
}
});
@@ -169,6 +167,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getModel().setServerModified(false);
} else {
ui.getModel().setServerDataSourceConfiguration(ui.getServerConfigurations().getSelectedValue());
+ ui.getServerName().requestFocusInWindow();
}
});
@@ -190,15 +189,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ServerDataSourceConfiguration oldValue = (ServerDataSourceConfiguration) evt.getOldValue();
if (ui.getModel().getServerDataSourceConfiguration() == null) {
- ui.getServerContentPanel().remove(ui.getServerForm());
- ui.getServerContentPanel().add(ui.getNoServerSelected(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getCreateAction());
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "empty");
+ ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getServerForm().setVisible(true);
- ui.getServerContentPanel().remove(ui.getNoServerSelected());
- ui.getServerContentPanel().add(ui.getServerForm(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getServerName());
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "form");
}
ui.getModel().setServerModified(false);
}
@@ -210,11 +205,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
if ((Boolean) evt.getNewValue()) {
serverActions.remove(ui.getResetServerAction());
serverActions.remove(ui.getDeleteServerAction());
+ serverActions.remove(ui.getDuplicateServerAction());
serverActions.add(ui.getCancelServerAction(), 0);
} else {
serverActions.add(ui.getResetServerAction(), 0);
serverActions.add(ui.getDeleteServerAction(), 2);
+ serverActions.add(ui.getDuplicateServerAction());
serverActions.remove(ui.getCancelServerAction());
}
});
@@ -222,6 +219,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getServerActions().remove(0);
UIHelper.askFocus(ui.getCreateAction());
+ if (ui.getRemoteConfigurations().getModel().getSize()>0) {
+ ui.getRemoteConfigurations().setSelectedIndex(0);
+ }
+
+ if (ui.getServerConfigurations().getModel().getSize()>0) {
+ ui.getServerConfigurations().setSelectedIndex(0);
+ }
}
protected void init(JSplitPane editor) {
@@ -243,8 +247,33 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
log.debug("init common action " + actionId);
}
+ if (actionId.contains("Remote")) {
+ inputMap = ui.getRemoteContentPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ actionMap = ui.getRemoteContentPanel().getActionMap();
+ } else if (actionId.contains("Server")) {
+ inputMap = ui.getServerContentPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ actionMap = ui.getServerContentPanel().getActionMap();
+ } else {
+ inputMap = ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ actionMap = ui.getActionMap();
+ }
action.initForMainUi(editor, inputMap, actionMap);
editor.putClientProperty(UIActionSupport.CLIENT_PROPERTY_UI, ui);
}
+
+ protected void setServerModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setServerModified(true);
+ }
+
+ protected void setRemoteModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setRemoteModified(true);
+ }
+
}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -72,6 +72,9 @@ observe.action.delete.tip=Delete
observe.action.detail=Details
observe.action.do.backup=Backup local database
observe.action.do.backup.tip=Make a backup of local database before applying modifications.
+observe.action.duplicate=Duplicate
+observe.action.duplicate.remote.tip=Duplicate remote
+observe.action.duplicate.server.tip=Duplicate server
observe.action.exit=Quit
observe.action.exit.tip=quit Observe
observe.action.floatingObjectPresets=Floating Object references
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -72,6 +72,9 @@ observe.action.delete.tip=Eliminar
observe.action.detail=Ver detalles
observe.action.do.backup=Guardar la base local
observe.action.do.backup.tip=Hacer copia de seguridad de la base local antes de aplicar los cambios
+observe.action.duplicate=Duplicate \#TODO
+observe.action.duplicate.remote.tip=Duplicate remote \#TODO
+observe.action.duplicate.server.tip=Duplicate server \#TODO
observe.action.exit=Salir
observe.action.exit.tip=Salir de ObServe
observe.action.floatingObjectPresets=Referencias de objetos flotantes
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -72,6 +72,9 @@ observe.action.delete.tip=Supprimer
observe.action.detail=Voir les détails
observe.action.do.backup=Sauver la base locale
observe.action.do.backup.tip=Effectuer une sauvegarde de la base locale avant d'appliquer les changements
+observe.action.duplicate=Dupliquer
+observe.action.duplicate.remote.tip=Duplicate la connexion distante
+observe.action.duplicate.server.tip=Duplicate la connexion server
observe.action.exit=Quitter
observe.action.exit.tip=Quitter ObServe
observe.action.floatingObjectPresets=Objets flottants de références
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/21c928dd2b4fe4e2d9c1c614f…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/21c928dd2b4fe4e2d9c1c614f…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 5 commits: Dans le gestionnaire de connexions, un bouton 'dupliquer le profil' serait pratique - Closes #1477
by Tony CHEMIT 10 May '20
by Tony CHEMIT 10 May '20
10 May '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
f47515ed by Tony Chemit at 2020-05-10T11:14:02+02:00
Dans le gestionnaire de connexions, un bouton 'dupliquer le profil' serait pratique - Closes #1477
- - - - -
c4485e34 by Tony Chemit at 2020-05-10T11:50:51+02:00
Quelques améliorations dans le gestionnaire de connexion - Closes #1479
- - - - -
033aecf1 by Tony Chemit at 2020-05-10T11:50:52+02:00
L'écran de gestion des connexions pourrait être présenté en partage horizontal - Closes #1480
- - - - -
f1aa53a0 by Tony Chemit at 2020-05-10T11:50:52+02:00
UI référentiel liste d'affichage d'espèces non classée - Closes #1474
- - - - -
3183afba by Tony Chemit at 2020-05-10T11:50:52+02:00
simplify how to deploy demo war
- - - - -
15 changed files:
- .gitlab-ci.yml
- client-core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java
- client-core/src/main/resources/fr/ird/observe/client/ui/ObserveCommon.jcss
- client-datasource-editor-api/src/main/i18n/getters/java.getter
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jaxx
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jcss
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUIHandler.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteRemote.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteServer.java
- + client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateRemote.java
- + client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateServer.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- server-runner/pom.xml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -65,7 +65,7 @@ image: registry.gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/docker:lat
environment:
name: demo
script:
- - ultreiaio-war-deploy-to-demo 'server-runner'
+ - ultreiaio-maven-execute 'clean verify -U -DperformRelease -Dmaven.javadoc.skip -Pdeploy -am -pl server-runner'
###################################################################################################
### TRIGGERS JOBS ###
=====================================
client-core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java
=====================================
@@ -100,6 +100,7 @@ public abstract class ObserveKeyStrokesSupport {
public static final KeyStroke KEY_STROKE_NEW_DATA = KeyStroke.getKeyStroke("pressed F4");
public static final KeyStroke KEY_STROKE_NEW_NEXT_DATA = KeyStroke.getKeyStroke("pressed F9");
public static final KeyStroke KEY_STROKE_DELETE_DATA_GLOBAL = KeyStroke.getKeyStroke("pressed F6");
+ public static final KeyStroke KEY_STROKE_DUPLICATE = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_MOVE_DATA_GLOBAL = KeyStroke.getKeyStroke("pressed F8");
public static final KeyStroke KEY_STROKE_OPEN_DATA = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_CLOSE_DATA = KeyStroke.getKeyStroke("pressed F3");
=====================================
client-core/src/main/resources/fr/ird/observe/client/ui/ObserveCommon.jcss
=====================================
@@ -140,10 +140,11 @@ CoordinatesEditor {
}
FilterableDoubleList {
- showDecorator:true;
+ showDecorator:false;
showReset:true;
- showSelectPopupEnabled: true;
+ showSelectPopupEnabled: false;
filterable:false;
+ autoSortSelectedList:true;
_notBlocking: true;
}
=====================================
client-datasource-editor-api/src/main/i18n/getters/java.getter
=====================================
@@ -32,6 +32,9 @@ observe.action.delete.tip
observe.action.detail
observe.action.do.backup
observe.action.do.backup.tip
+observe.action.duplicate
+observe.action.duplicate.remote.tip
+observe.action.duplicate.server.tip
observe.action.goDown
observe.action.goDown.tip
observe.action.goUp
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jaxx
=====================================
@@ -23,23 +23,26 @@
fr.ird.observe.dto.presets.RemoteDataSourceConfiguration
fr.ird.observe.dto.presets.ServerDataSourceConfiguration
org.nuiton.jaxx.widgets.select.BeanComboBox
+ java.awt.CardLayout
</import>
<RemotePresetsUIModel id="model" initializer="getContextValue(RemotePresetsUIModel.class)"/>
<JTabbedPane id='tabs' constraints='BorderLayout.CENTER'>
<tab id='remoteTab' title="observe.storage.remote.presets.title">
- <JSplitPane id="remotePanel">
- <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
- <JPanel id="remoteContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noRemoteSelected" constraints='BorderLayout.CENTER'/>
- <Table id="remoteForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="remotePanel" layout="{new BorderLayout()}">
+ <JScrollPane id='remoteConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="remoteContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noRemoteSelected" constraints='"empty"'/>
+ <Table id="remoteForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteName" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteName" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -47,7 +50,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteUrl" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteUrl" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -55,7 +58,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteLogin" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteLogin" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -63,7 +66,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remotePassword" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remotePassword" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -80,26 +83,29 @@
<JButton id="saveRemoteAction"/>
<JButton id="deleteRemoteAction"/>
<JButton id="testRemoteAction"/>
+ <JButton id="duplicateRemoteAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
<tab id='serverTab' title="observe.storage.server.presets.title">
- <JSplitPane id="serverPanel">
- <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
- <JPanel id="serverContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noServerSelected" constraints='BorderLayout.CENTER'/>
- <Table id="serverForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="serverPanel" layout="{new BorderLayout()}" >
+ <JScrollPane id='serverConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="serverContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noServerSelected" constraints='"empty"'/>
+ <Table id="serverForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverName" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverName" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -107,7 +113,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverUrl" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverUrl" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -115,7 +121,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverLogin" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverLogin" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -123,7 +129,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverPassword" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverPassword" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -131,7 +137,7 @@
<JLabel id="serverDataBaseLabel" text='observe.storage.server.dataBase'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverDataBase" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverDataBase" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
@@ -143,12 +149,13 @@
<JButton id="saveServerAction"/>
<JButton id="deleteServerAction"/>
<JButton id="testServerAction"/>
+ <JButton id="duplicateServerAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
</JTabbedPane>
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jcss
=====================================
@@ -25,15 +25,10 @@
}
#noRemoteSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#remoteForm {
- visible: false;
-}
-
#remoteName {
text:{SwingUtil.getStringValue(model.getRemoteDataSourceConfiguration().getName())};
}
@@ -56,15 +51,10 @@
}
#noServerSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#serverForm {
- visible: false;
-}
-
#serverName {
text:{SwingUtil.getStringValue(model.getServerDataSourceConfiguration().getName())};
}
@@ -85,6 +75,10 @@
text:{SwingUtil.getStringValue(model.getServerDataSourceConfiguration().getDatabaseName())};
}
+#resetRemoteAction {
+ enabled:{model.isRemoteModified()};
+}
+
#saveRemoteAction {
enabled:{model.isRemoteModified()};
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUIHandler.java
=====================================
@@ -42,6 +42,7 @@ import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
+import java.awt.CardLayout;
import java.awt.event.KeyEvent;
import java.util.List;
@@ -55,11 +56,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
private static final Logger log = LogManager.getLogger(RemotePresetsUIHandler.class);
-// private RemotePresetsUI ui;
+ private RemotePresetsUI ui;
@Override
public void beforeInit(RemotePresetsUI ui) {
-// this.ui = ui;
+ this.ui = ui;
RemotePresetsUIModel model = new RemotePresetsUIModel();
ClientConfig config = getClientConfig();
model.setServerDataSourceConfigurations(config.getServerDataSourceConfigurationList());
@@ -98,6 +99,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
ui.getModel().setRemoteModified(false);
} else {
ui.getModel().setRemoteDataSourceConfiguration(ui.getRemoteConfigurations().getSelectedValue());
+ ui.getRemoteName().requestFocusInWindow();
}
});
@@ -118,15 +120,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
RemoteDataSourceConfiguration oldValue = (RemoteDataSourceConfiguration) evt.getOldValue();
if (ui.getModel().getRemoteDataSourceConfiguration() == null) {
- ui.getRemoteContentPanel().remove(ui.getRemoteForm());
- ui.getRemoteContentPanel().add(ui.getNoRemoteSelected(), BorderLayout.CENTER);
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "empty");
ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getRemoteForm().setVisible(true);
- ui.getRemoteContentPanel().remove(ui.getNoRemoteSelected());
- ui.getRemoteContentPanel().add(ui.getRemoteForm(), BorderLayout.CENTER);
- ui.getRemoteName().requestFocusInWindow();
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "form");
}
ui.getModel().setRemoteModified(false);
}
@@ -137,10 +135,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
if ((Boolean) evt.getNewValue()) {
remoteActions.remove(ui.getResetRemoteAction());
remoteActions.remove(ui.getDeleteRemoteAction());
+ remoteActions.remove(ui.getDuplicateRemoteAction());
remoteActions.add(ui.getCancelRemoteAction(), 0);
} else {
remoteActions.add(ui.getResetRemoteAction(), 0);
remoteActions.add(ui.getDeleteRemoteAction(), 2);
+ remoteActions.add(ui.getDuplicateRemoteAction());
remoteActions.remove(ui.getCancelRemoteAction());
}
});
@@ -160,6 +160,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
ui.getModel().setServerModified(false);
} else {
ui.getModel().setServerDataSourceConfiguration(ui.getServerConfigurations().getSelectedValue());
+ ui.getServerName().requestFocusInWindow();
}
});
@@ -180,15 +181,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
ServerDataSourceConfiguration oldValue = (ServerDataSourceConfiguration) evt.getOldValue();
if (ui.getModel().getServerDataSourceConfiguration() == null) {
- ui.getServerContentPanel().remove(ui.getServerForm());
- ui.getServerContentPanel().add(ui.getNoServerSelected(), BorderLayout.CENTER);
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "empty");
ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getServerForm().setVisible(true);
- ui.getServerContentPanel().remove(ui.getNoServerSelected());
- ui.getServerContentPanel().add(ui.getServerForm(), BorderLayout.CENTER);
- ui.getServerName().requestFocusInWindow();
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "form");
}
ui.getModel().setServerModified(false);
}
@@ -200,11 +197,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
if ((Boolean) evt.getNewValue()) {
serverActions.remove(ui.getResetServerAction());
serverActions.remove(ui.getDeleteServerAction());
+ serverActions.remove(ui.getDuplicateServerAction());
serverActions.add(ui.getCancelServerAction(), 0);
} else {
serverActions.add(ui.getResetServerAction(), 0);
serverActions.add(ui.getDeleteServerAction(), 2);
+ serverActions.add(ui.getDuplicateServerAction());
serverActions.remove(ui.getCancelServerAction());
}
});
@@ -212,29 +211,31 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
ui.getServerActions().remove(0);
ui.getCreateAction().requestFocusInWindow();
+ if (ui.getRemoteConfigurations().getModel().getSize() > 0) {
+ ui.getRemoteConfigurations().setSelectedIndex(0);
+ }
+
+ if (ui.getServerConfigurations().getModel().getSize() > 0) {
+ ui.getServerConfigurations().setSelectedIndex(0);
+ }
}
protected void init(JSplitPane editor) {
editor.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), "none");
}
-//
-// protected void init(InputMap inputMap, ActionMap actionMap, AbstractButton editor) {
-// String actionId = (String) editor.getClientProperty(OBSERVE_ACTION);
-// if (actionId == null) {
-//
-// return;
-// }
-//
-// UIActionSupport action = (UIActionSupport) actionMap.get(actionId);
-// Objects.requireNonNull(action, "action [" + actionId + "] not found for ui " + ui.getClass().getName());
-//
-// if (log.isDebugEnabled()) {
-// log.debug("init common action " + actionId);
-// }
-//
-// action.initForMainUi(editor, inputMap, actionMap);
-// editor.putClientProperty(UIActionSupport.CLIENT_PROPERTY_UI, ui);
-//
-// }
+
+ protected void setServerModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setServerModified(true);
+ }
+
+ protected void setRemoteModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setRemoteModified(true);
+ }
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteRemote.java
=====================================
@@ -65,6 +65,8 @@ public class DeleteRemote extends RemoteActionSupport {
ui.getModel().setRemoteDataSourceConfigurations(configurations);
getClientConfig().removeRemoteDataSourceConfiguration(configuration);
ui.getModel().setRemoteDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getRemoteConfigurations().setSelectedIndex(newConfiguration);
}
}
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteServer.java
=====================================
@@ -31,6 +31,7 @@ import javax.swing.JOptionPane;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import static io.ultreia.java4all.i18n.I18n.n;
import static io.ultreia.java4all.i18n.I18n.t;
@@ -67,6 +68,8 @@ public class DeleteServer extends ServerActionSupport {
ui.getModel().setServerDataSourceConfigurations(configurations);
getClientConfig().removeServerDataSourceConfiguration(configuration);
ui.getModel().setServerDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getServerConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateRemote.java
=====================================
@@ -0,0 +1,59 @@
+package fr.ird.observe.client.datasource.editor.wizard.presets.actions;
+
+/*-
+ * #%L
+ * ObServe :: Client DataSource Editor API
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.datasource.editor.wizard.presets.RemotePresetsUI;
+import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
+import fr.ird.observe.dto.presets.RemoteDataSourceConfiguration;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateRemote extends RemoteActionSupport {
+
+ public DuplicateRemote() {
+ super(n("observe.action.duplicate"), n("observe.action.duplicate.remote.tip"), "mode-create", ObserveKeyStrokesSupport.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(ActionEvent event, RemotePresetsUI ui) {
+
+ RemoteDataSourceConfiguration incomingConfiguration = ui.getModel().getRemoteDataSourceConfiguration();
+
+ RemoteDataSourceConfiguration configuration = new RemoteDataSourceConfiguration();
+
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName() + " (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<RemoteDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getRemoteDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setRemoteDataSourceConfigurations(configurations);
+ ui.getModel().setRemoteCreateMode(true);
+ ui.getRemoteConfigurations().setSelectedValue(configuration, true);
+ }
+}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateServer.java
=====================================
@@ -0,0 +1,62 @@
+package fr.ird.observe.client.datasource.editor.wizard.presets.actions;
+
+/*-
+ * #%L
+ * ObServe :: Client DataSource Editor API
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.datasource.editor.wizard.presets.RemotePresetsUI;
+import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
+import fr.ird.observe.dto.presets.ServerDataSourceConfiguration;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateServer extends ServerActionSupport {
+
+ public DuplicateServer() {
+ super(n("observe.action.duplicate"), n("observe.action.duplicate.server.tip"), "mode-create", ObserveKeyStrokesSupport.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(ActionEvent event, RemotePresetsUI ui) {
+
+ ServerDataSourceConfiguration incomingConfiguration = ui.getModel().getServerDataSourceConfiguration();
+ ServerDataSourceConfiguration configuration = new ServerDataSourceConfiguration();
+
+ configuration.setDatabaseName(incomingConfiguration.getDatabaseName());
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName()+" (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<ServerDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getServerDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setServerDataSourceConfigurations(configurations);
+ ui.getModel().setServerCreateMode(true);
+ ui.getServerConfigurations().setSelectedValue(configuration, true);
+
+ }
+
+
+}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -98,6 +98,9 @@ observe.action.delete.tip=Delete
observe.action.detail=Details
observe.action.do.backup=Backup local database
observe.action.do.backup.tip=Make a backup of local database before applying modifications.
+observe.action.duplicate=Duplicate
+observe.action.duplicate.remote.tip=Duplicate remote
+observe.action.duplicate.server.tip=Duplicate server
observe.action.exit=Quit
observe.action.exit.tip=quit Observe
observe.action.export.requiredInsertMissingReferentials=Insert into central source missing referentials
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -98,6 +98,9 @@ observe.action.delete.tip=Eliminar
observe.action.detail=Ver detalles
observe.action.do.backup=Guardar la base local
observe.action.do.backup.tip=Hacer copia de seguridad de la base local antes de aplicar los cambios
+observe.action.duplicate=Duplicate \#TODO
+observe.action.duplicate.remote.tip=Duplicate remote \#TODO
+observe.action.duplicate.server.tip=Duplicate server \#TODO
observe.action.exit=Salir
observe.action.exit.tip=Salir de ObServe
observe.action.export.requiredInsertMissingReferentials=Insérer les référentiels manquant dans la source centrale. \#TODO
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -98,6 +98,9 @@ observe.action.delete.tip=Supprimer
observe.action.detail=Voir les détails
observe.action.do.backup=Sauver la base locale
observe.action.do.backup.tip=Effectuer une sauvegarde de la base locale avant d'appliquer les changements
+observe.action.duplicate=Dupliquer
+observe.action.duplicate.remote.tip=Duplicate la connexion distante
+observe.action.duplicate.server.tip=Duplicate la connexion server
observe.action.exit=Quitter
observe.action.exit.tip=Quitter ObServe
observe.action.export.requiredInsertMissingReferentials=Insérer les référentiels manquant dans la source centrale.
=====================================
server-runner/pom.xml
=====================================
@@ -88,37 +88,6 @@
</build>
<profiles>
-
- <profile>
- <id>deploy-demo</id>
- <properties>
- <classifier>${project.version}</classifier>
- </properties>
- <build>
- <defaultGoal>verify</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>wagon-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>deploy-demo</id>
- <phase>verify</phase>
- <goals>
- <goal>upload-single</goal>
- </goals>
- <configuration>
- <serverId>doc.ultreia.io</serverId>
- <url>scpexe://ultreia.io/var/lib/tomcat8/webapps</url>
- <fromFile>${project.build.directory}/${project.build.finalName}.war</fromFile>
- <toFile>observe-${classifier}.war</toFile>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
<profile>
<id>deploy</id>
<properties>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/41bd1605fa32fca4feeb4a01…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/41bd1605fa32fca4feeb4a01…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
aa84cc6f by Tony Chemit at 2020-05-10T11:50:07+02:00
Report form v8 :
* Dans le gestionnaire de connexions, un bouton 'dupliquer le profil' serait pratique - Closes #1477
* Quelques améliorations dans le gestionnaire de connexion - Closes #1479
* L'écran de gestion des connexions pourrait être présenté en partage horizontal - Closes #1480
- - - - -
14 changed files:
- client-core/src/main/i18n/getters/java.getter
- client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelRemoteUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelServerUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteRemoteUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteServerUIAction.java
- + client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateRemoteUIAction.java
- + client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateServerUIAction.java
- client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jcss
- client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUIHandler.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
Changes:
=====================================
client-core/src/main/i18n/getters/java.getter
=====================================
@@ -44,6 +44,9 @@ observe.action.delete.remote.tip
observe.action.delete.server.tip
observe.action.delete.tip
observe.action.detail
+observe.action.duplicate
+observe.action.duplicate.remote.tip
+observe.action.duplicate.server.tip
observe.action.exit
observe.action.exit.tip
observe.action.floatingObjectPresets
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java
=====================================
@@ -86,6 +86,7 @@ public abstract class ObserveKeyStrokes {
public static final KeyStroke KEY_STROKE_RESET_DATA = KeyStroke.getKeyStroke("pressed F7");
public static final KeyStroke KEY_STROKE_NEW_NEXT_DATA = KeyStroke.getKeyStroke("pressed F4");
public static final KeyStroke KEY_STROKE_DELETE_DATA_GLOBAL = KeyStroke.getKeyStroke("pressed F6");
+ public static final KeyStroke KEY_STROKE_DUPLICATE = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_OPEN_DATA = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_CLOSE_DATA = KeyStroke.getKeyStroke("pressed F3");
public static final KeyStroke KEY_STROKE_SAVE_DATA = KeyStroke.getKeyStroke("pressed F5");
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelRemoteUIAction.java
=====================================
@@ -57,6 +57,8 @@ public class CancelRemoteUIAction extends PresetsUIActionSupport {
ObserveSwingApplicationContext.get().getConfig().removeRemoteDataSourceConfiguration(configuration);
ui.getModel().setRemoteDataSourceConfiguration(null);
ui.getModel().setRemoteCreateMode(false);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getRemoteConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/CancelServerUIAction.java
=====================================
@@ -57,6 +57,8 @@ public class CancelServerUIAction extends PresetsUIActionSupport {
ObserveSwingApplicationContext.get().getConfig().removeServerDataSourceConfiguration(configuration);
ui.getModel().setServerDataSourceConfiguration(null);
ui.getModel().setServerCreateMode(false);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getServerConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteRemoteUIAction.java
=====================================
@@ -69,6 +69,8 @@ public class DeleteRemoteUIAction extends PresetsUIActionSupport {
ui.getModel().setRemoteDataSourceConfigurations(configurations);
ObserveSwingApplicationContext.get().getConfig().removeRemoteDataSourceConfiguration(configuration);
ui.getModel().setRemoteDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getRemoteConfigurations().setSelectedIndex(newConfiguration);
}
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DeleteServerUIAction.java
=====================================
@@ -71,6 +71,8 @@ public class DeleteServerUIAction extends PresetsUIActionSupport {
ui.getModel().setServerDataSourceConfigurations(configurations);
ObserveSwingApplicationContext.get().getConfig().removeServerDataSourceConfiguration(configuration);
ui.getModel().setServerDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getServerConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateRemoteUIAction.java
=====================================
@@ -0,0 +1,61 @@
+package fr.ird.observe.client.ui.actions.storage.presets;
+
+/*-
+ * #%L
+ * ObServe :: Client core
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.ui.ObserveKeyStrokes;
+import fr.ird.observe.client.ui.ObserveMainUI;
+import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI;
+import fr.ird.observe.dto.presets.RemoteDataSourceConfiguration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateRemoteUIAction extends PresetsUIActionSupport {
+
+ public static final String ACTION_NAME = DuplicateRemoteUIAction.class.getName();
+
+ public DuplicateRemoteUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, n("observe.action.duplicate"), n("observe.action.duplicate.remote.tip"), "mode-create", ObserveKeyStrokes.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(RemotePresetsUI ui) {
+
+ RemoteDataSourceConfiguration incomingConfiguration = ui.getModel().getRemoteDataSourceConfiguration();
+
+ RemoteDataSourceConfiguration configuration = new RemoteDataSourceConfiguration();
+
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName() + " (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<RemoteDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getRemoteDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setRemoteDataSourceConfigurations(configurations);
+ ui.getModel().setRemoteCreateMode(true);
+ ui.getRemoteConfigurations().setSelectedValue(configuration, true);
+ }
+}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/actions/storage/presets/DuplicateServerUIAction.java
=====================================
@@ -0,0 +1,62 @@
+package fr.ird.observe.client.ui.actions.storage.presets;
+
+/*-
+ * #%L
+ * ObServe :: Client core
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.ui.ObserveKeyStrokes;
+import fr.ird.observe.client.ui.ObserveMainUI;
+import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI;
+import fr.ird.observe.dto.presets.ServerDataSourceConfiguration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateServerUIAction extends PresetsUIActionSupport {
+
+ public static final String ACTION_NAME = DuplicateServerUIAction.class.getName();
+
+ public DuplicateServerUIAction(ObserveMainUI mainUI) {
+ super(mainUI, ACTION_NAME, n("observe.action.duplicate"), n("observe.action.duplicate.server.tip"), "mode-create", ObserveKeyStrokes.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(RemotePresetsUI ui) {
+
+ ServerDataSourceConfiguration incomingConfiguration = ui.getModel().getServerDataSourceConfiguration();
+ ServerDataSourceConfiguration configuration = new ServerDataSourceConfiguration();
+
+ configuration.setDatabaseName(incomingConfiguration.getDatabaseName());
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName() + " (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<ServerDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getServerDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setServerDataSourceConfigurations(configurations);
+ ui.getModel().setServerCreateMode(true);
+ ui.getServerConfigurations().setSelectedValue(configuration, true);
+
+ }
+}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jaxx
=====================================
@@ -19,7 +19,7 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<JPanel layout="{new BorderLayout()}">
+<org.jdesktop.swingx.JXTitledPanel id="dataSourcePresets">
<import>
fr.ird.observe.dto.presets.RemoteDataSourceConfiguration
@@ -28,6 +28,8 @@
fr.ird.observe.client.ui.actions.storage.presets.CreatePresetUIAction
fr.ird.observe.client.ui.actions.storage.presets.DeleteRemoteUIAction
fr.ird.observe.client.ui.actions.storage.presets.DeleteServerUIAction
+ fr.ird.observe.client.ui.actions.storage.presets.DuplicateRemoteUIAction
+ fr.ird.observe.client.ui.actions.storage.presets.DuplicateServerUIAction
fr.ird.observe.client.ui.actions.storage.presets.QuitPresetsUIAction
fr.ird.observe.client.ui.actions.storage.presets.CancelRemoteUIAction
fr.ird.observe.client.ui.actions.storage.presets.ResetRemoteUIAction
@@ -39,24 +41,26 @@
fr.ird.observe.client.ui.actions.storage.presets.TestServerUIAction
org.nuiton.jaxx.widgets.select.BeanComboBox
-
+ java.awt.CardLayout
</import>
<RemotePresetsUIModel id="model" initializer="getContextValue(RemotePresetsUIModel.class)"/>
<JTabbedPane id='tabs' constraints='BorderLayout.CENTER'>
<tab id='remoteTab' title="observe.storage.remote.presets.title">
- <JSplitPane id="remotePanel">
- <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
- <JPanel id="remoteContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noRemoteSelected" constraints='BorderLayout.CENTER'/>
- <Table id="remoteForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="remotePanel" layout="{new BorderLayout()}">
+ <JScrollPane id='remoteConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="remoteContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noRemoteSelected" constraints='"empty"'/>
+ <Table id="remoteForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteName" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteName" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -64,7 +68,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteUrl" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteUrl" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -72,7 +76,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteLogin" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteLogin" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -80,7 +84,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remotePassword" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remotePassword" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -97,26 +101,29 @@
<JButton id="saveRemoteAction"/>
<JButton id="deleteRemoteAction"/>
<JButton id="testRemoteAction"/>
+ <JButton id="duplicateRemoteAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
<tab id='serverTab' title="observe.storage.server.presets.title">
- <JSplitPane id="serverPanel">
- <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
- <JPanel id="serverContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noServerSelected" constraints='BorderLayout.CENTER'/>
- <Table id="serverForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="serverPanel" layout="{new BorderLayout()}" >
+ <JScrollPane id='serverConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="serverContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noServerSelected" constraints='"empty"'/>
+ <Table id="serverForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverName" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverName" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -124,7 +131,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverUrl" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverUrl" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -132,7 +139,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverLogin" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverLogin" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -140,7 +147,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverPassword" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverPassword" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -148,7 +155,7 @@
<JLabel id="serverDataBaseLabel" text='observe.storage.server.dataBase'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverDataBase" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverDataBase" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
@@ -160,12 +167,13 @@
<JButton id="saveServerAction"/>
<JButton id="deleteServerAction"/>
<JButton id="testServerAction"/>
+ <JButton id="duplicateServerAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
</JTabbedPane>
@@ -174,4 +182,4 @@
<JButton id="quitAction"/>
</JPanel>
-</JPanel>
+</org.jdesktop.swingx.JXTitledPanel>
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUI.jcss
=====================================
@@ -21,15 +21,10 @@
*/
#noRemoteSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#remoteForm {
- visible: false;
-}
-
#remoteName {
text:{SwingUtil.getStringValue(model.getRemoteDataSourceConfiguration().getName())};
}
@@ -52,15 +47,10 @@
}
#noServerSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#serverForm {
- visible: false;
-}
-
#serverName {
text:{SwingUtil.getStringValue(model.getServerDataSourceConfiguration().getName())};
}
@@ -87,6 +77,7 @@
#resetRemoteAction {
_observeAction:{ResetRemoteUIAction.ACTION_NAME};
+ enabled:{model.isRemoteModified()};
}
#saveRemoteAction {
@@ -98,6 +89,10 @@
_observeAction:{DeleteRemoteUIAction.ACTION_NAME};
}
+#duplicateRemoteAction {
+ _observeAction:{DuplicateRemoteUIAction.ACTION_NAME};
+}
+
#testRemoteAction {
_observeAction:{TestRemoteUIAction.ACTION_NAME};
}
@@ -120,6 +115,10 @@
_observeAction:{DeleteServerUIAction.ACTION_NAME};
}
+#duplicateServerAction {
+ _observeAction:{DuplicateServerUIAction.ACTION_NAME};
+}
+
#testServerAction {
_observeAction:{TestServerUIAction.ACTION_NAME};
}
=====================================
client-core/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUIHandler.java
=====================================
@@ -44,7 +44,7 @@ import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
-import java.awt.BorderLayout;
+import java.awt.CardLayout;
import java.awt.event.KeyEvent;
import java.util.List;
import java.util.Objects;
@@ -105,6 +105,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getModel().setRemoteModified(false);
} else {
ui.getModel().setRemoteDataSourceConfiguration(ui.getRemoteConfigurations().getSelectedValue());
+ ui.getRemoteName().requestFocusInWindow();
}
});
@@ -124,17 +125,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getModel().addPropertyChangeListener("remoteDataSourceConfiguration", evt -> {
RemoteDataSourceConfiguration oldValue = (RemoteDataSourceConfiguration) evt.getOldValue();
-
if (ui.getModel().getRemoteDataSourceConfiguration() == null) {
- ui.getRemoteContentPanel().remove(ui.getRemoteForm());
- ui.getRemoteContentPanel().add(ui.getNoRemoteSelected(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getCreateAction());
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "empty");
+ ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getRemoteForm().setVisible(true);
- ui.getRemoteContentPanel().remove(ui.getNoRemoteSelected());
- ui.getRemoteContentPanel().add(ui.getRemoteForm(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getRemoteName());
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "form");
}
ui.getModel().setRemoteModified(false);
}
@@ -146,10 +142,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
if ((Boolean) evt.getNewValue()) {
remoteActions.remove(ui.getResetRemoteAction());
remoteActions.remove(ui.getDeleteRemoteAction());
+ remoteActions.remove(ui.getDuplicateRemoteAction());
remoteActions.add(ui.getCancelRemoteAction(), 0);
} else {
remoteActions.add(ui.getResetRemoteAction(), 0);
remoteActions.add(ui.getDeleteRemoteAction(), 2);
+ remoteActions.add(ui.getDuplicateRemoteAction());
remoteActions.remove(ui.getCancelRemoteAction());
}
});
@@ -169,6 +167,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getModel().setServerModified(false);
} else {
ui.getModel().setServerDataSourceConfiguration(ui.getServerConfigurations().getSelectedValue());
+ ui.getServerName().requestFocusInWindow();
}
});
@@ -190,15 +189,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ServerDataSourceConfiguration oldValue = (ServerDataSourceConfiguration) evt.getOldValue();
if (ui.getModel().getServerDataSourceConfiguration() == null) {
- ui.getServerContentPanel().remove(ui.getServerForm());
- ui.getServerContentPanel().add(ui.getNoServerSelected(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getCreateAction());
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "empty");
+ ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getServerForm().setVisible(true);
- ui.getServerContentPanel().remove(ui.getNoServerSelected());
- ui.getServerContentPanel().add(ui.getServerForm(), BorderLayout.CENTER);
- UIHelper.askFocus(ui.getServerName());
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "form");
}
ui.getModel().setServerModified(false);
}
@@ -210,11 +205,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
if ((Boolean) evt.getNewValue()) {
serverActions.remove(ui.getResetServerAction());
serverActions.remove(ui.getDeleteServerAction());
+ serverActions.remove(ui.getDuplicateServerAction());
serverActions.add(ui.getCancelServerAction(), 0);
} else {
serverActions.add(ui.getResetServerAction(), 0);
serverActions.add(ui.getDeleteServerAction(), 2);
+ serverActions.add(ui.getDuplicateServerAction());
serverActions.remove(ui.getCancelServerAction());
}
});
@@ -222,6 +219,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
ui.getServerActions().remove(0);
UIHelper.askFocus(ui.getCreateAction());
+ if (ui.getRemoteConfigurations().getModel().getSize()>0) {
+ ui.getRemoteConfigurations().setSelectedIndex(0);
+ }
+
+ if (ui.getServerConfigurations().getModel().getSize()>0) {
+ ui.getServerConfigurations().setSelectedIndex(0);
+ }
}
protected void init(JSplitPane editor) {
@@ -243,8 +247,33 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> {
log.debug("init common action " + actionId);
}
+ if (actionId.contains("Remote")) {
+ inputMap = ui.getRemoteContentPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ actionMap = ui.getRemoteContentPanel().getActionMap();
+ } else if (actionId.contains("Server")) {
+ inputMap = ui.getServerContentPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ actionMap = ui.getServerContentPanel().getActionMap();
+ } else {
+ inputMap = ui.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+ actionMap = ui.getActionMap();
+ }
action.initForMainUi(editor, inputMap, actionMap);
editor.putClientProperty(UIActionSupport.CLIENT_PROPERTY_UI, ui);
}
+
+ protected void setServerModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setServerModified(true);
+ }
+
+ protected void setRemoteModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setRemoteModified(true);
+ }
+
}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -72,6 +72,9 @@ observe.action.delete.tip=Delete
observe.action.detail=Details
observe.action.do.backup=Backup local database
observe.action.do.backup.tip=Make a backup of local database before applying modifications.
+observe.action.duplicate=Duplicate
+observe.action.duplicate.remote.tip=Duplicate remote
+observe.action.duplicate.server.tip=Duplicate server
observe.action.exit=Quit
observe.action.exit.tip=quit Observe
observe.action.floatingObjectPresets=Floating Object references
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -72,6 +72,9 @@ observe.action.delete.tip=Eliminar
observe.action.detail=Ver detalles
observe.action.do.backup=Guardar la base local
observe.action.do.backup.tip=Hacer copia de seguridad de la base local antes de aplicar los cambios
+observe.action.duplicate=Duplicate \#TODO
+observe.action.duplicate.remote.tip=Duplicate remote \#TODO
+observe.action.duplicate.server.tip=Duplicate server \#TODO
observe.action.exit=Salir
observe.action.exit.tip=Salir de ObServe
observe.action.floatingObjectPresets=Referencias de objetos flotantes
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -72,6 +72,9 @@ observe.action.delete.tip=Supprimer
observe.action.detail=Voir les détails
observe.action.do.backup=Sauver la base locale
observe.action.do.backup.tip=Effectuer une sauvegarde de la base locale avant d'appliquer les changements
+observe.action.duplicate=Dupliquer
+observe.action.duplicate.remote.tip=Duplicate la connexion distante
+observe.action.duplicate.server.tip=Duplicate la connexion server
observe.action.exit=Quitter
observe.action.exit.tip=Quitter ObServe
observe.action.floatingObjectPresets=Objets flottants de références
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/aa84cc6fdd6ed6c4b5ba88d49…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/aa84cc6fdd6ed6c4b5ba88d49…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] UI référentiel liste d'affichage d'espèces non classée - Closes #1474
by Tony CHEMIT 10 May '20
by Tony CHEMIT 10 May '20
10 May '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
41bd1605 by Tony Chemit at 2020-05-10T09:44:49+02:00
UI référentiel liste d'affichage d'espèces non classée - Closes #1474
- - - - -
1 changed file:
- client-core/src/main/resources/fr/ird/observe/client/ui/ObserveCommon.jcss
Changes:
=====================================
client-core/src/main/resources/fr/ird/observe/client/ui/ObserveCommon.jcss
=====================================
@@ -140,10 +140,11 @@ CoordinatesEditor {
}
FilterableDoubleList {
- showDecorator:true;
+ showDecorator:false;
showReset:true;
- showSelectPopupEnabled: true;
+ showSelectPopupEnabled: false;
filterable:false;
+ autoSortSelectedList:true;
_notBlocking: true;
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/41bd1605fa32fca4feeb4a01f…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/41bd1605fa32fca4feeb4a01f…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
de1041b9 by Tony Chemit at 2020-05-10T08:57:07+02:00
update pom
- - - - -
110d6cd0 by Tony Chemit at 2020-05-10T08:57:09+02:00
Fichiers de traductions manquants - Closes #1478
- - - - -
dd5eadd9 by Tony Chemit at 2020-05-10T08:57:09+02:00
Absence du gestionnaire de connexions - Closes #1476
- - - - -
94dc03fe by Tony Chemit at 2020-05-10T08:57:09+02:00
Dans le gestionnaire de connexions, un bouton 'dupliquer le profil' serait pratique - Closes #1477
- - - - -
8495b35d by Tony Chemit at 2020-05-10T08:57:09+02:00
Quelques améliorations dans le gestionnaire de connexion - Closes #1479
- - - - -
5c0030fc by Tony Chemit at 2020-05-10T09:41:40+02:00
L'écran de gestion des connexions pourrait être présenté en partage horizontal - Closes #1480
- - - - -
17 changed files:
- + client-core/src/main/i18n/templates/initStorage_en_GB.ftl
- + client-core/src/main/i18n/templates/initStorage_es_ES.ftl
- + client-core/src/main/i18n/templates/initStorage_fr_FR.ftl
- client-core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java
- client-datasource-editor-api/src/main/i18n/getters/java.getter
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/DataSourceEditorBodyContent.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jaxx
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jcss
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUIHandler.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteRemote.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteServer.java
- + client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateRemote.java
- + client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateServer.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- pom.xml
Changes:
=====================================
client-core/src/main/i18n/templates/initStorage_en_GB.ftl
=====================================
@@ -0,0 +1,43 @@
+<#--
+ #%L
+ ObServe :: Client Core
+ %%
+ Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+-->
+
+<html>
+<body>
+
+<h3>Loading a data sourced</h3>
+
+<p>
+ The local database does not exist (path ${localDb.absolutePath}).
+</p>
+
+You can now:
+
+<ul>
+<#if withBackup>
+ <li>use last automatic backup (${backupDate})</li>
+</#if>
+ <li>create a new local database</li>
+ <li>connect to a remote database</li>
+</ul>
+
+</body>
+</html>
=====================================
client-core/src/main/i18n/templates/initStorage_es_ES.ftl
=====================================
@@ -0,0 +1,42 @@
+<#--
+ #%L
+ ObServe :: Client Core
+ %%
+ Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+-->
+<html>
+<body>
+
+<h3>Importar una base de datos</h3>
+
+<p>
+ La base local no existe (ruta ${localDb.absolutePath}).
+</p>
+
+Ahora puede:
+
+<ul>
+<#if withBackup>
+ <li>Utilizar la última copia de seguridad automática (${backupDate})</li>
+</#if>
+ <li>Crear una base local nueva</li>
+ <li>Conectar a una base remota</li>
+</ul>
+
+</body>
+</html>
=====================================
client-core/src/main/i18n/templates/initStorage_fr_FR.ftl
=====================================
@@ -0,0 +1,42 @@
+<#--
+ #%L
+ ObServe :: Client Core
+ %%
+ Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+-->
+<html>
+<body>
+
+<h3>Chargement d'une source de donnée</h3>
+
+<p>
+ La base locale n'existe pas (emplacement ${localDb.absolutePath}).
+</p>
+
+Vous pouvez à ce stade
+
+<ul>
+<#if withBackup>
+ <li>utiliser la dernière sauvegarde automatique (${backupDate})</li>
+</#if>
+ <li>créer la base locale</li>
+ <li>vous connecter à une base distante.</li>
+</ul>
+
+</body>
+</html>
=====================================
client-core/src/main/java/fr/ird/observe/client/util/ObserveKeyStrokesSupport.java
=====================================
@@ -100,6 +100,7 @@ public abstract class ObserveKeyStrokesSupport {
public static final KeyStroke KEY_STROKE_NEW_DATA = KeyStroke.getKeyStroke("pressed F4");
public static final KeyStroke KEY_STROKE_NEW_NEXT_DATA = KeyStroke.getKeyStroke("pressed F9");
public static final KeyStroke KEY_STROKE_DELETE_DATA_GLOBAL = KeyStroke.getKeyStroke("pressed F6");
+ public static final KeyStroke KEY_STROKE_DUPLICATE = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_MOVE_DATA_GLOBAL = KeyStroke.getKeyStroke("pressed F8");
public static final KeyStroke KEY_STROKE_OPEN_DATA = KeyStroke.getKeyStroke("pressed F2");
public static final KeyStroke KEY_STROKE_CLOSE_DATA = KeyStroke.getKeyStroke("pressed F3");
=====================================
client-datasource-editor-api/src/main/i18n/getters/java.getter
=====================================
@@ -32,6 +32,9 @@ observe.action.delete.tip
observe.action.detail
observe.action.do.backup
observe.action.do.backup.tip
+observe.action.duplicate
+observe.action.duplicate.remote.tip
+observe.action.duplicate.server.tip
observe.action.goDown
observe.action.goDown.tip
observe.action.goUp
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/DataSourceEditorBodyContent.java
=====================================
@@ -94,7 +94,7 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi
navigationMenu.getUiModel().init();
getClientUIContext().getBusyModel().addPropertyChangeListener(BusyModel.BUSY_PROPERTY_NAME, evt -> reload());
- ShowDataSourcePresetsAction.init(mainUI, mainUI.getShowDataSourcePresets());
+ ShowDataSourcePresetsAction.init(mainUI, mainUI.getShowDataSourcePresets(), ShowDataSourcePresetsAction.class);
}
// @Override
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jaxx
=====================================
@@ -23,23 +23,26 @@
fr.ird.observe.dto.presets.RemoteDataSourceConfiguration
fr.ird.observe.dto.presets.ServerDataSourceConfiguration
org.nuiton.jaxx.widgets.select.BeanComboBox
+ java.awt.CardLayout
</import>
<RemotePresetsUIModel id="model" initializer="getContextValue(RemotePresetsUIModel.class)"/>
<JTabbedPane id='tabs' constraints='BorderLayout.CENTER'>
<tab id='remoteTab' title="observe.storage.remote.presets.title">
- <JSplitPane id="remotePanel">
- <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
- <JPanel id="remoteContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noRemoteSelected" constraints='BorderLayout.CENTER'/>
- <Table id="remoteForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="remotePanel" layout="{new BorderLayout()}">
+ <JScrollPane id='remoteConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='remoteConfigurations' genericType="RemoteDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="remoteContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noRemoteSelected" constraints='"empty"'/>
+ <Table id="remoteForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteName" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteName" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -47,7 +50,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteUrl" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteUrl" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -55,7 +58,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remoteLogin" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remoteLogin" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -63,7 +66,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="remotePassword" onKeyReleased="model.setRemoteModified(true);"/>
+ <JTextField id="remotePassword" onKeyReleased="handler.setRemoteModified(event);"/>
</cell>
</row>
<row>
@@ -80,26 +83,29 @@
<JButton id="saveRemoteAction"/>
<JButton id="deleteRemoteAction"/>
<JButton id="testRemoteAction"/>
+ <JButton id="duplicateRemoteAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
<tab id='serverTab' title="observe.storage.server.presets.title">
- <JSplitPane id="serverPanel">
- <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
- <JPanel id="serverContentPanel" layout="{new BorderLayout()}">
- <JLabel id="noServerSelected" constraints='BorderLayout.CENTER'/>
- <Table id="serverForm" constraints='BorderLayout.SOUTH' fill="both">
+ <JPanel id="serverPanel" layout="{new BorderLayout()}" >
+ <JScrollPane id='serverConfigurationsPane' constraints='BorderLayout.CENTER'>
+ <JList id='serverConfigurations' genericType="ServerDataSourceConfiguration"/>
+ </JScrollPane>
+ <JPanel id="serverContentPanel" layout="{new CardLayout()}" constraints='BorderLayout.SOUTH' border='{new TitledBorder("")}'>
+ <JLabel id="noServerSelected" constraints='"empty"'/>
+ <Table id="serverForm" constraints='"form"' fill="both">
<row>
<cell anchor='west'>
<JLabel text='observe.storage.remote.name'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverName" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverName" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -107,7 +113,7 @@
<JLabel text='observe.storage.remote.url'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverUrl" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverUrl" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -115,7 +121,7 @@
<JLabel text='observe.storage.remote.login'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverLogin" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverLogin" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -123,7 +129,7 @@
<JLabel text='observe.storage.remote.password'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverPassword" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverPassword" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
<row>
@@ -131,7 +137,7 @@
<JLabel id="serverDataBaseLabel" text='observe.storage.server.dataBase'/>
</cell>
<cell weightx='1' fill="both" anchor='east'>
- <JTextField id="serverDataBase" onKeyReleased="model.setServerModified(true);"/>
+ <JTextField id="serverDataBase" onKeyReleased="handler.setServerModified(event);"/>
</cell>
</row>
@@ -143,12 +149,13 @@
<JButton id="saveServerAction"/>
<JButton id="deleteServerAction"/>
<JButton id="testServerAction"/>
+ <JButton id="duplicateServerAction"/>
</JPanel>
</cell>
</row>
</Table>
</JPanel>
- </JSplitPane>
+ </JPanel>
</tab>
</JTabbedPane>
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUI.jcss
=====================================
@@ -25,15 +25,10 @@
}
#noRemoteSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#remoteForm {
- visible: false;
-}
-
#remoteName {
text:{SwingUtil.getStringValue(model.getRemoteDataSourceConfiguration().getName())};
}
@@ -56,15 +51,10 @@
}
#noServerSelected {
- visible: true;
text:"observe.storage.presets.no.selected";
horizontalAlignment: center;
}
-#serverForm {
- visible: false;
-}
-
#serverName {
text:{SwingUtil.getStringValue(model.getServerDataSourceConfiguration().getName())};
}
@@ -85,6 +75,10 @@
text:{SwingUtil.getStringValue(model.getServerDataSourceConfiguration().getDatabaseName())};
}
+#resetRemoteAction {
+ enabled:{model.isRemoteModified()};
+}
+
#saveRemoteAction {
enabled:{model.isRemoteModified()};
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/RemotePresetsUIHandler.java
=====================================
@@ -42,6 +42,7 @@ import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
+import java.awt.CardLayout;
import java.awt.event.KeyEvent;
import java.util.List;
@@ -55,11 +56,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
private static final Logger log = LogManager.getLogger(RemotePresetsUIHandler.class);
-// private RemotePresetsUI ui;
+ private RemotePresetsUI ui;
@Override
public void beforeInit(RemotePresetsUI ui) {
-// this.ui = ui;
+ this.ui = ui;
RemotePresetsUIModel model = new RemotePresetsUIModel();
ClientConfig config = getClientConfig();
model.setServerDataSourceConfigurations(config.getServerDataSourceConfigurationList());
@@ -98,6 +99,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
ui.getModel().setRemoteModified(false);
} else {
ui.getModel().setRemoteDataSourceConfiguration(ui.getRemoteConfigurations().getSelectedValue());
+ ui.getRemoteName().requestFocusInWindow();
}
});
@@ -118,15 +120,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
RemoteDataSourceConfiguration oldValue = (RemoteDataSourceConfiguration) evt.getOldValue();
if (ui.getModel().getRemoteDataSourceConfiguration() == null) {
- ui.getRemoteContentPanel().remove(ui.getRemoteForm());
- ui.getRemoteContentPanel().add(ui.getNoRemoteSelected(), BorderLayout.CENTER);
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "empty");
ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getRemoteForm().setVisible(true);
- ui.getRemoteContentPanel().remove(ui.getNoRemoteSelected());
- ui.getRemoteContentPanel().add(ui.getRemoteForm(), BorderLayout.CENTER);
- ui.getRemoteName().requestFocusInWindow();
+ ((CardLayout) ui.getRemoteContentPanel().getLayout()).show(ui.getRemoteContentPanel(), "form");
}
ui.getModel().setRemoteModified(false);
}
@@ -137,10 +135,12 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
if ((Boolean) evt.getNewValue()) {
remoteActions.remove(ui.getResetRemoteAction());
remoteActions.remove(ui.getDeleteRemoteAction());
+ remoteActions.remove(ui.getDuplicateRemoteAction());
remoteActions.add(ui.getCancelRemoteAction(), 0);
} else {
remoteActions.add(ui.getResetRemoteAction(), 0);
remoteActions.add(ui.getDeleteRemoteAction(), 2);
+ remoteActions.add(ui.getDeleteRemoteAction());
remoteActions.remove(ui.getCancelRemoteAction());
}
});
@@ -160,6 +160,7 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
ui.getModel().setServerModified(false);
} else {
ui.getModel().setServerDataSourceConfiguration(ui.getServerConfigurations().getSelectedValue());
+ ui.getServerName().requestFocusInWindow();
}
});
@@ -180,15 +181,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
ServerDataSourceConfiguration oldValue = (ServerDataSourceConfiguration) evt.getOldValue();
if (ui.getModel().getServerDataSourceConfiguration() == null) {
- ui.getServerContentPanel().remove(ui.getServerForm());
- ui.getServerContentPanel().add(ui.getNoServerSelected(), BorderLayout.CENTER);
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "empty");
ui.getCreateAction().requestFocusInWindow();
} else {
if (oldValue == null) {
- ui.getServerForm().setVisible(true);
- ui.getServerContentPanel().remove(ui.getNoServerSelected());
- ui.getServerContentPanel().add(ui.getServerForm(), BorderLayout.CENTER);
- ui.getServerName().requestFocusInWindow();
+ ((CardLayout) ui.getServerContentPanel().getLayout()).show(ui.getServerContentPanel(), "form");
}
ui.getModel().setServerModified(false);
}
@@ -200,11 +197,13 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
if ((Boolean) evt.getNewValue()) {
serverActions.remove(ui.getResetServerAction());
serverActions.remove(ui.getDeleteServerAction());
+ serverActions.remove(ui.getDuplicateServerAction());
serverActions.add(ui.getCancelServerAction(), 0);
} else {
serverActions.add(ui.getResetServerAction(), 0);
serverActions.add(ui.getDeleteServerAction(), 2);
+ serverActions.add(ui.getDuplicateServerAction());
serverActions.remove(ui.getCancelServerAction());
}
});
@@ -218,23 +217,18 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI>, WithC
editor.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), "none");
}
-//
-// protected void init(InputMap inputMap, ActionMap actionMap, AbstractButton editor) {
-// String actionId = (String) editor.getClientProperty(OBSERVE_ACTION);
-// if (actionId == null) {
-//
-// return;
-// }
-//
-// UIActionSupport action = (UIActionSupport) actionMap.get(actionId);
-// Objects.requireNonNull(action, "action [" + actionId + "] not found for ui " + ui.getClass().getName());
-//
-// if (log.isDebugEnabled()) {
-// log.debug("init common action " + actionId);
-// }
-//
-// action.initForMainUi(editor, inputMap, actionMap);
-// editor.putClientProperty(UIActionSupport.CLIENT_PROPERTY_UI, ui);
-//
-// }
+
+ protected void setServerModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setServerModified(true);
+ }
+
+ protected void setRemoteModified(KeyEvent event) {
+ if (event.isActionKey()) {
+ return;
+ }
+ ui.getModel().setRemoteModified(true);
+ }
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteRemote.java
=====================================
@@ -65,6 +65,8 @@ public class DeleteRemote extends RemoteActionSupport {
ui.getModel().setRemoteDataSourceConfigurations(configurations);
getClientConfig().removeRemoteDataSourceConfiguration(configuration);
ui.getModel().setRemoteDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getRemoteConfigurations().setSelectedIndex(newConfiguration);
}
}
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DeleteServer.java
=====================================
@@ -31,6 +31,7 @@ import javax.swing.JOptionPane;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import static io.ultreia.java4all.i18n.I18n.n;
import static io.ultreia.java4all.i18n.I18n.t;
@@ -67,6 +68,8 @@ public class DeleteServer extends ServerActionSupport {
ui.getModel().setServerDataSourceConfigurations(configurations);
getClientConfig().removeServerDataSourceConfiguration(configuration);
ui.getModel().setServerDataSourceConfiguration(null);
+ int newConfiguration = configurations.isEmpty() ? -1 : 0;
+ ui.getServerConfigurations().setSelectedIndex(newConfiguration);
}
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateRemote.java
=====================================
@@ -0,0 +1,59 @@
+package fr.ird.observe.client.datasource.editor.wizard.presets.actions;
+
+/*-
+ * #%L
+ * ObServe :: Client DataSource Editor API
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.datasource.editor.wizard.presets.RemotePresetsUI;
+import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
+import fr.ird.observe.dto.presets.RemoteDataSourceConfiguration;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateRemote extends RemoteActionSupport {
+
+ public DuplicateRemote() {
+ super(n("observe.action.duplicate"), n("observe.action.duplicate.remote.tip"), "mode-create", ObserveKeyStrokesSupport.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(ActionEvent event, RemotePresetsUI ui) {
+
+ RemoteDataSourceConfiguration incomingConfiguration = ui.getModel().getRemoteDataSourceConfiguration();
+
+ RemoteDataSourceConfiguration configuration = new RemoteDataSourceConfiguration();
+
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName() + " (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<RemoteDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getRemoteDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setRemoteDataSourceConfigurations(configurations);
+ ui.getModel().setRemoteCreateMode(true);
+ ui.getRemoteConfigurations().setSelectedValue(configuration, true);
+ }
+}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/wizard/presets/actions/DuplicateServer.java
=====================================
@@ -0,0 +1,62 @@
+package fr.ird.observe.client.datasource.editor.wizard.presets.actions;
+
+/*-
+ * #%L
+ * ObServe :: Client DataSource Editor API
+ * %%
+ * Copyright (C) 2008 - 2020 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ird.observe.client.datasource.editor.wizard.presets.RemotePresetsUI;
+import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
+import fr.ird.observe.dto.presets.ServerDataSourceConfiguration;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import static io.ultreia.java4all.i18n.I18n.n;
+
+public class DuplicateServer extends ServerActionSupport {
+
+ public DuplicateServer() {
+ super(n("observe.action.duplicate"), n("observe.action.duplicate.server.tip"), "mode-create", ObserveKeyStrokesSupport.KEY_STROKE_DUPLICATE);
+ }
+
+ @Override
+ protected void doActionPerformed(ActionEvent event, RemotePresetsUI ui) {
+
+ ServerDataSourceConfiguration incomingConfiguration = ui.getModel().getServerDataSourceConfiguration();
+ ServerDataSourceConfiguration configuration = new ServerDataSourceConfiguration();
+
+ configuration.setDatabaseName(incomingConfiguration.getDatabaseName());
+ configuration.setLogin(incomingConfiguration.getLogin());
+ configuration.setPassword(incomingConfiguration.getPassword());
+ configuration.setName(incomingConfiguration.getName()+" (Copie)");
+ configuration.setUrl(incomingConfiguration.getUrl());
+
+ List<ServerDataSourceConfiguration> configurations = new ArrayList<>(ui.getModel().getServerDataSourceConfigurations());
+ configurations.add(configuration);
+ ui.getModel().setServerDataSourceConfigurations(configurations);
+ ui.getModel().setServerCreateMode(true);
+ ui.getServerConfigurations().setSelectedValue(configuration, true);
+
+ }
+
+
+}
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -98,6 +98,9 @@ observe.action.delete.tip=Delete
observe.action.detail=Details
observe.action.do.backup=Backup local database
observe.action.do.backup.tip=Make a backup of local database before applying modifications.
+observe.action.duplicate=Duplicate
+observe.action.duplicate.remote.tip=Duplicate remote
+observe.action.duplicate.server.tip=Duplicate server
observe.action.exit=Quit
observe.action.exit.tip=quit Observe
observe.action.export.requiredInsertMissingReferentials=Insert into central source missing referentials
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -98,6 +98,9 @@ observe.action.delete.tip=Eliminar
observe.action.detail=Ver detalles
observe.action.do.backup=Guardar la base local
observe.action.do.backup.tip=Hacer copia de seguridad de la base local antes de aplicar los cambios
+observe.action.duplicate=Duplicate \#TODO
+observe.action.duplicate.remote.tip=Duplicate remote \#TODO
+observe.action.duplicate.server.tip=Duplicate server \#TODO
observe.action.exit=Salir
observe.action.exit.tip=Salir de ObServe
observe.action.export.requiredInsertMissingReferentials=Insérer les référentiels manquant dans la source centrale. \#TODO
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -98,6 +98,9 @@ observe.action.delete.tip=Supprimer
observe.action.detail=Voir les détails
observe.action.do.backup=Sauver la base locale
observe.action.do.backup.tip=Effectuer une sauvegarde de la base locale avant d'appliquer les changements
+observe.action.duplicate=Dupliquer
+observe.action.duplicate.remote.tip=Duplicate la connexion distante
+observe.action.duplicate.server.tip=Duplicate la connexion server
observe.action.exit=Quitter
observe.action.exit.tip=Quitter ObServe
observe.action.export.requiredInsertMissingReferentials=Insérer les référentiels manquant dans la source centrale.
=====================================
pom.xml
=====================================
@@ -24,7 +24,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.19</version>
+ <version>2020.23</version>
</parent>
<groupId>fr.ird.observe</groupId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/ce1e84ab8f301184758a4376…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/ce1e84ab8f301184758a4376…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
16dbfffe by Tony Chemit at 2020-05-09T12:16:12+02:00
update pom
- - - - -
1 changed file:
- pom.xml
Changes:
=====================================
pom.xml
=====================================
@@ -26,7 +26,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.21</version>
+ <version>2020.23</version>
</parent>
<groupId>fr.ird.observe</groupId>
@@ -163,7 +163,7 @@
<!--can't use 1.4.197 (date has changed + blob also-->
<lib.version.h2>1.4.196</lib.version.h2>
<lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene>
- <lib.version.java4all.jaxx>3.0-alpha-68-SNAPSHOT</lib.version.java4all.jaxx>
+ <!--<lib.version.java4all.jaxx>3.0-alpha-68-SNAPSHOT</lib.version.java4all.jaxx>-->
<!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>-->
<lib.version.java4all.topia>1.1.17</lib.version.java4all.topia>
<lib.version.nuiton.utils>3.0</lib.version.nuiton.utils>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/16dbfffe737d01a91c92ccac8…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/16dbfffe737d01a91c92ccac8…
You're receiving this email because of your account on gitlab.com.
1
0