T3-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
February 2018
- 1 participants
- 74 discussions
[Git][ultreiaio/ird-t3][release/2.1] 2 commits: [jgitflow-maven-plugin]updating poms for branch'release/2.1' with non-snapshot versions[skip ci]
by Tony CHEMIT 25 Feb '18
by Tony CHEMIT 25 Feb '18
25 Feb '18
Tony CHEMIT pushed to branch release/2.1 at ultreiaio / ird-t3
Commits:
6e8d6571 by Tony CHEMIT at 2018-02-25T22:59:17+01:00
[jgitflow-maven-plugin]updating poms for branch'release/2.1' with non-snapshot versions[skip ci]
- - - - -
bda4237b by Tony CHEMIT at 2018-02-25T23:10:48+01:00
fix version for release modules
- - - - -
12 changed files:
- pom.xml
- t3-actions/pom.xml
- t3-domain/pom.xml
- t3-input-avdthv33/pom.xml
- t3-input-avdthv35/pom.xml
- t3-input-avdthv36/pom.xml
- t3-installer/pom.xml
- t3-msaccess-importer/pom.xml
- t3-output-balbayav32/pom.xml
- t3-test/pom.xml
- t3-web/pom.xml
- t3/pom.xml
Changes:
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
<packaging>pom</packaging>
<name>T3 :: Pom</name>
=====================================
t3-actions/pom.xml
=====================================
--- a/t3-actions/pom.xml
+++ b/t3-actions/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-actions</artifactId>
=====================================
t3-domain/pom.xml
=====================================
--- a/t3-domain/pom.xml
+++ b/t3-domain/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-domain</artifactId>
=====================================
t3-input-avdthv33/pom.xml
=====================================
--- a/t3-input-avdthv33/pom.xml
+++ b/t3-input-avdthv33/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-input-avdthv33</artifactId>
=====================================
t3-input-avdthv35/pom.xml
=====================================
--- a/t3-input-avdthv35/pom.xml
+++ b/t3-input-avdthv35/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-input-avdthv35</artifactId>
=====================================
t3-input-avdthv36/pom.xml
=====================================
--- a/t3-input-avdthv36/pom.xml
+++ b/t3-input-avdthv36/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-input-avdthv36</artifactId>
=====================================
t3-installer/pom.xml
=====================================
--- a/t3-installer/pom.xml
+++ b/t3-installer/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-installer</artifactId>
=====================================
t3-msaccess-importer/pom.xml
=====================================
--- a/t3-msaccess-importer/pom.xml
+++ b/t3-msaccess-importer/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-msaccess-importer</artifactId>
=====================================
t3-output-balbayav32/pom.xml
=====================================
--- a/t3-output-balbayav32/pom.xml
+++ b/t3-output-balbayav32/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-output-balbayav32</artifactId>
=====================================
t3-test/pom.xml
=====================================
--- a/t3-test/pom.xml
+++ b/t3-test/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-test</artifactId>
=====================================
t3-web/pom.xml
=====================================
--- a/t3-web/pom.xml
+++ b/t3-web/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-web</artifactId>
=====================================
t3/pom.xml
=====================================
--- a/t3/pom.xml
+++ b/t3/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/f4f891b53206d5277ff7b0a2d83516b…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/f4f891b53206d5277ff7b0a2d83516b…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][master] 61 commits: [jgitflow-maven-plugin]updating poms for 2.0.2-SNAPSHOT development
by Tony CHEMIT 25 Feb '18
by Tony CHEMIT 25 Feb '18
25 Feb '18
Tony CHEMIT pushed to branch master at ultreiaio / ird-t3
Commits:
406b7da3 by 166231 at 2017-05-11T00:24:49+00:00
[jgitflow-maven-plugin]updating poms for 2.0.2-SNAPSHOT development
- - - - -
f9528149 by 166231 at 2017-05-11T00:31:11+00:00
[jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts
- - - - -
f37933a7 by 166231 at 2017-05-11T00:31:11+00:00
[jgitflow-maven-plugin]merging 'master' into 'develop'
- - - - -
bafe0d71 by 166231 at 2017-05-11T00:31:12+00:00
[jgitflow-maven-plugin]Updating develop poms back to pre merge state
- - - - -
fb633cf3 by 166231 at 2017-05-11T00:33:32+00:00
Update changelog after release of milestone 2.0.2
- - - - -
cda2a47c by Tony CHEMIT at 2018-02-18T04:47:34+01:00
Update pom to use last ultreiaio pom + then use nearly updated libs (except for struts)
- - - - -
02721df2 by Tony CHEMIT at 2018-02-18T07:07:25+01:00
use last pom + last data
- - - - -
a0fecb54 by Tony CHEMIT at 2018-02-18T07:37:00+01:00
Ajouter un lien entre ports et pays (See #253)
- - - - -
d9193bca by Tony CHEMIT at 2018-02-18T07:57:38+01:00
Supprimer localmarketpackaging.status (See #249)
- - - - -
3d049b2d by Tony CHEMIT at 2018-02-18T08:09:53+01:00
Les topiaid de LocalMarketPackagingType sont mal préfixés (See #250)
- - - - -
c0965197 by Tony CHEMIT at 2018-02-18T09:09:54+01:00
[PERSISTENCE] Renommage de tables et champs (See #196)
- - - - -
7768109b by Tony CHEMIT at 2018-02-21T00:23:45+01:00
[REFERENTIEL] Rajouter des champs de traduction (See #245)
- - - - -
739d78af by Tony CHEMIT at 2018-02-21T00:23:47+01:00
L'importeur plante si les coordonnées d'un port sont à NULL (See #258)
- - - - -
d85f0d93 by Tony CHEMIT at 2018-02-21T00:23:47+01:00
generate bundle for main application
- - - - -
7d705348 by Tony CHEMIT at 2018-02-21T00:23:47+01:00
move some pom conf
- - - - -
ef991d25 by Tony CHEMIT at 2018-02-21T00:23:47+01:00
Améliorations dans la gestion des profils utilisateurs (See #251)
- - - - -
db020e61 by Tony CHEMIT at 2018-02-21T00:23:47+01:00
[LOGS] Erreur d'affichage sur le log du RF1 (See #246)
- - - - -
0d6eedfa by Tony CHEMIT at 2018-02-21T00:23:48+01:00
[N0.4][LOG] Calcul du nombre de calées et durée des calées - Petite erreur dans le log (See #160)
- - - - -
87ba2424 by Tony CHEMIT at 2018-02-21T00:23:48+01:00
[LOGS] Inversion de libellé dans le log d'import AVDTH (See #247)
- - - - -
98f0052d by Tony CHEMIT at 2018-02-21T00:23:48+01:00
Ordonnacement du traitement de marées au 1.4 (distribution des échantillons sur les calées de l'échantillon) (See #259)
- - - - -
b1f3d41d by Tony CHEMIT at 2018-02-21T00:23:48+01:00
Erreur de libellé dans le log N0.1 (calcul des RF1) (See #270)
- - - - -
389c4eb7 by Tony CHEMIT at 2018-02-21T00:23:48+01:00
Amélioration du log du RF1 (N0.1) (See #2171)
- - - - -
15bc0636 by Tony CHEMIT at 2018-02-21T00:23:48+01:00
reformat code
- - - - -
14ce5598 by Tony CHEMIT at 2018-02-21T00:23:48+01:00
Probleme de calcul de rf1 (See #283)
- - - - -
318b2b93 by Tony CHEMIT at 2018-02-21T00:23:48+01:00
[WIN] Windows/Mauvais affichage des caractères accentués dans le navigateur (See #154)
- - - - -
780318bf by Tony CHEMIT at 2018-02-21T00:23:48+01:00
use auto-service
- - - - -
aa86a809 by Tony CHEMIT at 2018-02-21T00:23:48+01:00
Améliorations dans la gestion des profils utilisateurs (Pour la création on deamdne aussi une confirmation du mot de passe) (See #251)
- - - - -
8c1d0a5e by Tony CHEMIT at 2018-02-21T00:23:48+01:00
improve configurations (for migration purpose)
- - - - -
6f6dcf51 by Tony CHEMIT at 2018-02-21T00:23:48+01:00
fix migrations + add a test for migraiton
- - - - -
6e537254 by Tony CHEMIT at 2018-02-21T00:23:49+01:00
Let's go to version 2.1
- - - - -
893ac656 by Tony CHEMIT at 2018-02-21T00:23:49+01:00
Use ird-t3-data 1.2
- - - - -
1266f890 by Tony CHEMIT at 2018-02-21T00:23:49+01:00
[N0] Marée Echantillons seulement et gestion de l'UI du N0 (Closes #85)
- - - - -
8f5d5139 by Tony CHEMIT at 2018-02-21T00:23:49+01:00
let's use a password, otherwise can't open test db in IDEA, what a shame...
- - - - -
cafd70e9 by Tony CHEMIT at 2018-02-21T00:23:49+01:00
Improve persistences tests
- - - - -
8cea3365 by Tony CHEMIT at 2018-02-21T00:23:49+01:00
[N0] Calcul des temps de pêche (See #240)
- - - - -
9a005089 by Tony CHEMIT at 2018-02-21T00:23:49+01:00
[N0] Marée Echantillons seulement et gestion de l'UI du N0 (See #85)
- - - - -
e35842a5 by Tony CHEMIT at 2018-02-21T00:57:02+01:00
[N0] Calcul des temps de pêche (See #240)
- - - - -
4072de7b by Tony CHEMIT at 2018-02-21T02:09:42+01:00
[N0.4] Calcul des durées de calées pour les activités avec setcount > 1 (Closes #241)
- - - - -
676b259b by Tony CHEMIT at 2018-02-21T09:17:30+01:00
[N1][N2][N3] Permettre la sélection mutliple d'océans (See #260) N1 done
- - - - -
c6cd77c4 by Tony CHEMIT at 2018-02-21T10:50:19+01:00
Fill Harbour.ocean (See #260)
- - - - -
92a44e1e by Tony CHEMIT at 2018-02-21T10:50:58+01:00
up data version
- - - - -
b2092129 by Tony CHEMIT at 2018-02-21T13:41:45+01:00
[N1][N2][N3] Permettre la sélection mutliple d'océans (See #260) N2 and N3 done (plus reformat and clean codes and those levels)
- - - - -
b1ffee7e by Tony CHEMIT at 2018-02-21T14:06:48+01:00
Revert removed method
- - - - -
89e03ab7 by Tony CHEMIT at 2018-02-21T15:48:15+01:00
Sur la page 'Gérer les marées', la mise en page déborde de l'écran à droite. Voir la PJ. Cela génère un ascenseur horizontal, pourtant inutile. (Closes #232)
- - - - -
5ce68d04 by Tony CHEMIT at 2018-02-21T15:50:10+01:00
[UI][N2][N3] Changer la sélection de la flotte d'une sélection unique vers une sélection multiple (Closes #243)
- - - - -
19e6e2e5 by Tony CHEMIT at 2018-02-21T16:15:01+01:00
Fix loading trips with no ocean
- - - - -
0ea4c85e by Tony CHEMIT at 2018-02-21T17:02:36+01:00
fix level 2 and 3 config code
- - - - -
5b34b3ef by Tony CHEMIT at 2018-02-21T17:05:13+01:00
[N2][N3] Gestion des catégories de poids -10/+10kg dans la stratification N2 et N3 (Mise en place de la configuration) (See #263)
- - - - -
ea4a2e79 by Tony CHEMIT at 2018-02-21T20:14:49+01:00
[N2][N3] Gestion des catégories de poids -10/+10kg dans la stratification N2 et N3 (Mise en place du lancement d'une action (reste à gerer ça au sein des strates) (See #263)
- - - - -
dc65837f by Tony CHEMIT at 2018-02-22T15:32:40+01:00
improve test config
- - - - -
3e1ae6d6 by Tony CHEMIT at 2018-02-22T22:04:44+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (Mise en place de la persistence) (See #244)
- - - - -
4f2c864f by Tony CHEMIT at 2018-02-23T03:28:15+01:00
Ajouter un nouveau package avec des bases h2 (vide et avec le référentiel) (closes #285)
- - - - -
f6afe830 by Tony CHEMIT at 2018-02-23T03:41:19+01:00
use t3 data 1.3
- - - - -
fcbee305 by Tony CHEMIT at 2018-02-23T03:59:47+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (deplacer l'ancien code dans un package legacy) (See #244)
- - - - -
27a021ea by Tony CHEMIT at 2018-02-25T16:59:34+01:00
use new pom conf to deploy
- - - - -
95ed5ffc by Tony CHEMIT at 2018-02-25T16:59:40+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (mise en place d'un switch pour utiliser le nouveau mécanisme) (See #244)
- - - - -
8ad6d17c by Tony CHEMIT at 2018-02-25T22:41:17+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (mise en place de la nouvelle implantation) (See #244)
- - - - -
f4f891b5 by Tony CHEMIT at 2018-02-25T22:58:09+01:00
[jgitflow-maven-plugin]updating poms for 2.1 branch with snapshot versions[skip ci]
- - - - -
6e8d6571 by Tony CHEMIT at 2018-02-25T22:59:17+01:00
[jgitflow-maven-plugin]updating poms for branch'release/2.1' with non-snapshot versions[skip ci]
- - - - -
bda4237b by Tony CHEMIT at 2018-02-25T23:10:48+01:00
fix version for release modules
- - - - -
11d713b9 by Tony CHEMIT at 2018-02-25T23:46:54+01:00
[jgitflow-maven-plugin]merging 'release/2.1' into 'master'
- - - - -
30 changed files:
- .gitlab-ci.yml
- + .mvn/deploy
- + .mvn/mono-module-site
- + .mvn/pom.gitflow.develop
- + .mvn/pom.gitflow.master
- + .mvn/pom.organizationId
- + .mvn/pom.projectId
- + .mvn/pom.stageId
- CHANGELOG.md
- CONTRIBUTING.md
- README.md
- pom.xml
- + t3-actions/.mvn/i18n-generate
- + t3-actions/.mvn/i18n-parse-java
- + t3-actions/.mvn/load-test-data
- + t3-actions/.mvn/pom.gitflow.develop
- + t3-actions/.mvn/pom.gitflow.master
- + t3-actions/.mvn/pom.organizationId
- + t3-actions/.mvn/pom.projectId
- + t3-actions/.mvn/pom.stageId
- t3-actions/pom.xml
- t3-actions/src/license/THIRD-PARTY.properties
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/AbstractLevel0Action.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Action.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Configuration.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF2Action.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeSetDurationAndPositiveSetCountAction.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeTripEffortsAction.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeWellPlanWeightCategoriesProportionsAction.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesAction.java
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/21d11ee3ccff60cb558b2ebb68b8c51…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/21d11ee3ccff60cb558b2ebb68b8c51…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] 7 commits: [jgitflow-maven-plugin]updating poms for 2.1 branch with snapshot versions[skip ci]
by Tony CHEMIT 25 Feb '18
by Tony CHEMIT 25 Feb '18
25 Feb '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
f4f891b5 by Tony CHEMIT at 2018-02-25T22:58:09+01:00
[jgitflow-maven-plugin]updating poms for 2.1 branch with snapshot versions[skip ci]
- - - - -
6e8d6571 by Tony CHEMIT at 2018-02-25T22:59:17+01:00
[jgitflow-maven-plugin]updating poms for branch'release/2.1' with non-snapshot versions[skip ci]
- - - - -
bda4237b by Tony CHEMIT at 2018-02-25T23:10:48+01:00
fix version for release modules
- - - - -
11d713b9 by Tony CHEMIT at 2018-02-25T23:46:54+01:00
[jgitflow-maven-plugin]merging 'release/2.1' into 'master'
- - - - -
7817355e by Tony CHEMIT at 2018-02-25T23:46:56+01:00
[jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts[skip ci]
- - - - -
c7c5f103 by Tony CHEMIT at 2018-02-25T23:46:56+01:00
[jgitflow-maven-plugin]merging 'master' into 'develop'
- - - - -
fe986192 by Tony CHEMIT at 2018-02-25T23:46:57+01:00
[jgitflow-maven-plugin]Updating develop poms back to pre merge state[skip ci]
- - - - -
2 changed files:
- t3-installer/pom.xml
- t3/pom.xml
Changes:
=====================================
t3-installer/pom.xml
=====================================
--- a/t3-installer/pom.xml
+++ b/t3-installer/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3-installer</artifactId>
=====================================
t3/pom.xml
=====================================
--- a/t3/pom.xml
+++ b/t3/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
</parent>
<artifactId>t3</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/7e8c6347b1c9540542cf60a7b08ae64…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/7e8c6347b1c9540542cf60a7b08ae64…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] [jgitflow-maven-plugin]updating poms for 2.2-SNAPSHOT development[skip ci]
by Tony CHEMIT 25 Feb '18
by Tony CHEMIT 25 Feb '18
25 Feb '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
7e8c6347 by Tony CHEMIT at 2018-02-25T22:58:10+01:00
[jgitflow-maven-plugin]updating poms for 2.2-SNAPSHOT development[skip ci]
- - - - -
10 changed files:
- pom.xml
- t3-actions/pom.xml
- t3-domain/pom.xml
- t3-input-avdthv33/pom.xml
- t3-input-avdthv35/pom.xml
- t3-input-avdthv36/pom.xml
- t3-msaccess-importer/pom.xml
- t3-output-balbayav32/pom.xml
- t3-test/pom.xml
- t3-web/pom.xml
Changes:
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>T3 :: Pom</name>
@@ -245,13 +245,13 @@
<configuration>
<!-- TODO chemit 2011-02-24 Change to 'target' when using ant-run 1.6 in mavenpom4labs... -->
<tasks>
- <echo message="Copy model to site"/>
+ <echo message="Copy model to site" />
<copy verbose="true" failonerror="false" overwrite="true" todir="${project.reporting.outputDirectory}/model">
<fileset dir="${basedir}/doc/modelisation/t3">
- <include name="**/*.png"/>
+ <include name="**/*.png" />
</fileset>
<fileset dir="${basedir}/t3-domain/src/main/xmi">
- <include name="t3-persistence.zargo"/>
+ <include name="t3-persistence.zargo" />
</fileset>
</copy>
</tasks>
=====================================
t3-actions/pom.xml
=====================================
--- a/t3-actions/pom.xml
+++ b/t3-actions/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-actions</artifactId>
=====================================
t3-domain/pom.xml
=====================================
--- a/t3-domain/pom.xml
+++ b/t3-domain/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-domain</artifactId>
=====================================
t3-input-avdthv33/pom.xml
=====================================
--- a/t3-input-avdthv33/pom.xml
+++ b/t3-input-avdthv33/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-input-avdthv33</artifactId>
=====================================
t3-input-avdthv35/pom.xml
=====================================
--- a/t3-input-avdthv35/pom.xml
+++ b/t3-input-avdthv35/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-input-avdthv35</artifactId>
=====================================
t3-input-avdthv36/pom.xml
=====================================
--- a/t3-input-avdthv36/pom.xml
+++ b/t3-input-avdthv36/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-input-avdthv36</artifactId>
=====================================
t3-msaccess-importer/pom.xml
=====================================
--- a/t3-msaccess-importer/pom.xml
+++ b/t3-msaccess-importer/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-msaccess-importer</artifactId>
=====================================
t3-output-balbayav32/pom.xml
=====================================
--- a/t3-output-balbayav32/pom.xml
+++ b/t3-output-balbayav32/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-output-balbayav32</artifactId>
=====================================
t3-test/pom.xml
=====================================
--- a/t3-test/pom.xml
+++ b/t3-test/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-test</artifactId>
=====================================
t3-web/pom.xml
=====================================
--- a/t3-web/pom.xml
+++ b/t3-web/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>fr.ird.t3</groupId>
<artifactId>ird-t3</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>2.2-SNAPSHOT</version>
</parent>
<artifactId>t3-web</artifactId>
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/7e8c6347b1c9540542cf60a7b08ae646…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/7e8c6347b1c9540542cf60a7b08ae646…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed new branch release/2.1 at ultreiaio / ird-t3
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/tree/release/2.1
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] [N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (mise en…
by Tony CHEMIT 25 Feb '18
by Tony CHEMIT 25 Feb '18
25 Feb '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
8ad6d17c by Tony CHEMIT at 2018-02-25T22:41:17+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (mise en place de la nouvelle implantation) (See #244)
- - - - -
30 changed files:
- pom.xml
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesAction.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesConfiguration.java
- t3-actions/src/main/resources/i18n/t3-actions_en_GB.properties
- t3-actions/src/main/resources/i18n/t3-actions_fr_FR.properties
- + t3-domain/src/main/java/fr/ird/t3/entities/conversion/DefaultWeightCategoryLogBookConverter.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertor.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConverter.java
- + t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConverterProvider.java
- − t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProvider.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/AbstractWeightCategoryLogBookConvertor.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/AbstractWeightCategoryLogBookConverter.java
- − t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProvider.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OABI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OABL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OABO.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OIBI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OIBL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OIBO.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OPBI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OPBL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OPBO.java
- t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionSpeciesImpl.java
- t3-domain/src/test/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProviderTest.java → t3-domain/src/test/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConverterProviderTest.java
- t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
- t3-domain/src/test/resources/db/WeightCategoryLogBookConvertorProviderTest.sql → t3-domain/src/test/resources/db/WeightCategoryLogBookConverterProviderTest.sql
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction.java
- t3-web/src/main/resources/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction-validateConvertCatchesWeightCategories-validation.xml
- t3-web/src/main/resources/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction-validation.xml
- t3-web/src/main/resources/i18n/t3-web_en_GB.properties
- t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
- t3-web/src/main/webapp/WEB-INF/jsp/data/level0/ConvertCatchesWeightCategoriesConfig.jsp
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/8ad6d17c437f241d56bc5e4125f20028…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/8ad6d17c437f241d56bc5e4125f20028…
You're receiving this email because of your account on gitlab.com.
1
0
25 Feb '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
27a021ea by Tony CHEMIT at 2018-02-25T16:59:34+01:00
use new pom conf to deploy
- - - - -
95ed5ffc by Tony CHEMIT at 2018-02-25T16:59:40+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (mise en place d'un switch pour utiliser le nouveau mécanisme) (See #244)
- - - - -
0983614a by Tony CHEMIT at 2018-02-25T22:26:32+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (mise en place de la nouvelle implantation) (See #244)
- - - - -
30 changed files:
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesAction.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesConfiguration.java
- t3-actions/src/main/resources/i18n/t3-actions_en_GB.properties
- t3-actions/src/main/resources/i18n/t3-actions_fr_FR.properties
- + t3-domain/src/main/java/fr/ird/t3/entities/conversion/DefaultWeightCategoryLogBookConverter.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertor.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConverter.java
- + t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConverterProvider.java
- − t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProvider.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/AbstractWeightCategoryLogBookConvertor.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/AbstractWeightCategoryLogBookConverter.java
- − t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProvider.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OABI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OABL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OABO.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OIBI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OIBL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OIBO.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OPBI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OPBL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConverterFOR_OPBO.java
- t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionSpeciesImpl.java
- t3-domain/src/test/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProviderTest.java → t3-domain/src/test/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConverterProviderTest.java
- t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
- t3-domain/src/test/resources/db/WeightCategoryLogBookConvertorProviderTest.sql → t3-domain/src/test/resources/db/WeightCategoryLogBookConverterProviderTest.sql
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction.java
- t3-web/src/main/resources/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction-validateConvertCatchesWeightCategories-validation.xml
- t3-web/src/main/resources/fr/ird/t3/web/actions/data/level0/ConvertCatchesWeightCategoriesConfigureAction-validation.xml
- t3-web/src/main/resources/i18n/t3-web_en_GB.properties
- t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
- t3-web/src/main/webapp/WEB-INF/jsp/data/level0/ConvertCatchesWeightCategoriesConfig.jsp
- t3-web/src/main/webapp/WEB-INF/jsp/data/level0/ConvertCatchesWeightCategoriesConfigResume.jsp
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/fcbee3056fb34ba8001e0f2ead801be…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/fcbee3056fb34ba8001e0f2ead801be…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] [N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique…
by Tony CHEMIT 23 Feb '18
by Tony CHEMIT 23 Feb '18
23 Feb '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
fcbee305 by Tony CHEMIT at 2018-02-23T03:59:47+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (deplacer l'ancien code dans un package legacy) (See #244)
- - - - -
15 changed files:
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesAction.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProvider.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/AbstractWeightCategoryLogBookConvertor.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/AbstractWeightCategoryLogBookConvertor.java
- + t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProvider.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABO.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBO.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBL.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBO.java
- t3-domain/src/test/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProviderTest.java → t3-domain/src/test/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProviderTest.java
- t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
Changes:
=====================================
t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesAction.java
=====================================
--- a/t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesAction.java
+++ b/t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ConvertCatchesWeightCategoriesAction.java
@@ -20,11 +20,11 @@
*/
package fr.ird.t3.actions.data.level0;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertor;
import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorProvider;
+import fr.ird.t3.entities.conversion.legacy.LegacyWeightCategoryLogBookConvertorProvider;
import fr.ird.t3.entities.data.Activity;
import fr.ird.t3.entities.data.CorrectedElementaryCatch;
import fr.ird.t3.entities.data.CorrectedElementaryCatchTopiaDao;
@@ -37,15 +37,16 @@ import fr.ird.t3.entities.reference.SpeciesTopiaDao;
import fr.ird.t3.entities.reference.WeightCategoryLogBook;
import fr.ird.t3.entities.reference.WeightCategoryTreatment;
import fr.ird.t3.services.ioc.InjectDAO;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.TopiaException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
import static org.nuiton.i18n.I18n.l;
@@ -59,16 +60,11 @@ import static org.nuiton.i18n.I18n.l;
*/
public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<ConvertCatchesWeightCategoriesConfiguration> {
- /** Logger. */
- private static final Log log = LogFactory.getLog(
- ConvertCatchesWeightCategoriesAction.class);
-
+ private static final Log log = LogFactory.getLog(ConvertCatchesWeightCategoriesAction.class);
+ Map<Species, CatchWeightResult> specieWeightResult;
@InjectDAO(entityType = CorrectedElementaryCatch.class)
- protected CorrectedElementaryCatchTopiaDao correctedElementaryCatchDAO;
-
- protected WeightCategoryLogBookConvertorProvider convertorProvider;
-
- protected Map<Species, CatchWeightResult> specieWeightResult;
+ private CorrectedElementaryCatchTopiaDao correctedElementaryCatchDAO;
+ private WeightCategoryLogBookConvertorProvider convertorProvider;
public ConvertCatchesWeightCategoriesAction() {
super(Level0Step.CONVERT_CATCHES_WEIGHT_CATEGORIES);
@@ -82,7 +78,7 @@ public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<C
return specieWeightResult.get(species);
}
- protected CatchWeightResult getCatchWeithResult(Map<Species, CatchWeightResult> specieWeightResult, Species species) {
+ private CatchWeightResult getCatchWeithResult(Map<Species, CatchWeightResult> specieWeightResult, Species species) {
CatchWeightResult result = specieWeightResult.get(species);
if (result == null) {
result = new CatchWeightResult();
@@ -96,8 +92,7 @@ public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<C
super.prepareAction();
- setConvertorProvider(
- WeightCategoryLogBookConvertorProvider.newInstance(getT3TopiaPersistenceContext().get()));
+ setConvertorProvider(LegacyWeightCategoryLogBookConvertorProvider.newInstance(getT3TopiaPersistenceContext().get()));
List<Trip> tripList = getUsableTrips(null, true);
setTrips(tripList);
@@ -130,7 +125,7 @@ public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<C
return result;
}
- protected boolean executeForTrip(Trip trip) throws TopiaException {
+ private boolean executeForTrip(Trip trip) throws TopiaException {
incrementsProgression();
@@ -162,22 +157,19 @@ public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<C
}
if (log.isInfoEnabled()) {
- log.info("Treat activity " + activity.getDate() +
- " with " + activity.sizeElementaryCatch());
+ log.info(String.format("Treat activity %s with %d", activity.getDate(), activity.sizeElementaryCatch()));
}
Ocean currentOcean = activity.getOcean();
SchoolType schoolType = activity.getSchoolType();
// get converter for this ocean and school type
- WeightCategoryLogBookConvertor converter =
- convertorProvider.getConvertor(currentOcean, schoolType);
+ WeightCategoryLogBookConvertor converter = convertorProvider.getConvertor(currentOcean, schoolType);
if (converter == null) {
// can not redistribute if no weight categories found
message = l(locale, "t3.level0.convertCatchesWeightCategories.warning.noconvertor.found",
- currentOcean.getLabel1(),
- schoolType.getLabel1());
+ currentOcean.getLabel1(), schoolType.getLabel1());
if (log.isWarnEnabled()) {
log.warn(message);
}
@@ -185,33 +177,24 @@ public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<C
continue;
}
- if (log.isDebugEnabled()) {
- log.debug("Use converter " + converter);
- }
-
// split catches by species
- Multimap<Species, ElementaryCatch> catchesBySpecie =
- SpeciesTopiaDao.groupBySpecies(activity.getElementaryCatch());
+ Multimap<Species, ElementaryCatch> catchesBySpecie = SpeciesTopiaDao.groupBySpecies(activity.getElementaryCatch());
for (Species species : catchesBySpecie.keySet()) {
- CatchWeightResult catchWeightResult =
- getCatchWeithResult(tripResult, species);
+ CatchWeightResult catchWeightResult = getCatchWeithResult(tripResult, species);
- Collection<ElementaryCatch> catches =
- catchesBySpecie.get(species);
+ Collection<ElementaryCatch> catches = catchesBySpecie.get(species);
catchWeightResult.addLogBookWeight(catches);
if (log.isInfoEnabled()) {
- log.info("Treat species " + species.getCode() + " with " +
- catches.size() + " catches");
+ log.info(String.format("Treat species %d with %d catches", species.getCode(), catches.size()));
}
// converts to weight category treatment for this species
- Map<WeightCategoryTreatment, Float> distribution =
- converter.distribute(species, catches);
+ Map<WeightCategoryTreatment, Float> distribution = converter.distribute(species, catches);
if (MapUtils.isEmpty(distribution)) {
@@ -219,20 +202,17 @@ public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<C
continue;
}
- Collection<CorrectedElementaryCatch> newCatches =
- Lists.newArrayList();
+ Collection<CorrectedElementaryCatch> newCatches = new ArrayList<>();
// create new catches
- for (Map.Entry<WeightCategoryTreatment, Float> e2 :
- distribution.entrySet()) {
+ for (Map.Entry<WeightCategoryTreatment, Float> e2 : distribution.entrySet()) {
WeightCategoryTreatment weightCategoryTreatment = e2.getKey();
Float weight = e2.getValue();
CorrectedElementaryCatch correctedElementaryCatch =
correctedElementaryCatchDAO.create(
CorrectedElementaryCatch.PROPERTY_WEIGHT_CATEGORY_TREATMENT, weightCategoryTreatment,
CorrectedElementaryCatch.PROPERTY_SPECIES, species,
- CorrectedElementaryCatch.PROPERTY_CATCH_WEIGHT, weight
- );
+ CorrectedElementaryCatch.PROPERTY_CATCH_WEIGHT, weight);
newCatches.add(correctedElementaryCatch);
}
@@ -272,15 +252,14 @@ public class ConvertCatchesWeightCategoriesAction extends AbstractLevel0Action<C
return true;
}
- public void setConvertorProvider(WeightCategoryLogBookConvertorProvider convertorProvider) {
+ private void setConvertorProvider(WeightCategoryLogBookConvertorProvider convertorProvider) {
this.convertorProvider = convertorProvider;
}
public static class CatchWeightResult {
- protected float logBookTotalWeight;
-
- protected float treatmentTotalWeight;
+ float logBookTotalWeight;
+ float treatmentTotalWeight;
public float getLogBookTotalWeight() {
return logBookTotalWeight;
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProvider.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProvider.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProvider.java
@@ -8,28 +8,27 @@
* it under the terms of the GNU Affero 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 Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package fr.ird.t3.entities.conversion;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import fr.ird.t3.entities.T3TopiaPersistenceContext;
import fr.ird.t3.entities.reference.Ocean;
import fr.ird.t3.entities.reference.SchoolType;
import fr.ird.t3.entities.reference.WeightCategoryTreatment;
import fr.ird.t3.entities.reference.WeightCategoryTreatmentTopiaDao;
-import java.util.Collection;
import org.nuiton.topia.persistence.TopiaException;
+import java.util.Collection;
+import java.util.Objects;
+
/**
* To obtain a ll available wieght convertors.
*
@@ -38,157 +37,23 @@ import org.nuiton.topia.persistence.TopiaException;
*/
public class WeightCategoryLogBookConvertorProvider {
- protected static final String OCEAN =
- WeightCategoryTreatment.PROPERTY_OCEAN + "." + Ocean.PROPERTY_CODE;
-
- protected static final String SCHOOL_TYPE =
- WeightCategoryTreatment.PROPERTY_SCHOOL_TYPE + "." +
- SchoolType.PROPERTY_CODE;
-
- protected final Collection<WeightCategoryLogBookConvertor> convertors;
-
- public static final int OA = 1;
-
- public static final int OI = 2;
-
- public static final int OP = 5;
-
- public static final int BO = 1;
-
- public static final int BL = 2;
-
- public static final int BI = 3;
-
- public static WeightCategoryLogBookConvertorProvider newInstance(T3TopiaPersistenceContext transaction) throws TopiaException {
-
- WeightCategoryTreatmentTopiaDao dao = transaction.getWeightCategoryTreatmentDao();
-
- Collection<WeightCategoryLogBookConvertor> converters =
- Lists.newArrayList();
-
- // BO = 1, BL = 2, BI = 3
- // OA = 1, OI = 2, OP = 5
-
- prepareForOA(dao, converters);
- prepareForOI(dao, converters);
- prepareForOP(dao, converters);
-
- return new WeightCategoryLogBookConvertorProvider(converters);
- }
-
- private static void prepareForOA(WeightCategoryTreatmentTopiaDao dao,
- Collection<WeightCategoryLogBookConvertor> converters) throws TopiaException {
- {
- // BO Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OABO(
- getCategory(dao, OA, BO, null, null),
- getCategory(dao, OA, BO, 0, 10),
- getCategory(dao, OA, BO, 10, null)
- );
- converters.add(convertor);
- }
- {
- // BL Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OABL(
- getCategory(dao, OA, BL, null, null),
- getCategory(dao, OA, BL, 0, 10),
- getCategory(dao, OA, BL, 10, 30),
- getCategory(dao, OA, BL, 30, null)
- );
- converters.add(convertor);
- }
- {
- // BI Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OABI(
- getCategory(dao, OA, BI, null, null),
- getCategory(dao, OA, BI, 0, 10),
- getCategory(dao, OA, BI, 10, 30),
- getCategory(dao, OA, BI, 30, null)
- );
- converters.add(convertor);
- }
-
- }
-
- private static void prepareForOI(WeightCategoryTreatmentTopiaDao dao,
- Collection<WeightCategoryLogBookConvertor> converters) throws TopiaException {
-
- {
- // BO Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OIBO(
- getCategory(dao, OI, BO, null, null),
- getCategory(dao, OI, BO, 0, 10),
- getCategory(dao, OI, BO, 10, null)
- );
- converters.add(convertor);
- }
- {
- // BL Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OIBL(
- getCategory(dao, OI, BL, null, null),
- getCategory(dao, OI, BL, 0, 10),
- getCategory(dao, OI, BL, 10, null)
- );
- converters.add(convertor);
- }
- {
- // BI Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OIBI(
- getCategory(dao, OI, BI, null, null),
- getCategory(dao, OI, BI, 0, 10),
- getCategory(dao, OI, BI, 10, null)
- );
- converters.add(convertor);
- }
- }
-
- private static void prepareForOP(WeightCategoryTreatmentTopiaDao dao,
- Collection<WeightCategoryLogBookConvertor> converters) throws TopiaException {
-
- {
- // BO Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OPBO(
- getCategory(dao, OP, BO, null, null),
- getCategory(dao, OP, BO, 0, 10),
- getCategory(dao, OP, BO, 10, null)
- );
- converters.add(convertor);
- }
- {
- // BL Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OPBL(
- getCategory(dao, OP, BL, null, null),
- getCategory(dao, OP, BL, 0, 10),
- getCategory(dao, OP, BL, 10, null)
- );
- converters.add(convertor);
- }
- {
- // BI Convertor
- WeightCategoryLogBookConvertor convertor =
- new WeightCategoryLogBookConvertorFOR_OPBI(
- getCategory(dao, OP, BI, null, null),
- getCategory(dao, OP, BI, 0, 10),
- getCategory(dao, OP, BI, 10, null)
- );
- converters.add(convertor);
- }
- }
+ private final Collection<WeightCategoryLogBookConvertor> convertors;
protected WeightCategoryLogBookConvertorProvider(Collection<WeightCategoryLogBookConvertor> convertors) {
this.convertors = convertors;
}
- public WeightCategoryLogBookConvertor getConvertor(Ocean ocean,
- SchoolType schoolType) {
+ protected static WeightCategoryTreatment getCategory(WeightCategoryTreatmentTopiaDao dao,
+ int oceanCode,
+ int schoolTypeCode,
+ Integer min,
+ Integer max) throws TopiaException {
+ WeightCategoryTreatment result = dao.findByOceanSchoolTypeAndBound(oceanCode, schoolTypeCode, min, max);
+ return Objects.requireNonNull(result,
+ String.format("Could not find weight treatment category with parameters : [ocean:%d, schoolType:%d, min:%d, max:%d]", oceanCode, schoolTypeCode, min, max));
+ }
+
+ public WeightCategoryLogBookConvertor getConvertor(Ocean ocean, SchoolType schoolType) {
WeightCategoryLogBookConvertor result = null;
for (WeightCategoryLogBookConvertor converter : convertors) {
if (converter.accept(ocean, schoolType)) {
@@ -198,26 +63,4 @@ public class WeightCategoryLogBookConvertorProvider {
}
return result;
}
-
- private static WeightCategoryTreatment getCategory(WeightCategoryTreatmentTopiaDao dao,
- int oceanCode,
- int schoolTypeCode,
- Integer min,
- Integer max) throws TopiaException {
-
- WeightCategoryTreatment result = dao.findByOceanSchoolTypeAndBound(
- oceanCode,
- schoolTypeCode,
- min,
- max
- );
-
- Preconditions.checkNotNull(
- result,
- "Could not find weight treatment category with " +
- "parameters : [ocean:" + oceanCode + ", schoolType:" +
- schoolTypeCode + ", min:" + min + ", max:" + max + "]"
- );
- return result;
- }
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/AbstractWeightCategoryLogBookConvertor.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/AbstractWeightCategoryLogBookConvertor.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/AbstractWeightCategoryLogBookConvertor.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/AbstractWeightCategoryLogBookConvertor.java
@@ -18,8 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertor;
import fr.ird.t3.entities.data.ElementaryCatch;
import fr.ird.t3.entities.reference.Ocean;
import fr.ird.t3.entities.reference.SchoolType;
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProvider.java
=====================================
--- /dev/null
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProvider.java
@@ -0,0 +1,176 @@
+/*
+ * #%L
+ * T3 :: Domain
+ * %%
+ * Copyright (C) 2010 - 2017 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ird.t3.entities.conversion.legacy;
+
+import com.google.common.collect.Lists;
+import fr.ird.t3.entities.T3TopiaPersistenceContext;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertor;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorProvider;
+import fr.ird.t3.entities.reference.WeightCategoryTreatmentTopiaDao;
+import org.nuiton.topia.persistence.TopiaException;
+
+import java.util.Collection;
+
+/**
+ * To obtain a ll available wieght convertors.
+ *
+ * @author Tony Chemit - dev(a)tchemit.fr
+ * @since 1.0
+ */
+public class LegacyWeightCategoryLogBookConvertorProvider extends WeightCategoryLogBookConvertorProvider {
+
+ public static final int OA = 1;
+ public static final int OI = 2;
+ public static final int OP = 5;
+ public static final int BO = 1;
+ public static final int BL = 2;
+ public static final int BI = 3;
+
+ private LegacyWeightCategoryLogBookConvertorProvider(Collection<WeightCategoryLogBookConvertor> convertors) {
+ super(convertors);
+ }
+
+ public static WeightCategoryLogBookConvertorProvider newInstance(T3TopiaPersistenceContext transaction) throws TopiaException {
+
+ WeightCategoryTreatmentTopiaDao dao = transaction.getWeightCategoryTreatmentDao();
+
+ Collection<WeightCategoryLogBookConvertor> converters =
+ Lists.newArrayList();
+
+ // BO = 1, BL = 2, BI = 3
+ // OA = 1, OI = 2, OP = 5
+
+ prepareForOA(dao, converters);
+ prepareForOI(dao, converters);
+ prepareForOP(dao, converters);
+
+ return new LegacyWeightCategoryLogBookConvertorProvider(converters);
+ }
+
+ private static void prepareForOA(WeightCategoryTreatmentTopiaDao dao,
+ Collection<WeightCategoryLogBookConvertor> converters) throws TopiaException {
+ {
+ // BO Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OABO(
+ getCategory(dao, OA, BO, null, null),
+ getCategory(dao, OA, BO, 0, 10),
+ getCategory(dao, OA, BO, 10, null)
+ );
+ converters.add(convertor);
+ }
+ {
+ // BL Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OABL(
+ getCategory(dao, OA, BL, null, null),
+ getCategory(dao, OA, BL, 0, 10),
+ getCategory(dao, OA, BL, 10, 30),
+ getCategory(dao, OA, BL, 30, null)
+ );
+ converters.add(convertor);
+ }
+ {
+ // BI Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OABI(
+ getCategory(dao, OA, BI, null, null),
+ getCategory(dao, OA, BI, 0, 10),
+ getCategory(dao, OA, BI, 10, 30),
+ getCategory(dao, OA, BI, 30, null)
+ );
+ converters.add(convertor);
+ }
+
+ }
+
+ private static void prepareForOI(WeightCategoryTreatmentTopiaDao dao,
+ Collection<WeightCategoryLogBookConvertor> converters) throws TopiaException {
+
+ {
+ // BO Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OIBO(
+ getCategory(dao, OI, BO, null, null),
+ getCategory(dao, OI, BO, 0, 10),
+ getCategory(dao, OI, BO, 10, null)
+ );
+ converters.add(convertor);
+ }
+ {
+ // BL Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OIBL(
+ getCategory(dao, OI, BL, null, null),
+ getCategory(dao, OI, BL, 0, 10),
+ getCategory(dao, OI, BL, 10, null)
+ );
+ converters.add(convertor);
+ }
+ {
+ // BI Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OIBI(
+ getCategory(dao, OI, BI, null, null),
+ getCategory(dao, OI, BI, 0, 10),
+ getCategory(dao, OI, BI, 10, null)
+ );
+ converters.add(convertor);
+ }
+ }
+
+ private static void prepareForOP(WeightCategoryTreatmentTopiaDao dao,
+ Collection<WeightCategoryLogBookConvertor> converters) throws TopiaException {
+
+ {
+ // BO Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OPBO(
+ getCategory(dao, OP, BO, null, null),
+ getCategory(dao, OP, BO, 0, 10),
+ getCategory(dao, OP, BO, 10, null)
+ );
+ converters.add(convertor);
+ }
+ {
+ // BL Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OPBL(
+ getCategory(dao, OP, BL, null, null),
+ getCategory(dao, OP, BL, 0, 10),
+ getCategory(dao, OP, BL, 10, null)
+ );
+ converters.add(convertor);
+ }
+ {
+ // BI Convertor
+ WeightCategoryLogBookConvertor convertor =
+ new WeightCategoryLogBookConvertorFOR_OPBI(
+ getCategory(dao, OP, BI, null, null),
+ getCategory(dao, OP, BI, 0, 10),
+ getCategory(dao, OP, BI, 10, null)
+ );
+ converters.add(convertor);
+ }
+ }
+
+
+}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABI.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABI.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABI.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import fr.ird.t3.entities.data.ElementaryCatch;
import fr.ird.t3.entities.reference.Species;
@@ -47,7 +47,7 @@ public class WeightCategoryLogBookConvertorFOR_OABI extends AbstractWeightCatego
WeightCategoryTreatment plus10Category,
WeightCategoryTreatment plus30Category) {
- super(WeightCategoryLogBookConvertorProvider.OA, WeightCategoryLogBookConvertorProvider.BI, minus10Category, unknownCategory);
+ super(LegacyWeightCategoryLogBookConvertorProvider.OA, LegacyWeightCategoryLogBookConvertorProvider.BI, minus10Category, unknownCategory);
this.plus10Category = plus10Category;
this.plus30Category = plus30Category;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABL.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABL.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABL.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
@@ -45,8 +45,8 @@ public class WeightCategoryLogBookConvertorFOR_OABL extends AbstractWeightCatego
WeightCategoryTreatment plus10Category,
WeightCategoryTreatment plus30Category) {
- super(WeightCategoryLogBookConvertorProvider.OA,
- WeightCategoryLogBookConvertorProvider.BL,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OA,
+ LegacyWeightCategoryLogBookConvertorProvider.BL,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
this.plus30Category = plus30Category;
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABO.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABO.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OABO.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
@@ -42,8 +42,8 @@ public class WeightCategoryLogBookConvertorFOR_OABO extends AbstractWeightCatego
WeightCategoryTreatment minus10Category,
WeightCategoryTreatment plus10Category) {
- super(WeightCategoryLogBookConvertorProvider.OA,
- WeightCategoryLogBookConvertorProvider.BO,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OA,
+ LegacyWeightCategoryLogBookConvertorProvider.BO,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBI.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBI.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBI.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import fr.ird.t3.entities.data.ElementaryCatch;
import fr.ird.t3.entities.reference.Species;
@@ -44,8 +44,8 @@ public class WeightCategoryLogBookConvertorFOR_OIBI extends AbstractWeightCatego
WeightCategoryTreatment minus10Category,
WeightCategoryTreatment plus10Category) {
- super(WeightCategoryLogBookConvertorProvider.OI,
- WeightCategoryLogBookConvertorProvider.BI,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OI,
+ LegacyWeightCategoryLogBookConvertorProvider.BI,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBL.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBL.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBL.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
@@ -42,8 +42,8 @@ public class WeightCategoryLogBookConvertorFOR_OIBL extends AbstractWeightCatego
WeightCategoryTreatment minus10Category,
WeightCategoryTreatment plus10Category) {
- super(WeightCategoryLogBookConvertorProvider.OI,
- WeightCategoryLogBookConvertorProvider.BL,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OI,
+ LegacyWeightCategoryLogBookConvertorProvider.BL,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBO.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBO.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OIBO.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
@@ -42,8 +42,8 @@ public class WeightCategoryLogBookConvertorFOR_OIBO extends AbstractWeightCatego
WeightCategoryTreatment minus10Category,
WeightCategoryTreatment plus10Category) {
- super(WeightCategoryLogBookConvertorProvider.OI,
- WeightCategoryLogBookConvertorProvider.BO,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OI,
+ LegacyWeightCategoryLogBookConvertorProvider.BO,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBI.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBI.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBI.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBI.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
@@ -42,8 +42,8 @@ public class WeightCategoryLogBookConvertorFOR_OPBI extends AbstractWeightCatego
WeightCategoryTreatment minus10Category,
WeightCategoryTreatment plus10Category) {
- super(WeightCategoryLogBookConvertorProvider.OP,
- WeightCategoryLogBookConvertorProvider.BI,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OP,
+ LegacyWeightCategoryLogBookConvertorProvider.BI,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBL.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBL.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBL.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBL.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
@@ -42,8 +42,8 @@ public class WeightCategoryLogBookConvertorFOR_OPBL extends AbstractWeightCatego
WeightCategoryTreatment minus10Category,
WeightCategoryTreatment plus10Category) {
- super(WeightCategoryLogBookConvertorProvider.OP,
- WeightCategoryLogBookConvertorProvider.BL,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OP,
+ LegacyWeightCategoryLogBookConvertorProvider.BL,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBO.java → t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBO.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OPBO.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/legacy/WeightCategoryLogBookConvertorFOR_OPBO.java
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
@@ -42,8 +42,8 @@ public class WeightCategoryLogBookConvertorFOR_OPBO extends AbstractWeightCatego
WeightCategoryTreatment minus10Category,
WeightCategoryTreatment plus10Category) {
- super(WeightCategoryLogBookConvertorProvider.OP,
- WeightCategoryLogBookConvertorProvider.BO,
+ super(LegacyWeightCategoryLogBookConvertorProvider.OP,
+ LegacyWeightCategoryLogBookConvertorProvider.BO,
minus10Category, unknownCategory);
this.plus10Category = plus10Category;
}
=====================================
t3-domain/src/test/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProviderTest.java → t3-domain/src/test/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProviderTest.java
=====================================
--- a/t3-domain/src/test/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorProviderTest.java
+++ b/t3-domain/src/test/java/fr/ird/t3/entities/conversion/legacy/LegacyWeightCategoryLogBookConvertorProviderTest.java
@@ -18,10 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-package fr.ird.t3.entities.conversion;
+package fr.ird.t3.entities.conversion.legacy;
import fr.ird.t3.entities.AbstractDatabaseTest;
import fr.ird.t3.entities.T3TopiaPersistenceContext;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorProvider;
import org.junit.Assert;
import org.junit.Test;
@@ -31,15 +32,15 @@ import org.junit.Test;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.0
*/
-public class WeightCategoryLogBookConvertorProviderTest extends AbstractDatabaseTest {
+public class LegacyWeightCategoryLogBookConvertorProviderTest extends AbstractDatabaseTest {
@Test
- public void newInstance() throws Exception {
+ public void newInstance() {
db.loadClassPathScript("/db/WeightCategoryLogBookConvertorProviderTest.sql");
try (T3TopiaPersistenceContext tx = beginTransaction()) {
- WeightCategoryLogBookConvertorProvider provider = WeightCategoryLogBookConvertorProvider.newInstance(tx);
+ WeightCategoryLogBookConvertorProvider provider = LegacyWeightCategoryLogBookConvertorProvider.newInstance(tx);
Assert.assertNotNull(provider);
}
=====================================
t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
=====================================
--- a/t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
+++ b/t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
@@ -24,16 +24,17 @@ package fr.ird.t3.services.migration;
import fr.ird.t3.entities.T3TopiaApplicationContext;
import fr.ird.t3.entities.T3TopiaPersistenceContext;
import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertor;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OABI;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OABL;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OABO;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OIBI;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OIBL;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OIBO;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OPBI;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OPBL;
-import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OPBO;
import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorProvider;
+import fr.ird.t3.entities.conversion.legacy.LegacyWeightCategoryLogBookConvertorProvider;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OABI;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OABL;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OABO;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OIBI;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OIBL;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OIBO;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OPBI;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OPBL;
+import fr.ird.t3.entities.conversion.legacy.WeightCategoryLogBookConvertorFOR_OPBO;
import fr.ird.t3.entities.reference.Ocean;
import fr.ird.t3.entities.reference.OceanTopiaDao;
import fr.ird.t3.entities.reference.SchoolType;
@@ -119,7 +120,7 @@ public class T3MigrationTest {
try (T3TopiaPersistenceContext persistenceContext = rootContext.newPersistenceContext()) {
- WeightCategoryLogBookConvertorProvider convertorProvider = WeightCategoryLogBookConvertorProvider.newInstance(persistenceContext);
+ WeightCategoryLogBookConvertorProvider convertorProvider = LegacyWeightCategoryLogBookConvertorProvider.newInstance(persistenceContext);
OceanTopiaDao oceanDao = persistenceContext.getOceanDao();
speciesDao = persistenceContext.getSpeciesDao();
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/fcbee3056fb34ba8001e0f2ead801be3…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/fcbee3056fb34ba8001e0f2ead801be3…
You're receiving this email because of your account on gitlab.com.
1
0
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
f6afe830 by Tony CHEMIT at 2018-02-23T03:41:19+01:00
use t3 data 1.3
- - - - -
1 changed file:
- pom.xml
Changes:
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -99,7 +99,7 @@
<organizationId>ultreiaio</organizationId>
<projectId>ird-t3</projectId>
<applicationName>t3</applicationName>
- <t3-data.version>1.3-SNAPSHOT</t3-data.version>
+ <t3-data.version>1.3</t3-data.version>
<env>dev</env>
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/f6afe830521894eb83279a0e94478804…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/f6afe830521894eb83279a0e94478804…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-t3][develop] 2 commits: [N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (Mise en…
by Tony CHEMIT 23 Feb '18
by Tony CHEMIT 23 Feb '18
23 Feb '18
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
3e1ae6d6 by Tony CHEMIT at 2018-02-22T22:04:44+01:00
[N0.3] Rendre la conversion des catégories de poids AVDTH->T3 générique (Mise en place de la persistence) (See #244)
- - - - -
4f2c864f by Tony CHEMIT at 2018-02-23T03:28:15+01:00
Ajouter un nouveau package avec des bases h2 (vide et avec le référentiel) (closes #285)
- - - - -
25 changed files:
- + .mvn/deploy
- pom.xml
- + t3-domain/.mvn/deploy
- t3-domain/pom.xml
- t3-domain/src/main/java/fr/ird/t3/entities/T3JdbcHelper.java
- t3-domain/src/main/java/fr/ird/t3/entities/T3TopiaApplicationContext.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/AbstractWeightCategoryLogBookConvertor.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertor.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABI.java
- t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBI.java
- t3-domain/src/main/java/fr/ird/t3/entities/reference/LengthWeightConversionImpl.java
- + t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionImpl.java
- + t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionSpeciesImpl.java
- t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_1.java
- + t3-domain/src/main/resources/db/migration/V2_1_10_add-WeightCategoryLogBookConversion-table.sql
- + t3-domain/src/main/resources/db/migration/V2_1_11_fill-WeightCategoryLogBookConversion-table.sql
- t3-domain/src/main/resources/t3-datadb.properties
- t3-domain/src/main/xmi/t3-persistence.properties
- t3-domain/src/main/xmi/t3-persistence.zargo
- t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
- t3-installer/pom.xml
- t3-installer/src/main/assembly/bin.xml
- t3-test/src/main/java/fr/ird/t3/FakeT3ServiceContext.java
- t3-test/src/main/resources/t3-TopiaContextImpl.properties
- + t3/.mvn/deploy
Changes:
=====================================
.mvn/deploy
=====================================
--- /dev/null
+++ b/.mvn/deploy
=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2018.20</version>
+ <version>2018.21</version>
</parent>
<groupId>fr.ird.t3</groupId>
@@ -132,9 +132,6 @@
<gitlab.changesAuthorEmail>dev(a)tchemit.fr</gitlab.changesAuthorEmail>
<gitlab.trackers>Anomalie,Evolution,Tâche</gitlab.trackers>
- <!-- deploy nothing -->
- <maven.deploy.skip>true</maven.deploy.skip>
-
</properties>
<dependencyManagement>
@@ -461,7 +458,7 @@
<artifactId>wagon-maven-plugin</artifactId>
<executions>
<execution>
- <id>get-referential-files</id>
+ <id>get-h2-files</id>
<phase>test-compile</phase>
<goals>
<goal>download-single</goal>
@@ -469,7 +466,7 @@
<configuration>
<serverId>doc.ultreia.io</serverId>
<url>scpexe://ultreia.io/var/www/t3/private</url>
- <fromFile>t3-data-${t3-data.version}-referential.zip</fromFile>
+ <fromFile>t3-data-${t3-data.version}-h2.zip</fromFile>
<toDir>${project.build.directory}</toDir>
</configuration>
</execution>
=====================================
t3-domain/.mvn/deploy
=====================================
--- /dev/null
+++ b/t3-domain/.mvn/deploy
=====================================
t3-domain/pom.xml
=====================================
--- a/t3-domain/pom.xml
+++ b/t3-domain/pom.xml
@@ -37,6 +37,11 @@
<config.generatePropertyChangeSupport>true</config.generatePropertyChangeSupport>
<config.packageName>fr.ird.t3</config.packageName>
<config.useNuitonI18n>true</config.useNuitonI18n>
+
+ <maven.deploy.skip>false</maven.deploy.skip>
+ <maven.javadoc.skip>false</maven.javadoc.skip>
+ <maven.source.skip>false</maven.source.skip>
+ <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
</properties>
<dependencies>
@@ -107,6 +112,10 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/T3JdbcHelper.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/T3JdbcHelper.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/T3JdbcHelper.java
@@ -21,6 +21,17 @@ package fr.ird.t3.entities;
* #L%
*/
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.jdbc.JdbcConfiguration;
+import org.nuiton.topia.persistence.jdbc.JdbcHelper;
+import org.nuiton.util.ZipUtil;
+import org.nuiton.util.sql.SqlFileReader;
+import org.nuiton.version.Version;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@@ -29,12 +40,12 @@ import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
+import java.nio.file.Paths;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
-import org.nuiton.topia.persistence.jdbc.JdbcConfiguration;
-import org.nuiton.topia.persistence.jdbc.JdbcHelper;
-import org.nuiton.util.sql.SqlFileReader;
+import java.util.Collections;
+import java.util.List;
/**
* Created by tchemit on 03/04/17.
@@ -43,7 +54,9 @@ import org.nuiton.util.sql.SqlFileReader;
*/
public class T3JdbcHelper extends JdbcHelper {
- public static final int BUZZER_SIZE = 100;
+ private static final Log log = LogFactory.getLog(T3JdbcHelper.class);
+
+ private static final int BUZZER_SIZE = 100;
T3JdbcHelper(JdbcConfiguration jdbcConfiguration) {
super(jdbcConfiguration);
@@ -120,4 +133,49 @@ public class T3JdbcHelper extends JdbcHelper {
runSelectOnString("SCRIPT TO '" + file.getAbsolutePath() + "'" + options);
}
+ public static File getScriptsDirectory(File buildRootDirectory, String classifier, Version version) throws IOException {
+
+ File scriptsZip = Paths.get(buildRootDirectory.getAbsolutePath())
+ .resolve("target")
+ .resolve(String.format("t3-data-%s-%s.zip", version, classifier))
+ .toFile();
+ ZipUtil.uncompress(scriptsZip, scriptsZip.getParentFile());
+
+ File target = Paths.get(buildRootDirectory.getAbsolutePath())
+ .resolve("target")
+ .resolve(String.format("t3-data-%s-%s", classifier, version))
+ .toFile();
+ Preconditions.checkState(target.exists(), "Could not find script directory: " + target);
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Scripts directory: %s", target));
+ }
+ return target;
+ }
+
+ public static void importReferential(File buildRootDirectory, Version t3DataVersion, T3JdbcHelper jdbcH2Helper) throws IOException {
+
+ File scriptsDirectory = getScriptsDirectory(buildRootDirectory, "referential", t3DataVersion);
+
+ String[] list = scriptsDirectory.list((dir, name) -> name.endsWith(".sql"));
+ ImmutableSet.Builder<File> filesBuilder = ImmutableSet.builder();
+ if (list != null) {
+ List<String> scriptsName = Lists.newArrayList(list);
+ Collections.sort(scriptsName);
+ for (String ddlScriptName : scriptsName) {
+ filesBuilder.add(new File(scriptsDirectory, ddlScriptName));
+ }
+ }
+ ImmutableSet<File> scriptsFile = filesBuilder.build();
+
+ if (log.isInfoEnabled()) {
+ log.info("Will load referentiel in h2 database ");
+ }
+
+ for (File file : scriptsFile) {
+ if (log.isInfoEnabled()) {
+ log.info(" o Loading sql script ...(" + file.getName() + ")");
+ }
+ jdbcH2Helper.executeSql(file);
+ }
+ }
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/T3TopiaApplicationContext.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/T3TopiaApplicationContext.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/T3TopiaApplicationContext.java
@@ -24,12 +24,8 @@ package fr.ird.t3.entities;
import com.google.common.base.Charsets;
import fr.ird.t3.T3IOUtil;
import fr.ird.t3.entities.user.JdbcConfiguration;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Properties;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.BeanTopiaConfiguration;
import org.nuiton.topia.persistence.HibernateAvailableSettings;
import org.nuiton.topia.persistence.TopiaConfiguration;
@@ -37,11 +33,19 @@ import org.nuiton.topia.persistence.TopiaConfigurationBuilder;
import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.util.RecursiveProperties;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Objects;
+import java.util.Properties;
+
public class T3TopiaApplicationContext extends AbstractT3TopiaApplicationContext {
private static final String T3_EMBEDDED_DB_PROPERTIES = "/t3-TopiaContextImpl.properties";
-
private static final String T3_USER_DB_PROPERTIES = "/t3-datadb.properties";
+ private static final Log log = LogFactory.getLog(T3TopiaApplicationContext.class);
/**
* Open a new topia root context from the given jdbc configuration.
@@ -81,8 +85,7 @@ public class T3TopiaApplicationContext extends AbstractT3TopiaApplicationContext
/**
- * Open a new topia root context for the user t3 db using a embedded db (
- * this should be a h2 db).
+ * Open a new topia root context for the user t3 db using a embedded db (this should be a h2 db).
* <p/>
* This is mainly used by tests.
*
@@ -107,6 +110,35 @@ public class T3TopiaApplicationContext extends AbstractT3TopiaApplicationContext
return new T3TopiaApplicationContext(topiaConfiguration);
}
+ /**
+ * Open a new topia root context for the user t3 db using a embedded db (this should be a h2 db).
+ * <p/>
+ * This is mainly used by tests.
+ *
+ * @param dbLocation file where to store the db.
+ * @param backupFile backup file to load in db
+ * @return the new fresh root context of the db
+ */
+ public static T3TopiaApplicationContext newEmbeddedBackupDb(File dbLocation, File backupFile) {
+
+ Properties configuration = new Properties();
+
+ try (InputStream stream = T3TopiaApplicationContext.class.getResourceAsStream(T3_EMBEDDED_DB_PROPERTIES)) {
+ configuration.load(stream);
+ } catch (IOException e) {
+ throw new TopiaException("Could not load input file " + T3_EMBEDDED_DB_PROPERTIES, e);
+ }
+
+ configuration.put(HibernateAvailableSettings.URL, "jdbc:h2:file:" + dbLocation);
+ BeanTopiaConfiguration topiaConfiguration = new TopiaConfigurationBuilder().readProperties(configuration);
+ topiaConfiguration.setValidateSchema(false);
+ topiaConfiguration.setInitSchema(false);
+ T3TopiaApplicationContext topiaApplicationContext = new T3TopiaApplicationContext(topiaConfiguration);
+ log.info("Laoding database from a backup: " + backupFile);
+ topiaApplicationContext.newJdbcHelper().executeSql(Objects.requireNonNull(backupFile));
+ return topiaApplicationContext;
+ }
+
public T3JdbcHelper newJdbcHelper() {
return new T3JdbcHelper(getConfiguration());
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/AbstractWeightCategoryLogBookConvertor.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/AbstractWeightCategoryLogBookConvertor.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/AbstractWeightCategoryLogBookConvertor.java
@@ -20,14 +20,16 @@
*/
package fr.ird.t3.entities.conversion;
-import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
import fr.ird.t3.entities.reference.Ocean;
import fr.ird.t3.entities.reference.SchoolType;
import fr.ird.t3.entities.reference.WeightCategoryTreatment;
+import org.apache.commons.collections.CollectionUtils;
+
import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
-import org.apache.commons.collections.CollectionUtils;
/**
* Abstract log book convertor.
@@ -122,8 +124,7 @@ public abstract class AbstractWeightCategoryLogBookConvertor implements WeightCa
if (CollectionUtils.isNotEmpty(catches)) {
for (ElementaryCatch aCatch : catches) {
- Integer weightCategoryCode =
- aCatch.getWeightCategoryLogBook().getCode();
+ Integer weightCategoryCode = aCatch.getWeightCategoryLogBook().getCode();
Float ratio = distribution.get(weightCategoryCode);
if (ratio != null) {
result += ratio * aCatch.getCatchWeightRf2();
@@ -141,6 +142,7 @@ public abstract class AbstractWeightCategoryLogBookConvertor implements WeightCa
*
* @return the distributions
*/
+ @Override
public Map<WeightCategoryTreatment, Map<Integer, Float>> getDistributions() {
if (distributions == null) {
distributions = buildDistributions();
@@ -149,6 +151,20 @@ public abstract class AbstractWeightCategoryLogBookConvertor implements WeightCa
}
@Override
+ public Map<String, Map<Integer, Float>> getDistributionsByIds() {
+ Map<String, Map<Integer, Float>> distributionsToSave = new LinkedHashMap<>();
+ for (Map.Entry<WeightCategoryTreatment, Map<Integer, Float>> e : getDistributions().entrySet()) {
+ distributionsToSave.put(e.getKey().getTopiaId(), e.getValue());
+ }
+ return distributionsToSave;
+ }
+
+ @Override
+ public Map<Integer, Float> getDistributions(WeightCategoryTreatment treatment) {
+ return getDistributions().get(treatment);
+ }
+
+ @Override
public final WeightCategoryTreatment getMinus10Category() {
return minus10Category;
}
@@ -165,12 +181,11 @@ public abstract class AbstractWeightCategoryLogBookConvertor implements WeightCa
Map<WeightCategoryTreatment, Map<Integer, Float>> distributions,
float unknownWeight) {
- Map<WeightCategoryTreatment, Float> unknownResult = Maps.newHashMap();
+ Map<WeightCategoryTreatment, Float> unknownResult = new HashMap<>();
float totalWeight = 0f;
- for (Map.Entry<WeightCategoryTreatment, Map<Integer, Float>> e :
- distributions.entrySet()) {
+ for (Map.Entry<WeightCategoryTreatment, Map<Integer, Float>> e : distributions.entrySet()) {
WeightCategoryTreatment category = e.getKey();
@@ -193,7 +208,7 @@ public abstract class AbstractWeightCategoryLogBookConvertor implements WeightCa
} else {
// there is some unknown weight to redistribute
- result = Maps.newHashMap();
+ result = new HashMap<>();
if (totalWeight == 0) {
@@ -224,9 +239,9 @@ public abstract class AbstractWeightCategoryLogBookConvertor implements WeightCa
protected final Map<WeightCategoryTreatment, Float> defaultDistributeForSpecie2(
float totalWeight) {
- Map<WeightCategoryTreatment, Float> result = Maps.newHashMap();
+ Map<WeightCategoryTreatment, Float> result = new HashMap<>();
- // for species SKJ (code 2) : all goes to -10 kg categorie
+ // for species SKJ (code 2) : all goes to -10 kg category
result.put(getMinus10Category(), totalWeight);
return result;
}
@@ -234,9 +249,9 @@ public abstract class AbstractWeightCategoryLogBookConvertor implements WeightCa
protected final Map<WeightCategoryTreatment, Float> defaultDistributeForOtherSpecie(
float unknownWeight) {
- Map<WeightCategoryTreatment, Float> result = Maps.newHashMap();
+ Map<WeightCategoryTreatment, Float> result = new HashMap<>();
- // only keep unknown categorie weight
+ // only keep unknown category weight
result.put(getUnkownCategory(), unknownWeight);
return result;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertor.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertor.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertor.java
@@ -25,6 +25,7 @@ import fr.ird.t3.entities.reference.Ocean;
import fr.ird.t3.entities.reference.SchoolType;
import fr.ird.t3.entities.reference.Species;
import fr.ird.t3.entities.reference.WeightCategoryTreatment;
+
import java.util.Collection;
import java.util.Map;
@@ -39,8 +40,13 @@ public interface WeightCategoryLogBookConvertor {
boolean accept(Ocean ocean, SchoolType schoolType);
- Map<WeightCategoryTreatment, Float> distribute(Species species,
- Collection<ElementaryCatch> catches);
+ Map<WeightCategoryTreatment, Float> distribute(Species species, Collection<ElementaryCatch> catches);
+
+ Map<String, Map<Integer, Float>> getDistributionsByIds() ;
+
+ Map<WeightCategoryTreatment, Map<Integer, Float>> getDistributions();
+
+ Map<Integer, Float> getDistributions(WeightCategoryTreatment treatment);
WeightCategoryTreatment getMinus10Category();
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABI.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABI.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OABI.java
@@ -20,12 +20,14 @@
*/
package fr.ird.t3.entities.conversion;
-import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
import fr.ird.t3.entities.reference.Species;
import fr.ird.t3.entities.reference.WeightCategoryTreatment;
+
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
/**
* To convert weight categories for Atlantic ocean and undetermined school type.
@@ -45,19 +47,16 @@ public class WeightCategoryLogBookConvertorFOR_OABI extends AbstractWeightCatego
WeightCategoryTreatment plus10Category,
WeightCategoryTreatment plus30Category) {
- super(WeightCategoryLogBookConvertorProvider.OA,
- WeightCategoryLogBookConvertorProvider.BI,
- minus10Category, unknownCategory);
+ super(WeightCategoryLogBookConvertorProvider.OA, WeightCategoryLogBookConvertorProvider.BI, minus10Category, unknownCategory);
this.plus10Category = plus10Category;
this.plus30Category = plus30Category;
}
@Override
protected Map<WeightCategoryTreatment, Map<Integer, Float>> buildDistributions() {
- Map<WeightCategoryTreatment, Map<Integer, Float>> result =
- Maps.newHashMap();
+ Map<WeightCategoryTreatment, Map<Integer, Float>> result = new HashMap<>();
- Map<Integer, Float> distributionMinus10 = Maps.newTreeMap();
+ Map<Integer, Float> distributionMinus10 = new TreeMap<>();
// 1 + 2 + 4*(0.2) + 10
distributionMinus10.put(1, 1f);
@@ -68,7 +67,7 @@ public class WeightCategoryLogBookConvertorFOR_OABI extends AbstractWeightCatego
result.put(minus10Category, distributionMinus10);
// 3 + 4*(0.8) + 6*(0.5) + 11*(0.1) + 12
- Map<Integer, Float> distributionPlus10 = Maps.newTreeMap();
+ Map<Integer, Float> distributionPlus10 = new TreeMap<>();
distributionPlus10.put(3, 1f);
distributionPlus10.put(4, 0.8f);
distributionPlus10.put(6, 0.5f);
@@ -78,7 +77,7 @@ public class WeightCategoryLogBookConvertorFOR_OABI extends AbstractWeightCatego
result.put(plus10Category, distributionPlus10);
// 5 + 6*(0.5) + 7 + 8 + 11*(0.9) + 13
- Map<Integer, Float> distributionPlus30 = Maps.newTreeMap();
+ Map<Integer, Float> distributionPlus30 = new TreeMap<>();
distributionPlus30.put(5, 1f);
distributionPlus30.put(6, 0.5f);
distributionPlus30.put(7, 1f);
@@ -92,14 +91,13 @@ public class WeightCategoryLogBookConvertorFOR_OABI extends AbstractWeightCatego
}
@Override
- public final Map<WeightCategoryTreatment, Float> distribute(Species species,
- Collection<ElementaryCatch> catches) {
+ public final Map<WeightCategoryTreatment, Float> distribute(Species species, Collection<ElementaryCatch> catches) {
float totalWeight = getTotalWeight(catches);
if (totalWeight == 0) {
// this means no catches
- return Maps.newHashMap();
+ return new HashMap<>();
}
Map<WeightCategoryTreatment, Float> result;
@@ -111,20 +109,22 @@ public class WeightCategoryLogBookConvertorFOR_OABI extends AbstractWeightCatego
float unknownWeight = getUnknownWeight(catches);
- result = defaultDistributeForSpecie1or3or4(catches,
- getDistributions(),
- unknownWeight
- );
+ result = defaultDistributeForSpecie1or3or4(catches, getDistributions(), unknownWeight);
break;
case 2:
-
- result = defaultDistributeForSpecie2(totalWeight);
-
+// result = defaultDistributeForSpecie2(totalWeight);
+ result = new HashMap<>();
+ // for species SKJ (code 2) : all goes to -10 kg category
+ result.put(getMinus10Category(), totalWeight);
break;
default:
- result = defaultDistributeForOtherSpecie(totalWeight);
+// result = defaultDistributeForOtherSpecie(totalWeight);
+ result = new HashMap<>();
+
+ // only keep unknown category weight
+ result.put(getUnkownCategory(), totalWeight);
}
return result;
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBI.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBI.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/conversion/WeightCategoryLogBookConvertorFOR_OIBI.java
@@ -20,12 +20,14 @@
*/
package fr.ird.t3.entities.conversion;
-import com.google.common.collect.Maps;
import fr.ird.t3.entities.data.ElementaryCatch;
import fr.ird.t3.entities.reference.Species;
import fr.ird.t3.entities.reference.WeightCategoryTreatment;
+
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
/**
* To convert weight categories for Indian ocean and undetermined school type.
@@ -50,11 +52,10 @@ public class WeightCategoryLogBookConvertorFOR_OIBI extends AbstractWeightCatego
@Override
protected Map<WeightCategoryTreatment, Map<Integer, Float>> buildDistributions() {
- Map<WeightCategoryTreatment, Map<Integer, Float>> result =
- Maps.newHashMap();
+ Map<WeightCategoryTreatment, Map<Integer, Float>> result = new HashMap<>();
// 1 + 2 + 4*(0.2) + 10
- Map<Integer, Float> distributionMinus10 = Maps.newTreeMap();
+ Map<Integer, Float> distributionMinus10 = new TreeMap<>();
distributionMinus10.put(1, 1f);
distributionMinus10.put(2, 1f);
distributionMinus10.put(4, 0.2f);
@@ -63,7 +64,7 @@ public class WeightCategoryLogBookConvertorFOR_OIBI extends AbstractWeightCatego
result.put(minus10Category, distributionMinus10);
// 3 + 4*(0.8) + 5 + 6 + 7 + 8 + 11 + 12 + 13
- Map<Integer, Float> distributionPlus10 = Maps.newTreeMap();
+ Map<Integer, Float> distributionPlus10 = new TreeMap<>();
distributionPlus10.put(3, 1f);
distributionPlus10.put(4, 0.8f);
distributionPlus10.put(5, 1f);
@@ -79,14 +80,13 @@ public class WeightCategoryLogBookConvertorFOR_OIBI extends AbstractWeightCatego
}
@Override
- public final Map<WeightCategoryTreatment, Float> distribute(Species species,
- Collection<ElementaryCatch> catches) {
+ public final Map<WeightCategoryTreatment, Float> distribute(Species species, Collection<ElementaryCatch> catches) {
float totalWeight = getTotalWeight(catches);
if (totalWeight == 0) {
// this means no catches
- return Maps.newHashMap();
+ return new HashMap<>();
}
Map<WeightCategoryTreatment, Float> result;
@@ -95,22 +95,13 @@ public class WeightCategoryLogBookConvertorFOR_OIBI extends AbstractWeightCatego
case 1:
case 3:
case 4:
-
float unknownWeight = getUnknownWeight(catches);
-
- result = defaultDistributeForSpecie1or3or4(catches,
- getDistributions(),
- unknownWeight
- );
-
+ result = defaultDistributeForSpecie1or3or4(catches, getDistributions(), unknownWeight);
break;
case 2:
-
result = defaultDistributeForSpecie2(totalWeight);
-
break;
default:
-
result = defaultDistributeForOtherSpecie(totalWeight);
}
return result;
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/reference/LengthWeightConversionImpl.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/entities/reference/LengthWeightConversionImpl.java
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/reference/LengthWeightConversionImpl.java
@@ -20,29 +20,22 @@
*/
package fr.ird.t3.entities.reference;
-import com.google.common.collect.Maps;
import fr.ird.t3.entities.LengthWeightConversionHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import java.util.Map;
+import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
public class LengthWeightConversionImpl extends LengthWeightConversionAbstract {
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(LengthWeightConversionImpl.class);
-
+ private static final Log log = LogFactory.getLog(LengthWeightConversionImpl.class);
private static final long serialVersionUID = 1L;
-
-
- private static final Pattern COEFFICIENTS_PATTERN =
- Pattern.compile("(.+)=(.+)");
-
+ private static final Pattern COEFFICIENTS_PATTERN = Pattern.compile("(.+)=(.+)");
/** variable poids à utiliser dans la relation taille */
public static final String VARIABLE_POIDS = "P";
-
/** variable taille à utiliser dans la relation poids */
public static final String VARIABLE_TAILLE = "L";
@@ -59,19 +52,19 @@ public class LengthWeightConversionImpl extends LengthWeightConversionAbstract {
}
@Override
- public float computeWeight(float longueur) {
+ public Float computeWeight(float longueur) {
return LengthWeightConversionHelper.computeWeight(this, longueur);
}
@Override
- public float computeWeightFromLFLengthClass(int lengthClass) {
+ public Float computeWeightFromLFLengthClass(int lengthClass) {
Integer lfLengthClassStep = species.getLfLengthClassStep();
float longueur = lengthClass + lfLengthClassStep / 2f;
return LengthWeightConversionHelper.computeWeight(this, longueur);
}
@Override
- public float computeLength(float poids) {
+ public Float computeLength(float poids) {
return LengthWeightConversionHelper.computeLength(this, poids);
}
@@ -92,31 +85,27 @@ public class LengthWeightConversionImpl extends LengthWeightConversionAbstract {
@Override
public Map<String, Double> getCoefficientValues() {
- Map<String, Double> result = Maps.newTreeMap();
+ Map<String, Double> result = new TreeMap<>();
String coefficients = getCoefficients();
if (coefficients != null) {
for (String coefficientDef : coefficients.split(":")) {
- Matcher matcher =
- COEFFICIENTS_PATTERN.matcher(coefficientDef.trim());
+ Matcher matcher = COEFFICIENTS_PATTERN.matcher(coefficientDef.trim());
if (log.isDebugEnabled()) {
- log.debug("constant to test = " + coefficientDef);
+ log.debug(String.format("constant to test = %s", coefficientDef));
}
if (matcher.matches()) {
-
String key = matcher.group(1);
String val = matcher.group(2);
try {
Double d = Double.valueOf(val);
result.put(key, d);
if (log.isDebugEnabled()) {
- log.debug("detets coefficient " + key + '=' +
- val);
+ log.debug(String.format("detect coefficient %s=%s", key, val));
}
} catch (NumberFormatException e) {
// pas pu recupere le nombre...
if (log.isWarnEnabled()) {
- log.warn("could not parse double " + val +
- " for coefficient " + key);
+ log.warn(String.format("could not parse double %s for coefficient %s", val, key));
}
}
}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionImpl.java
=====================================
--- /dev/null
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionImpl.java
@@ -0,0 +1,49 @@
+package fr.ird.t3.entities.reference;
+
+/*-
+ * #%L
+ * T3 :: Domain
+ * %%
+ * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import java.util.Date;
+
+public class WeightCategoryLogBookConversionImpl extends WeightCategoryLogBookConversionAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public int getCode() {
+ return 0;
+ }
+
+ @Override
+ public String getLabel1() {
+ return null;
+ }
+
+ @Override
+ public boolean isStatus() {
+ return true;
+ }
+
+ @Override
+ public boolean acceptDate(Date date) {
+ return !date.before(getBeginDate()) && (getEndDate() == null || !date.after(getEndDate()));
+ }
+}
=====================================
t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionSpeciesImpl.java
=====================================
--- /dev/null
+++ b/t3-domain/src/main/java/fr/ird/t3/entities/reference/WeightCategoryLogBookConversionSpeciesImpl.java
@@ -0,0 +1,59 @@
+package fr.ird.t3.entities.reference;
+
+/*-
+ * #%L
+ * T3 :: Domain
+ * %%
+ * Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import java.util.Map;
+
+public class WeightCategoryLogBookConversionSpeciesImpl extends WeightCategoryLogBookConversionSpeciesAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
+
+ public static String toString(Map<String, Map<Integer, Float>> distributions) {
+ return gson.toJson(distributions);
+ }
+
+ @Override
+ public int getCode() {
+ return 0;
+ }
+
+ @Override
+ public String getLabel1() {
+ return null;
+ }
+
+ @Override
+ public boolean isStatus() {
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Map<String, Map<Integer, Float>> getDistributions2() {
+ return gson.fromJson(getDistribution(), Map.class);
+ }
+}
=====================================
t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_1.java
=====================================
--- a/t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_1.java
+++ b/t3-domain/src/main/java/fr/ird/t3/services/migration/T3MigrationCallbackV2_1.java
@@ -123,6 +123,8 @@ public class T3MigrationCallbackV2_1 extends T3MigrationCallbackSupport {
addScript("08", "remove-Trip-fields", queries);
addScript("09", "fill-Harbour-ocean.sql", queries);
+ addScript("10", "add-WeightCategoryLogBookConversion-table.sql", queries);
+ addScript("11", "fill-WeightCategoryLogBookConversion-table.sql", queries);
}
=====================================
t3-domain/src/main/resources/db/migration/V2_1_10_add-WeightCategoryLogBookConversion-table.sql
=====================================
--- /dev/null
+++ b/t3-domain/src/main/resources/db/migration/V2_1_10_add-WeightCategoryLogBookConversion-table.sql
@@ -0,0 +1,39 @@
+---
+-- #%L
+-- T3 :: Domain
+-- %%
+-- Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU Affero 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 Affero General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+-- #L%
+---
+-- drop TABLE IF EXISTS weightcategorylogbookconversion CASCADE ;
+-- drop TABLE IF EXISTS weightcategorylogbookconversionspecies CASCADE ;
+-- drop TABLE IF EXISTS weightcategorylogbookconversionspecies_species CASCADE ;
+
+CREATE TABLE WeightCategoryLogBookConversion( topiaid VARCHAR(255) PRIMARY KEY NOT NULL, topiaversion BIGINT NOT NULL, topiacreatedate TIMESTAMP NOT NULL, ocean VARCHAR(255) NOT NULL, schoolType VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, beginDate DATE NOT NULL, endDate DATE);
+CREATE UNIQUE INDEX uk_WeightCategoryLogBookConversion ON WeightCategoryLogBookConversion(version, ocean, schoolType, beginDate);
+ALTER TABLE WeightCategoryLogBookConversion ADD CONSTRAINT fk_WeightCategoryLogBookConversion_ocean FOREIGN KEY (ocean) REFERENCES Ocean(topiaid);
+ALTER TABLE WeightCategoryLogBookConversion ADD CONSTRAINT fk_WeightCategoryLogBookConversion_schoolType FOREIGN KEY (schoolType) REFERENCES SchoolType(topiaid);
+CREATE INDEX idx_WeightCategoryLogBookConversion_ocean ON WeightCategoryLogBookConversion(ocean);
+CREATE INDEX idx_WeightCategoryLogBookConversion_schoolType ON WeightCategoryLogBookConversion(schoolType);
+
+CREATE TABLE WeightCategoryLogBookConversionSpecies( topiaid VARCHAR(255) PRIMARY KEY NOT NULL, topiaversion BIGINT NOT NULL, topiacreatedate TIMESTAMP NOT NULL, parent VARCHAR(255) NOT NULL, parent_idx int, distribution TEXT NOT NULL);
+ALTER TABLE WeightCategoryLogBookConversionSpecies ADD CONSTRAINT fk_WeightCategoryLogBookConversionSpecies_parent FOREIGN KEY (parent) REFERENCES WeightCategoryLogBookConversion(topiaid);
+CREATE INDEX idx_WeightCategoryLogBookConversion_parent ON WeightCategoryLogBookConversionSpecies(parent);
+
+CREATE TABLE WeightCategoryLogBookConversionSpecies_Species(weightCategoryLogBookConversionSpecies VARCHAR(255) NOT NULL, species VARCHAR(255) NOT NULL);
+ALTER TABLE WeightCategoryLogBookConversionSpecies_Species ADD CONSTRAINT pk_WeightCategoryLogBookConversionS PRIMARY KEY (weightCategoryLogBookConversionSpecies,species);
+ALTER TABLE WeightCategoryLogBookConversionSpecies_Species ADD CONSTRAINT fk_WeightCategoryLogBookConversionS_w FOREIGN KEY (weightCategoryLogBookConversionSpecies) REFERENCES WeightCategoryLogBookConversionSpecies(topiaid);
+ALTER TABLE WeightCategoryLogBookConversionSpecies_Species ADD CONSTRAINT fk_WeightCategoryLogBookConversionS_s FOREIGN KEY (species) REFERENCES Species(topiaid);
\ No newline at end of file
=====================================
t3-domain/src/main/resources/db/migration/V2_1_11_fill-WeightCategoryLogBookConversion-table.sql
=====================================
--- /dev/null
+++ b/t3-domain/src/main/resources/db/migration/V2_1_11_fill-WeightCategoryLogBookConversion-table.sql
@@ -0,0 +1,300 @@
+---
+-- #%L
+-- T3 :: Domain
+-- %%
+-- Copyright (C) 2010 - 2018 IRD, Code Lutin, Ultreia.io
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU Affero 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 Affero General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+-- #L%
+---
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#00', 1, '2018-02-22 21:43:17.612000', 'fr.ird.t3.entities.reference.Ocean#1297580528924#0.4917298410119624', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.9747685881931636', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#01', 1, '2018-02-22 21:43:17.676000', 'fr.ird.t3.entities.reference.Ocean#1297580528924#0.4917298410119624', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.8923578380543445', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#02', 1, '2018-02-22 21:43:17.677000', 'fr.ird.t3.entities.reference.Ocean#1297580528924#0.4917298410119624', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.633774803291473', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#03', 1, '2018-02-22 21:43:17.677000', 'fr.ird.t3.entities.reference.Ocean#1297580528924#0.02462443299831396', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.9747685881931636', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#04', 1, '2018-02-22 21:43:17.680000', 'fr.ird.t3.entities.reference.Ocean#1297580528924#0.02462443299831396', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.8923578380543445', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#05', 1, '2018-02-22 21:43:17.681000', 'fr.ird.t3.entities.reference.Ocean#1297580528924#0.02462443299831396', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.633774803291473', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#06', 1, '2018-02-22 21:43:17.685000', 'fr.ird.t3.entities.reference.Ocean#1297580528925#0.868563686958073', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.9747685881931636', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#07', 1, '2018-02-22 21:43:17.689000', 'fr.ird.t3.entities.reference.Ocean#1297580528925#0.868563686958073', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.8923578380543445', '1.0', '1970-01-01', null);
+INSERT INTO public.weightcategorylogbookconversion (topiaid, topiaversion, topiacreatedate, ocean, schooltype, version, begindate, enddate) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#08', 1, '2018-02-22 21:43:17.690000', 'fr.ird.t3.entities.reference.Ocean#1297580528925#0.868563686958073', 'fr.ird.t3.entities.reference.SchoolType#1297580528908#0.633774803291473', '1.0', '1970-01-01', null);
+
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#00', 1, '2018-02-22 21:43:17.758000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#00', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830509#0.5499777108807193": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#01', 1, '2018-02-22 21:43:17.790000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#00', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830509#0.44386731073429053": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#02', 1, '2018-02-22 21:43:17.808000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#00', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830509#0.5237318856431237": {
+ "3": 1.0,
+ "4": 0.8,
+ "6": 0.5,
+ "11": 0.1,
+ "12": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830509#0.5499777108807192": {
+ "5": 1.0,
+ "6": 0.5,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 0.9,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830509#0.44386731073429053": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#03', 1, '2018-02-22 21:43:17.811000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#01', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830505#0.988038536400382": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#04', 1, '2018-02-22 21:43:17.821000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#01', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830500#0.6310700924396421": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#05', 1, '2018-02-22 21:43:17.826000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#01', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830505#0.988038536400381": {
+ "3": 1.0,
+ "4": 0.8,
+ "5": 1.0,
+ "6": 1.0,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 1.0,
+ "12": 1.0,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830500#0.6310700924396421": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#06', 1, '2018-02-22 21:43:17.840000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#02', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830506#0.5499777108807193": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#07', 1, '2018-02-22 21:43:17.843000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#02', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830505#0.44386731073429053": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#08', 1, '2018-02-22 21:43:17.855000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#02', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830506#0.5237318856431237": {
+ "3": 1.0,
+ "4": 0.8,
+ "6": 0.5,
+ "11": 0.1,
+ "12": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830506#0.5499777108807192": {
+ "5": 1.0,
+ "6": 0.5,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 0.9,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830505#0.44386731073429053": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#017', 1, '2018-02-22 21:43:17.943000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#02', 3, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830508#0.8969775036221255": {
+ "3": 1.0,
+ "4": 0.8,
+ "5": 1.0,
+ "6": 1.0,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 1.0,
+ "12": 1.0,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830507#0.6434841998774135": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#09', 1, '2018-02-22 21:43:17.858000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#03', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830510#0.8969775036221247": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#010', 1, '2018-02-22 21:43:17.875000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#03', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830510#0.6434841998774145": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#011', 1, '2018-02-22 21:43:17.891000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#03', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830510#0.8969775036221246": {
+ "3": 1.0,
+ "4": 0.8,
+ "5": 1.0,
+ "6": 1.0,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 1.0,
+ "12": 1.0,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830510#0.6434841998774145": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#012', 1, '2018-02-22 21:43:17.897000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#04', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830507#0.14752652961660063": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#013', 1, '2018-02-22 21:43:17.903000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#04', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830506#0.4807760142660965": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#014', 1, '2018-02-22 21:43:17.920000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#04', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830507#0.14752652961660062": {
+ "3": 1.0,
+ "4": 0.8,
+ "5": 1.0,
+ "6": 1.0,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 1.0,
+ "12": 1.0,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830506#0.4807760142660965": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#015', 1, '2018-02-22 21:43:17.929000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#05', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830508#0.8969775036221256": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#016', 1, '2018-02-22 21:43:17.939000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#05', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#1308925830507#0.6434841998774135": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#018', 1, '2018-02-22 21:43:17.951000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#06', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830510#0.8969775036221247": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#019', 1, '2018-02-22 21:43:17.956000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#06', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830510#0.6434841998774145": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#020', 1, '2018-02-22 21:43:17.961000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#06', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830510#0.8969775036221246": {
+ "3": 1.0,
+ "4": 0.8,
+ "5": 1.0,
+ "6": 1.0,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 1.0,
+ "12": 1.0,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830510#0.6434841998774145": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#021', 1, '2018-02-22 21:43:17.970000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#07', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830507#0.14752652961660063": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#022', 1, '2018-02-22 21:43:17.975000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#07', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830506#0.4807760142660965": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#023', 1, '2018-02-22 21:43:17.988000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#07', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830507#0.14752652961660062": {
+ "3": 1.0,
+ "4": 0.8,
+ "5": 1.0,
+ "6": 1.0,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 1.0,
+ "12": 1.0,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830506#0.4807760142660965": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#024', 1, '2018-02-22 21:43:17.991000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#08', 0, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830508#0.8969775036221256": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#025', 1, '2018-02-22 21:43:17.994000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#08', 1, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830507#0.6434841998774135": {}
+}');
+INSERT INTO public.weightcategorylogbookconversionspecies (topiaid, topiaversion, topiacreatedate, parent, parent_idx, distribution) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#026', 1, '2018-02-22 21:43:18.006000', 'fr.ird.t3.entities.reference.WeightCategoryLogBookConversion#1519311532526#08', 2, '{
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830508#0.8969775036221255": {
+ "3": 1.0,
+ "4": 0.8,
+ "5": 1.0,
+ "6": 1.0,
+ "7": 1.0,
+ "8": 1.0,
+ "11": 1.0,
+ "12": 1.0,
+ "13": 1.0
+ },
+ "fr.ird.t3.entities.reference.WeightCategoryTreatment#2308925830507#0.6434841998774135": {
+ "1": 1.0,
+ "2": 1.0,
+ "4": 0.2,
+ "10": 1.0
+ }
+}');
+
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#01', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#02', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#02', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#02', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#04', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#05', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#05', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#05', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#07', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#08', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#08', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#08', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#010', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#011', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#011', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#011', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#013', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#014', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#014', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#014', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#016', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#017', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#017', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#017', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#019', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#020', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#020', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#020', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#022', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#023', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#023', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#023', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#025', 'fr.ird.t3.entities.reference.Species#1297580528889#0.21694502845340558');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#026', 'fr.ird.t3.entities.reference.Species#1297580528889#0.5520768903332204');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#026', 'fr.ird.t3.entities.reference.Species#1297580528889#0.44612689800927063');
+INSERT INTO weightcategorylogbookconversionspecies_species (weightcategorylogbookconversionspecies, species) VALUES ('fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies#1519311532526#026', 'fr.ird.t3.entities.reference.Species#1297580528889#0.7537605030704515');
=====================================
t3-domain/src/main/resources/t3-datadb.properties
=====================================
--- a/t3-domain/src/main/resources/t3-datadb.properties
+++ b/t3-domain/src/main/resources/t3-datadb.properties
@@ -38,4 +38,5 @@ topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine
topia.service.migration.callback=fr.ird.t3.services.migration.T3MigrationCallback
topia.service.migration.showSql=true
topia.service.migration.showProgression=true
+topia.persistence.topiaIdFactoryClassName=org.nuiton.topia.persistence.internal.LegacyTopiaIdFactory
=====================================
t3-domain/src/main/xmi/t3-persistence.properties
=====================================
--- a/t3-domain/src/main/xmi/t3-persistence.properties
+++ b/t3-domain/src/main/xmi/t3-persistence.properties
@@ -18,7 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
-#model.tagValue.i18n=t3.common.
model.tagValue.notGenerateToString=true
model.tagValue.generateOperatorForDAOHelper=true
model.tagValue.constantPrefix=PROPERTY_
@@ -27,6 +26,7 @@ model.tagValue.indexForeignKeys=true
fr.ird.t3.entities.data.Trip.attribute.route.stereotype=ordered
fr.ird.t3.entities.data.Route.attribute.activity.stereotype=ordered
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.distributions.stereotype=ordered
fr.ird.t3.entities.data.Trip.attribute.route.tagvalue.orderBy=date
fr.ird.t3.entities.data.Route.attribute.activity.tagvalue.orderBy=date
@@ -34,6 +34,11 @@ fr.ird.t3.entities.data.Route.attribute.activity.tagvalue.orderBy=date
fr.ird.t3.entities.data.Route.attribute.date.tagvalue.hibernateAttributeType.java.util.Date=date
fr.ird.t3.entities.data.Activity.attribute.time.tagvalue.hibernateAttributeType.java.util.Date=time
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.beginDate.tagValue.hibernateAttributeType.java.util.Date=date
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.endDate.tagValue.hibernateAttributeType.java.util.Date=date
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies.attribute.distribution.tagValue.hibernateAttributeType.java.lang.String=text
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies.attribute.species.tagvalue.manyToManyTableName=WeightCategoryLogBookConversionSpecies_Species
+
fr.ird.t3.entities.data.Activity.attribute.comment.tagvalue.sqlType=text
fr.ird.t3.entities.data.LocalMarketBatch.attribute.origin.tagvalue.sqlType=text
fr.ird.t3.entities.data.LocalMarketBatch.attribute.comment.tagvalue.sqlType=text
@@ -50,6 +55,7 @@ fr.ird.t3.entities.reference.Vessel.attribute.vesselSizeCategory.tagvalue.lazy=f
fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.species.tagvalue.lazy=false
fr.ird.t3.entities.reference.WeightCategoryLogBook.attribute.species.tagvalue.lazy=false
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies.attribute.species.tagValue.lazy=false
fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.ocean.tagvalue.lazy=false
fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.schoolType.tagvalue.lazy=false
@@ -74,6 +80,7 @@ fr.ird.t3.entities.reference.VesselActivity.attribute.code.stereotype=unique
fr.ird.t3.entities.reference.VesselSizeCategory.attribute.code.stereotype=unique
fr.ird.t3.entities.reference.VesselType.attribute.code.stereotype=unique
#fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.code.stereotype=unique
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies.attribute.species.stereotype=unique
fr.ird.t3.entities.reference.WellDestiny.attribute.code.stereotype=unique
fr.ird.t3.entities.reference.Species.attribute.faoId.stereotype=unique
fr.ird.t3.entities.reference.Species.attribute.wormsId.stereotype=unique
@@ -87,40 +94,66 @@ fr.ird.t3.entities.reference.ElementaryCatchFate.attribute.code.stereotype=uniqu
fr.ird.t3.entities.reference.Company.attribute.code.stereotype=unique
###############################################################################
+### Not null for references ###################################################
+###############################################################################
+
+fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.code.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.species.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBook.attribute.code.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBook.attribute.species.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.ocean.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.schoolType.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.min.tagValue.notNull=false
+fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.max.tagValue.notNull=false
+fr.ird.t3.entities.reference.LengthWeightConversion.attribute.species.tagValue.notNull=true
+fr.ird.t3.entities.reference.LengthWeightConversion.attribute.ocean.tagValue.notNull=false
+fr.ird.t3.entities.reference.LengthWeightConversion.attribute.sexe.tagValue.notNull=false
+fr.ird.t3.entities.reference.LengthWeightConversion.attribute.beginDate.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.ocean.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.schoolType.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.beginDate.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.version.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies.attribute.distribution.tagValue.notNull=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies.attribute.parent.tagValue.notNull=true
+
+###############################################################################
### Natural id for references ################################################
###############################################################################
fr.ird.t3.entities.reference.WeightCategoryLanding.class.tagValue.naturalIdMutable=false
fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.code.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.code.tagValue.notNull=true
fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.species.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryLanding.attribute.species.tagValue.notNull=true
+
fr.ird.t3.entities.reference.WeightCategoryLogBook.class.tagValue.naturalIdMutable=false
fr.ird.t3.entities.reference.WeightCategoryLogBook.attribute.code.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryLogBook.attribute.code.tagValue.notNull=true
fr.ird.t3.entities.reference.WeightCategoryLogBook.attribute.species.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryLogBook.attribute.species.tagValue.notNull=true
fr.ird.t3.entities.reference.WeightCategoryTreatment.class.tagValue.naturalIdMutable=false
fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.ocean.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.ocean.tagValue.notNull=true
fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.schoolType.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.schoolType.tagValue.notNull=true
fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.min.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.min.tagValue.notNull=false
fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.max.tagValue.naturalId=true
-fr.ird.t3.entities.reference.WeightCategoryTreatment.attribute.max.tagValue.notNull=false
fr.ird.t3.entities.reference.LengthWeightConversion.class.tagValue.naturalIdMutable=true
fr.ird.t3.entities.reference.LengthWeightConversion.attribute.species.tagValue.naturalId=true
-fr.ird.t3.entities.reference.LengthWeightConversion.attribute.species.tagValue.notNull=true
fr.ird.t3.entities.reference.LengthWeightConversion.attribute.ocean.tagValue.naturalId=true
-fr.ird.t3.entities.reference.LengthWeightConversion.attribute.ocean.tagValue.notNull=false
fr.ird.t3.entities.reference.LengthWeightConversion.attribute.sexe.tagValue.naturalId=true
-fr.ird.t3.entities.reference.LengthWeightConversion.attribute.sexe.tagValue.notNull=false
fr.ird.t3.entities.reference.LengthWeightConversion.attribute.beginDate.tagValue.naturalId=true
-fr.ird.t3.entities.reference.LengthWeightConversion.attribute.beginDate.tagValue.notNull=true
+
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.class.tagValue.naturalIdMutable=false
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.ocean.tagValue.naturalId=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.schoolType.tagValue.naturalId=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.beginDate.tagValue.naturalId=true
+fr.ird.t3.entities.reference.WeightCategoryLogBookConversion.attribute.version.tagValue.naturalId=true
+
+###############################################################################
+### Not null for data #########################################################
+###############################################################################
+
+fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.activity.tagValue.notNull=true
+fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.species.tagValue.notNull=true
+fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.lfLengthClass.tagValue.notNull=true
###############################################################################
### Natural id for data ######################################################
@@ -128,8 +161,5 @@ fr.ird.t3.entities.reference.LengthWeightConversion.attribute.beginDate.tagValue
fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.class.tagValue.naturalIdMutable=false
fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.activity.tagValue.naturalId=true
-fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.activity.tagValue.notNull=true
fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.species.tagValue.naturalId=true
-fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.species.tagValue.notNull=true
fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.lfLengthClass.tagValue.naturalId=true
-fr.ird.t3.entities.data.ExtrapolatedAllSetSpeciesFrequency.attribute.lfLengthClass.tagValue.notNull=true
=====================================
t3-domain/src/main/xmi/t3-persistence.zargo
=====================================
Binary files a/t3-domain/src/main/xmi/t3-persistence.zargo and b/t3-domain/src/main/xmi/t3-persistence.zargo differ
=====================================
t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
=====================================
--- a/t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
+++ b/t3-domain/src/test/java/fr/ird/t3/services/migration/T3MigrationTest.java
@@ -22,11 +22,49 @@ package fr.ird.t3.services.migration;
*/
import fr.ird.t3.entities.T3TopiaApplicationContext;
+import fr.ird.t3.entities.T3TopiaPersistenceContext;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertor;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OABI;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OABL;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OABO;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OIBI;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OIBL;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OIBO;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OPBI;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OPBL;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorFOR_OPBO;
+import fr.ird.t3.entities.conversion.WeightCategoryLogBookConvertorProvider;
+import fr.ird.t3.entities.reference.Ocean;
+import fr.ird.t3.entities.reference.OceanTopiaDao;
+import fr.ird.t3.entities.reference.SchoolType;
+import fr.ird.t3.entities.reference.SchoolTypeTopiaDao;
+import fr.ird.t3.entities.reference.Species;
+import fr.ird.t3.entities.reference.SpeciesTopiaDao;
+import fr.ird.t3.entities.reference.WeightCategoryLogBookConversion;
+import fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpecies;
+import fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpeciesImpl;
+import fr.ird.t3.entities.reference.WeightCategoryLogBookConversionSpeciesTopiaDao;
+import fr.ird.t3.entities.reference.WeightCategoryLogBookConversionTopiaDao;
+import fr.ird.t3.entities.reference.WeightCategoryTreatment;
+import fr.ird.t3.entities.reference.WeightCategoryTreatmentTopiaDao;
import fr.ird.t3.entities.user.JdbcConfiguration;
import fr.ird.t3.entities.user.JdbcConfigurationHelper;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
+import org.nuiton.topia.persistence.BeanTopiaConfiguration;
+import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.topia.persistence.internal.LegacyTopiaIdFactory;
+import org.nuiton.util.DateUtil;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
/**
* Created by tchemit on 20/02/2018.
@@ -36,6 +74,11 @@ import org.junit.Test;
@Ignore
public class T3MigrationTest {
+ private int count = 0;
+ private SpeciesTopiaDao speciesDao;
+ private WeightCategoryLogBookConversionTopiaDao weightCategoryLogBookConversionDao;
+ private WeightCategoryLogBookConversionSpeciesTopiaDao weightCategoryLogBookConversionSpeciesDao;
+
@Test
public void migratePostgres() {
@@ -52,4 +95,159 @@ public class T3MigrationTest {
}
}
+
+ @Test
+ public void generateWeightCategoryLogBookConversions() {
+
+ String url = "jdbc:postgresql:t3";
+ String login = "t3-admin";
+ String password = "a";
+
+ JdbcConfiguration jdbcConfiguration = JdbcConfigurationHelper.newJdbcConfiguration();
+ jdbcConfiguration.setUrl(url);
+ jdbcConfiguration.setLogin(login);
+ jdbcConfiguration.setPassword(password);
+ try (T3TopiaApplicationContext rootContext = T3TopiaApplicationContext.newDb(jdbcConfiguration)) {
+
+ ((BeanTopiaConfiguration) rootContext.getConfiguration()).setTopiaIdFactory(new LegacyTopiaIdFactory() {
+
+ @Override
+ public <E extends TopiaEntity> String newTopiaId(Class<E> entityClass, TopiaEntity topiaEntity) {
+ return entityClass.getName() + "#1519311532526#0" + count++;
+ }
+ });
+
+ try (T3TopiaPersistenceContext persistenceContext = rootContext.newPersistenceContext()) {
+
+ WeightCategoryLogBookConvertorProvider convertorProvider = WeightCategoryLogBookConvertorProvider.newInstance(persistenceContext);
+
+ OceanTopiaDao oceanDao = persistenceContext.getOceanDao();
+ speciesDao = persistenceContext.getSpeciesDao();
+ SchoolTypeTopiaDao schoolTypeDao = persistenceContext.getSchoolTypeDao();
+ WeightCategoryTreatmentTopiaDao weightCategoryTreatmentDao = persistenceContext.getWeightCategoryTreatmentDao();
+ weightCategoryLogBookConversionDao = persistenceContext.getWeightCategoryLogBookConversionDao();
+ weightCategoryLogBookConversionSpeciesDao = persistenceContext.getWeightCategoryLogBookConversionSpeciesDao();
+
+ weightCategoryLogBookConversionDao.deleteAll(weightCategoryLogBookConversionDao.findAll());
+ persistenceContext.getHibernateSupport().getHibernateSession().flush();
+
+ Date beginDate = DateUtil.createDate(1, 1, 1970);
+
+ Ocean oceanA = oceanDao.forCodeEquals(1).findUnique();
+ Ocean oceanI = oceanDao.forCodeEquals(2).findUnique();
+ Ocean oceanP = oceanDao.forCodeEquals(5).findUnique();
+ SchoolType schoolTypeBo = schoolTypeDao.forCodeEquals(1).findUnique();
+ SchoolType schoolTypeBl = schoolTypeDao.forCodeEquals(2).findUnique();
+ SchoolType schoolTypeBi = schoolTypeDao.forCodeEquals(3).findUnique();
+
+ String version = "1.0";
+
+ this.count = 0;
+
+ // OA
+ WeightCategoryLogBookConversion oaBi = addConversion(version, beginDate, oceanA, schoolTypeBi);
+ WeightCategoryLogBookConversion oaBo = addConversion(version, beginDate, oceanA, schoolTypeBo);
+ WeightCategoryLogBookConversion oaBl = addConversion(version, beginDate, oceanA, schoolTypeBl);
+
+ // OI
+ WeightCategoryLogBookConversion oiBi = addConversion(version, beginDate, oceanI, schoolTypeBi);
+ WeightCategoryLogBookConversion oiBo = addConversion(version, beginDate, oceanI, schoolTypeBo);
+ WeightCategoryLogBookConversion oiBl = addConversion(version, beginDate, oceanI, schoolTypeBl);
+
+ // OP
+ WeightCategoryLogBookConversion opBi = addConversion(version, beginDate, oceanP, schoolTypeBi);
+ WeightCategoryLogBookConversion opBo = addConversion(version, beginDate, oceanP, schoolTypeBo);
+ WeightCategoryLogBookConversion opBl = addConversion(version, beginDate, oceanP, schoolTypeBl);
+
+ persistenceContext.commit();
+
+ this.count = 0;
+
+ //OA
+ {
+ WeightCategoryLogBookConvertorFOR_OABI convertor = getConvertor(convertorProvider, oaBi, WeightCategoryLogBookConvertorFOR_OABI.class);
+ addEmptyConversionSpecies(oaBi, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(oaBi, convertor.getMinus10Category(), 2);
+ addConversionSpecies(oaBi, convertor, 1, 3, 4);
+ }
+ {
+ WeightCategoryLogBookConvertorFOR_OABO convertor = getConvertor(convertorProvider, oaBo, WeightCategoryLogBookConvertorFOR_OABO.class);
+ addEmptyConversionSpecies(oaBo, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(oaBo, convertor.getMinus10Category(), 2);
+ addConversionSpecies(oaBo, convertor, 1, 3, 4);
+ }
+ {
+ WeightCategoryLogBookConvertorFOR_OABL convertor = getConvertor(convertorProvider, oaBl, WeightCategoryLogBookConvertorFOR_OABL.class);
+ addEmptyConversionSpecies(oaBl, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(oaBl, convertor.getMinus10Category(), 2);
+ addConversionSpecies(oaBl, convertor, 1, 3, 4);
+ }
+ //OI
+ {
+ WeightCategoryLogBookConvertorFOR_OIBI convertor = getConvertor(convertorProvider, oiBi, WeightCategoryLogBookConvertorFOR_OIBI.class);
+ addEmptyConversionSpecies(oiBi, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(oiBi, convertor.getMinus10Category(), 2);
+ addConversionSpecies(oiBi, convertor, 1, 3, 4);
+ }
+ {
+ WeightCategoryLogBookConvertorFOR_OIBO convertor = getConvertor(convertorProvider, oiBo, WeightCategoryLogBookConvertorFOR_OIBO.class);
+ addEmptyConversionSpecies(oiBo, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(oiBo, convertor.getMinus10Category(), 2);
+ addConversionSpecies(oiBo, convertor, 1, 3, 4);
+ }
+ {
+ WeightCategoryLogBookConvertorFOR_OIBL convertor = getConvertor(convertorProvider, oiBl, WeightCategoryLogBookConvertorFOR_OIBL.class);
+ addEmptyConversionSpecies(oiBl, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(oiBl, convertor.getMinus10Category(), 2);
+ addConversionSpecies(oaBl, convertor, 1, 3, 4);
+ }
+ //OP
+ {
+ WeightCategoryLogBookConvertorFOR_OPBI convertor = getConvertor(convertorProvider, opBi, WeightCategoryLogBookConvertorFOR_OPBI.class);
+ addEmptyConversionSpecies(opBi, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(opBi, convertor.getMinus10Category(), 2);
+ addConversionSpecies(opBi, convertor, 1, 3, 4);
+ }
+ {
+ WeightCategoryLogBookConvertorFOR_OPBO convertor = getConvertor(convertorProvider, opBo, WeightCategoryLogBookConvertorFOR_OPBO.class);
+ addEmptyConversionSpecies(opBo, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(opBo, convertor.getMinus10Category(), 2);
+ addConversionSpecies(opBo, convertor, 1, 3, 4);
+ }
+ {
+ WeightCategoryLogBookConvertorFOR_OPBL convertor = getConvertor(convertorProvider, opBl, WeightCategoryLogBookConvertorFOR_OPBL.class);
+ addEmptyConversionSpecies(opBl, convertor.getUnkownCategory());
+ addEmptyConversionSpecies(opBl, convertor.getMinus10Category(), 2);
+ addConversionSpecies(opBl, convertor, 1, 3, 4);
+ }
+ persistenceContext.commit();
+ }
+ }
+ }
+
+ private void addConversionSpecies(WeightCategoryLogBookConversion conversion, WeightCategoryLogBookConvertor convertor, Integer... speciesCode) {
+ List<Species> species = speciesDao.forCodeIn(Stream.of(speciesCode).collect(Collectors.toSet())).findAll();
+ Map<String, Map<Integer, Float>> distributionsToSave = convertor.getDistributionsByIds();
+ WeightCategoryLogBookConversionSpecies conversionSpecies = weightCategoryLogBookConversionSpeciesDao.createByNotNull(WeightCategoryLogBookConversionSpeciesImpl.toString(distributionsToSave), conversion);
+ conversionSpecies.setSpecies(new HashSet<>(species));
+ conversion.addDistributions(conversionSpecies);
+ }
+
+ private void addEmptyConversionSpecies(WeightCategoryLogBookConversion conversion, WeightCategoryTreatment weightCategoryTreatment, Integer... speciesCode) {
+ List<Species> species = speciesDao.forCodeIn(Stream.of(speciesCode).collect(Collectors.toSet())).findAll();
+ Map<String, Map<Integer, Float>> distributionsToSave = new LinkedHashMap<>();
+ distributionsToSave.put(weightCategoryTreatment.getTopiaId(), Collections.emptyMap());
+ WeightCategoryLogBookConversionSpecies conversionSpecies = weightCategoryLogBookConversionSpeciesDao.createByNotNull(WeightCategoryLogBookConversionSpeciesImpl.toString(distributionsToSave), conversion);
+ conversionSpecies.setSpecies(new HashSet<>(species));
+ conversion.addDistributions(conversionSpecies);
+ }
+
+
+ private <C extends WeightCategoryLogBookConvertor> C getConvertor(WeightCategoryLogBookConvertorProvider convertorProvider, WeightCategoryLogBookConversion conversion, Class<C> convertorType) {
+ return convertorType.cast(convertorProvider.getConvertor(conversion.getOcean(), conversion.getSchoolType()));
+ }
+
+ private WeightCategoryLogBookConversion addConversion(String version, Date beginDate, Ocean ocean, SchoolType schoolType) {
+ return weightCategoryLogBookConversionDao.createByNotNull(version, beginDate, ocean, schoolType);
+ }
}
=====================================
t3-installer/pom.xml
=====================================
--- a/t3-installer/pom.xml
+++ b/t3-installer/pom.xml
@@ -258,6 +258,16 @@
<fromFile>t3-data-${t3-data.version}-zones.zip</fromFile>
</configuration>
</execution>
+ <execution>
+ <id>get-h2-files</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>download-single</goal>
+ </goals>
+ <configuration>
+ <fromFile>t3-data-${t3-data.version}-h2.zip</fromFile>
+ </configuration>
+ </execution>
</executions>
</plugin>
@@ -272,6 +282,7 @@
<unzip src="${explodedDataDirection}/t3-data-${t3-data.version}-ddl.zip" dest="${explodedDataDirection}" />
<unzip src="${explodedDataDirection}/t3-data-${t3-data.version}-referential.zip" dest="${explodedDataDirection}" />
<unzip src="${explodedDataDirection}/t3-data-${t3-data.version}-zones.zip" dest="${explodedDataDirection}" />
+ <unzip src="${explodedDataDirection}/t3-data-${t3-data.version}-h2.zip" dest="${explodedDataDirection}" />
</tasks>
</configuration>
<goals>
=====================================
t3-installer/src/main/assembly/bin.xml
=====================================
--- a/t3-installer/src/main/assembly/bin.xml
+++ b/t3-installer/src/main/assembly/bin.xml
@@ -82,6 +82,14 @@
</fileSet>
<fileSet>
+ <directory>${explodedDataDirection}/t3-data-h2-${t3-data.version}</directory>
+ <outputDirectory>scripts/h2</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+
+ <fileSet>
<directory>src/main/assembly/dist</directory>
<outputDirectory/>
<includes>
=====================================
t3-test/src/main/java/fr/ird/t3/FakeT3ServiceContext.java
=====================================
--- a/t3-test/src/main/java/fr/ird/t3/FakeT3ServiceContext.java
+++ b/t3-test/src/main/java/fr/ird/t3/FakeT3ServiceContext.java
@@ -21,6 +21,7 @@
package fr.ird.t3;
import fr.ird.t3.entities.T3EntityHelper;
+import fr.ird.t3.entities.T3JdbcHelper;
import fr.ird.t3.entities.T3TopiaApplicationContext;
import fr.ird.t3.entities.T3TopiaPersistenceContext;
import fr.ird.t3.entities.T3UserTopiaApplicationContext;
@@ -28,13 +29,6 @@ import fr.ird.t3.entities.T3UserTopiaPersistenceContext;
import fr.ird.t3.services.T3Service;
import fr.ird.t3.services.T3ServiceContext;
import fr.ird.t3.services.T3ServiceFactory;
-import java.io.Closeable;
-import java.io.File;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.function.Supplier;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.rules.TestWatcher;
@@ -44,6 +38,13 @@ import org.nuiton.topia.persistence.TopiaException;
import org.nuiton.util.FileUtil;
import org.nuiton.version.Version;
+import java.io.Closeable;
+import java.io.File;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Properties;
+import java.util.function.Supplier;
+
/**
* TODO
*
@@ -91,26 +92,6 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex
Properties defaultProps = new Properties();
defaultProps.put(T3ConfigOption.DATA_DIRECTORY.getKey(), testDir);
-// applicationConfiguration = new T3Config(defaultProps);
-// try {
-//
-// // where to put h2 database
-// File dbDirectory = new File(testDir, "h2-database");
-//
-// rootContext = T3TopiaApplicationContext.newEmbeddedDb(dbDirectory);
-//
-// initOk = true;
-// } catch (Exception e) {
-// initOk = false;
-// throw new IllegalStateException("Could not strat db", e);
-// }
-//
-// testDir = T3IOUtil.getTestSpecificDirectory(description.getTestClass(),
-// description.getMethodName());
-// if (log.isInfoEnabled()) {
-// log.info("Test dir = " + testDir);
-// }
-//
File treatmentDirectory = new File(testDir, "treatment");
FileUtil.createDirectoryIfNecessary(treatmentDirectory);
@@ -128,19 +109,28 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory()).thenReturn(treatmentDirectory);
Mockito.when(applicationConfiguration.getT3DataVersion()).thenReturn(t3DataVersion);
Mockito.when(applicationConfiguration.getTreatmentWorkingDirectory(Mockito.anyString(), Mockito.anyBoolean())).thenCallRealMethod();
+ Mockito.when(applicationConfiguration.getApplicationVersion()).thenReturn(realConfiguration.getApplicationVersion());
try {
// where to put h2 database
File dbDirectory = new File(testDir, "h2-database");
- rootContext = T3TopiaApplicationContext.newEmbeddedDb(dbDirectory);
-
if (injectReferential) {
- // inject in db the referentiel
- T3SqlScriptsImporter.importReferential(new File(""), this, T3SqlScriptsImporter.SKIP_SPECIES_LENGTH_STEP_FILE);
-
+ File scriptsDirectory = T3JdbcHelper.getScriptsDirectory(new File(""), "h2", t3DataVersion);
+
+ String[] list = scriptsDirectory.list((dir, name) -> name.endsWith(".sql") && name.contains("-referential"));
+ if (list == null || list.length != 1) {
+ throw new IllegalStateException(String.format("Can't find h2 referential db from %s", scriptsDirectory));
+ }
+ rootContext = T3TopiaApplicationContext.newEmbeddedBackupDb(dbDirectory, scriptsDirectory.toPath().resolve(list[0]).toFile());
+ } else {
+ rootContext = T3TopiaApplicationContext.newEmbeddedDb(dbDirectory);
}
+// if (injectReferential) {
+// // inject in db the referentiel
+// T3SqlScriptsImporter.importReferential(new File(""), this, T3SqlScriptsImporter.SKIP_SPECIES_LENGTH_STEP_FILE);
+// }
initOk = true;
} catch (Exception e) {
@@ -233,7 +223,7 @@ public class FakeT3ServiceContext extends TestWatcher implements T3ServiceContex
}
@Override
- public void close() throws IOException {
+ public void close() {
if (transaction != null) {
transaction.close();
}
=====================================
t3-test/src/main/resources/t3-TopiaContextImpl.properties
=====================================
--- a/t3-test/src/main/resources/t3-TopiaContextImpl.properties
+++ b/t3-test/src/main/resources/t3-TopiaContextImpl.properties
@@ -19,12 +19,23 @@
# #L%
###
-# Proprietes par defaut pour une base de donnees de type H2
+# DB configuration
+#hibernate.dialect=org.hibernate.dialect.H2Dialect
+hibernate.connection.driver_class=org.h2.Driver
+hibernate.connection.provider_class=org.hibernate.hikaricp.internal.HikariCPConnectionProvider
hibernate.show_sql=false
-
-hibernate.dialect=org.hibernate.dialect.H2Dialect
+hibernate.format_sql=false
+hibernate.use_sql_comments=false
hibernate.connection.username=sa
-hibernate.connection.password=
-hibernate.connection.driver_class=org.h2.Driver
-# tchemit 2010-11-28 : comment this line, each test must define his own db path
-#hibernate.connection.url=jdbc:h2:file:target/surefire-workdir/h2data
+hibernate.connection.password=sa
+hibernate.hikari.minimumIdle=2
+hibernate.hikari.maximumPoolSize=20
+hibernate.hikari.autoCommit=false
+hibernate.hikari.registerMbeans=true
+
+# Migration configuration
+#topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine
+#topia.service.migration.callback=fr.ird.t3.services.migration.T3MigrationCallback
+#topia.service.migration.showSql=true
+#topia.service.migration.showProgression=true
+#topia.persistence.topiaIdFactoryClassName=org.nuiton.topia.persistence.internal.LegacyTopiaIdFactory
=====================================
t3/.mvn/deploy
=====================================
--- /dev/null
+++ b/t3/.mvn/deploy
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/a47953868daef6f68a03c362b86e11a…
---
View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/a47953868daef6f68a03c362b86e11a…
You're receiving this email because of your account on gitlab.com.
1
0