Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- 4058 discussions
r1487 - in trunk/tutti-ui-swing/src/main/help: en fr
by lkaufmann@users.forge.codelutin.com 15 Jan '14
by lkaufmann@users.forge.codelutin.com 15 Jan '14
15 Jan '14
Author: lkaufmann
Date: 2014-01-15 13:45:59 +0100 (Wed, 15 Jan 2014)
New Revision: 1487
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1487
Log:
Replace tutti by allegro campagne in help pages
Modified:
trunk/tutti-ui-swing/src/main/help/en/config.html
trunk/tutti-ui-swing/src/main/help/en/dbManager.html
trunk/tutti-ui-swing/src/main/help/en/editCruise.html
trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html
trunk/tutti-ui-swing/src/main/help/en/editProgram.html
trunk/tutti-ui-swing/src/main/help/en/editProtocol.html
trunk/tutti-ui-swing/src/main/help/en/editSampleCategory.html
trunk/tutti-ui-swing/src/main/help/en/faq.html
trunk/tutti-ui-swing/src/main/help/en/index.html
trunk/tutti-ui-swing/src/main/help/en/manageTemporaryReferential.html
trunk/tutti-ui-swing/src/main/help/en/report.html
trunk/tutti-ui-swing/src/main/help/en/selectCruise.html
trunk/tutti-ui-swing/src/main/help/fr/config.html
trunk/tutti-ui-swing/src/main/help/fr/dbManager.html
trunk/tutti-ui-swing/src/main/help/fr/editCruise.html
trunk/tutti-ui-swing/src/main/help/fr/editProgram.html
trunk/tutti-ui-swing/src/main/help/fr/editProtocol.html
trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html
trunk/tutti-ui-swing/src/main/help/fr/faq.html
trunk/tutti-ui-swing/src/main/help/fr/fonctionnalites_transversales.html
trunk/tutti-ui-swing/src/main/help/fr/index.html
trunk/tutti-ui-swing/src/main/help/fr/manageTemporaryReferential.html
trunk/tutti-ui-swing/src/main/help/fr/menu.html
trunk/tutti-ui-swing/src/main/help/fr/report.html
trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html
Modified: trunk/tutti-ui-swing/src/main/help/en/config.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/config.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/config.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Configuration</title>
+ <title>Allegro Campagne - Configuration</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/dbManager.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/dbManager.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/dbManager.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Gérer la base de données</title>
+ <title>Allegro Campagne - Gérer la base de données</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/editCruise.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/editCruise.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/editCruise.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Créer / Éditer une campagne</title>
+ <title>Allegro Campagne - Créer / Éditer une campagne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Saisie du trait et de la capture</title>
+ <title>Allegro Campagne - Saisie du trait et de la capture</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/editProgram.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/editProgram.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/editProgram.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
<head>
<meta charset="utf-8"/>
- <title>Tutti - Éditer une série de campagne</title>
+ <title>Allegro Campagne - Éditer une série de campagne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/editProtocol.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/editProtocol.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/editProtocol.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Éditer un protocole</title>
+ <title>Allegro Campagne - Éditer un protocole</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/editSampleCategory.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/editSampleCategory.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/editSampleCategory.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Configurer les catégories</title>
+ <title>Allegro Campagne - Configurer les catégories</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/faq.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/faq.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/faq.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Aide en ligne (Foire aux questions)</title>
+ <title>Allegro Campagne - Aide en ligne (Foire aux questions)</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/index.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/index.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/index.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
<head>
<meta charset="utf-8">
- <title>Tutti - Aide en ligne</title>
+ <title>Allegro Campagne - Aide en ligne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/manageTemporaryReferential.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/manageTemporaryReferential.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/manageTemporaryReferential.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Gérer les référentiels temporaires</title>
+ <title>Allegro Campagne - Gérer les référentiels temporaires</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/report.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/report.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/report.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
<head>
<meta charset="utf-8"/>
- <title>Tutti - Générer des rapports</title>
+ <title>Allegro Campagne - Générer des rapports</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/en/selectCruise.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/selectCruise.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/en/selectCruise.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Choisir la campagne</title>
+ <title>Allegro Campagne - Choisir la campagne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/config.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/config.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/config.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Configuration</title>
+ <title>Allegro Campagne - Configuration</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/dbManager.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/dbManager.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/dbManager.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Gérer la base de données</title>
+ <title>Allegro Campagne - Gérer la base de données</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/editCruise.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editCruise.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/editCruise.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Créer / Éditer une campagne</title>
+ <title>Allegro Campagne - Créer / Éditer une campagne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/editProgram.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editProgram.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/editProgram.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
<head>
<meta charset="utf-8"/>
- <title>Tutti - Éditer une série de campagne</title>
+ <title>Allegro Campagne - Éditer une série de campagne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/editProtocol.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editProtocol.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/editProtocol.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Éditer un protocole</title>
+ <title>Allegro Campagne - Éditer un protocole</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Configurer les catégories</title>
+ <title>Allegro Campagne - Configurer les catégories</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/faq.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/faq.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/faq.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Aide en ligne (Foire aux questions)</title>
+ <title>Allegro Campagne - Aide en ligne (Foire aux questions)</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/fonctionnalites_transversales.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/fonctionnalites_transversales.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/fonctionnalites_transversales.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Aide en ligne (Fonctionnalités transversales)</title>
+ <title>Allegro Campagne - Aide en ligne (Fonctionnalités transversales)</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/index.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/index.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/index.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
<head>
<meta charset="utf-8">
- <title>Tutti - Aide en ligne</title>
+ <title>Allegro Campagne - Aide en ligne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/manageTemporaryReferential.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/manageTemporaryReferential.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/manageTemporaryReferential.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Gérer les référentiels temporaires</title>
+ <title>Allegro Campagne - Gérer les référentiels temporaires</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/menu.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/menu.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/menu.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Aide en ligne (Menu)</title>
+ <title>Allegro Campagne - Aide en ligne (Menu)</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
@@ -249,7 +249,7 @@
<h3>Aide<a name="menu_aide_aide"></a></h3>
Permet d'accéder à l'aide sur l'application.
<h3>Site<a name="menu_aide_site"></a></h3>
-En mode connecté, permet d'accéder au site du projet Tutti qui coordonne le
+En mode connecté, permet d'accéder au site du projet Allegro Campagne qui coordonne le
développement de cette application.
<h3>À propos<a name="menu_aide_about"></a></h3>
Permet d'accéder aux informations légales sur l’application, à des
Modified: trunk/tutti-ui-swing/src/main/help/fr/report.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/report.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/report.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -26,7 +26,7 @@
<head>
<meta charset="utf-8"/>
- <title>Tutti - Générer des rapports</title>
+ <title>Allegro Campagne - Générer des rapports</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
Modified: trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html 2014-01-15 08:43:26 UTC (rev 1486)
+++ trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html 2014-01-15 12:45:59 UTC (rev 1487)
@@ -25,7 +25,7 @@
-->
<meta charset="utf-8">
- <title>Tutti - Choisir la campagne</title>
+ <title>Allegro Campagne - Choisir la campagne</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
1
0
15 Jan '14
Author: tchemit
Date: 2014-01-15 09:43:26 +0100 (Wed, 15 Jan 2014)
New Revision: 1486
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1486
Log:
refs #4124: [TECH] Mise ?\195?\160 jour de r?\195?\169f?\195?\169rentiel - Erreur sur les donn?\195?\169es suite ?\195?\160 la mise ?\195?\160 jour (rewrite synchro service)
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroDatabaseMetadata.java
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroResult.java
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTable.java
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadata.java
trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableTool.java
trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/
trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/
trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/
trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/technical/
trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/technical/synchro/
trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadataTest.java
Removed:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/synchro/
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java
trunk/tutti-service/src/license/THIRD-PARTY.properties
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java
trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties
trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDbUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroDatabaseMetadata.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroDatabaseMetadata.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroDatabaseMetadata.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,136 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import fr.ifremer.shared.application.ApplicationTechnicalException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.mapping.Table;
+import org.hibernate.tool.hbm2ddl.DatabaseMetadata;
+import org.hibernate.tool.hbm2ddl.TableMetadata;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.Map;
+import java.util.Set;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Created on 1/14/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class ReferentialSynchroDatabaseMetadata {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ReferentialSynchroDatabaseMetadata.class);
+
+ /**
+ * Load the datasource schema for the given connection and dialect.
+ *
+ * @param connection connection of the data source
+ * @param dialect dialect to use
+ * @return the datasource schema
+ */
+ public static ReferentialSynchroDatabaseMetadata loadDatabaseMetadata(Connection connection,
+ Dialect dialect) {
+ ReferentialSynchroDatabaseMetadata result = new ReferentialSynchroDatabaseMetadata(connection, dialect);
+ for (ReferentialSynchroTable tuttiTable : ReferentialSynchroTable.values()) {
+
+ String tableName = tuttiTable.name();
+ if (log.isDebugEnabled()) {
+ log.debug("Load metas of table: " + tableName);
+ }
+ result.getTable(tableName);
+ }
+ return result;
+ }
+
+ protected final DatabaseMetadata delegate;
+
+ protected final Map<String, ReferentialSynchroTableMetadata> tables;
+
+ protected final DatabaseMetaData meta;
+
+ public ReferentialSynchroDatabaseMetadata(Connection connection, Dialect dialect) {
+ Preconditions.checkNotNull(connection);
+ Preconditions.checkNotNull(dialect);
+ try {
+ this.delegate = new DatabaseMetadata(connection, dialect, true);
+ this.meta = connection.getMetaData();
+ } catch (SQLException e) {
+ throw new ApplicationTechnicalException(_("tutti.persistence.dbMetadata.instanciation.error", connection), e);
+ }
+ tables = Maps.newTreeMap();
+ }
+
+ public ReferentialSynchroTableMetadata getTable(String name) throws HibernateException {
+ return getTable(name, "PUBLIC", null, false);
+ }
+
+ public int getTableCount() {
+ return tables.size();
+ }
+
+ public Set<String> getTableNames() {
+ Set<String> result = Sets.newHashSet();
+ for (ReferentialSynchroTableMetadata tableMetadata : tables.values()) {
+ result.add(tableMetadata.getName());
+ }
+ return result;
+ }
+
+ protected ReferentialSynchroTableMetadata getTable(String name,
+ String schema,
+ String catalog,
+ boolean isQuoted) throws HibernateException {
+ String key = Table.qualify(catalog, schema, name);
+ ReferentialSynchroTableMetadata tuttiTableMetadata = tables.get(key);
+ if (tuttiTableMetadata == null) {
+
+ TableMetadata tableMetadata = delegate.getTableMetadata(
+ name, schema, catalog, isQuoted);
+ Preconditions.checkNotNull(tableMetadata,
+ "Could not find db table " + name);
+ ReferentialSynchroTable tuttiTable = ReferentialSynchroTable.valueOf(name);
+ Preconditions.checkNotNull(tuttiTable,
+ "Could not find db table " + tuttiTable);
+ tuttiTableMetadata = new ReferentialSynchroTableMetadata(tableMetadata, meta);
+ Preconditions.checkNotNull(tuttiTableMetadata,
+ "Could not find db table " + name);
+ tables.put(key, tuttiTableMetadata);
+ }
+ return tuttiTableMetadata;
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroDatabaseMetadata.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroResult.java (from rev 1477, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeResult.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroResult.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroResult.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,208 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import fr.ifremer.tutti.persistence.ProgressionModel;
+
+import java.sql.Timestamp;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Result of a referential synchronize operation.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class ReferentialSynchroResult {
+
+ protected Exception error;
+
+ /**
+ * Number of rows detected to update (per table).
+ *
+ * @since 1.0
+ */
+ protected final Map<String, Integer> rowHits = Maps.newTreeMap();
+
+ /**
+ * Number of insert done (per table).
+ *
+ * @since 1.0
+ */
+ protected final Map<String, Integer> insertHits = Maps.newTreeMap();
+
+ /**
+ * Number of update done (per table).
+ *
+ * @since 1.0
+ */
+ protected final Map<String, Integer> updateHits = Maps.newTreeMap();
+
+ /**
+ * timestamp of last update date (per table).
+ *
+ * @since 1.0
+ */
+ protected final Map<String, Timestamp> updateDateHits = Maps.newTreeMap();
+
+ /**
+ * All table treated.
+ *
+ * @since 1.0
+ */
+ protected final Set<String> tableNames = Sets.newHashSet();
+
+ protected String localUrl;
+
+ protected String remoteUrl;
+
+ protected final ProgressionModel progressionModel = new ProgressionModel();
+
+ public ReferentialSynchroResult() {
+ }
+
+ public ReferentialSynchroResult(String localUrl, String remoteUrl) {
+ this.localUrl = localUrl;
+ this.remoteUrl = remoteUrl;
+ }
+
+ public void setLocalUrl(String localUrl) {
+ this.localUrl = localUrl;
+ }
+
+ public void setRemoteUrl(String remoteUrl) {
+ this.remoteUrl = remoteUrl;
+ }
+
+ public boolean isSuccess() {
+ return error == null;
+ }
+
+ public Exception getError() {
+ return error;
+ }
+
+ public void setError(Exception error) {
+ this.error = error;
+ }
+
+ public ProgressionModel getProgressionModel() {
+ return progressionModel;
+ }
+
+ public Set<String> getTableNames() {
+ return ImmutableSet.copyOf(tableNames);
+ }
+
+ public int getTotalRows() {
+ int result = 0;
+ for (Integer nb : rowHits.values()) {
+ result += nb;
+ }
+ return result;
+ }
+
+ public int getTotalInserts() {
+ int result = 0;
+ for (Integer nb : insertHits.values()) {
+ result += nb;
+ }
+ return result;
+ }
+
+ public int getTotalUpdates() {
+ int result = 0;
+ for (Integer nb : updateHits.values()) {
+ result += nb;
+ }
+ return result;
+ }
+
+ public int getNbRows(String tableName) {
+ Integer result = rowHits.get(tableName);
+ if (result == null) {
+ result = 0;
+ }
+ return result;
+ }
+
+ public int getNbInserts(String tableName) {
+ Integer result = insertHits.get(tableName);
+ if (result == null) {
+ result = 0;
+ }
+ return result;
+ }
+
+ public int getNbUpdates(String tableName) {
+ Integer result = updateHits.get(tableName);
+ if (result == null) {
+ result = 0;
+ }
+ return result;
+ }
+
+ public void addRows(String tableName, int nb) {
+ if (nb > 0) {
+ rowHits.put(tableName, getNbRows(tableName) + nb);
+ }
+ }
+
+ public void addUpdates(String tableName, int nb) {
+ if (nb > 0) {
+ updateHits.put(tableName, getNbUpdates(tableName) + nb);
+ }
+ }
+
+ public void addInserts(String tableName, int nb) {
+ if (nb > 0) {
+ insertHits.put(tableName, getNbInserts(tableName) + nb);
+ }
+ }
+
+ public Timestamp getUpdateDate(String tableName) {
+ return updateDateHits.get(tableName);
+ }
+
+ public void setUpdateDate(String tableName, Timestamp t) {
+ updateDateHits.put(tableName, t);
+ }
+
+ public void addTableName(String tableName) {
+ tableNames.add(tableName);
+ }
+
+ public String getLocalUrl() {
+ return localUrl;
+ }
+
+ public String getRemoteUrl() {
+ return remoteUrl;
+ }
+}
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroService.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroService.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,78 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.hibernate.dialect.Dialect;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Properties;
+
+/**
+ * Created on 1/14/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
+public interface ReferentialSynchroService {
+
+ /**
+ * Get the db connexion informations for the internal data source.
+ *
+ * @return the db connexion for the internal data source
+ */
+ Properties getLocalConnectionProperties();
+
+ /**
+ * Gets the dialect used by the local database.
+ *
+ * @return the dialect used by the local database.
+ */
+ Dialect getLocalDialect();
+
+ /**
+ * Prepare the synchronize operation from the local data database supported
+ * by this service, says just compute nb rows to update for each table and
+ * update the result model.
+ *
+ * @param remoteConnectionProperties connection properties of the remote
+ * database used to synchronize referential
+ * @param result result of the operation
+ */
+ void prepare(Properties remoteConnectionProperties,
+ ReferentialSynchroResult result);
+
+ /**
+ * Launch the synchronize operation from the local data database supported
+ * by this service.
+ *
+ * @param remoteConnectionProperties connection properties of the remote
+ * database used to synchronize referential
+ * @param result model
+ */
+ void synchronize(Properties remoteConnectionProperties,
+ ReferentialSynchroResult result);
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroServiceImpl.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroServiceImpl.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,646 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+import com.google.common.io.Closeables;
+import fr.ifremer.tutti.persistence.ProgressionModel;
+import org.apache.commons.lang3.time.DateUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Environment;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.tool.hbm2ddl.ColumnMetadata;
+import org.nuiton.util.TimeLog;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DataRetrievalFailureException;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import org.springframework.jdbc.support.JdbcUtils;
+import org.springframework.stereotype.Service;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Created on 1/14/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+@Service("referentialSynchroService")
+public class ReferentialSynchroServiceImpl implements ReferentialSynchroService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ReferentialSynchroServiceImpl.class);
+
+ private static final TimeLog TIME =
+ new TimeLog(ReferentialSynchroServiceImpl.class);
+
+ @Autowired
+ protected DriverManagerDataSource dataSource;
+
+ @Autowired
+ protected SessionFactory sessionFactory;
+
+ protected Dialect localDialect;
+
+ protected Properties dbconnexionProperties;
+
+ @Override
+ public Properties getLocalConnectionProperties() {
+ if (dbconnexionProperties == null) {
+ dbconnexionProperties = new Properties();
+
+ dbconnexionProperties.put(Environment.URL, dataSource.getUrl());
+ dbconnexionProperties.put(Environment.USER, dataSource.getUsername());
+ dbconnexionProperties.put(Environment.PASS, dataSource.getPassword());
+ }
+ return dbconnexionProperties;
+ }
+
+ @Override
+ public Dialect getLocalDialect() {
+ if (localDialect == null) {
+ localDialect = ((SessionFactoryImplementor) sessionFactory).getSettings().getDialect();
+ }
+ return localDialect;
+ }
+
+ @Override
+ public void prepare(Properties remoteConnectionProperties, ReferentialSynchroResult result) {
+ Preconditions.checkNotNull(result);
+ Preconditions.checkNotNull(remoteConnectionProperties);
+
+
+ result.setLocalUrl(getUrl(getLocalConnectionProperties()));
+ result.setRemoteUrl(getUrl(remoteConnectionProperties));
+
+ dbconnexionProperties = null;
+ localDialect = null;
+
+ Connection localConnection = null;
+ Connection remoteConnection = null;
+ try {
+
+ ProgressionModel progressionModel = result.getProgressionModel();
+ progressionModel.setMessage(_("tutti.persistence.synchronizeReferential.prepare.step1"));
+
+ // create local connection
+ localConnection = createConnection(getLocalConnectionProperties());
+
+ progressionModel.setMessage(_("tutti.persistence.synchronizeReferential.prepare.step2"));
+
+ // create remote Connection
+ remoteConnection = createConnection(remoteConnectionProperties);
+
+ // load metas
+ ReferentialSynchroDatabaseMetadata localMeta =
+ ReferentialSynchroDatabaseMetadata.loadDatabaseMetadata(localConnection, getLocalDialect());
+
+ ReferentialSynchroDatabaseMetadata remoteMeta =
+ ReferentialSynchroDatabaseMetadata.loadDatabaseMetadata(remoteConnection, getLocalDialect());
+
+ progressionModel.setMessage(_("tutti.persistence.synchronizeReferential.prepare.step3"));
+
+ // check schema
+ try {
+ checkSchemas(localMeta, remoteMeta);
+ } catch (DataRetrievalFailureException e) {
+ result.setError(e);
+ }
+
+ if (result.isSuccess()) {
+
+ // prepare model (compute update date, count rows to update,...)
+
+ for (ReferentialSynchroTable tuttiTable : ReferentialSynchroTable.values()) {
+
+ long t0 = TimeLog.getTime();
+
+ String tableName = tuttiTable.name();
+
+ progressionModel.setMessage(_("tutti.persistence.synchronizeReferential.prepare.step4", tableName));
+
+ ReferentialSynchroTableMetadata table = remoteMeta.getTable(tableName);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Prepare table: " + tableName);
+ }
+ prepareTable(table,
+ localConnection,
+ remoteConnection,
+ result);
+
+ TIME.log(t0, "prepare table " + tableName);
+ }
+
+ long totalRows = result.getTotalRows();
+ if (log.isInfoEnabled()) {
+ log.info("Total rows to update: " + totalRows);
+ }
+ localConnection.rollback();
+ }
+ } catch (SQLException e) {
+ try {
+ if (localConnection != null) {
+ localConnection.rollback();
+ }
+ } catch (SQLException e1) {
+
+ // ignore the rolback error
+ }
+ result.setError(e);
+ } finally {
+ JdbcUtils.closeConnection(remoteConnection);
+ JdbcUtils.closeConnection(localConnection);
+ }
+ }
+
+ @Override
+ public void synchronize(Properties remoteConnectionProperties, ReferentialSynchroResult result) {
+ Preconditions.checkNotNull(result);
+ Preconditions.checkNotNull(remoteConnectionProperties);
+
+ Connection localConnection = null;
+ Connection remoteConnection = null;
+ try {
+
+ // create local connection
+ localConnection = createConnection(getLocalConnectionProperties());
+
+ // create remote Connection
+ remoteConnection = createConnection(remoteConnectionProperties);
+
+ // load metas
+ ReferentialSynchroDatabaseMetadata remoteMeta =
+ ReferentialSynchroDatabaseMetadata.loadDatabaseMetadata(remoteConnection, getLocalDialect());
+
+ // set total in progression model
+ ProgressionModel progressionModel = result.getProgressionModel();
+ progressionModel.setTotal(result.getTotalRows());
+
+ // prepare target (desactivate constraints)
+ prepareSynch(localConnection);
+
+ try {
+
+ for (ReferentialSynchroTable tuttiTable : ReferentialSynchroTable.values()) {
+
+ long t0 = TimeLog.getTime();
+
+ String tableName = tuttiTable.name();
+
+ progressionModel.setMessage(_("tutti.persistence.synchronizeReferential.synchronize.step1", tableName));
+
+ ReferentialSynchroTableMetadata table = remoteMeta.getTable(tableName);
+
+ if (log.isInfoEnabled()) {
+ log.info("Synchronize table: " + tableName);
+ }
+ long countToUpdate = result.getNbRows(tableName);
+
+ if (countToUpdate > 0) {
+
+ synchronizeTable(table,
+ localConnection,
+ remoteConnection,
+ result);
+ }
+
+ TIME.log(t0, "synchronize table " + tableName);
+ }
+ if (log.isInfoEnabled()) {
+ long totalInserts = result.getTotalInserts();
+ long totalUpdates = result.getTotalUpdates();
+ log.info("Total rows to treat: " + result.getTotalRows());
+ log.info("Total rows inserted: " + totalInserts);
+ log.info("Total rows updated: " + totalUpdates);
+ log.info("Total rows treated: " + (totalInserts + totalUpdates));
+ }
+ } finally {
+ releaseSynch(localConnection);
+ }
+
+ progressionModel.setMessage(_("tutti.persistence.synchronizeReferential.synchronize.step2"));
+
+ localConnection.commit();
+
+ } catch (SQLException e) {
+ try {
+ if (localConnection != null) {
+ localConnection.rollback();
+ }
+ } catch (SQLException e1) {
+
+ // ignore the rolback error
+ }
+ result.setError(e);
+ } finally {
+ JdbcUtils.closeConnection(remoteConnection);
+ JdbcUtils.closeConnection(localConnection);
+ }
+ }
+
+ /**
+ * Check that the tow given datasource shemas are compatible for a
+ * synchronize operation (same tables with same columns).
+ * <p/>
+ * If schemas are incompatible, then a
+ * {@link DataRetrievalFailureException} exception will be thrown.
+ *
+ * @param schema1 schema 1 to check
+ * @param schema2 schema 2 to check
+ */
+ protected void checkSchemas(ReferentialSynchroDatabaseMetadata schema1,
+ ReferentialSynchroDatabaseMetadata schema2) {
+ Set<String> internalSchemaTableNames = schema1.getTableNames();
+ Set<String> externalSchemaTableNames = schema2.getTableNames();
+ if (!internalSchemaTableNames.equals(externalSchemaTableNames)) {
+ throw new DataRetrievalFailureException("Incompatible schemas");
+ }
+ for (String tableName : internalSchemaTableNames) {
+ ReferentialSynchroTableMetadata internalTable = schema1.getTable(tableName);
+ ReferentialSynchroTableMetadata externalTable = schema2.getTable(tableName);
+ Set<String> internalColumnNames = internalTable.getColumnNames();
+ Set<String> externalColumnNames = externalTable.getColumnNames();
+ if (!internalColumnNames.equals(externalColumnNames)) {
+ throw new DataRetrievalFailureException("Incompatible schema of table: " + tableName);
+ }
+ for (String columnName : internalColumnNames) {
+ ColumnMetadata internalColumn = internalTable.getColumnMetadata(columnName);
+ ColumnMetadata externalColumn = externalTable.getColumnMetadata(columnName);
+ String internalColumnTypeName = internalColumn.getTypeName();
+ String externalColumnTypeName = externalColumn.getTypeName();
+ if (!internalColumnTypeName.equals(externalColumnTypeName)) {
+ throw new DataRetrievalFailureException("Incompatible column type of table / column: " + tableName + " / " + columnName);
+ }
+ }
+ }
+ }
+
+ protected void prepareTable(ReferentialSynchroTableMetadata table,
+ Connection localConnection,
+ Connection remoteConnection,
+ ReferentialSynchroResult result) throws SQLException {
+
+ String tablePrefix = table.getTableLogPrefix();
+
+ String tableName = table.getName();
+
+ ReferentialSynchroTableTool localDao = new ReferentialSynchroTableTool(localConnection, table);
+
+ long localCount = localDao.count();
+
+ // get last updateDate used by local db
+ Timestamp updateDate = null;
+
+ if (localCount < 50000) {
+
+ // only use the update date on small table, for big table we will re-insert all the table content
+ updateDate = localDao.getLastUpdateDate();
+
+ if (updateDate != null) {
+
+ // just inscrements of 1 milisecond to not having same
+ updateDate = new Timestamp(DateUtils.setMilliseconds(updateDate, 0).getTime());
+ updateDate = new Timestamp(DateUtils.addSeconds(updateDate, 1).getTime());
+ }
+ }
+
+ ReferentialSynchroTableTool remoteDao = new ReferentialSynchroTableTool(remoteConnection, table);
+
+ long countToUpdate = remoteDao.getCountDataToUpdate(updateDate);
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format("%s nb rows to update: %s", tablePrefix, countToUpdate));
+ }
+
+ result.setUpdateDate(tableName, updateDate);
+ result.addRows(tableName, (int) countToUpdate);
+ }
+
+ protected void synchronizeTable(ReferentialSynchroTableMetadata table,
+ Connection localConnection,
+ Connection remoteConnection,
+ ReferentialSynchroResult result) throws SQLException {
+
+ String tableName = table.getName();
+
+ result.getProgressionModel().setMessage(_("tutti.persistence.synchronizeReferential.synchronizeTable", tableName));
+
+ String tablePrefix = table.getTableLogPrefix();
+
+ ReferentialSynchroTableTool localDao = new ReferentialSynchroTableTool(localConnection, table);
+ ReferentialSynchroTableTool remoteDao = new ReferentialSynchroTableTool(remoteConnection, table);
+
+ // get last updateDate used by local db
+ Date updateDate = result.getUpdateDate(tableName);
+
+ // get table count
+ long count = localDao.count();
+
+ // get existing ids in the local db
+ Set<String> existingIds = localDao.getExistingPrimaryKeys();
+
+ if (log.isDebugEnabled()) {
+ log.debug(tablePrefix + " existingIds: " + existingIds.size());
+ }
+
+ boolean bigTable = count > 50000;
+
+ // get data to update from remote db
+ ResultSet dataToUpdate = remoteDao.getDataToUpdate(
+ bigTable ? null : updateDate);
+
+ try {
+
+ if (bigTable) {
+
+ // big table update strategy
+ updateBigTable(localDao,
+ remoteDao,
+ table,
+ dataToUpdate,
+ result);
+ } else {
+
+ // small table update strategy
+ updateTable(localDao,
+ table,
+ dataToUpdate,
+ result);
+ }
+ dataToUpdate.close();
+ } finally {
+
+ Closeables.closeQuietly(localDao);
+ Closeables.closeQuietly(remoteDao);
+ JdbcUtils.closeResultSet(dataToUpdate);
+ }
+ }
+
+ /**
+ * To update the content of the given {@code table} on the local db,
+ * from the given {@code incomingData} of the remote db.
+ * <p/>
+ * The algorithm is pretty simple, for each row of the {@code incomingData},
+ * if exists on local table, then do an update, otherwise do a insert.
+ * <p/>
+ * As an update query is more expensive, we won't use this method for table
+ * with a lot of rows, we will prefer to use the {@code updateBigTable}
+ * method instead.
+ *
+ * @param localDao connection on the local db
+ * @param table table to update
+ * @param incomingData data to update from the remote db
+ * @param result where to store operation results
+ * @throws SQLException if any sql errors
+ */
+ protected void updateTable(ReferentialSynchroTableTool localDao,
+ ReferentialSynchroTableMetadata table,
+ ResultSet incomingData,
+ ReferentialSynchroResult result) throws SQLException {
+
+ // get existing ids in the local db
+ Set<String> existingIds = localDao.getExistingPrimaryKeys();
+
+ String tableName = table.getName();
+ String tablePrefix = table.getTableLogPrefix() + " - " + result.getNbRows(tableName);
+
+ result.addTableName(tableName);
+
+ int countR = 0;
+
+ while (incomingData.next()) {
+
+ List<Object> pk = table.getPk(incomingData);
+ String pkStr = table.toPkStr(pk);
+
+ boolean doUpdate = existingIds.contains(pkStr);
+
+ if (doUpdate) {
+
+ localDao.executeUpdate(pk, incomingData);
+
+ } else {
+
+ localDao.executeInsert(pk, incomingData);
+ }
+
+ countR++;
+
+ reportProgress(result, localDao, countR, tablePrefix);
+ }
+
+ localDao.flushQueries();
+
+ int insertCount = localDao.getInsertCount();
+ int updateCount = localDao.getUpdateCount();
+
+ result.addInserts(tableName, insertCount);
+ result.addUpdates(tableName, updateCount);
+ if (log.isInfoEnabled()) {
+ log.info(String.format("%s done: %s (inserts: %s, updates: %s)", tablePrefix, countR, insertCount, updateCount));
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("%s INSERT count: %s", tablePrefix, result.getNbInserts(tableName)));
+ log.debug(String.format("%s UPDATE count: %s", tablePrefix, result.getNbUpdates(tableName)));
+ }
+
+ result.getProgressionModel().increments(countR % 1000);
+ }
+
+ /**
+ * To update the content of the given {@code table} (with a lot of rows) on
+ * the local db, from the given {@code incomingData} of the remote db.
+ * <p/>
+ * We can't use the simple algorithm, since update queries cost too much
+ * and is not acceptable when talking on huge numbers of rows.
+ * <p/>
+ * Here is what to do :
+ * <ul>
+ * <li>Get form the local db the data which are not in remote db, keep them</li>
+ * <li>Delete local table content</li>
+ * <li>Insert remote table in local table</li>
+ * <li>Insert the saved extra rows from original table</li>
+ * </ul>
+ * In that way we will only perform some insert queries.
+ *
+ * @param localDao connection on the local db
+ * @param remoteDao connection on the local db
+ * @param table table to update
+ * @param incomingData data to update from the remote db
+ * @param result where to store operation results
+ * @throws SQLException if any sql errors
+ */
+ protected void updateBigTable(ReferentialSynchroTableTool localDao,
+ ReferentialSynchroTableTool remoteDao,
+ ReferentialSynchroTableMetadata table,
+ ResultSet incomingData,
+ ReferentialSynchroResult result) throws SQLException {
+
+ String tableName = table.getName();
+
+ result.addTableName(tableName);
+
+ String tablePrefix = table.getTableLogPrefix() + " - " + result.getNbRows(tableName);
+
+ // get existing ids in the local db
+ Set<String> existingIds = localDao.getExistingPrimaryKeys();
+
+ if (log.isDebugEnabled()) {
+ log.debug(tablePrefix + " local existingIds: " + existingIds.size());
+ }
+
+ Set<String> remoteExistingIds = remoteDao.getExistingPrimaryKeys();
+
+ if (log.isDebugEnabled()) {
+ log.debug(tablePrefix + " remote existingIds: " + existingIds.size());
+ }
+
+ existingIds.removeAll(remoteExistingIds);
+
+ if (log.isDebugEnabled()) {
+ log.debug(tablePrefix + " local data existingIds not in remote: " + existingIds);
+ }
+
+
+ // copy extra rows from local
+
+ Map<List<Object>, Object[]> extraRows = Maps.newLinkedHashMap();
+
+ for (String pkStr : existingIds) {
+
+ List<Object> pk = table.fromPkStr(pkStr);
+
+ Object[] extraRow = localDao.findByPk(pk);
+
+ extraRows.put(pk, extraRow);
+ }
+
+ // delete table
+ localDao.deleteAll();
+
+ int countR = 0;
+
+ // add all data from remote
+ while (incomingData.next()) {
+
+ List<Object> pk = table.getPk(incomingData);
+
+ localDao.executeInsert(pk, incomingData);
+
+ countR++;
+
+ reportProgress(result, localDao, countR, tablePrefix);
+ }
+
+ // re-add extra local rows
+ for (Map.Entry<List<Object>, Object[]> entry : extraRows.entrySet()) {
+
+ List<Object> pk = entry.getKey();
+ Object[] row = entry.getValue();
+ localDao.executeInsert(pk, row);
+
+ countR++;
+
+ reportProgress(result, localDao, countR, tablePrefix);
+ }
+
+ localDao.flushQueries();
+
+ int insertCount = localDao.getInsertCount();
+ result.addInserts(tableName, insertCount);
+ if (log.isInfoEnabled()) {
+ log.info(String.format("%s done: %s (inserts: %s)", tablePrefix, countR, insertCount));
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("%s INSERT count: %s", tablePrefix, result.getNbInserts(tableName)));
+ }
+
+ result.getProgressionModel().increments(countR % 1000);
+ }
+
+ protected void reportProgress(ReferentialSynchroResult result, ReferentialSynchroTableTool dao, int countR, String tablePrefix) {
+ if (countR % 1000 == 0) {
+ result.getProgressionModel().increments(1000);
+ }
+
+ if (countR % 10000 == 0) {
+ if (log.isInfoEnabled()) {
+ log.info(String.format("%s Done: %s (inserts: %s, updates: %s)", tablePrefix, countR, dao.getInsertCount(), dao.getUpdateCount()));
+ }
+ }
+ }
+
+ Connection createConnection(Properties connectionProperties) throws SQLException {
+ return createConnection(
+ connectionProperties.getProperty(Environment.URL),
+ connectionProperties.getProperty(Environment.USER),
+ connectionProperties.getProperty(Environment.PASS)
+ );
+ }
+
+ String getUrl(Properties connectionProperties) {
+ return connectionProperties.getProperty(Environment.URL);
+ }
+
+ Connection createConnection(String jdbcUrl,
+ String user,
+ String password) throws SQLException {
+ Connection connection = DriverManager.getConnection(jdbcUrl,
+ user,
+ password);
+ connection.setAutoCommit(false);
+ return connection;
+ }
+
+ void prepareSynch(Connection connection) throws SQLException {
+ PreparedStatement statement = connection.prepareStatement("SET REFERENTIAL_INTEGRITY FALSE;");
+ statement.executeUpdate();
+ }
+
+ void releaseSynch(Connection connection) throws SQLException {
+ PreparedStatement statement = connection.prepareStatement("SET REFERENTIAL_INTEGRITY TRUE;");
+ statement.executeUpdate();
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTable.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTable.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTable.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,116 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * List of all tables we want to synchronize.
+ * <p/>
+ * Created on 1/14/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public enum ReferentialSynchroTable {
+
+ STATUS,
+ QUALITY_FLAG,
+
+ // PMFM
+ UNIT,
+ AGGREGATION_LEVEL,
+ PARAMETER_GROUP,
+ QUALITATIVE_VALUE,
+ PARAMETER,
+ MATRIX,
+ FRACTION,
+ FRACTION2MATRIX,
+ METHOD,
+ PMFM,
+ PMFM2QUALITATIVE_VALUE,
+
+ // GEAR
+ GEAR_CLASSIFICATION,
+ GEAR_CLASSIFICATION_ASSOCIATIO,
+ GEAR,
+ GEAR_ASSOCIATION,
+
+ // LOCATION
+ LOCATION_CLASSIFICATION,
+ LOCATION_LEVEL,
+ LOCATION_ASSOCIATION,
+ LOCATION,
+ LOCATION_HIERARCHY,
+ LOCATION_HIERARCHY_EXCEPTION,
+
+ // TAXON
+ TAXONOMIC_LEVEL,
+ REFERENCE_TAXON,
+ TAXON_NAME,
+ TAXON_INFORMATION,
+ TAXON_INFORMATION_HISTORY,
+ VIRTUAL_COMPONENT,
+ TAXON_NAME_HISTORY,
+ REFERENCE_DOCUMENT,
+ AUTHOR,
+ CITATION,
+
+ // TAXON GROUP
+ TAXON_GROUP_TYPE,
+ TAXON_GROUP,
+ TAXON_GROUP_HISTORICAL_RECORD,
+ TAXON_GROUP_INFORMATION,
+
+ // CONVERSION
+ ROUND_WEIGHT_CONVERSION,
+ WEIGHT_LENGTH_CONVERSION,
+ UNIT_CONVERSION,
+
+ // VESSEL
+ VESSEL_TYPE,
+ VESSEL_REGISTRATION_PERIOD,
+ VESSEL_FEATURES,
+ VESSEL,
+
+ // PERSON
+ USER_PROFIL,
+ DEPARTMENT,
+ PERSON,
+ PERSON2USER_PROFIL,
+
+ // VESSEL_PERSON_ROLE
+ VESSEL_PERSON_ROLE,
+ VESSEL_PERSON,
+
+ //ORDER
+ ORDER_ITEM,
+
+ //OTHER
+ PRECISION_TYPE,
+ NUMERICAL_PRECISION,
+ PHOTO_TYPE,
+ OBJECT_TYPE,
+ ORDER_TYPE,
+ ANALYSIS_INSTRUMENT
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTable.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadata.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadata.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadata.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,425 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import fr.ifremer.shared.application.ApplicationTechnicalException;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import org.hibernate.mapping.ForeignKey;
+import org.hibernate.tool.hbm2ddl.ColumnMetadata;
+import org.hibernate.tool.hbm2ddl.ForeignKeyMetadata;
+import org.hibernate.tool.hbm2ddl.IndexMetadata;
+import org.hibernate.tool.hbm2ddl.TableMetadata;
+
+import java.lang.reflect.Field;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Overrides of the {@link TableMetadata} with some improvements:
+ * <ul>
+ * <li>Obtains number of columns via {@link #getColumnsCount()}</li>
+ * <li>Obtains all columns names available via {@link #getColumnNames()}</li>
+ * <li>Obtains primary key column names via {@link #getPkNames()}</li>
+ * </ul>
+ * <p/>
+ * And others methods used to synchronize referentials:
+ * <ul>
+ * <li>Obtains query to update a row of the table (column names order is the
+ * one introduced by method {@link #getColumnNames()}: {@link #getUpdateQuery()}
+ * </li>
+ * <li>Obtains query to insert a row in the table (column names order is the
+ * one introduced by method {@link #getColumnNames()}: {@link #getInsertQuery()}
+ * </li>
+ * </ul>
+ * Created on 1/14/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class ReferentialSynchroTableMetadata {
+
+ protected static final String QUERY_SELECT_MAX_UPDATE = "SELECT max(update_date) FROM %s";
+
+ protected static final String QUERY_INSERT = "INSERT INTO %s (%s) VALUES (%s)";
+
+ protected static final String QUERY_UPDATE = "UPDATE %s SET %s WHERE %s";
+
+ protected static final String QUERY_SELECT = "SELECT %s FROM %s WHERE %s";
+
+ protected static final String QUERY_SELECT_PRIMARY_KEYS = "SELECT %s FROM %s";
+
+ protected static final String QUERY_SELECT_COUNT = "SELECT count(*) FROM %s";
+
+ protected final String existingPrimaryKeysQuery;
+
+ protected final String maxUpdateDateQuery;
+
+ protected final String countQuery;
+
+ protected final TableMetadata delegate;
+
+ protected final Map<String, ColumnMetadata> columns;
+
+ protected final Set<String> pkNames;
+
+ protected final int[] pkIndexs;
+
+ protected final String insertQuery;
+
+ protected final String updateQuery;
+
+ protected final boolean withUpdateDateColumn;
+
+ protected final String countDataToUpdateQuery;
+
+ protected final String countDataToUpdateQueryWithNull;
+
+ protected final String dataToUpdateQuery;
+
+ protected final String dataToUpdateQueryWithNull;
+
+ protected final String selectDataQueryFromPk;
+
+ protected final boolean simpleKey;
+
+ public ReferentialSynchroTableMetadata(TableMetadata delegate,
+ DatabaseMetaData meta) {
+
+ Preconditions.checkNotNull(delegate);
+ this.delegate = delegate;
+
+ try {
+ Field field = TableMetadata.class.getDeclaredField("columns");
+ field.setAccessible(true);
+ this.columns = (Map) field.get(delegate);
+ this.withUpdateDateColumn = columns.containsKey("update_date");
+ this.pkNames = initPrimaryKeys(meta);
+ Preconditions.checkNotNull(pkNames);
+ this.pkIndexs = createPkIndex();
+
+ this.simpleKey = this.pkIndexs.length == 1;
+
+ this.insertQuery = createInsertQuery();
+ this.updateQuery = createUpdateQuery();
+ this.maxUpdateDateQuery = String.format(QUERY_SELECT_MAX_UPDATE, getName());
+ this.existingPrimaryKeysQuery = String.format(QUERY_SELECT_PRIMARY_KEYS, Joiner.on(',').join(pkNames), getName());
+ this.countQuery = String.format(QUERY_SELECT_COUNT, getName());
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(_("tutti.persistence.tableMetadata.instanciation.error", this), e);
+ }
+
+ dataToUpdateQueryWithNull = "SELECT " + createSelectParams() + " FROM " + getName();
+ countDataToUpdateQueryWithNull = "SELECT count(*) FROM " + getName();
+
+ this.selectDataQueryFromPk = createSelectQuery();
+ String whereClause;
+
+ if (isWithUpdateDateColumn()) {
+
+ // add a filter
+ whereClause = " WHERE (update_date IS NULL OR update_date > ?)";
+ } else {
+ whereClause = "";
+ }
+ dataToUpdateQuery = dataToUpdateQueryWithNull + whereClause;
+ countDataToUpdateQuery = countDataToUpdateQueryWithNull + whereClause;
+ }
+
+ // for tests purposes
+ ReferentialSynchroTableMetadata() {
+
+ existingPrimaryKeysQuery = null;
+
+ maxUpdateDateQuery = null;
+
+ countQuery = null;
+
+ delegate = null;
+
+ columns = null;
+
+ pkNames = null;
+
+ pkIndexs = null;
+
+ insertQuery = null;
+
+ updateQuery = null;
+
+ withUpdateDateColumn = false;
+
+ countDataToUpdateQuery = null;
+
+ countDataToUpdateQueryWithNull = null;
+
+ dataToUpdateQuery = null;
+
+ dataToUpdateQueryWithNull = null;
+
+ selectDataQueryFromPk = null;
+ simpleKey = false;
+ }
+
+ public Set<String> getPkNames() {
+ return pkNames;
+ }
+
+ public boolean isWithUpdateDateColumn() {
+ return withUpdateDateColumn;
+ }
+
+ public int getColumnsCount() {
+ return columns.size();
+ }
+
+ public SortedSet<String> getColumnNames() {
+ return Sets.newTreeSet(columns.keySet());
+ }
+
+ public String getName() {
+ return delegate.getName();
+ }
+
+ public ForeignKeyMetadata getForeignKeyMetadata(ForeignKey fk) {
+ return delegate.getForeignKeyMetadata(fk);
+ }
+
+ public ColumnMetadata getColumnMetadata(String columnName) {
+ return delegate.getColumnMetadata(columnName);
+ }
+
+ public String getSchema() {
+ return delegate.getSchema();
+ }
+
+ public String getCatalog() {
+ return delegate.getCatalog();
+ }
+
+ public ForeignKeyMetadata getForeignKeyMetadata(String keyName) {
+ return delegate.getForeignKeyMetadata(keyName);
+ }
+
+ public IndexMetadata getIndexMetadata(String indexName) {
+ return delegate.getIndexMetadata(indexName);
+ }
+
+ public String getInsertQuery() {
+ return insertQuery;
+ }
+
+ public String getUpdateQuery() {
+ return updateQuery;
+ }
+
+ public String getExistingPrimaryKeysQuery() {
+ return existingPrimaryKeysQuery;
+ }
+
+ public String getMaxUpdateDateQuery() {
+ return maxUpdateDateQuery;
+ }
+
+ public String getCountQuery() {
+ return countQuery;
+ }
+
+ public String getSelectDataQueryFromPk() {
+ return selectDataQueryFromPk;
+ }
+
+ public int[] getPkIndexs() {
+ return pkIndexs;
+ }
+
+ public String getDataToUpdateQuery() {
+ return dataToUpdateQuery;
+ }
+
+ public String getDataToUpdateQueryWithNull() {
+ return dataToUpdateQueryWithNull;
+ }
+
+ public String getCountDataToUpdateQuery() {
+ return countDataToUpdateQuery;
+ }
+
+ public String getCountDataToUpdateQueryWithNull() {
+ return countDataToUpdateQueryWithNull;
+ }
+
+ public boolean isSimpleKey() {
+ return simpleKey;
+ }
+
+ public List<Object> getPk(ResultSet incomingData) throws SQLException {
+ List<Object> result = Lists.newArrayListWithCapacity(pkIndexs.length);
+ for (int pkIndex : pkIndexs) {
+ Object pk = incomingData.getObject(pkIndex);
+ result.add(pk);
+ }
+ return result;
+ }
+
+ public String toPkStr(List<Object> pkList) {
+ StringBuilder sb = new StringBuilder();
+ for (Object pk : pkList) {
+ sb.append("~|").append(pk);
+ }
+ return sb.toString();
+ }
+
+ public List<Object> fromPkStr(String pk) {
+ List<Object> pkList = Lists.newArrayList();
+ String[] split = pk.split("~\\|");
+ for (String s : split) {
+ if ("null".equals(s)) {
+ s = null;
+ }
+ pkList.add(s);
+ }
+ pkList.remove(0);
+ return pkList;
+ }
+
+ protected Set<String> initPrimaryKeys(DatabaseMetaData meta) throws SQLException {
+
+ Set<String> result = Sets.newHashSet();
+ ResultSet rs = meta.getPrimaryKeys(getCatalog(), getSchema(), getName());
+ try {
+
+ while (rs.next()) {
+ result.add(rs.getString("COLUMN_NAME"));
+ }
+ rs.close();
+ return ImmutableSet.copyOf(result);
+ } finally {
+ TuttiEntities.closeSilently(rs);
+ }
+ }
+
+ protected int[] createPkIndex() {
+
+ int[] result = new int[pkNames.size()];
+
+ int pkI = 0;
+ for (String pkName : pkNames) {
+ String pkColumnName = pkName.toLowerCase();
+
+ int i = 1;
+
+ int index = -1;
+ for (String columnName : getColumnNames()) {
+ if (pkColumnName.equals(columnName)) {
+ index = i;
+ } else {
+ i++;
+ }
+ }
+ result[pkI++] = index;
+ }
+ return result;
+ }
+
+
+ protected String createInsertQuery() {
+
+ StringBuilder queryParams = new StringBuilder();
+ StringBuilder valueParams = new StringBuilder();
+
+ for (String columnName : getColumnNames()) {
+ queryParams.append(", ").append(columnName);
+ valueParams.append(", ?");
+ }
+
+ String result = String.format(QUERY_INSERT,
+ getName(),
+ queryParams.substring(2),
+ valueParams.substring(2));
+ return result;
+ }
+
+ protected String createUpdateQuery() {
+
+ StringBuilder updateParams = new StringBuilder();
+
+ for (String columnName : getColumnNames()) {
+ updateParams.append(", ").append(columnName).append(" = ?");
+ }
+
+ String result = String.format(QUERY_UPDATE,
+ getName(),
+ updateParams.substring(2),
+ createPkWhereClause());
+ return result;
+ }
+
+ protected String createSelectQuery() {
+
+ String result = String.format(QUERY_SELECT,
+ createSelectParams(),
+ getName(),
+ createPkWhereClause());
+ return result;
+ }
+
+ protected String createPkWhereClause() {
+
+ StringBuilder pkParams = new StringBuilder();
+
+ for (String columnName : getPkNames()) {
+ pkParams.append("AND ").append(columnName).append(" = ?");
+ }
+
+ return pkParams.substring(4);
+ }
+
+ protected String createSelectParams() {
+
+ StringBuilder queryParams = new StringBuilder();
+
+ for (String columnName : getColumnNames()) {
+ queryParams.append(", ").append(columnName);
+ }
+
+ return queryParams.substring(2);
+ }
+
+ public String getTableLogPrefix() {
+ return "[" + getName() + "]";
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadata.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableTool.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableTool.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableTool.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,365 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Created on 1/14/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class ReferentialSynchroTableTool implements Closeable {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ReferentialSynchroTableTool.class);
+
+ protected final Connection connection;
+
+ protected final ReferentialSynchroTableMetadata table;
+
+ protected final PreparedStatement insertStatement;
+
+ protected final PreparedStatement updateStatement;
+
+ protected final int columnCount;
+
+ protected final String tableName;
+
+ protected int insertCount = 0;
+
+ protected int updateCount = 0;
+
+ protected boolean debug;
+
+ public ReferentialSynchroTableTool(Connection connection,
+ ReferentialSynchroTableMetadata table) throws SQLException {
+ this.connection = connection;
+ this.table = table;
+ this.columnCount = table.getColumnsCount();
+ this.tableName = table.getName();
+
+ String insertSql = table.getInsertQuery();
+ String updateSql = table.getUpdateQuery();
+
+ insertStatement = connection.prepareStatement(insertSql);
+ updateStatement = connection.prepareStatement(updateSql);
+
+ debug = log.isTraceEnabled();
+ }
+
+
+ public void deleteAll() throws SQLException {
+ PreparedStatement deleteStatement =
+ connection.prepareStatement(
+ "DELETE FROM " + table.getName());
+ deleteStatement.execute();
+ }
+
+ public Object[] findByPk(List<Object> pk) throws SQLException {
+ String selectDataSql = table.getSelectDataQueryFromPk();
+
+ PreparedStatement selectStatement =
+ connection.prepareStatement(selectDataSql);
+
+ int columnCountIndex = 1;
+
+ for (Object pkColumn : pk) {
+ selectStatement.setObject(columnCountIndex++, pkColumn);
+ }
+
+ int columnsCount = table.getColumnsCount();
+ ResultSet resultSet = selectStatement.executeQuery();
+ resultSet.next();
+
+ Object[] result = new Object[columnsCount];
+
+ for (int i = 1; i <= columnsCount; i++) {
+
+ result[i - 1] = resultSet.getObject(i);
+ }
+ return result;
+ }
+
+ public Set<String> getExistingPrimaryKeys() throws SQLException {
+
+ Set<String> pkNames = table.getPkNames();
+ int pkCount = pkNames.size();
+ String sql = table.getExistingPrimaryKeysQuery();
+
+ PreparedStatement statement = connection.prepareStatement(sql);
+
+ Set<String> result = Sets.newHashSet();
+ try {
+ ResultSet resultSet = statement.executeQuery();
+
+
+ while (resultSet.next()) {
+ List<Object> pkList = Lists.newArrayListWithCapacity(pkNames.size());
+ for (int i = 1; i <= pkCount; i++) {
+ Object pk = resultSet.getObject(i);
+ pkList.add(pk);
+ }
+ String pk = table.toPkStr(pkList);
+ result.add(pk);
+ }
+ statement.close();
+ return result;
+ } finally {
+ closeSilently(statement);
+ }
+ }
+
+ public ResultSet getDataToUpdate(Date fromDate) throws SQLException {
+
+ String sql = fromDate == null ?
+ table.getDataToUpdateQueryWithNull() :
+ table.getDataToUpdateQuery();
+
+ PreparedStatement statement = connection.prepareStatement(sql);
+ if (table.isWithUpdateDateColumn() &&
+ fromDate != null) {
+ statement.setTimestamp(1, new Timestamp(fromDate.getTime()));
+ }
+ statement.setFetchSize(1000);
+
+ ResultSet result = statement.executeQuery();
+// // to be able to reward on resultSet
+// ((RowSet)result).setType(ResultSet.TYPE_SCROLL_INSENSITIVE);
+ return result;
+ }
+
+ @Override
+ public void close() throws IOException {
+ closeSilently(insertStatement);
+ closeSilently(updateStatement);
+ }
+
+ public void executeInsert(List<Object> pk, ResultSet incomingData) throws SQLException {
+
+ List<Object> params = null;
+
+ if (debug) {
+ params = Lists.newArrayList();
+ }
+
+ for (int c = 1; c <= columnCount; c++) {
+ Object object = incomingData.getObject(c);
+ insertStatement.setObject(c, object);
+ if (debug) {
+ params.add(object);
+ }
+ }
+ insertCount++;
+
+ insertStatement.addBatch();
+
+ if (debug) {
+ log.debug(String.format("%s Execute insert query (pk:%s), params: %s", tableName, pk, params));
+ }
+
+ if (insertCount > 0 && insertCount % 1000 == 0) {
+ insertStatement.executeBatch();
+ insertStatement.clearBatch();
+ }
+ }
+
+ public void executeInsert(List<Object> pk, Object[] incomingData) throws SQLException {
+
+ for (int c = 1; c <= columnCount; c++) {
+ Object object = incomingData[c - 1];
+ insertStatement.setObject(c, object);
+ }
+ insertCount++;
+
+ insertStatement.addBatch();
+
+ if (debug) {
+ log.debug(String.format("%s Execute insert query (pk:%s), params: %s", tableName, pk, Arrays.toString(incomingData)));
+ }
+
+ if (insertCount > 0 && insertCount % 1000 == 0) {
+ insertStatement.executeBatch();
+ insertStatement.clearBatch();
+ }
+ }
+
+ public void executeUpdate(List<Object> pk, ResultSet incomingData) throws SQLException {
+
+ List<Object> params = null;
+
+ if (debug) {
+ params = Lists.newArrayList();
+ }
+
+ for (int c = 1; c <= columnCount; c++) {
+ Object object = incomingData.getObject(c);
+ updateStatement.setObject(c, object);
+ if (debug) {
+ params.add(object);
+ }
+ }
+
+ int columnCountIndex = columnCount + 1;
+
+ for (Object pkColumn : pk) {
+ updateStatement.setObject(columnCountIndex++, pkColumn);
+ }
+
+ updateCount++;
+
+ updateStatement.addBatch();
+
+ if (debug) {
+ log.debug(String.format("%s Execute update query (pk:%s), params: %s", tableName, pk, params));
+ }
+
+ if (updateCount > 0 && updateCount % 1000 == 0) {
+ updateStatement.executeBatch();
+ updateStatement.clearBatch();
+ }
+ }
+
+ public int getInsertCount() {
+ return insertCount;
+ }
+
+ public int getUpdateCount() {
+ return updateCount;
+ }
+
+ public void flushQueries() throws SQLException {
+
+ if (insertCount > 0 && insertCount % 1000 != 0) {
+ insertStatement.executeBatch();
+ }
+ if (updateCount > 0 && updateCount % 1000 != 0) {
+ updateStatement.executeBatch();
+ }
+ }
+
+ /**
+ * Gets the last updateDate for the given {@code table} using
+ * the given datasource.
+ *
+ * @return the last update date of the given table, or {@code null}
+ * if table does not use a updateDate columns or if there
+ * is no data in table.
+ */
+ public Timestamp getLastUpdateDate() throws SQLException {
+ Timestamp result = null;
+
+ if (table.isWithUpdateDateColumn()) {
+
+ String sql = table.getMaxUpdateDateQuery();
+
+ PreparedStatement statement = connection.prepareStatement(sql);
+ try {
+ ResultSet resultSet = statement.executeQuery();
+ if (resultSet.next()) {
+ result = resultSet.getTimestamp(1);
+ }
+ statement.close();
+ } finally {
+ closeSilently(statement);
+ }
+ }
+ return result;
+ }
+
+ public long getCountDataToUpdate(Date fromDate) throws SQLException {
+
+ String sql = fromDate == null ?
+ table.getCountDataToUpdateQueryWithNull() :
+ table.getCountDataToUpdateQuery();
+
+ PreparedStatement statement = connection.prepareStatement(sql);
+ if (table.isWithUpdateDateColumn() &&
+ fromDate != null) {
+ statement.setTimestamp(1, new Timestamp(fromDate.getTime()));
+ }
+
+ ResultSet queryResult = statement.executeQuery();
+ queryResult.next();
+ long result = queryResult.getLong(1);
+ return result;
+ }
+
+ public long count() throws SQLException {
+
+ String sql = table.getCountQuery();
+
+ PreparedStatement statement = connection.prepareStatement(sql);
+
+ try {
+ ResultSet resultSet = statement.executeQuery();
+ resultSet.next();
+ long result = resultSet.getLong(1);
+ statement.close();
+ return result;
+ } finally {
+ closeSilently(statement);
+ }
+ }
+
+ void closeSilently(Statement statement) {
+ try {
+ if (statement != null && !statement.isClosed()) {
+
+ statement.close();
+ }
+ } catch (AbstractMethodError e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Fix this linkage error, damned hsqlsb 1.8.0.7:(");
+ }
+ } catch (IllegalAccessError e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Fix this IllegalAccessError error, damned hsqlsb 1.8.0.7:(");
+ }
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not close statement, but do not care", e);
+ }
+ }
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableTool.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -25,9 +25,9 @@
*/
import fr.ifremer.adagio.core.service.ServiceLocator;
+import fr.ifremer.adagio.core.service.technical.synchro.ReferentialSynchroService;
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
-import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeService;
/**
* To obtain services from spring context.
@@ -115,9 +115,11 @@
ProtocolPersistenceService.class);
}
- public static ReferentialSynchronizeService getReferentialSynchronizeService() {
- return getPersistenceService("referentialSynchronizeService",
- ReferentialSynchronizeService.class);
+ //TODO Move this to adagio
+ public static ReferentialSynchroService getReferentialSynchroService() {
+ ReferentialSynchroService service = instance().getService(
+ "referentialSynchroService", ReferentialSynchroService.class);
+ return service;
}
public static AttachmentPersistenceService getAttachmentPersistenceService() {
Added: trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadataTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadataTest.java (rev 0)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadataTest.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -0,0 +1,56 @@
+package fr.ifremer.adagio.core.service.technical.synchro;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2012 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.Lists;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.List;
+
+/**
+ * Created on 1/14/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class ReferentialSynchroTableMetadataTest {
+
+ @Test
+ public void getPkStr() {
+
+ List<Object> pk = Lists.<Object>newArrayList("a", null, 3);
+
+ ReferentialSynchroTableMetadata table = new ReferentialSynchroTableMetadata();
+
+ String pkStr = table.toPkStr(pk);
+ Assert.assertEquals("~|a~|null~|3", pkStr);
+
+ List<Object> fromPkStr = table.fromPkStr(pkStr);
+
+ Assert.assertEquals(Lists.<Object>newArrayList("a", null, "3"), fromPkStr);
+ }
+
+}
Property changes on: trunk/tutti-persistence/src/test/java/fr/ifremer/adagio/core/service/technical/synchro/ReferentialSynchroTableMetadataTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-service/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-service/src/license/THIRD-PARTY.properties 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-service/src/license/THIRD-PARTY.properties 2014-01-15 08:43:26 UTC (rev 1486)
@@ -20,7 +20,6 @@
# - Lesser General Public License (LPGL)
# - Lesser General Public License (LPGL) v 2.1
# - MIT License
-# - MPL 1.1
# - Mozilla Public License
# - New BSD License
# - Public Domain
@@ -31,7 +30,7 @@
# Please fill the missing licenses for dependencies :
#
#
-#Sun Dec 08 20:03:42 CET 2013
+#Wed Jan 15 09:00:37 CET 2014
antlr--antlr--2.7.6=BSD License
batik--batik-awt-util--1.6=The Apache Software License, Version 2.0
batik--batik-bridge--1.6=The Apache Software License, Version 2.0
@@ -48,4 +47,5 @@
batik--batik-xml--1.6=The Apache Software License, Version 2.0
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
+javassist--javassist--3.11.0.GA=The Apache Software License, Version 2.0
javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -120,8 +120,6 @@
protected Cruise cruise;
-// protected TuttiProtocol protocol;
-
protected FishingOperation fishingOperation;
protected List<Caracteristic> caracteristics;
@@ -211,6 +209,7 @@
resetPersons();
resetSpecies();
resetValidationDataContext();
+ resetCaracteristics();
}
public void checkDbContext() {
@@ -777,10 +776,14 @@
referentSpecies = null;
referentSpeciesWithSurveyCode = null;
referentBenthosWithSurveyCode = null;
+
}
public void resetCaracteristics() {
caracteristics = null;
+ caracteristicsWithProtected = null;
+ genderValues = null;
+ deadOrAliveValues = null;
}
public void loadSampleCategoryModel(SampleCategoryModel sampleCategoryModel) {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/referential/TuttiReferentialSynchronizeService.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -24,11 +24,11 @@
* #L%
*/
+import fr.ifremer.adagio.core.service.technical.synchro.ReferentialSynchroResult;
+import fr.ifremer.adagio.core.service.technical.synchro.ReferentialSynchroService;
import fr.ifremer.tutti.TuttiConfiguration;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator;
-import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeResult;
-import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeService;
import fr.ifremer.tutti.service.AbstractTuttiService;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiServiceContext;
@@ -44,22 +44,22 @@
protected PersistenceService persistenceService;
- protected ReferentialSynchronizeService synchroService;
+ protected ReferentialSynchroService synchroService;
@Override
public void setServiceContext(TuttiServiceContext context) {
super.setServiceContext(context);
- synchroService = TuttiPersistenceServiceLocator.getReferentialSynchronizeService();
+ synchroService = TuttiPersistenceServiceLocator.getReferentialSynchroService();
persistenceService = getService(PersistenceService.class);
}
- public void prepare(File dbDirectory, ReferentialSynchronizeResult result) {
+ public void prepare(File dbDirectory, ReferentialSynchroResult result) {
Properties remoteConnectionProperties = getRemoteProperties(dbDirectory);
synchroService.prepare(remoteConnectionProperties, result);
}
public void synchronize(File dbDirectory,
- ReferentialSynchronizeResult result) {
+ ReferentialSynchroResult result) {
Properties remoteConnectionProperties = getRemoteProperties(dbDirectory);
synchroService.synchronize(remoteConnectionProperties, result);
}
Modified: trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-ui-swing/src/license/THIRD-PARTY.properties 2014-01-15 08:43:26 UTC (rev 1486)
@@ -30,7 +30,7 @@
# Please fill the missing licenses for dependencies :
#
#
-#Mon Dec 09 13:48:21 CET 2013
+#Wed Jan 15 09:38:43 CET 2014
antlr--antlr--2.7.6=BSD License
batik--batik-awt-util--1.6=The Apache Software License, Version 2.0
batik--batik-bridge--1.6=The Apache Software License, Version 2.0
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties 2014-01-15 08:43:26 UTC (rev 1486)
@@ -34,6 +34,7 @@
#See https://forum.hibernate.org/viewtopic.php?p=2404391
log4j.logger.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=ERROR
+log4j.logger.fr.ifremer.adagio.core.service.technical.synchro=DEBUG
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.file=${tutti.log.file}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -230,7 +230,7 @@
File cacheDirectory = config.getCacheDirectory();
ApplicationIOUtil.forceDeleteOnExit(
cacheDirectory,
- _("tutti.applicationUpdater.updateDone.deleteDirectory.caches.error", i18nDirectory)
+ _("tutti.applicationUpdater.updateDone.deleteDirectory.caches.error", cacheDirectory)
);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDbUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDbUpdaterCallBack.java 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDbUpdaterCallBack.java 2014-01-15 08:43:26 UTC (rev 1486)
@@ -26,12 +26,13 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
+import fr.ifremer.adagio.core.service.technical.synchro.ReferentialSynchroResult;
import fr.ifremer.shared.application.ApplicationTechnicalException;
import fr.ifremer.shared.application.swing.action.ApplicationActionException;
import fr.ifremer.shared.application.swing.action.ApplicationActionUI;
import fr.ifremer.tutti.TuttiConfiguration;
import fr.ifremer.tutti.persistence.ProgressionModel;
-import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeResult;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.referential.TuttiReferentialSynchronizeService;
import fr.ifremer.tutti.ui.swing.action.AbstractTuttiAction;
@@ -227,7 +228,7 @@
log.info(String.format("A database update was downloaded (oldVersion: %s, newVersion: %s), will launch a referential synchronize operation ", info.oldVersion, info.newVersion));
}
TuttiReferentialSynchronizeService service = context.getTuttiReferentialSynchronizeService();
- ReferentialSynchronizeResult result = new ReferentialSynchronizeResult();
+ ReferentialSynchroResult result = new ReferentialSynchroResult();
File dbDirectory = getDbDirectory(info);
ApplicationActionUI actionUI = context.getActionUI();
@@ -251,6 +252,15 @@
PersistenceService persistence = context.getPersistenceService();
persistence.clearAllCaches();
+ // clean data context
+ if (log.isInfoEnabled()) {
+ log.info("Clean data context.");
+ }
+ SampleCategoryModel sampleCategoryModel =
+ context.getDataContext().getSampleCategoryModel();
+ context.getDataContext().clearContext();
+ context.getDataContext().loadSampleCategoryModel(sampleCategoryModel);
+
// replace the version.appup file content
File target = context.getConfig().getDbDirectory();
File versionFile = ApplicationUpdater.getVersionFile(target);
@@ -260,7 +270,8 @@
try {
ApplicationUpdater.storeVersionFile(target, info.newVersion);
} catch (IOException e) {
- throw new ApplicationTechnicalException(_("tutti.applicationUpdater.synchroDB.writeVersion.error", versionFile));
+ throw new ApplicationTechnicalException(
+ _("tutti.applicationUpdater.synchroDB.writeVersion.error", versionFile));
}
}
}
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2014-01-13 15:19:06 UTC (rev 1485)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2014-01-15 08:43:26 UTC (rev 1486)
@@ -301,7 +301,7 @@
tutti.dbManager.action.upgradeDb=Mettre à jour les référentiels
tutti.dbManager.action.upgradeDb.check=Recherche des mises à jour de la base
tutti.dbManager.action.upgradeDb.done=La mise à jour des référentiel en version <strong>%s</strong> est terminée.
-tutti.dbManager.action.upgradeDb.mnemonic=V
+tutti.dbManager.action.upgradeDb.mnemonic=M
tutti.dbManager.action.upgradeDb.no.backup.db.choosen=La base ne sera pas migrée (vous avez annulé la sauvegarde avant migration).
tutti.dbManager.action.upgradeDb.opening=Ouverture de la base de données
tutti.dbManager.action.upgradeDb.reloading=Rechargement de la base de données
@@ -313,7 +313,7 @@
tutti.dbManager.action.upgradeDb.schema.version.not.found=L'application n'a pas pu déterminer la version de la base de données à importer. L'import ne peut pas être réalisé, veuillez contacter les administrateurs de l'application.
tutti.dbManager.action.upgradeDb.tip=Mettre à jour les référentiels
tutti.dbManager.action.upgradeDb.upToDate=<strong>Aucune mise à jour de base détectée</strong>
-tutti.dbManager.caracteristic.lastReferentialVersion=Version du référentiel disponible en mis à jour
+tutti.dbManager.caracteristic.lastReferentialVersion=Version du référentiel disponible en mise à jour
tutti.dbManager.caracteristic.referentialVersion=Version du référentiel utilisé
tutti.dbManager.caracteristic.schemaVersion=Version du schema
tutti.dbManager.caracteristic.url=Url de connexion
@@ -1472,6 +1472,8 @@
tutti.updateReport.message.success=La mise à jour des rapports nécessite le redémarrage de l'application
tutti.updateReport.noUpdate=<strong>Aucune mise à jour de rapports détectée.</strong>
tutti.updateReport.title.success=Redémarrage de l'application nécessaire...
+tutti.upgradeDb.message.success=La mise à jour des référentiels nécessite le redémarrage de l'application
+tutti.upgradeDb.title.success=Redémarrage de l'application nécessaire...
tutti.validateCruise.action.export.all.chooseFile.label=Choisir le fichier d'export
tutti.validateCruise.action.export.all.chooseFile.title=Exporter les messages de validation de la campagne
tutti.validateCruise.action.export.all.success=Les messages de validation des captures ont correctement été exporté dans le fichier %s
1
0
r1485 - in trunk: tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra tutti-service/src/main/resources/i18n tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action
by tchemit@users.forge.codelutin.com 13 Jan '14
by tchemit@users.forge.codelutin.com 13 Jan '14
13 Jan '14
Author: tchemit
Date: 2014-01-13 16:19:06 +0100 (Mon, 13 Jan 2014)
New Revision: 1485
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1485
Log:
fixes #3880: Erreur lors d'un export Sumatra
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportCruiseForSumatraAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraAction.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportService.java 2014-01-13 15:18:31 UTC (rev 1484)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportService.java 2014-01-13 15:19:06 UTC (rev 1485)
@@ -29,6 +29,7 @@
import com.google.common.collect.Lists;
import com.google.common.io.Files;
import fr.ifremer.shared.application.ApplicationTechnicalException;
+import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.service.AbstractTuttiService;
@@ -76,7 +77,8 @@
* @since 2.0
*/
public void exportCruiseForSumatra(File file,
- String cruiseId) {
+ String cruiseId,
+ ProgressionModel progressionModel) {
Preconditions.checkNotNull(cruiseId, "Cannot export a null cruise");
Preconditions.checkNotNull(file, "Cannot export to a null file");
@@ -85,13 +87,23 @@
log.info("Will export cruise " + cruiseId + " to file: " + file);
}
+ progressionModel.increments(_("tutti.service.sumatra.export.step.load.cruise", cruiseId));
+
Cruise cruise = persistenceService.getCruise(cruiseId);
Preconditions.checkNotNull(cruise, "Cruise [" + cruiseId + "] not found");
+ progressionModel.increments(_("tutti.service.sumatra.export.step.load.fishingOperationIds"));
+
List<String> operations =
persistenceService.getAllFishingOperationIds(cruiseId);
- prepareOperationsAndExport(file, operations);
+ if (log.isInfoEnabled()) {
+ log.info(operations.size() + " operations found for cruise: " + cruiseId);
+ }
+
+ progressionModel.adaptTotal(operations.size() + 3);
+
+ prepareOperationsAndExport(file, operations, progressionModel);
}
/**
@@ -104,7 +116,8 @@
*/
public void exportFishingOperationForSumatra(File file,
String cruiseId,
- String fishingOperationId) {
+ String fishingOperationId,
+ ProgressionModel progressionModel) {
Preconditions.checkNotNull(file, "Cannot export to a null file");
Preconditions.checkNotNull(cruiseId, "Cannot export a null cruise");
@@ -115,26 +128,39 @@
fishingOperationId + " to file: " + file);
}
+ progressionModel.increments(_("tutti.service.sumatra.export.step.load.cruise", cruiseId));
+
Cruise cruise = persistenceService.getCruise(cruiseId);
Preconditions.checkNotNull(cruise, "Cruise [" + cruiseId + "] not found");
List<String> operations = Lists.newArrayList(fishingOperationId);
- prepareOperationsAndExport(file, operations);
+ prepareOperationsAndExport(file, operations, progressionModel);
}
protected void prepareOperationsAndExport(File file,
- List<String> operations) {
+ List<String> operations,
+ ProgressionModel progressionModel) {
List<CatchRow> rows = Lists.newArrayList();
if (operations != null) {
for (String operationId : operations) {
+ progressionModel.increments(_("tutti.service.sumatra.export.step.load.fishingOperation", operationId));
+ if (!persistenceService.isFishingOperationWithCatchBatch(operationId)) {
+
+ if (log.isWarnEnabled()) {
+ log.warn("No catch for operation with id: " + operationId);
+ }
+ break;
+ }
+
prepareFishingOperation(rows, operationId);
}
}
+ progressionModel.increments(_("tutti.service.sumatra.export.step.export", file));
CatchRowModel csvModel =
new CatchRowModel(context.getConfig().getCsvSeparator());
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2014-01-13 15:18:31 UTC (rev 1484)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2014-01-13 15:19:06 UTC (rev 1485)
@@ -161,6 +161,10 @@
tutti.service.referential.import.vessels.error=
tutti.service.referential.import.vessels.existingValue.error=
tutti.service.sumatra.export.error=
+tutti.service.sumatra.export.step.export=
+tutti.service.sumatra.export.step.load.cruise=
+tutti.service.sumatra.export.step.load.fishingOperation=
+tutti.service.sumatra.export.step.load.fishingOperationIds=
tutti.service.validateCruise.exportResult.error=
tutti.service.validateCruise.operations.progress=
tutti.validator.error.accidental.species.required=
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2014-01-13 15:18:31 UTC (rev 1484)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2014-01-13 15:19:06 UTC (rev 1485)
@@ -161,6 +161,10 @@
tutti.service.referential.import.vessels.error=Erreur lors de l'import des navires du fichier %s
tutti.service.referential.import.vessels.existingValue.error=Un navire avec le nom %1s et l'immatriculation %2s existe déjà dans le référentiel
tutti.service.sumatra.export.error=Erreur lors de l'export Sumatra dans le fichier %s
+tutti.service.sumatra.export.step.export=Export dans le fichier %s
+tutti.service.sumatra.export.step.load.cruise=Chargement de la campagne %s
+tutti.service.sumatra.export.step.load.fishingOperation=Chargement du trait %s
+tutti.service.sumatra.export.step.load.fishingOperationIds=Recherche des opérations
tutti.service.validateCruise.exportResult.error=Erreur lors de l'export des résultats de validation de la campagne dans le fichier %s
tutti.service.validateCruise.operations.progress=Vérification du trait %s
tutti.validator.error.accidental.species.required=L'espèce est obligatoire
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceTest.java 2014-01-13 15:18:31 UTC (rev 1484)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceTest.java 2014-01-13 15:19:06 UTC (rev 1485)
@@ -24,6 +24,7 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.service.ServiceDbResource;
import fr.ifremer.tutti.service.TuttiServiceContext;
import fr.ifremer.tutti.service.catches.TuttiWeightComputingException;
@@ -91,7 +92,9 @@
File exportFile = new File(dataDirectory, "exportSumatra.csv");
- service.exportCruiseForSumatra(exportFile, CRUISE_BAD_ID);
+ ProgressionModel progressionModel = new ProgressionModel();
+ progressionModel.setTotal(3);
+ service.exportCruiseForSumatra(exportFile, CRUISE_BAD_ID, progressionModel);
}
@Test
@@ -102,7 +105,9 @@
File exportFile = new File(dataDirectory, "exportSumatra.csv");
- service.exportCruiseForSumatra(exportFile, CRUISE_ID);
+ ProgressionModel progressionModel = new ProgressionModel();
+ progressionModel.setTotal(3);
+ service.exportCruiseForSumatra(exportFile, CRUISE_ID, progressionModel);
ServiceDbResource.assertFileContent("Sumatra export file:\n",
exportFile,
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportCruiseForSumatraAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportCruiseForSumatraAction.java 2014-01-13 15:18:31 UTC (rev 1484)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportCruiseForSumatraAction.java 2014-01-13 15:19:06 UTC (rev 1485)
@@ -25,6 +25,7 @@
*/
import com.google.common.base.Preconditions;
+import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.service.export.sumatra.CatchesSumatraExportService;
import fr.ifremer.tutti.ui.swing.content.MainUIHandler;
@@ -92,11 +93,14 @@
log.info("Will export cruise " + cruise.getId() +
" to file: " + file);
}
+ ProgressionModel pm = new ProgressionModel();
+ pm.setTotal(3); // loading cruise + loading fishing operationIds + export
+ setProgressionModel(pm);
// export catches
CatchesSumatraExportService service =
getContext().getCatchesSumatraExportService();
- service.exportCruiseForSumatra(file, cruise.getId());
+ service.exportCruiseForSumatra(file, cruise.getId(), pm);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraAction.java 2014-01-13 15:18:31 UTC (rev 1484)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraAction.java 2014-01-13 15:19:06 UTC (rev 1485)
@@ -25,6 +25,7 @@
*/
import com.google.common.base.Preconditions;
+import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.service.export.sumatra.CatchesSumatraExportService;
@@ -100,12 +101,17 @@
" to file: " + file);
}
+ ProgressionModel pm = new ProgressionModel();
+ pm.setTotal(3); // loading cruise + loading fishing operationIds + export
+ setProgressionModel(pm);
+
// export catches
CatchesSumatraExportService service =
getContext().getCatchesSumatraExportService();
service.exportFishingOperationForSumatra(file,
cruise.getId(),
- fishingOperation.getId());
+ fishingOperation.getId(),
+ pm);
}
1
0
r1484 - in trunk/tutti-ui-swing/src/main/assembly: full min
by tchemit@users.forge.codelutin.com 13 Jan '14
by tchemit@users.forge.codelutin.com 13 Jan '14
13 Jan '14
Author: tchemit
Date: 2014-01-13 16:18:31 +0100 (Mon, 13 Jan 2014)
New Revision: 1484
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1484
Log:
fixes #4126: [TECH] Am?\195?\169lioration des logs au d?\195?\169marrage
Modified:
trunk/tutti-ui-swing/src/main/assembly/full/tutti.bat
trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh
trunk/tutti-ui-swing/src/main/assembly/min/launch.bat
trunk/tutti-ui-swing/src/main/assembly/min/launch.sh
Modified: trunk/tutti-ui-swing/src/main/assembly/full/tutti.bat
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/full/tutti.bat 2014-01-12 13:44:33 UTC (rev 1483)
+++ trunk/tutti-ui-swing/src/main/assembly/full/tutti.bat 2014-01-13 15:18:31 UTC (rev 1484)
@@ -8,16 +8,19 @@
set JAVA_COMMAND=%JAVA_HOME%\bin\java
set TUTTI_LOG_FILE=%TUTTI_BASEDIR%\data\tutti-${project.version}.log
-echo "tutti basedir: %TUTTI_BASEDIR%"
-echo "tutti jre home: %JAVA_HOME%"
-echo "tutti log file: %TUTTI_LOG_FILE%"
+echo Allegro Campaign basedir: %TUTTI_BASEDIR%
+echo Allegro Campaign app home: %TUTTI_HOME%
+echo Allegro Campaign jre home: %JAVA_HOME%
+echo Allegro Campaign log file: %TUTTI_LOG_FILE%
:start
-copy tutti\update.bat .
+copy tutti\update.bat .
+echo Searching for updates...
call update.bat
del update.bat
-copy tutti.config tutti
+if exist "tutti.config" copy tutti.config tutti
+echo Allegro Campaign ${project.version} is starting...
call tutti\launch.bat --option tutti.launch.mode full --option tutti.basedir %TUTTI_BASEDIR%
if errorlevel 89 goto deletedb
if errorlevel 88 goto start
Modified: trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh 2014-01-12 13:44:33 UTC (rev 1483)
+++ trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh 2014-01-13 15:18:31 UTC (rev 1484)
@@ -8,17 +8,21 @@
cd $TUTTI_BASEDIR
-echo "tutti basedir: $TUTTI_BASEDIR"
-echo "tutti app home: $TUTTI_HOME"
-echo "tutti jre home: $JAVA_HOME"
-echo "tutti log file: $TUTTI_LOG_FILE"
+echo "Allegro Campaign basedir: $TUTTI_BASEDIR"
+echo "Allegro Campaign app home: $TUTTI_HOME"
+echo "Allegro Campaign jre home: $JAVA_HOME"
+echo "Allegro Campaign log file: $TUTTI_LOG_FILE"
while true; do
cp $TUTTI_HOME/update.sh .
+ echo "Searching for updates..."
./update.sh
- rm -fv update.sh
- cp $TUTTI_BASEDIR/tutti.config $TUTTI_HOME
+ rm -f update.sh
+ if [ -f $TUTTI_BASEDIR/tutti.config ]; then
+ cp -rfv $TUTTI_BASEDIR/tutti.config $TUTTI_HOME
+ fi
+ echo "Allegro Campaign ${project.version} is starting..."
./tutti/launch.sh --option tutti.launch.mode full --option tutti.basedir $TUTTI_BASEDIR
exitcode=$?
Modified: trunk/tutti-ui-swing/src/main/assembly/min/launch.bat
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/min/launch.bat 2014-01-12 13:44:33 UTC (rev 1483)
+++ trunk/tutti-ui-swing/src/main/assembly/min/launch.bat 2014-01-13 15:18:31 UTC (rev 1484)
@@ -3,9 +3,8 @@
set OLDDIR=%CD%
cd /d %~dp0%
-echo lauch java
%JAVA_COMMAND% -Xmx1024M -XX:MaxPermSize=128M -Dtutti.log.file=%TUTTI_LOG_FILE% -jar ${project.build.finalName}.${project.packaging} %1 %2 %3 %4 %5 %6 %7 %8 %9
set exitcode=%ERRORLEVEL%
-echo Stop Tutti with exitcode: %exitcode%
+echo Stop Allegro Campaign with exitcode: %exitcode%
cd %OLDDIR%
exit /b %exitcode%
Modified: trunk/tutti-ui-swing/src/main/assembly/min/launch.sh
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/min/launch.sh 2014-01-12 13:44:33 UTC (rev 1483)
+++ trunk/tutti-ui-swing/src/main/assembly/min/launch.sh 2014-01-13 15:18:31 UTC (rev 1484)
@@ -7,9 +7,9 @@
cd $REP
-echo "java command: $JAVA_COMMAND"
+#echo "java command: $JAVA_COMMAND"
$JAVA_COMMAND $MEMORY $TUTTI_JVM_OPTS -Dtutti.log.file=$TUTTI_LOG_FILE -jar ${project.build.finalName}.${project.packaging} $*
exitcode=$?
-echo "Stop Tutti with exitcode: $exitcode"
+echo "Stop Allegro Campaign with exitcode: $exitcode"
exit $exitcode
1
0
r1483 - trunk/tutti-ui-swing/src/main/filtered-resources
by tchemit@users.forge.codelutin.com 12 Jan '14
by tchemit@users.forge.codelutin.com 12 Jan '14
12 Jan '14
Author: tchemit
Date: 2014-01-12 14:44:33 +0100 (Sun, 12 Jan 2014)
New Revision: 1483
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1483
Log:
fixes #4123: [AIDE] L'aide contextuelle ne fonctionne pas sur certains boutons
Modified:
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-01-12 13:27:11 UTC (rev 1482)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-01-12 13:44:33 UTC (rev 1483)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Wed Jan 08 12:42:32 CET 2014
+#Sun Jan 12 14:36:06 CET 2014
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -176,11 +176,15 @@
tutti.editFishingOperation.field.gearLatitude.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearLongitude.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearShootingEnd.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.field.gearShootingEndDate.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearShootingEndLatitude.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearShootingEndLongitude.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.field.gearShootingEndTime.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearShootingStart.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.field.gearShootingStartDate.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearShootingStartLatitude.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearShootingStartLongitude.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.field.gearShootingStartTime.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.gearTime.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.location.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.multirigAggregation.help=editFishingOperation.html\#traitFields
1
0
Author: tchemit
Date: 2014-01-12 14:27:11 +0100 (Sun, 12 Jan 2014)
New Revision: 1482
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1482
Log:
updates jaxx to 2.7 version
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-01-10 17:33:46 UTC (rev 1481)
+++ trunk/pom.xml 2014-01-12 13:27:11 UTC (rev 1482)
@@ -124,7 +124,7 @@
<nuitonValidatorVersion>3.0-alpha-1</nuitonValidatorVersion>
<eugenePluginVersion>2.7.2</eugenePluginVersion>
<hibernateVersion>3.6.10.Final</hibernateVersion>
- <jaxxVersion>2.6</jaxxVersion>
+ <jaxxVersion>2.7</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<slf4jVersion>1.7.5</slf4jVersion>
<adagioVersion>3.4.1</adagioVersion>
1
0
10 Jan '14
Author: tchemit
Date: 2014-01-10 18:33:46 +0100 (Fri, 10 Jan 2014)
New Revision: 1481
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1481
Log:
refs #4123: [AIDE] L'aide contextuelle ne fonctionne pas sur certains boutons (utilisation jaxx 2.7 + ajout des liens sur les ?\195?\169diteurs)
Modified:
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiHelpBroker.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/report/ReportUI.css
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-01-10 17:33:46 UTC (rev 1481)
@@ -185,13 +185,13 @@
tutti.editFishingOperation.field.location.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.multirigAggregation.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.recorderPerson.help=editFishingOperation.html\#traitFields
-tutti.editFishingOperation.field.secondaryVessel.help=
+tutti.editFishingOperation.field.secondaryVessel.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.stationNumber.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.strata.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.subStrata.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.trawlDistance.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.vessel.help=editFishingOperation.html\#traitFields
-tutti.editFishingOperation.filterSecondaryVesselType.help=
+tutti.editFishingOperation.filterSecondaryVesselType.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.help=editFishingOperation.html\#traitFields
tutti.editIndividualObservationBatch.action.createBatch.help=editFishingOperation.html\#captureObservationsIndividuellesActions
tutti.editIndividualObservationBatch.action.exportMultiPost.help=editFishingOperation.html\#captureObservationsIndividuellesActions
@@ -204,7 +204,7 @@
tutti.editMarineLitterBatch.action.importMultiPost.help=editFishingOperation.html\#captureMacroDechetsActions
tutti.editMarineLitterBatch.action.removeBatch.help=editFishingOperation.html\#captureMacroDechetsActions
tutti.editMarineLitterBatch.field.marineLitterTotalWeight.help=editFishingOperation.html\#captureMacroDechetsFields
-tutti.editMarineLitterBatch.help=editMarineLitterBatch.html
+tutti.editMarineLitterBatch.help=editFishingOperation.html\#captureMacroDechetsFields
tutti.editProgram.action.cancelProgram.help=editProgram.html\#actions
tutti.editProgram.action.saveProgram.help=editProgram.html\#actions
tutti.editProgram.field.description.help=editProgram.html\#fields
@@ -316,7 +316,7 @@
tutti.main.menu.action.showHelp.help=menu.html\#menu_aide
tutti.main.menu.action.site.help=menu.html\#menu_aide
tutti.main.menu.action.updateApplication.help=menu.html\#menu_fichier
-tutti.main.menu.action.updateReport.help=
+tutti.main.menu.action.updateReport.help=menu.html\#menu_fichier
tutti.main.menu.action.validateCatches.help=menu.html\#menu_action
tutti.manageTemporaryReferential.action.exportTemporaryGearExample.help=menu.html\#menu_administration_referentiel
tutti.manageTemporaryReferential.action.exportTemporaryPersonExample.help=menu.html\#menu_administration_referentiel
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiHelpBroker.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiHelpBroker.java 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiHelpBroker.java 2014-01-10 17:33:46 UTC (rev 1481)
@@ -111,18 +111,4 @@
return result;
}
- @Override
- public Component getDeppestComponent(Component mouseComponent, MouseEvent event) {
- ComponentTreeNode tree = BuildTreeVisitor.buildTree(mouseComponent);
-
- Point point = event.getPoint();
-
- Component component = GetCompopentAtPointVisitor.get(tree, point);
- if (log.isDebugEnabled()) {
- log.debug("Component at (" + point + "): " + component);
- }
- return component;
- }
-
-
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -86,6 +86,7 @@
#nameField {
text: {model.getName()};
_validatorLabel: {_("tutti.editCruise.field.name")};
+ _help: {"tutti.editCruise.field.name.help"};
}
#surveyPartLabel {
@@ -98,6 +99,7 @@
#surveyPartField {
text: {model.getSurveyPart()};
_validatorLabel: {_("tutti.editCruise.field.surveyPart")};
+ _help: {"tutti.editCruise.field.surveyPart.help"};
}
#departureLocationLabel {
@@ -111,6 +113,7 @@
property: departureLocation;
selectedItem: {model.getDepartureLocation()};
_validatorLabel: {_("tutti.editCruise.field.departureLocation")};
+ _help: {"tutti.editCruise.field.departureLocation.help"};
}
#returnLocationLabel {
@@ -124,6 +127,7 @@
property: returnLocation;
selectedItem: {model.getReturnLocation()};
_validatorLabel: {_("tutti.editCruise.field.returnLocation")};
+ _help: {"tutti.editCruise.field.returnLocation.help"};
}
#programLabel {
@@ -137,6 +141,7 @@
property: program;
selectedItem: {model.getProgram()};
_validatorLabel: {_("tutti.editCruise.field.program")};
+ _help: {"tutti.editCruise.field.program.help"};
}
#beginDateLabel {
@@ -149,6 +154,7 @@
#beginDateField {
date: {model.getBeginDate()};
_validatorLabel: {_("tutti.editCruise.field.beginDate")};
+ _help: {"tutti.editCruise.field.beginDate.help"};
}
#endDateLabel {
@@ -161,6 +167,7 @@
#endDateField {
date: {model.getEndDate()};
_validatorLabel: {_("tutti.editCruise.field.endDate")};
+ _help: {"tutti.editCruise.field.endDate.help"};
}
#multirigNumberLabel {
@@ -176,6 +183,7 @@
useFloat: false;
numberPattern: {INT_1_DIGITS_PATTERN};
_validatorLabel: {_("tutti.editCruise.field.multirigNumber")};
+ _help: {"tutti.editCruise.field.multirigNumber.help"};
}
#filterVesselLabel {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -54,6 +54,7 @@
selectedItem: {model.getProgram()};
enabled: {!programCombobox.isEmpty()};
_validatorLabel: {_("tutti.selectCruise.field.program")};
+ _help: {"tutti.selectCruise.field.program.help"};
}
#editProgramComboBox {
@@ -100,6 +101,7 @@
selectedItem: {model.getCruise()};
enabled: {!cruiseCombobox.isEmpty()};
_validatorLabel: {_("tutti.selectCruise.field.cruise")};
+ _help: {"tutti.selectCruise.field.cruise.help"};
}
#editCruiseComboBox {
@@ -163,6 +165,7 @@
selectedItem: {model.getProtocol()};
enabled: {!protocolCombobox.isEmpty()};
_validatorLabel: {_("tutti.selectCruise.field.protocol")};
+ _help: {"tutti.selectCruise.field.protocol.help"};
}
#newProtocolComboBox {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -103,6 +103,7 @@
text: {model.getStationNumber()};
_validatorLabel: {_("tutti.editFishingOperation.field.stationNumber")};
_selectOnFocus: {true};
+ _help: {"tutti.editFishingOperation.field.stationNumber.help"};
}
#fishingOperationNumberLabel {
@@ -118,6 +119,7 @@
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
_validatorLabel: {_("tutti.editFishingOperation.field.fishingOperationNumber")};
+ _help: {"tutti.editFishingOperation.field.fishingOperationNumber.help"};
}
#strataLabel {
@@ -131,6 +133,7 @@
property: strata;
selectedItem: {model.getStrata()};
_validatorLabel: {_("tutti.editFishingOperation.field.strata")};
+ _help: {"tutti.editFishingOperation.field.strata.help"};
}
#subStrataLabel {
@@ -144,6 +147,7 @@
property: subStrata;
selectedItem: {model.getSubStrata()};
_validatorLabel: {_("tutti.editFishingOperation.field.subStrata")};
+ _help: {"tutti.editFishingOperation.field.subStrata.help"};
}
#locationLabel {
@@ -157,6 +161,7 @@
property: location;
selectedItem: {model.getLocation()};
_validatorLabel: {_("tutti.editFishingOperation.field.location")};
+ _help: {"tutti.editFishingOperation.field.location.help"};
}
#gearLongitudeLabel {
@@ -218,6 +223,7 @@
#vesselField {
text: {handler.decorateVessel(model.getVessel())};
_strongStyle: true;
+ _help: {"tutti.editFishingOperation.field.vessel.help"};
}
#gearLabel {
@@ -232,6 +238,7 @@
property: gear;
selectedItem: {model.getGear()};
_validatorLabel: {_("tutti.editFishingOperation.field.gear")};
+ _help: {"tutti.editFishingOperation.field.gear.help"};
}
#multirigAggregationLabel {
@@ -244,14 +251,18 @@
#multirigAggregationField {
text: {model.getMultirigAggregation()};
_validatorLabel: {_("tutti.editFishingOperation.field.multirigAggregation")};
+ _help: {"tutti.editFishingOperation.field.multirigAggregation.help"};
}
+#secondaryVesselFilterPane {
+ _help: {"tutti.editFishingOperation.filterSecondaryVesselType.help"};
+}
+
#filterSecondaryVesselLabel {
text: "tutti.editFishingOperation.filterSecondaryVesselType";
_strongStyle: true;
actionIcon: filter;
toolTipText: "tutti.editFishingOperation.filterSecondaryVesselType.tip";
- _help: {"tutti.editFishingOperation.filterSecondaryVesselType.help"};
}
#filterSecondaryVesselAllButton {
@@ -489,21 +500,25 @@
#gearShootingStartDateField {
date: {model.getGearShootingStartDate()};
_validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartDate")};
+ _help: {"tutti.editFishingOperation.field.gearShootingStartDate.help"};
}
#gearShootingStartTimeField {
property: gearShootingStartTime;
date: {model.getGearShootingStartDate()};
+ _help: {"tutti.editFishingOperation.field.gearShootingStartTime.help"};
}
#gearShootingEndDateField {
date: {model.getGearShootingEndDate()};
_validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndDate")};
+ _help: {"tutti.editFishingOperation.field.gearShootingEndDate.help"};
}
#gearShootingEndTimeField {
property: gearShootingEndTime;
date: {model.getGearShootingEndDate()};
+ _help: {"tutti.editFishingOperation.field.gearShootingEndTime.help"};
}
#fishingOperationValidPanel {
@@ -519,17 +534,20 @@
text: "tutti.editFishingOperation.field.fishingOperationValid";
selected: {model.getFishingOperationValid() == Boolean.TRUE};
buttonGroup: "fishingOperationValid";
+ _help: {"tutti.editFishingOperation.field.fishingOperationValid.help"};
}
#fishingOperationInvalidRadio {
text: "tutti.editFishingOperation.field.fishingOperationInvalid";
selected: {model.getFishingOperationValid() == Boolean.FALSE};
buttonGroup: "fishingOperationValid";
+ _help: {"tutti.editFishingOperation.field.fishingOperationValid.help"};
}
#fishingOperationResetRadio {
selected: {model.getFishingOperationValid() == null};
buttonGroup: "fishingOperationValid";
+ _help: {"tutti.editFishingOperation.field.fishingOperationValid.help"};
}
#fishingOperationRectiligneCheckBox {
@@ -554,6 +572,7 @@
enabled: {!model.isFishingOperationRectiligne()};
toolTipText: {handler.getTrawlDistanceTooltipText(model.getTrawlDistance())};
_validatorLabel: {_("tutti.editFishingOperation.field.trawlDistance")};
+ _help: {"tutti.editFishingOperation.field.trawlDistance.help"};
}
#durationLabel {
@@ -567,6 +586,7 @@
text: {handler.getDuration(model.getGearShootingStartDate(), model.getGearShootingEndDate())};
enabled: false;
_validatorLabel: {_("tutti.editFishingOperation.field.duration")};
+ _help: {"tutti.editFishingOperation.field.duration.help"};
}
#recorderPersonList {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2014-01-10 17:33:46 UTC (rev 1481)
@@ -233,9 +233,6 @@
<cell>
<JPanel/>
</cell>
- <!--cell>
- <JPanel/>
- </cell-->
<cell>
<JLabel id='gearLatitudeLabel'/>
</cell>
@@ -254,21 +251,6 @@
<cell>
<JLabel id='gearShootingStartLabel'/>
</cell>
- <!--cell rows="2" fill="both">
-
- <JPanel id='quadrant'
- layout="{new GridLayout(2,2,0,0)}"
- background='{Color.GREEN}'>
- <JToggleButton id='quadrant4'
- onActionPerformed='handler.setQuadrantValue(4)'/>
- <JToggleButton id='quadrant1'
- onActionPerformed='handler.setQuadrantValue(1)'/>
- <JToggleButton id='quadrant3'
- onActionPerformed='handler.setQuadrantValue(3)'/>
- <JToggleButton id='quadrant2'
- onActionPerformed='handler.setQuadrantValue(2)'/>
- </JPanel>
- </cell-->
<cell weightx='1'>
<JPanel id='gearShootingStartLatitudePanel'>
<NumberEditor id='gearShootingStartLatitudeDDField'
@@ -304,9 +286,6 @@
<cell>
<JLabel id='gearShootingEndLabel'/>
</cell>
- <!--cell>
- <JPanel/>
- </cell-->
<cell weightx='1'>
<JPanel id='gearShootingEndLatitudePanel'>
<NumberEditor id='gearShootingEndLatitudeDDField'
@@ -344,9 +323,6 @@
<cell>
<JLabel/>
</cell>
- <!--cell>
- <JPanel/>
- </cell-->
<cell>
<JCheckBox id='fishingOperationRectiligneCheckBox'
onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -96,6 +96,7 @@
#catchTotalWeightField {
bean: {model.getCatchTotalComputedOrNotWeight()};
model: {model.getCatchTotalWeight()};
+ _help: {"tutti.editCatchBatch.field.catchTotalWeight.help"};
}
#catchTotalSortedWeightLabel {
@@ -109,6 +110,7 @@
#catchTotalSortedWeightField {
text: {getWeightStringValue(model.getCatchTotalSortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.catchTotalSortedWeight.help"};
}
#tremieCarrouselRow {
@@ -126,6 +128,7 @@
#catchTotalSortedTremisWeightField {
enabled: false;
text: {getWeightStringValue(model.getCatchTotalSortedTremisWeight())};
+ _help: {"tutti.editCatchBatch.field.catchTotalSortedTremisWeight.help"};
}
#catchTotalSortedCarousselWeightLabel {
@@ -139,6 +142,7 @@
#catchTotalSortedCarousselWeightField {
enabled: false;
text: {getWeightStringValue(model.getCatchTotalSortedCarousselWeight())};
+ _help: {"tutti.editCatchBatch.field.catchTotalSortedCarousselWeight.help"};
}
#catchTotalRejectedWeightLabel {
@@ -152,6 +156,7 @@
#catchTotalRejectedWeightField {
bean: {model.getCatchTotalRejectedComputedOrNotWeight()};
model: {model.getCatchTotalRejectedWeight()};
+ _help: {"tutti.editCatchBatch.field.catchTotalRejectedWeight.help"};
}
#catchTotalUnsortedWeightLabel {
@@ -165,6 +170,7 @@
#catchTotalUnsortedWeightField {
text: {getWeightStringValue(model.getCatchTotalUnsortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.catchTotalUnsortedWeight.help"};
}
#speciesTabPanel {
@@ -187,6 +193,7 @@
#speciesTotalWeightField {
text: {getWeightStringValue(model.getSpeciesTotalComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.speciesTotalWeight.help"};
}
#speciesTotalSortedWeightLabel {
@@ -200,6 +207,7 @@
#speciesTotalSortedWeightField {
bean: {model.getSpeciesTotalSortedComputedOrNotWeight()};
model: {model.getSpeciesTotalSortedWeight()};
+ _help: {"tutti.editCatchBatch.field.speciesTotalSortedWeight.help"};
}
#speciesTotalSampleSortedWeightLabel {
@@ -213,6 +221,7 @@
#speciesTotalSampleSortedWeightField {
text: {getWeightStringValue(model.getSpeciesTotalSampleSortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.help"};
}
#speciesTotalUnsortedWeightLabel {
@@ -226,6 +235,7 @@
#speciesTotalUnsortedWeightField {
text: {getWeightStringValue(model.getSpeciesTotalUnsortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.speciesTotalUnsortedWeight.help"};
}
#benthosTabPanel {
@@ -248,6 +258,7 @@
#benthosTotalWeightField {
text: {getWeightStringValue(model.getBenthosTotalComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.benthosTotalWeight.help"};
}
#benthosTotalSortedWeightLabel {
@@ -261,6 +272,7 @@
#benthosTotalSortedWeightField {
bean: {model.getBenthosTotalSortedComputedOrNotWeight()};
model: {model.getBenthosTotalSortedWeight()};
+ _help: {"tutti.editCatchBatch.field.benthosTotalSortedWeight.help"};
}
#benthosTotalSampleSortedWeightLabel {
@@ -274,6 +286,7 @@
#benthosTotalSampleSortedWeightField {
text: {getWeightStringValue(model.getBenthosTotalSampleSortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.benthosTotalSampleSortedWeight.help"};
}
#benthosTotalUnsortedWeightLabel {
@@ -287,6 +300,7 @@
#benthosTotalUnsortedWeightField {
text: {getWeightStringValue(model.getBenthosTotalUnsortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editCatchBatch.field.benthosTotalUnsortedWeight.help"};
}
#marineLitterTabPanel {
@@ -309,6 +323,7 @@
#marineLitterTotalWeightField {
bean: {model.getMarineLitterTotalComputedOrNotWeight()};
model: {model.getMarineLitterTotalWeight()};
+ _help: {"tutti.editCatchBatch.field.marineLitterTotalWeight.help"};
}
#accidentalTabPanel {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -44,6 +44,7 @@
#accidentalSpeciesComboBox {
property: species;
selectedItem: {model.getSpecies()};
+ _help: {"tutti.createAccidentalBatch.field.accidentalSpecies.help"};
}
#accidentalGenderLabel {
@@ -56,6 +57,7 @@
#accidentalGenderComboBox {
property: gender;
selectedItem: {model.getGender()};
+ _help: {"tutti.createAccidentalBatch.field.accidentalGender.help"};
}
#accidentalWeightLabel {
@@ -71,6 +73,7 @@
useFloat: true;
bean: {model};
model: {model.getWeight()};
+ _help: {"tutti.createAccidentalBatch.field.accidentalWeight.help"};
}
#accidentalSizeLabel {
@@ -86,6 +89,7 @@
numberPattern: {DECIMAL3_PATTERN};
bean: {model};
model: {model.getSize()};
+ _help: {"tutti.createAccidentalBatch.field.accidentalSize.help"};
}
#accidentalLengthStepCaracteristicLabel {
@@ -98,6 +102,7 @@
#accidentalLengthStepCaracteristicComboBox {
property: lengthStepCaracteristic;
selectedItem: {model.getLengthStepCaracteristic()};
+ _help: {"tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic.help"};
}
#accidentalDeadOrAliveLabel {
@@ -110,6 +115,7 @@
#accidentalDeadOrAliveComboBox {
property: deadOrAlive;
selectedItem: {model.getDeadOrAlive()};
+ _help: {"tutti.createAccidentalBatch.field.accidentalDeadOrAlive.help"};
}
#saveAndContinueButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -60,6 +60,7 @@
#benthosTotalWeightField {
text: {getWeightStringValue(model.getBenthosTotalComputedWeight())};
_computed: true;
+ _help: {"tutti.editBenthosBatch.field.benthosTotalWeight.help"};
}
#benthosTotalSortedWeightLabel {
@@ -73,6 +74,7 @@
#benthosTotalSortedWeightField {
bean: {model.getBenthosTotalSortedComputedOrNotWeight()};
model: {model.getBenthosTotalSortedWeight()};
+ _help: {"tutti.editBenthosBatch.field.benthosTotalSortedWeight.help"};
}
#benthosTotalSampleSortedWeightLabel {
@@ -86,6 +88,7 @@
#benthosTotalSampleSortedWeightField {
text: {getWeightStringValue(model.getBenthosTotalSampleSortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editBenthosBatch.field.benthosTotalSampleSortedWeight.help"};
}
#benthosTotalUnsortedWeightLabel {
@@ -99,6 +102,7 @@
#benthosTotalUnsortedWeightField {
text: {getWeightStringValue(model.getBenthosTotalUnsortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editBenthosBatch.field.benthosTotalUnsortedWeight.help"};
}
#benthosTotalInertWeightLabel {
@@ -112,6 +116,7 @@
#benthosTotalInertWeightField {
bean: {model.getBenthosTotalInertComputedOrNotWeight()};
model: {model.getBenthosTotalInertWeight()};
+ _help: {"tutti.editBenthosBatch.field.benthosTotalInertWeight.help"};
}
#benthosTotalLivingNotItemizedWeightLabel {
@@ -125,6 +130,7 @@
#benthosTotalLivingNotItemizedWeightField {
bean: {model.getBenthosTotalLivingNotItemizedComputedOrNotWeight()};
model: {model.getBenthosTotalLivingNotItemizedWeight()};
+ _help: {"tutti.editBenthosBatch.field.benthosTotalLivingNotItemizedWeight.help"};
}
#tablePopup {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -48,6 +48,7 @@
property: species;
selectedItem: {model.getSpecies()};
data: {model.getAvailableSpecies()};
+ _help: {"tutti.createBenthosBatch.field.species.help"};
}
#categoryPanel {
@@ -64,6 +65,7 @@
#sampleCategoryComboBox {
property: sampleCategory;
selectedItem: {model.getSampleCategory()};
+ _help: {"tutti.createBenthosBatch.field.sampleCategory.help"};
}
#batchWeightLabel {
@@ -79,6 +81,7 @@
model: {model.getBatchWeight()};
useFloat: true;
bean: {model};
+ _help: {"tutti.createBenthosBatch.field.batchWeight.help"};
}
#batchCountLabel {
@@ -94,6 +97,7 @@
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
bean: {model};
+ _help: {"tutti.createBenthosBatch.field.batchCount.help"};
}
#categoryLabel {
@@ -111,6 +115,7 @@
selectedItem: {model.getSelectedCategory()};
data: {model.getCategory()};
enabled: {model.getBatchCount() == null};
+ _help: {"tutti.createBenthosBatch.field.categoryField.help"};
}
#sampleWeightLabel {
@@ -124,6 +129,7 @@
#sampleWeightField {
text: {getStringValue(model.getSampleWeight())};
_computed: true;
+ _help: {"tutti.createBenthosBatch.field.sampleWeightField.help"};
}
#table {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -53,6 +53,7 @@
enabled: {!model.isSimpleCountingMode()};
_selectOnFocus: true;
_validatorLabel: {_("tutti.editBenthosFrequencies.field.step")};
+ _help: {"tutti.editBenthosFrequencies.field.step.help"};
}
#totalNumberLabel {
@@ -67,6 +68,7 @@
text: {getStringValue(model.getTotalNumber())};
enabled: false;
_computed: true;
+ _help: {"tutti.editBenthosFrequencies.field.totalNumber.help"};
}
#totalWeightLabel {
@@ -82,6 +84,7 @@
text: {getWeightStringValue(model.getTotalWeight())};
enabled: false;
_computed: true;
+ _help: {"tutti.editBenthosFrequencies.field.totalWeight.help"};
}
#lengthStepCaracteristicLabel {
@@ -97,6 +100,7 @@
selectedItem: {model.getLengthStepCaracteristic()};
enabled: {!model.isSimpleCountingMode()};
_validatorLabel: {_("tutti.editBenthosFrequencies.field.lengthStepCaracteristic")};
+ _help: {"tutti.editBenthosFrequencies.field.lengthStepCaracteristic.help"};
}
#minStepLabel {
@@ -114,6 +118,7 @@
numberPattern: {DECIMAL1_PATTERN};
bean: {model};
_selectOnFocus: true;
+ _help: {"tutti.editBenthosFrequencies.field.minStep.help"};
}
#maxStepLabel {
@@ -131,6 +136,7 @@
numberPattern: {DECIMAL1_PATTERN};
bean: {model};
_selectOnFocus: true;
+ _help: {"tutti.editBenthosFrequencies.field.maxStep.help"};
}
#rafaleStepLabel {
@@ -147,6 +153,7 @@
numberPattern: {DECIMAL1_PATTERN};
enabled: {model.getLengthStepCaracteristic() != null};
_selectOnFocus: true;
+ _help: {"tutti.editBenthosFrequencies.field.rafaleStep.help"};
}
#configurationPanel {
@@ -205,6 +212,7 @@
showReset: true;
numberPattern: {TuttiUI.INT_6_DIGITS_PATTERN};
bean: {model};
+ _help: {"tutti.editBenthosFrequencies.field.simpleCounting.help"};
}
#dataInFrequenciesWarningContainer {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -39,6 +39,7 @@
#categoryComboBox {
selectedItem: {model.getSelectedCategory()};
+ _help: {"tutti.splitBenthosBatch.field.categoryField.help"};
}
#batchWeightLabel {
@@ -53,6 +54,7 @@
editable: false;
enabled: false;
text: {getStringValue(model.getBatchWeight())};
+ _help: {"tutti.splitBenthosBatch.field.batchWeightField.help"};
}
#sampleWeightLabel {
@@ -65,6 +67,7 @@
#sampleWeightField {
_computed: true;
text: {getStringValue(model.getSampleWeight())};
+ _help: {"tutti.splitBenthosBatch.field.sampleWeightField.help"};
}
#table {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -47,6 +47,7 @@
property: species;
selectedItem: {model.getSpecies()};
data: {model.getAvailableSpecies()};
+ _help: {"tutti.createIndividualObservationBatch.field.individualObservationSpecies.help"};
}
#individualObservationCreateFromBatch {
@@ -68,6 +69,7 @@
#individualObservationWeightField {
property: weight;
model: {model.getWeight()};
+ _help: {"tutti.createIndividualObservationBatch.field.individualObservationWeight.help"};
}
#individualObservationSizeLabel {
@@ -80,6 +82,7 @@
#individualObservationSizeField {
property: size;
model: {model.getSize()};
+ _help: {"tutti.createIndividualObservationBatch.field.individualObservationSize.help"};
}
#individualObservationLengthStepCaracteristicLabel {
@@ -92,6 +95,7 @@
#individualObservationLengthStepCaracteristicComboBox {
property: lengthStepCaracteristic;
selectedItem: {model.getLengthStepCaracteristic()};
+ _help: {"tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.help"};
}
#addSpeciesButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -53,6 +53,7 @@
#marineLitterTotalWeightField {
bean: {model.getMarineLitterTotalComputedOrNotWeight()};
model: {model.getMarineLitterTotalWeight()};
+ _help: {"tutti.editMarineLitterBatch.field.marineLitterTotalWeight.help"};
}
#tablePopup {
@@ -61,7 +62,6 @@
#table {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
- /*selectionBackground: {null};*/
selectionForeground: {Color.BLACK};
sortable: false;
}
@@ -89,7 +89,6 @@
text: "tutti.editMarineLitterBatch.action.createBatch";
toolTipText: "tutti.editMarineLitterBatch.action.createBatch.tip";
i18nMnemonic: "tutti.editMarineLitterBatch.action.createBatch.mnemonic";
- /*enabled: {model.isCreateBatchEnabled()};*/
_help: {"tutti.editMarineLitterBatch.action.createBatch.help"};
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -48,6 +48,7 @@
#marineLitterCategoryComboBox {
property: marineLitterCategory;
selectedItem: {model.getMarineLitterCategory()};
+ _help: {"tutti.createMarineLitterBatch.field.marineLitterCategory.help"};
}
#marineLitterSizeCategoryLabel {
@@ -60,6 +61,7 @@
#marineLitterSizeCategoryComboBox {
property: marineLitterSizeCategory;
selectedItem: {model.getMarineLitterSizeCategory()};
+ _help: {"tutti.createMarineLitterBatch.field.marineLitterSizeCategory.help"};
}
#marineLitterNumberLabel {
@@ -73,6 +75,7 @@
property: number;
model: {model.getNumber()};
numberPattern: {DECIMAL3_PATTERN};
+ _help: {"tutti.createMarineLitterBatch.field.number.help"};
}
#marineLitterWeightLabel {
@@ -86,6 +89,7 @@
#marineLitterWeightField {
property: weight;
model: {model.getWeight()};
+ _help: {"tutti.createMarineLitterBatch.field.weight.help"};
}
#saveAndContinueButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -60,6 +60,7 @@
#speciesTotalWeightField {
text: {getWeightStringValue(model.getSpeciesTotalComputedWeight())};
_computed: true;
+ _help: {"tutti.editSpeciesBatch.field.speciesTotalWeight.help"};
}
#speciesTotalSortedWeightLabel {
@@ -73,6 +74,7 @@
#speciesTotalSortedWeightField {
bean: {model.getSpeciesTotalSortedComputedOrNotWeight()};
model: {model.getSpeciesTotalSortedWeight()};
+ _help: {"tutti.editSpeciesBatch.field.speciesTotalSortedWeight.help"};
}
#speciesTotalSampleSortedWeightLabel {
@@ -86,6 +88,7 @@
#speciesTotalSampleSortedWeightField {
text: {getWeightStringValue(model.getSpeciesTotalSampleSortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editSpeciesBatch.field.speciesTotalSampleSortedWeight.help"};
}
#speciesTotalUnsortedWeightLabel {
@@ -99,6 +102,7 @@
#speciesTotalUnsortedWeightField {
text: {getWeightStringValue(model.getSpeciesTotalUnsortedComputedWeight())};
_computed: true;
+ _help: {"tutti.editSpeciesBatch.field.speciesTotalUnsortedWeight.help"};
}
#speciesTotalInertWeightLabel {
@@ -112,6 +116,7 @@
#speciesTotalInertWeightField {
bean: {model.getSpeciesTotalInertComputedOrNotWeight()};
model: {model.getSpeciesTotalInertWeight()};
+ _help: {"tutti.editSpeciesBatch.field.speciesTotalInertWeight.help"};
}
#speciesTotalLivingNotItemizedWeightLabel {
@@ -125,6 +130,7 @@
#speciesTotalLivingNotItemizedWeightField {
bean: {model.getSpeciesTotalLivingNotItemizedComputedOrNotWeight()};
model: {model.getSpeciesTotalLivingNotItemizedWeight()};
+ _help: {"tutti.editSpeciesBatch.field.speciesTotalLivingNotItemizedWeight.help"};
}
#tablePopup {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -48,6 +48,7 @@
property: species;
selectedItem: {model.getSpecies()};
data: {model.getAvailableSpecies()};
+ _help: {"tutti.createSpeciesBatch.field.species.help"};
}
#categoryPanel {
@@ -64,6 +65,7 @@
#sampleCategoryComboBox {
property: sampleCategory;
selectedItem: {model.getSampleCategory()};
+ _help: {"tutti.createSpeciesBatch.field.sampleCategory.help"};
}
#batchWeightLabel {
@@ -79,6 +81,7 @@
model: {model.getBatchWeight()};
useFloat: true;
bean: {model};
+ _help: {"tutti.createSpeciesBatch.field.batchWeight.help"};
}
#batchCountLabel {
@@ -94,6 +97,7 @@
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
bean: {model};
+ _help: {"tutti.createSpeciesBatch.field.batchCount.help"};
}
#categoryLabel {
@@ -111,6 +115,7 @@
selectedItem: {model.getSelectedCategory()};
data: {model.getCategory()};
enabled: {model.getBatchCount() == null};
+ _help: {"tutti.createSpeciesBatch.field.categoryField.help"};
}
#sampleWeightLabel {
@@ -124,6 +129,7 @@
#sampleWeightField {
_computed: true;
text: {getStringValue(model.getSampleWeight())};
+ _help: {"tutti.createSpeciesBatch.field.sampleWeightField.help"};
}
#table {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -53,6 +53,7 @@
enabled: {!model.isSimpleCountingMode()};
_selectOnFocus: true;
_validatorLabel: {_("tutti.editSpeciesFrequencies.field.step")};
+ _help: {"tutti.editSpeciesFrequencies.field.step.help"};
}
#totalNumberLabel {
@@ -67,6 +68,7 @@
text: {getStringValue(model.getTotalNumber())};
enabled: false;
_computed: true;
+ _help: {"tutti.editSpeciesFrequencies.field.totalNumber.help"};
}
#totalWeightLabel {
@@ -82,6 +84,7 @@
text: {getWeightStringValue(model.getTotalWeight())};
enabled: false;
_computed: true;
+ _help: {"tutti.editSpeciesFrequencies.field.totalWeight.help"};
}
#lengthStepCaracteristicLabel {
@@ -97,6 +100,7 @@
selectedItem: {model.getLengthStepCaracteristic()};
enabled: {!model.isSimpleCountingMode()};
_validatorLabel: {_("tutti.editSpeciesFrequencies.field.lengthStepCaracteristic")};
+ _help: {"tutti.editSpeciesFrequencies.field.lengthStepCaracteristic.help"};
}
#minStepLabel {
@@ -114,6 +118,7 @@
numberPattern: {DECIMAL1_PATTERN};
bean: {model};
_selectOnFocus: true;
+ _help: {"tutti.editSpeciesFrequencies.field.minStep.help"};
}
#maxStepLabel {
@@ -131,6 +136,7 @@
numberPattern: {DECIMAL1_PATTERN};
bean: {model};
_selectOnFocus: true;
+ _help: {"tutti.editSpeciesFrequencies.field.maxStep.help"};
}
#rafaleStepLabel {
@@ -147,6 +153,7 @@
numberPattern: {DECIMAL1_PATTERN};
enabled: {model.getLengthStepCaracteristic() != null};
_selectOnFocus: true;
+ _help: {"tutti.editSpeciesFrequencies.field.rafaleStep.help"};
}
#configurationPanel {
@@ -205,6 +212,7 @@
showReset: true;
numberPattern: {TuttiUI.INT_6_DIGITS_PATTERN};
bean: {model};
+ _help: {"tutti.editSpeciesFrequencies.field.simpleCounting.help"};
}
#dataInFrequenciesWarningContainer {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -53,6 +53,7 @@
editable: false;
enabled: false;
text: {getStringValue(model.getBatchWeight())};
+ _help: {"tutti.splitSpeciesBatch.field.batchWeightField.help"};
}
#sampleWeightLabel {
@@ -66,6 +67,7 @@
#sampleWeightField {
_computed: true;
text: {getStringValue(model.getSampleWeight())};
+ _help: {"tutti.splitSpeciesBatch.field.sampleWeightField.help"};
}
#table {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -49,6 +49,7 @@
#nameField {
text: {model.getName()};
_validatorLabel: {_("tutti.editProgram.field.name")};
+ _help: {"tutti.editProgram.field.name.help"};
}
#descriptionPane {
@@ -60,6 +61,7 @@
#descriptionField {
text: {getStringValue(model.getDescription())};
_validatorLabel: {_("tutti.editProgram.field.description")};
+ _help: {"tutti.editProgram.field.description.help"};
}
#zoneLabel {
@@ -73,6 +75,7 @@
property: zone;
selectedItem: {model.getZone()};
_validatorLabel: {_("tutti.editProgram.field.zone")};
+ _help: {"tutti.editProgram.field.zone.help"};
}
#saveButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -54,6 +54,7 @@
#nameField {
text: {model.getName()};
_validatorLabel: {_("tutti.editProtocol.field.protocol.name")};
+ _help: {"tutti.editProtocol.field.name.help"};
}
#commentPane {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/report/ReportUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/report/ReportUI.css 2014-01-08 12:38:08 UTC (rev 1480)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/report/ReportUI.css 2014-01-10 17:33:46 UTC (rev 1481)
@@ -54,6 +54,7 @@
property: report;
selectedItem: {model.getReport()};
_validatorLabel: {_("tutti.report.field.report")};
+ _help: {"tutti.report.field.report.help"};
}
#fishingOperationLabel {
@@ -67,6 +68,7 @@
property: fishingOperation;
selectedItem: {model.getFishingOperation()};
_validatorLabel: {_("tutti.report.field.fishingOperation")};
+ _help: {"tutti.report.field.fishingOperation.help"};
}
#outputFileLabel {
@@ -79,6 +81,7 @@
#outputFileField {
selectedFile: {model.getOutputFile()};
_validatorLabel: {_("tutti.report.field.outputFile")};
+ _help: {"tutti.report.field.outputFile.help"};
}
#showOutputFileButton {
1
0
r1480 - in trunk/tutti-ui-swing/src/main/help: en fr
by tchemit@users.forge.codelutin.com 08 Jan '14
by tchemit@users.forge.codelutin.com 08 Jan '14
08 Jan '14
Author: tchemit
Date: 2014-01-08 13:38:08 +0100 (Wed, 08 Jan 2014)
New Revision: 1480
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1480
Log:
refs #4073: [ERGO] Tri du tableau des esp?\195?\168ces (update doc)
Modified:
trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html
trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html
Modified: trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html 2014-01-08 12:34:01 UTC (rev 1479)
+++ trunk/tutti-ui-swing/src/main/help/en/editFishingOperation.html 2014-01-08 12:38:08 UTC (rev 1480)
@@ -440,9 +440,23 @@
l'applicatif propose le nombre de lignes « parents » dans le
tableau.
</dd>
+ <dt>Tri / Saisie</dt>
+ <dd>
+ dans le tableau, on affiche les lots dans l'ordre de saisie.
+ </dd>
+ <dt>Tri / Ascendant</dt>
+ <dd>
+ dans le tableau, on affiche les lots dans l'ordre ascendant sur la colonne espèce.
+ </dd>
+ <dt>Tri / Descendant</dt>
+ <dd>
+ dans le tableau, on affiche les lots dans l'ordre descendant sur la colonne espèce.
+ </dd>
<dt>Espèce</dt>
<dd>
- « Code campagne ou Code Rubin – nom scientifique » du lot
+ « Code campagne ou Code Rubin – nom scientifique » du lot.
+ <br/>
+ Un clic droit sur l'en-tête de la colonne permet de changer la décoration.
</dd>
<dt>V/HV</dt>
<dd>
Modified: trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html 2014-01-08 12:34:01 UTC (rev 1479)
+++ trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html 2014-01-08 12:38:08 UTC (rev 1480)
@@ -438,9 +438,23 @@
l'applicatif propose le nombre de lignes « parents » dans le
tableau.
</dd>
+ <dt>Tri / Saisie</dt>
+ <dd>
+ dans le tableau, on affiche les lots dans l'ordre de saisie.
+ </dd>
+ <dt>Tri / Ascendant</dt>
+ <dd>
+ dans le tableau, on affiche les lots dans l'ordre ascendant sur la colonne espèce.
+ </dd>
+ <dt>Tri / Descendant</dt>
+ <dd>
+ dans le tableau, on affiche les lots dans l'ordre descendant sur la colonne espèce.
+ </dd>
<dt>Espèce</dt>
<dd>
- « Code campagne ou Code Rubin – nom scientifique » du lot
+ « Code campagne ou Code Rubin – nom scientifique » du lot.
+ <br/>
+ Un clic droit sur l'en-tête de la colonne permet de changer la décoration.
</dd>
<dt>V/HV</dt>
<dd>
1
0
r1479 - in trunk/tutti-ui-swing/src/main: filtered-resources java/fr/ifremer/tutti/ui/swing/content/operation/catches java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos java/fr/ifremer/tutti/ui/swing/content/operation/catches/species java/fr/ifremer/tutti/ui/swing/content/protocol java/fr/ifremer/tutti/ui/swing/util resources/i18n resources/icons
by tchemit@users.forge.codelutin.com 08 Jan '14
by tchemit@users.forge.codelutin.com 08 Jan '14
08 Jan '14
Author: tchemit
Date: 2014-01-08 13:34:01 +0100 (Wed, 08 Jan 2014)
New Revision: 1479
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1479
Log:
fixes #4073: [ERGO] Tri du tableau des esp?\195?\168ces
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchRowHelper.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortMode.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortableRowModel.java
trunk/tutti-ui-swing/src/main/resources/icons/action-sort.png
Modified:
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecorator.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecoratorComparator.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-01-08 12:34:01 UTC (rev 1479)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Mon Dec 09 15:37:05 CET 2013
+#Wed Jan 08 12:42:32 CET 2014
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -85,6 +85,9 @@
tutti.editBenthosBatch.field.benthosTotalSortedWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosBatch.field.benthosTotalUnsortedWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosBatch.field.benthosTotalWeight.help=editFishingOperation.html\#captureBenthosFields
+tutti.editBenthosBatch.field.speciesSortMode.asc.help=editFishingOperation.html\#captureBenthosFields
+tutti.editBenthosBatch.field.speciesSortMode.desc.help=editFishingOperation.html\#captureBenthosFields
+tutti.editBenthosBatch.field.speciesSortMode.none.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosBatch.field.speciesTotalInertWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosBatch.field.speciesTotalLivingNotItemizedWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosBatch.field.speciesTotalSampleSortedWeight.help=editFishingOperation.html\#captureBenthosFields
@@ -93,6 +96,7 @@
tutti.editBenthosBatch.field.speciesTotalWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosBatch.filterBatch.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosBatch.help=editFishingOperation.html\#captureBenthos
+tutti.editBenthosBatch.sortSpeciesBatch.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosFrequencies.action.addLengthStepCaracteristic.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosFrequencies.action.cancel.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosFrequencies.action.generate.help=editFishingOperation.html\#captureBenthosActions
@@ -252,6 +256,9 @@
tutti.editSpeciesBatch.action.removeSubBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.renameBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.splitBatch.help=editFishingOperation.html\#captureEspecesActions
+tutti.editSpeciesBatch.field.speciesSortMode.asc.help=editFishingOperation.html\#captureEspecesFields
+tutti.editSpeciesBatch.field.speciesSortMode.desc.help=editFishingOperation.html\#captureEspecesFields
+tutti.editSpeciesBatch.field.speciesSortMode.none.help=editFishingOperation.html\#captureEspecesFields
tutti.editSpeciesBatch.field.speciesTotalInertWeight.help=editFishingOperation.html\#captureEspecesFields
tutti.editSpeciesBatch.field.speciesTotalLivingNotItemizedWeight.help=editFishingOperation.html\#captureEspecesFields
tutti.editSpeciesBatch.field.speciesTotalSampleSortedWeight.help=editFishingOperation.html\#captureEspecesFields
@@ -260,6 +267,7 @@
tutti.editSpeciesBatch.field.speciesTotalWeight.help=editFishingOperation.html\#captureEspecesFields
tutti.editSpeciesBatch.filterSpeciesBatch.help=editFishingOperation.html\#captureEspecesFields
tutti.editSpeciesBatch.help=editFishingOperation.html\#captureEspeces
+tutti.editSpeciesBatch.sortSpeciesBatch.help=editFishingOperation.html\#captureEspecesFields
tutti.editSpeciesFrequencies.action.addLengthStepCaracteristic.help=editFishingOperation.html\#captureEspecesMensurationActions
tutti.editSpeciesFrequencies.action.cancel.help=editFishingOperation.html\#captureEspecesMensurationActions
tutti.editSpeciesFrequencies.action.generate.help=editFishingOperation.html\#captureEspecesMensurationActions
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecorator.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecorator.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecorator.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -27,7 +27,6 @@
import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
-import org.jdesktop.swingx.JXTable;
import static org.nuiton.i18n.I18n._;
@@ -42,17 +41,23 @@
private static final long serialVersionUID = 1L;
- public static <R extends SpeciesAbleBatch> SpeciesBatchDecorator<R> newDecorator(JXTable table) {
- return new SpeciesBatchDecorator<R>(table);
+ public static <R extends SpeciesAbleBatch> SpeciesBatchDecorator<R> newDecorator() {
+ return new SpeciesBatchDecorator<R>();
}
- public SpeciesBatchDecorator(JXTable table) throws IllegalArgumentException, NullPointerException {
+ protected final TuttiDecoratorComparator[] originalComparators;
+
+ public SpeciesBatchDecorator() throws IllegalArgumentException, NullPointerException {
super();
- // use special comparator
- for (Context context : contexts) {
+ int nbContext = getNbContext();
+ originalComparators = new TuttiDecoratorComparator[nbContext];
+
+ for (int i = 0; i < nbContext; i++) {
TuttiDecoratorComparator comparator = (TuttiDecoratorComparator<?>) context.getComparator(0);
- context.setComparator(new SpeciesBatchDecoratorComparator<R>(comparator.getExpression(), table));
+ originalComparators[i] = comparator;
+ Context context = contexts[i];
+ context.setComparator(new SpeciesBatchDecoratorComparator<R>(comparator.getExpression()));
}
}
@@ -84,4 +89,20 @@
}
return result;
}
+
+ public TuttiDecoratorComparator getOriginalComparator() {
+ return originalComparators[contextIndex];
+ }
+
+ protected int contextIndex = 0;
+
+ @Override
+ public void setContextIndex(int index) {
+ super.setContextIndex(index);
+ this.contextIndex = index;
+ }
+
+ public int getContextIndex() {
+ return contextIndex;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecoratorComparator.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecoratorComparator.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchDecoratorComparator.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -26,10 +26,8 @@
import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch;
import fr.ifremer.tutti.service.TuttiDecorator;
-import org.jdesktop.swingx.JXTable;
import org.nuiton.decorator.JXPathDecorator;
-import javax.swing.SortOrder;
import java.util.List;
/**
@@ -44,18 +42,14 @@
*/
public class SpeciesBatchDecoratorComparator<R extends SpeciesAbleBatch> extends TuttiDecorator.TuttiDecoratorComparator<R> {
- static class RowComparatorContext implements Comparable<RowComparatorContext> {
+ class RowComparatorContext implements Comparable<RowComparatorContext> {
private final String speciesText;
private final int rowIndex;
- private final JXTable table;
-
- RowComparatorContext(JXTable table,
- String speciesText,
+ RowComparatorContext(String speciesText,
int rowIndex) {
- this.table = table;
this.speciesText = speciesText;
this.rowIndex = rowIndex;
}
@@ -63,23 +57,11 @@
@Override
public int compareTo(RowComparatorContext o) {
// first compare on speciesText
- int result = speciesText.compareTo(o.speciesText);
+ int result = sortSign * speciesText.compareTo(o.speciesText);
if (result == 0) {
- int sortedColumnIndex = table.getSortedColumnIndex();
- SortOrder sortOrder = table.getSortOrder(sortedColumnIndex);
-
- switch (sortOrder) {
- case UNSORTED:
- case ASCENDING:
-
- // respect natural order
- result = rowIndex - o.rowIndex;
- break;
- case DESCENDING:
- result = o.rowIndex - rowIndex;
- break;
- }
+ // respect natural order
+ result = rowIndex - o.rowIndex;
}
return result;
}
@@ -87,11 +69,21 @@
private static final long serialVersionUID = 1L;
- JXTable table;
+ SpeciesSortMode speciesSortMode;
- public SpeciesBatchDecoratorComparator(String expression, JXTable table) {
+ int sortSign;
+
+ public void setSpeciesSortMode(SpeciesSortMode speciesSortMode) {
+ this.speciesSortMode = speciesSortMode;
+ if (speciesSortMode == SpeciesSortMode.DESC) {
+ sortSign = -1;
+ } else {
+ sortSign = 1;
+ }
+ }
+
+ public SpeciesBatchDecoratorComparator(String expression) {
super(expression);
- this.table = table;
}
@Override
@@ -102,7 +94,7 @@
for (R data : datas) {
String speciesText = decorator.toString(data);
- Comparable value = new RowComparatorContext(table, speciesText, index++);
+ Comparable value = new RowComparatorContext(speciesText, index++);
valueCache.put(data, value);
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchRowHelper.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchRowHelper.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchRowHelper.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -0,0 +1,296 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import fr.ifremer.shared.application.swing.table.AbstractApplicationTableModel;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch;
+import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.service.TuttiDecorator;
+import jaxx.runtime.SwingUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.TableColumnExt;
+import org.nuiton.decorator.DecoratorUtil;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JLabel;
+import javax.swing.JPopupMenu;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JSeparator;
+import javax.swing.SwingUtilities;
+import javax.swing.table.JTableHeader;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Helper methods aroun sorting species rows.
+ * Created on 1/8/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public class SpeciesBatchRowHelper {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(SpeciesBatchRowHelper.class);
+
+ public static final String SPECIES_DECORATOR = "decorator";
+
+ public static final String SPECIES_DECORATOR_INDEX = "decoratorIndex";
+
+ public static <E extends SpeciesAbleBatch> int getIndexToInsert(List<E> rows,
+ E newRow,
+ SpeciesSortMode sortMode,
+ SpeciesBatchDecorator decorator) {
+
+ int result;
+
+ int rowsSize = rows.size();
+ if (sortMode == SpeciesSortMode.NONE) {
+ // after the last row
+ result = rowsSize;
+ } else {
+
+ // get the universe of species
+ Set<Species> speciesSet = Sets.newHashSet();
+ for (E row : rows) {
+ speciesSet.add(row.getSpecies());
+ }
+ Species newSpecies = newRow.getSpecies();
+
+ boolean speciestoAdd = speciesSet.add(newSpecies);
+
+ int nbSpecies = speciesSet.size();
+
+ // sort it
+ List<Species> speciesList = Lists.newArrayList(speciesSet);
+ TuttiDecorator.TuttiDecoratorComparator<Species> comparator = decorator.getOriginalComparator();
+ comparator.init(decorator, speciesList);
+ Collections.sort(speciesList, comparator);
+ if (sortMode == SpeciesSortMode.DESC) {
+
+ // reserve order
+ Collections.reverse(speciesList);
+ }
+
+ int indexOf = speciesList.indexOf(newSpecies);
+
+ if (!speciestoAdd) {
+ // add after all rows of the species
+ indexOf++;
+ }
+
+ if (indexOf == 0) {
+
+ // limit case: first row
+ result = 0;
+ } else if (indexOf >= nbSpecies) {
+
+ // limit case: last row
+ result = rowsSize;
+ } else {
+
+ // must insert before this species
+ Species beforeSpecies;
+ if (speciestoAdd) {
+ beforeSpecies = speciesList.get(indexOf + 1);
+ } else {
+ beforeSpecies = speciesList.get(indexOf);
+ }
+ result = 0;
+ for (E row : rows) {
+ Species species = row.getSpecies();
+ if (beforeSpecies.equals(species)) {
+ break;
+ }
+ result++;
+ }
+ }
+ }
+ return result;
+ }
+
+ public static TuttiDecorator<Species> getSpeciesColumnDecorator(TableColumnExt tableColumn) {
+ TuttiDecorator<Species> decorator = (TuttiDecorator<Species>) tableColumn.getClientProperty(SPECIES_DECORATOR);
+ return decorator;
+ }
+
+ public static <R extends Serializable, T extends AbstractApplicationTableModel<R>> void installSpeciesColumnComparatorPopup(JXTable table,
+ TableColumnExt speciesColumn,
+ SpeciesSortableRowModel optionalModel,
+ String... tips) {
+
+ ButtonGroup buttonGroup = new ButtonGroup();
+
+ SpeciesDecoratorListener<R, T> speciesDecoratorListener =
+ new SpeciesDecoratorListener<R, T>(table, buttonGroup, optionalModel);
+
+ TuttiDecorator<Species> decorator =
+ getSpeciesColumnDecorator(speciesColumn);
+
+ JPopupMenu popup = new JPopupMenu();
+ popup.add(new JLabel(_("tutti.ui.change.species.decorator")));
+ popup.add(new JSeparator());
+
+ for (int i = 0, nbContext = decorator.getNbContext(); i < nbContext; i++) {
+ String property = decorator.getProperty(i);
+
+ String i18nName = "tutti.property." + property;
+ speciesColumn.putClientProperty(i18nName, tips[i]);
+ JRadioButtonMenuItem item = new JRadioButtonMenuItem(tips[i]);
+ item.putClientProperty(SPECIES_DECORATOR_INDEX, i);
+ item.addActionListener(speciesDecoratorListener);
+ if (i == 0) {
+ // select the first property (as it is the
+ item.setSelected(true);
+ }
+ buttonGroup.add(item);
+ popup.add(item);
+ }
+
+ // recompute the header tip using the decorator
+ speciesDecoratorListener.recomputeSpeciesColumnTip();
+
+ // listen when to show popup menu on cell header
+ table.getTableHeader().addMouseListener(
+ new ShowSpeciesDecoratorPopupListener(popup));
+
+ }
+
+ public static <R extends SpeciesAbleBatch> void sortSpeciesRows(SpeciesBatchDecoratorComparator comparator,
+ SpeciesBatchDecorator decorator,
+ List<R> rows,
+ SpeciesSortMode speciesSortMode) {
+ comparator.setSpeciesSortMode(speciesSortMode);
+ comparator.init(decorator, rows);
+
+ switch (speciesSortMode) {
+
+ case NONE:
+ // nothing special to do
+ break;
+ case ASC:
+ case DESC:
+ // sort
+ DecoratorUtil.sort(decorator, rows, decorator.getContextIndex());
+ break;
+ }
+ }
+
+ protected static class SpeciesDecoratorListener<R extends Serializable, T extends AbstractApplicationTableModel<R>> implements ActionListener {
+
+ protected final JXTable table;
+
+ protected final ButtonGroup buttonGroup;
+
+ protected final SpeciesSortableRowModel optionalModel;
+
+ protected final TuttiDecorator<Species> decorator;
+
+ protected final TableColumnExt column;
+
+ public SpeciesDecoratorListener(JXTable table,
+ ButtonGroup buttonGroup,
+ SpeciesSortableRowModel optionalModel) {
+ this.table = table;
+ this.buttonGroup = buttonGroup;
+ this.optionalModel = optionalModel;
+ this.column = (TableColumnExt) table.getColumn(0);
+ this.decorator = getSpeciesColumnDecorator(column);
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ JRadioButtonMenuItem source = (JRadioButtonMenuItem) e.getSource();
+ buttonGroup.setSelected(source.getModel(), true);
+
+ Integer index =
+ (Integer) source.getClientProperty(SPECIES_DECORATOR_INDEX);
+
+ if (log.isInfoEnabled()) {
+ log.info("Selected decorator context index: " + index);
+ }
+
+ // do the decoration from here
+ decorator.setContextIndex(index);
+
+ column.setComparator(decorator.getCurrentComparator());
+
+ // recompute the header tip
+ recomputeSpeciesColumnTip();
+
+ if (optionalModel != null) {
+
+ // set new index in model
+ optionalModel.setSpeciesDecoratorContextIndex(index);
+ } else {
+
+ // reload table data
+ T tableModel = (T) table.getModel();
+
+ // keep selected rows
+ List<R> rowsToReSelect = Lists.newArrayList();
+ for (int rowIndex : SwingUtil.getSelectedModelRows(table)) {
+ R row = tableModel.getEntry(rowIndex);
+ rowsToReSelect.add(row);
+ }
+
+ // fire model (will reload the comparator)
+ tableModel.fireTableDataChanged();
+
+ // reselect rows
+ for (R row : rowsToReSelect) {
+ int modelRowIndex = tableModel.getRowIndex(row);
+ SwingUtil.addRowSelectionInterval(table, modelRowIndex);
+ }
+ }
+ }
+
+ public void recomputeSpeciesColumnTip() {
+ List<String> tips = Lists.newArrayList();
+ for (int i = 0, nbContext = decorator.getNbContext(); i < nbContext; i++) {
+ String property = decorator.getProperty(i);
+
+ String i18nName = "tutti.property." + property;
+ String tip = (String) column.getClientProperty(i18nName);
+ tips.add(tip);
+ }
+ String tip = Joiner.on(" - ").join(tips);
+ column.setToolTipText(tip);
+ }
+ }
+
+ protected static class ShowSpeciesDecoratorPopupListener extends MouseAdapter {
+
+ private final JPopupMenu popup;
+
+ public ShowSpeciesDecoratorPopupListener(JPopupMenu popup) {
+ this.popup = popup;
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ JTableHeader source = (JTableHeader) e.getSource();
+ Point point = e.getPoint();
+ int columnIndex = source.columnAtPoint(point);
+
+ boolean rightClick = SwingUtilities.isRightMouseButton(e);
+ if (columnIndex == 0 && rightClick) {
+ e.consume();
+ popup.show(source, e.getX(), e.getY());
+ }
+ }
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesBatchRowHelper.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortMode.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortMode.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortMode.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -0,0 +1,14 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+/**
+ * Created on 1/7/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since XXX
+ */
+public enum SpeciesSortMode {
+
+ NONE,
+ ASC,
+ DESC
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortMode.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortableRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortableRowModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortableRowModel.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -0,0 +1,34 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+/**
+ * Created on 1/8/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.0
+ */
+public interface SpeciesSortableRowModel {
+
+ String PROPERTY_SPECIES_SORT_MODE = "speciesSortMode";
+
+ String PROPERTY_SPECIES_SORT_MODE_NONE = "speciesSortModeNone";
+
+ String PROPERTY_SPECIES_SORT_MODE_ASC = "speciesSortModeAsc";
+
+ String PROPERTY_SPECIES_SORT_MODE_DESC = "speciesSortModeDesc";
+
+ String PROPERTY_SPECIES_DECORATOR_CONTEXT_INDEX = "speciesDecoratorContextIndex";
+
+ SpeciesSortMode getSpeciesSortMode();
+
+ void setSpeciesSortMode(SpeciesSortMode speciesSortMode);
+
+ boolean isSpeciesSortModeNone();
+
+ boolean isSpeciesSortModeAsc();
+
+ boolean isSpeciesSortModeDesc();
+
+ int getSpeciesDecoratorContextIndex();
+
+ void setSpeciesDecoratorContextIndex(int speciesDecoratorContextIndex);
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SpeciesSortableRowModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css 2014-01-08 12:34:01 UTC (rev 1479)
@@ -141,6 +141,10 @@
border: {new TitledBorder(null, "")};
}
+#speciesSortTablePane {
+ border: {new TitledBorder(null, "")};
+}
+
#filterBenthosBatchLabel {
actionIcon: filter;
text: "tutti.editBenthosBatch.filterBatch";
@@ -149,30 +153,14 @@
_help: {"tutti.editBenthosBatch.filterBatch.help"};
}
-#filterBenthosBatchAllButton {
- text: "tutti.editBenthosBatch.filterBatch.mode.all";
- toolTipText: "tutti.editBenthosBatch.filterBatch.mode.all.tip";
- value: "all";
- selected: {model.isTableViewModeAll()};
- buttonGroup: "filterBenthosBatchMode";
+#speciesSortBatchLabel {
+ actionIcon: sort;
+ text: "tutti.editBenthosBatch.sortSpeciesBatch";
+ toolTipText: "tutti.editBenthosBatch.sortSpeciesBatch.tip";
+ _strongStyle: true;
+ _help: {"tutti.editBenthosBatch.sortSpeciesBatch.help"};
}
-#filterBenthosBatchLeafButton {
- text: "tutti.editBenthosBatch.filterBatch.mode.leaf";
- toolTipText: "tutti.editBenthosBatch.filterBatch.mode.leaf.tip";
- value: "leaf";
- selected: {model.isTableViewModeLeaf()};
- buttonGroup: "filterBenthosBatchMode";
-}
-
-#filterBenthosBatchRootButton {
- text: {handler.getFilterBenthosBatchRootButtonText(model.getRootNumber())};
- toolTipText: "tutti.editBenthosBatch.filterBatch.mode.root.tip";
- value: "root";
- selected: {model.isTableViewModeRoot()};
- buttonGroup: "filterBenthosBatchMode";
-}
-
#splitBenthosBatchMenu {
actionIcon: batch-split;
text: "tutti.editBenthosBatch.action.splitBatch";
@@ -249,6 +237,30 @@
_help: {"tutti.editBenthosBatch.action.editFrequencies.help"};
}
+#filterBenthosBatchAllButton {
+ text: "tutti.editBenthosBatch.filterBatch.mode.all";
+ toolTipText: "tutti.editBenthosBatch.filterBatch.mode.all.tip";
+ value: "all";
+ selected: {model.isTableViewModeAll()};
+ buttonGroup: "filterBenthosBatchMode";
+}
+
+#filterBenthosBatchLeafButton {
+ text: "tutti.editBenthosBatch.filterBatch.mode.leaf";
+ toolTipText: "tutti.editBenthosBatch.filterBatch.mode.leaf.tip";
+ value: "leaf";
+ selected: {model.isTableViewModeLeaf()};
+ buttonGroup: "filterBenthosBatchMode";
+}
+
+#filterBenthosBatchRootButton {
+ text: {handler.getFilterBenthosBatchRootButtonText(model.getRootNumber())};
+ toolTipText: "tutti.editBenthosBatch.filterBatch.mode.root.tip";
+ value: "root";
+ selected: {model.isTableViewModeRoot()};
+ buttonGroup: "filterBenthosBatchMode";
+}
+
#importMultiPostButton {
actionIcon: import;
text: "tutti.editBenthosBatch.action.importMultiPost";
@@ -274,3 +286,30 @@
i18nMnemonic: "tutti.editBenthosBatch.action.createBatch.mnemonic";
_help: {"tutti.editBenthosBatch.action.createBatch.help"};
}
+
+#speciesSortModeNoneButton {
+ text: "tutti.editBenthosBatch.speciesSortMode.none";
+ toolTipText: "tutti.editBenthosBatch.speciesSortMode.none.tip";
+ _help: {"tutti.editBenthosBatch.field.speciesSortMode.none.help"};
+ value: "NONE";
+ selected: {model.isSpeciesSortModeNone()};
+ buttonGroup: "speciesSort";
+}
+
+#speciesSortModeAscButton {
+ text: "tutti.editBenthosBatch.speciesSortMode.asc";
+ toolTipText: "tutti.editBenthosBatch.speciesSortMode.asc.tip";
+ _help: {"tutti.editBenthosBatch.field.speciesSortMode.asc.help"};
+ value: "ASC";
+ selected: {model.isSpeciesSortModeAsc()};
+ buttonGroup: "speciesSort";
+}
+
+#speciesSortModeDescButton {
+ text: "tutti.editBenthosBatch.speciesSortMode.desc";
+ toolTipText: "tutti.editBenthosBatch.speciesSortMode.desc.tip";
+ _help: {"tutti.editBenthosBatch.field.speciesSortMode.desc.help"};
+ value: "DESC";
+ selected: {model.isSpeciesSortModeDesc()};
+ buttonGroup: "speciesSort";
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2014-01-08 12:34:01 UTC (rev 1479)
@@ -28,7 +28,7 @@
<import><![CDATA[
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode
-
+ fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortMode
fr.ifremer.tutti.ui.swing.util.TuttiUI
fr.ifremer.tutti.ui.swing.util.TuttiUIUtil
fr.ifremer.shared.application.swing.computable.ComputableDataEditor
@@ -143,14 +143,25 @@
<JButton id='createBenthosBatchButton'
onActionPerformed='handler.createBatch()'/>
</JPanel>
- <JPanel id='filterTablePane' constraints='BorderLayout.CENTER'>
- <JLabel id='filterBenthosBatchLabel'/>
- <JRadioButton id='filterBenthosBatchAllButton'
- onActionPerformed='model.setTableViewMode(TableViewMode.ALL)'/>
- <JRadioButton id='filterBenthosBatchLeafButton'
- onActionPerformed='model.setTableViewMode(TableViewMode.LEAF)'/>
- <JRadioButton id='filterBenthosBatchRootButton'
- onActionPerformed='model.setTableViewMode(TableViewMode.ROOT)'/>
+ <JPanel constraints='BorderLayout.CENTER' layout='{new GridLayout()}'>
+ <JPanel id='filterTablePane'>
+ <JLabel id='filterBenthosBatchLabel'/>
+ <JRadioButton id='filterBenthosBatchAllButton'
+ onActionPerformed='model.setTableViewMode(TableViewMode.ALL)'/>
+ <JRadioButton id='filterBenthosBatchLeafButton'
+ onActionPerformed='model.setTableViewMode(TableViewMode.LEAF)'/>
+ <JRadioButton id='filterBenthosBatchRootButton'
+ onActionPerformed='model.setTableViewMode(TableViewMode.ROOT)'/>
+ </JPanel>
+ <JPanel id='speciesSortTablePane'>
+ <JLabel id='speciesSortBatchLabel'/>
+ <JRadioButton id='speciesSortModeNoneButton'
+ onActionPerformed='model.setSpeciesSortMode(SpeciesSortMode.NONE)'/>
+ <JRadioButton id='speciesSortModeAscButton'
+ onActionPerformed='model.setSpeciesSortMode(SpeciesSortMode.ASC)'/>
+ <JRadioButton id='speciesSortModeDescButton'
+ onActionPerformed='model.setSpeciesSortMode(SpeciesSortMode.DESC)'/>
+ </JPanel>
</JPanel>
</JPanel>
</cell>
@@ -164,8 +175,4 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
- <!--JPanel constraints='BorderLayout.SOUTH'
- minimumSize="{new Dimension(10,30)}"
- maximumSize="{new Dimension(10,30)}"
- preferredSize="{new Dimension(10,30)}"/-->
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -43,7 +43,6 @@
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
-import fr.ifremer.tutti.service.TuttiDecorator;
import fr.ifremer.tutti.service.ValidationService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractTuttiBatchTableUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
@@ -52,6 +51,9 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryColumnIdentifier;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesBatchDecorator;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesBatchDecoratorComparator;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesBatchRowHelper;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.CreateBenthosBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.CreateBenthosBatchUIModel;
@@ -263,6 +265,16 @@
}
}
}
+
+ SpeciesBatchDecorator decorator = getSpeciesColumnDecorator();
+
+ SpeciesSortMode speciesSortMode = model.getSpeciesSortMode();
+ SpeciesBatchDecoratorComparator comparator = getSpeciesRowComparator();
+
+ SpeciesBatchRowHelper.sortSpeciesRows(comparator,
+ decorator,
+ rows,
+ speciesSortMode);
}
model.setRows(rows);
@@ -714,6 +726,7 @@
BenthosBatchUIModel model = new BenthosBatchUIModel(catchesUIModel);
model.setTableViewMode(TableViewMode.ALL);
+ model.setSpeciesSortMode(SpeciesSortMode.NONE);
ui.setContextValue(model);
}
@@ -761,8 +774,8 @@
BenthosBatchTableModel.SPECIES);
speciesColumn.setSortable(true);
SpeciesBatchDecorator<BenthosBatchRowModel> speciesDecorator =
- SpeciesBatchDecorator.newDecorator(table);
- speciesColumn.putClientProperty(TuttiUIUtil.SPECIES_DECORATOR, speciesDecorator);
+ SpeciesBatchDecorator.newDecorator();
+ speciesColumn.putClientProperty(SpeciesBatchRowHelper.SPECIES_DECORATOR, speciesDecorator);
speciesColumn.setCellRenderer(newTableCellRender(speciesDecorator));
}
@@ -855,6 +868,39 @@
getTable().setRowFilter(filter);
}
});
+
+ // when species sort mode change, must reload the firshing operation
+ // and applying the sort on model
+ getModel().addPropertyChangeListener(BenthosBatchUIModel.PROPERTY_SPECIES_SORT_MODE, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ SpeciesSortMode newValue = (SpeciesSortMode) evt.getNewValue();
+ if (log.isInfoEnabled()) {
+ log.info("New species sort mode: " + newValue);
+ }
+
+ // must reload fishing operation
+ selectFishingOperation(getModel().getFishingOperation());
+ }
+ });
+
+ // when species sort mode change, must reload the firshing operation
+ // and applying the sort on model
+ getModel().addPropertyChangeListener(BenthosBatchUIModel.PROPERTY_SPECIES_DECORATOR_CONTEXT_INDEX, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ int newValue = (int) evt.getNewValue();
+ if (log.isInfoEnabled()) {
+ log.info("New species decorator context index: " + newValue);
+ }
+
+ // update the decorator context index
+ getSpeciesColumnDecorator().setContextIndex(newValue);
+
+ // reload fishing operation
+ selectFishingOperation(getModel().getFishingOperation());
+ }
+ });
}
@Override
@@ -885,37 +931,22 @@
e.getLastRow() == Integer.MAX_VALUE) {
// get column comparator
- TuttiDecorator.TuttiDecoratorComparator<BenthosBatchRowModel> comparator =
- (TuttiDecorator.TuttiDecoratorComparator<BenthosBatchRowModel>)
- speciesColumn.getComparator();
+ SpeciesBatchDecoratorComparator<BenthosBatchRowModel> comparator = getSpeciesRowComparator();
- // get column comparator
- TuttiDecorator<BenthosBatchRowModel> decorator =
- TuttiUIUtil.getSpeciesColumnDecorator(speciesColumn);
+ // get column decorator
+ SpeciesBatchDecorator<BenthosBatchRowModel> decorator = getSpeciesColumnDecorator();
- boolean comparatorNull = comparator == null;
- if (comparatorNull) {
-
- // first time coming here, add the comparator
- comparator = decorator.getCurrentComparator();
- }
-
// init comparator with model species list
- comparator.init(decorator, tableModel.getRows());
-
- if (comparatorNull) {
-
- // affect it to colum
- speciesColumn.setComparator(comparator);
- }
+ comparator.init((SpeciesBatchDecorator) decorator, tableModel.getRows());
}
}
});
// create popup to change species decorator
- TuttiUIUtil.<BenthosBatchRowModel, BenthosBatchTableModel>installSpeciesColumnComparatorPopup(
+ SpeciesBatchRowHelper.installSpeciesColumnComparatorPopup(
table,
speciesColumn,
+ getModel(),
_("tutti.species.surveyCode.tip"),
_("tutti.species.name.tip")
);
@@ -966,8 +997,16 @@
saveRow(newRow);
- tableModel.addNewRow(newRow);
- TuttiUIUtil.selectFirstCellOnLastRow(getTable());
+ int insertIndex = SpeciesBatchRowHelper.getIndexToInsert(
+ tableModel.getRows(),
+ newRow,
+ getModel().getSpeciesSortMode(),
+ getSpeciesColumnDecorator());
+ if (log.isDebugEnabled()) {
+ log.debug("Will insert at index: " + insertIndex);
+ }
+ tableModel.addNewRow(insertIndex, newRow);
+ TuttiUIUtil.doSelectCell(getTable(), insertIndex, 0);
// update speciesUsed
addToSpeciesUsed(newRow);
@@ -1669,4 +1708,36 @@
}
return usedValues;
}
+
+ protected SpeciesBatchDecoratorComparator<BenthosBatchRowModel> getSpeciesRowComparator() {
+ TableColumnExt speciesColumn =
+ (TableColumnExt) getTable().getColumns().get(0);
+
+ SpeciesBatchDecoratorComparator<BenthosBatchRowModel> comparator =
+ (SpeciesBatchDecoratorComparator<BenthosBatchRowModel>) speciesColumn.getComparator();
+
+ SpeciesBatchDecorator<BenthosBatchRowModel> decorator = getSpeciesColumnDecorator();
+
+ boolean comparatorNull = comparator == null;
+ if (comparatorNull) {
+
+ // first time coming here, add the comparator
+ comparator = (SpeciesBatchDecoratorComparator) decorator.getCurrentComparator();
+ }
+
+ if (comparatorNull) {
+
+ // affect it to colum
+ speciesColumn.setComparator(comparator);
+ }
+ return comparator;
+ }
+
+ protected SpeciesBatchDecorator<BenthosBatchRowModel> getSpeciesColumnDecorator() {
+ TableColumnExt speciesColumn =
+ (TableColumnExt) getTable().getColumns().get(0);
+ SpeciesBatchDecorator<BenthosBatchRowModel> decorator =
+ (SpeciesBatchDecorator<BenthosBatchRowModel>) SpeciesBatchRowHelper.getSpeciesColumnDecorator(speciesColumn);
+ return decorator;
+ }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIModel.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIModel.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -25,13 +25,15 @@
*/
import com.google.common.collect.Multimap;
+import fr.ifremer.shared.application.swing.computable.ComputableData;
+import fr.ifremer.shared.application.swing.tab.TabContentModel;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortMode;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortableRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
-import fr.ifremer.shared.application.swing.tab.TabContentModel;
-import fr.ifremer.shared.application.swing.computable.ComputableData;
import org.apache.commons.collections.CollectionUtils;
import static org.nuiton.i18n.I18n.n_;
@@ -41,7 +43,7 @@
* @since 0.1
*/
public class BenthosBatchUIModel extends AbstractTuttiBatchUIModel<BenthosBatchRowModel, BenthosBatchUIModel>
- implements TabContentModel {
+ implements TabContentModel, SpeciesSortableRowModel {
private static final long serialVersionUID = 1L;
@@ -142,6 +144,20 @@
/** @since 1.0 */
protected int leafNumber;
+ /**
+ * How to sort table.
+ *
+ * @since 3.0
+ */
+ protected SpeciesSortMode speciesSortMode;
+
+ /**
+ * Which decorator index for species column decorate.
+ *
+ * @since 3.0
+ */
+ protected int speciesDecoratorContextIndex;
+
public BenthosBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel,
EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_COMPUTED_WEIGHT,
@@ -375,4 +391,50 @@
this.editFrequenciesEnabled = editFrequenciesEnabled;
firePropertyChange(PROPERTY_EDIT_FREQUENCIES_ENABLED, null, editFrequenciesEnabled);
}
+
+ //------------------------------------------------------------------------//
+ //-- SpeciesSortableRowModel --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public SpeciesSortMode getSpeciesSortMode() {
+ return speciesSortMode;
+ }
+
+ @Override
+ public void setSpeciesSortMode(SpeciesSortMode speciesSortMode) {
+ Object oldValue = getSpeciesSortMode();
+ this.speciesSortMode = speciesSortMode;
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE, oldValue, speciesSortMode);
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE_NONE, null, isSpeciesSortModeNone());
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE_ASC, null, isSpeciesSortModeAsc());
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE_DESC, null, isSpeciesSortModeDesc());
+ }
+
+ @Override
+ public boolean isSpeciesSortModeNone() {
+ return SpeciesSortMode.NONE.equals(speciesSortMode);
+ }
+
+ @Override
+ public boolean isSpeciesSortModeAsc() {
+ return SpeciesSortMode.ASC.equals(speciesSortMode);
+ }
+
+ @Override
+ public boolean isSpeciesSortModeDesc() {
+ return SpeciesSortMode.DESC.equals(speciesSortMode);
+ }
+
+ @Override
+ public int getSpeciesDecoratorContextIndex() {
+ return speciesDecoratorContextIndex;
+ }
+
+ @Override
+ public void setSpeciesDecoratorContextIndex(int speciesDecoratorContextIndex) {
+ int oldValue = getSpeciesDecoratorContextIndex();
+ this.speciesDecoratorContextIndex = speciesDecoratorContextIndex;
+ firePropertyChange(PROPERTY_SPECIES_DECORATOR_CONTEXT_INDEX, oldValue, speciesDecoratorContextIndex);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2014-01-08 12:34:01 UTC (rev 1479)
@@ -141,6 +141,10 @@
border: {new TitledBorder(null, "")};
}
+#speciesSortTablePane {
+ border: {new TitledBorder(null, "")};
+}
+
#filterSpeciesBatchLabel {
actionIcon: filter;
text: "tutti.editSpeciesBatch.filterBatch";
@@ -149,6 +153,14 @@
_help: {"tutti.editSpeciesBatch.filterSpeciesBatch.help"};
}
+#speciesSortBatchLabel {
+ actionIcon: sort;
+ text: "tutti.editSpeciesBatch.sortSpeciesBatch";
+ toolTipText: "tutti.editSpeciesBatch.sortSpeciesBatch.tip";
+ _strongStyle: true;
+ _help: {"tutti.editSpeciesBatch.sortSpeciesBatch.help"};
+}
+
#splitSpeciesBatchMenu {
actionIcon: batch-split;
text: "tutti.editSpeciesBatch.action.splitBatch";
@@ -283,3 +295,30 @@
i18nMnemonic: "tutti.editSpeciesBatch.action.createBatch.mnemonic";
_help: {"tutti.editSpeciesBatch.action.createBatch.help"};
}
+
+#speciesSortModeNoneButton {
+ text: "tutti.editSpeciesBatch.speciesSortMode.none";
+ toolTipText: "tutti.editSpeciesBatch.speciesSortMode.none.tip";
+ _help: {"tutti.editSpeciesBatch.field.speciesSortMode.none.help"};
+ value: "NONE";
+ selected: {model.isSpeciesSortModeNone()};
+ buttonGroup: "speciesSort";
+}
+
+#speciesSortModeAscButton {
+ text: "tutti.editSpeciesBatch.speciesSortMode.asc";
+ toolTipText: "tutti.editSpeciesBatch.speciesSortMode.asc.tip";
+ _help: {"tutti.editSpeciesBatch.field.speciesSortMode.asc.help"};
+ value: "ASC";
+ selected: {model.isSpeciesSortModeAsc()};
+ buttonGroup: "speciesSort";
+}
+
+#speciesSortModeDescButton {
+ text: "tutti.editSpeciesBatch.speciesSortMode.desc";
+ toolTipText: "tutti.editSpeciesBatch.speciesSortMode.desc.tip";
+ _help: {"tutti.editSpeciesBatch.field.speciesSortMode.desc.help"};
+ value: "DESC";
+ selected: {model.isSpeciesSortModeDesc()};
+ buttonGroup: "speciesSort";
+}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2014-01-08 12:34:01 UTC (rev 1479)
@@ -27,8 +27,8 @@
<import><![CDATA[
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
- fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode
+ fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortMode
fr.ifremer.tutti.ui.swing.util.TuttiUI
fr.ifremer.tutti.ui.swing.util.TuttiUIUtil
fr.ifremer.shared.application.swing.computable.ComputableDataEditor
@@ -45,7 +45,7 @@
<script><![CDATA[
-public SpeciesBatchUI(EditCatchesUI parentUI) {
+public SpeciesBatchUI(TuttiUI<?,?> parentUI) {
TuttiUIUtil.setParentUI(this, parentUI);
}
]]></script>
@@ -145,14 +145,25 @@
<JButton id='createSpeciesBatchButton'
onActionPerformed='handler.createBatch()'/>
</JPanel>
- <JPanel id='filterTablePane' constraints='BorderLayout.CENTER'>
- <JLabel id='filterSpeciesBatchLabel'/>
- <JRadioButton id='filterSpeciesBatchAllButton'
- onActionPerformed='model.setTableViewMode(TableViewMode.ALL)'/>
- <JRadioButton id='filterSpeciesBatchLeafButton'
- onActionPerformed='model.setTableViewMode(TableViewMode.LEAF)'/>
- <JRadioButton id='filterSpeciesBatchRootButton'
- onActionPerformed='model.setTableViewMode(TableViewMode.ROOT)'/>
+ <JPanel constraints='BorderLayout.CENTER' layout='{new GridLayout()}'>
+ <JPanel id='filterTablePane'>
+ <JLabel id='filterSpeciesBatchLabel'/>
+ <JRadioButton id='filterSpeciesBatchAllButton'
+ onActionPerformed='model.setTableViewMode(TableViewMode.ALL)'/>
+ <JRadioButton id='filterSpeciesBatchLeafButton'
+ onActionPerformed='model.setTableViewMode(TableViewMode.LEAF)'/>
+ <JRadioButton id='filterSpeciesBatchRootButton'
+ onActionPerformed='model.setTableViewMode(TableViewMode.ROOT)'/>
+ </JPanel>
+ <JPanel id='speciesSortTablePane'>
+ <JLabel id='speciesSortBatchLabel'/>
+ <JRadioButton id='speciesSortModeNoneButton'
+ onActionPerformed='model.setSpeciesSortMode(SpeciesSortMode.NONE)'/>
+ <JRadioButton id='speciesSortModeAscButton'
+ onActionPerformed='model.setSpeciesSortMode(SpeciesSortMode.ASC)'/>
+ <JRadioButton id='speciesSortModeDescButton'
+ onActionPerformed='model.setSpeciesSortMode(SpeciesSortMode.DESC)'/>
+ </JPanel>
</JPanel>
</JPanel>
</cell>
@@ -166,18 +177,4 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
- <!--JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER' columnHeaderView="{table.getTableHeader()}">
- <JPanel layout='{new BorderLayout()}'>
- <JXTable id='table' constraints='BorderLayout.CENTER'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
- onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
- <JLabel constraints='BorderLayout.SOUTH'
- preferredSize="{new Dimension(10,100)}"/>
- </JPanel>
-
- </JScrollPane-->
-
-
- <!--background="{Color.WHITE}"/>-->
-
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -43,7 +43,6 @@
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
-import fr.ifremer.tutti.service.TuttiDecorator;
import fr.ifremer.tutti.service.ValidationService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractTuttiBatchTableUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
@@ -52,6 +51,9 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryColumnIdentifier;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesBatchDecorator;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesBatchDecoratorComparator;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesBatchRowHelper;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUIModel;
@@ -216,6 +218,16 @@
}
}
}
+
+ SpeciesBatchDecorator decorator = getSpeciesColumnDecorator();
+
+ SpeciesSortMode speciesSortMode = model.getSpeciesSortMode();
+ SpeciesBatchDecoratorComparator comparator = getSpeciesRowComparator();
+
+ SpeciesBatchRowHelper.sortSpeciesRows(comparator,
+ decorator,
+ rows,
+ speciesSortMode);
}
model.setRows(rows);
@@ -669,6 +681,7 @@
SpeciesBatchUIModel model = new SpeciesBatchUIModel(catchesUIModel);
model.setTableViewMode(TableViewMode.ALL);
+ model.setSpeciesSortMode(SpeciesSortMode.NONE);
ui.setContextValue(model);
}
@@ -716,8 +729,8 @@
SpeciesBatchTableModel.SPECIES);
speciesColumn.setSortable(true);
SpeciesBatchDecorator<SpeciesBatchRowModel> speciesDecorator =
- SpeciesBatchDecorator.newDecorator(table);
- speciesColumn.putClientProperty(TuttiUIUtil.SPECIES_DECORATOR, speciesDecorator);
+ SpeciesBatchDecorator.newDecorator();
+ speciesColumn.putClientProperty(SpeciesBatchRowHelper.SPECIES_DECORATOR, speciesDecorator);
speciesColumn.setCellRenderer(newTableCellRender(speciesDecorator));
}
@@ -811,6 +824,39 @@
getTable().setRowFilter(filter);
}
});
+
+ // when species sort mode change, must reload the firshing operation
+ // and applying the sort on model
+ getModel().addPropertyChangeListener(SpeciesBatchUIModel.PROPERTY_SPECIES_SORT_MODE, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ SpeciesSortMode newValue = (SpeciesSortMode) evt.getNewValue();
+ if (log.isInfoEnabled()) {
+ log.info("New species sort mode: " + newValue);
+ }
+
+ // must reload fishing operation
+ selectFishingOperation(getModel().getFishingOperation());
+ }
+ });
+
+ // when species sort mode change, must reload the firshing operation
+ // and applying the sort on model
+ getModel().addPropertyChangeListener(SpeciesBatchUIModel.PROPERTY_SPECIES_DECORATOR_CONTEXT_INDEX, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ int newValue = (int) evt.getNewValue();
+ if (log.isInfoEnabled()) {
+ log.info("New species decorator context index: " + newValue);
+ }
+
+ // update the decorator context index
+ getSpeciesColumnDecorator().setContextIndex(newValue);
+
+ // reload fishing operation
+ selectFishingOperation(getModel().getFishingOperation());
+ }
+ });
}
@Override
@@ -839,40 +885,28 @@
int type = e.getType();
if (type == TableModelEvent.DELETE ||
type == TableModelEvent.INSERT ||
+ type == TableModelEvent.INSERT ||
e.getLastRow() == Integer.MAX_VALUE) {
// get column comparator
- TuttiDecorator.TuttiDecoratorComparator<SpeciesBatchRowModel> comparator =
- (TuttiDecorator.TuttiDecoratorComparator<SpeciesBatchRowModel>)
- speciesColumn.getComparator();
+ SpeciesBatchDecoratorComparator<SpeciesBatchRowModel> comparator =
+ getSpeciesRowComparator();
- // get column comparator
- TuttiDecorator<SpeciesBatchRowModel> decorator =
- TuttiUIUtil.getSpeciesColumnDecorator(speciesColumn);
+ // get column decorator
+ SpeciesBatchDecorator<SpeciesBatchRowModel> decorator =
+ getSpeciesColumnDecorator();
- boolean comparatorNull = comparator == null;
- if (comparatorNull) {
-
- // first time coming here, add the comparator
- comparator = decorator.getCurrentComparator();
- }
-
// init comparator with model species list
- comparator.init(decorator, tableModel.getRows());
-
- if (comparatorNull) {
-
- // affect it to colum
- speciesColumn.setComparator(comparator);
- }
+ comparator.init((SpeciesBatchDecorator) decorator, tableModel.getRows());
}
}
});
// create popup to change species decorator
- TuttiUIUtil.<SpeciesBatchRowModel, SpeciesBatchTableModel>installSpeciesColumnComparatorPopup(
+ SpeciesBatchRowHelper.installSpeciesColumnComparatorPopup(
table,
speciesColumn,
+ getModel(),
_("tutti.species.surveyCode.tip"),
_("tutti.species.name.tip")
);
@@ -922,9 +956,18 @@
saveRow(newRow);
- tableModel.addNewRow(newRow);
- TuttiUIUtil.selectFirstCellOnLastRow(getTable());
+ int insertIndex = SpeciesBatchRowHelper.getIndexToInsert(
+ tableModel.getRows(),
+ newRow,
+ getModel().getSpeciesSortMode(),
+ getSpeciesColumnDecorator());
+ if (log.isDebugEnabled()) {
+ log.debug("Will insert at index: " + insertIndex);
+ }
+ tableModel.addNewRow(insertIndex, newRow);
+ TuttiUIUtil.doSelectCell(getTable(), insertIndex, 0);
+
// update speciesUsed
addToSpeciesUsed(newRow);
@@ -1626,4 +1669,37 @@
}
return usedValues;
}
+
+ protected SpeciesBatchDecoratorComparator<SpeciesBatchRowModel> getSpeciesRowComparator() {
+ TableColumnExt speciesColumn =
+ (TableColumnExt) getTable().getColumns().get(0);
+
+ SpeciesBatchDecoratorComparator<SpeciesBatchRowModel> comparator =
+ (SpeciesBatchDecoratorComparator<SpeciesBatchRowModel>) speciesColumn.getComparator();
+
+ SpeciesBatchDecorator<SpeciesBatchRowModel> decorator = getSpeciesColumnDecorator();
+
+ boolean comparatorNull = comparator == null;
+ if (comparatorNull) {
+
+ // first time coming here, add the comparator
+ comparator = (SpeciesBatchDecoratorComparator) decorator.getCurrentComparator();
+ }
+
+ if (comparatorNull) {
+
+ // affect it to colum
+ speciesColumn.setComparator(comparator);
+ }
+ return comparator;
+ }
+
+ protected SpeciesBatchDecorator<SpeciesBatchRowModel> getSpeciesColumnDecorator() {
+ TableColumnExt speciesColumn =
+ (TableColumnExt) getTable().getColumns().get(0);
+ SpeciesBatchDecorator<SpeciesBatchRowModel> decorator =
+ (SpeciesBatchDecorator<SpeciesBatchRowModel>) SpeciesBatchRowHelper.getSpeciesColumnDecorator(speciesColumn);
+ return decorator;
+ }
+
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -27,15 +27,17 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
+import fr.ifremer.shared.application.swing.computable.ComputableData;
+import fr.ifremer.shared.application.swing.tab.TabContentModel;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortMode;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesSortableRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
-import fr.ifremer.shared.application.swing.tab.TabContentModel;
-import fr.ifremer.shared.application.swing.computable.ComputableData;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
@@ -48,7 +50,7 @@
* @since 0.1
*/
public class SpeciesBatchUIModel extends AbstractTuttiBatchUIModel<SpeciesBatchRowModel, SpeciesBatchUIModel>
- implements TabContentModel {
+ implements TabContentModel, SpeciesSortableRowModel {
private static final long serialVersionUID = 1L;
@@ -149,6 +151,20 @@
/** @since 1.0 */
protected int leafNumber;
+ /**
+ * How to sort table.
+ *
+ * @since 3.0
+ */
+ protected SpeciesSortMode speciesSortMode;
+
+ /**
+ * Which decorator index for species column decorate.
+ *
+ * @since 3.0
+ */
+ protected int speciesDecoratorContextIndex;
+
public SpeciesBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_COMPUTED_WEIGHT,
@@ -442,4 +458,50 @@
}
return result;
}
+
+ //------------------------------------------------------------------------//
+ //-- SpeciesSortableRowModel --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public SpeciesSortMode getSpeciesSortMode() {
+ return speciesSortMode;
+ }
+
+ @Override
+ public void setSpeciesSortMode(SpeciesSortMode speciesSortMode) {
+ Object oldValue = getSpeciesSortMode();
+ this.speciesSortMode = speciesSortMode;
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE, oldValue, speciesSortMode);
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE_NONE, null, isSpeciesSortModeNone());
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE_ASC, null, isSpeciesSortModeAsc());
+ firePropertyChange(PROPERTY_SPECIES_SORT_MODE_DESC, null, isSpeciesSortModeDesc());
+ }
+
+ @Override
+ public boolean isSpeciesSortModeNone() {
+ return SpeciesSortMode.NONE.equals(speciesSortMode);
+ }
+
+ @Override
+ public boolean isSpeciesSortModeAsc() {
+ return SpeciesSortMode.ASC.equals(speciesSortMode);
+ }
+
+ @Override
+ public boolean isSpeciesSortModeDesc() {
+ return SpeciesSortMode.DESC.equals(speciesSortMode);
+ }
+
+ @Override
+ public int getSpeciesDecoratorContextIndex() {
+ return speciesDecoratorContextIndex;
+ }
+
+ @Override
+ public void setSpeciesDecoratorContextIndex(int speciesDecoratorContextIndex) {
+ int oldValue = getSpeciesDecoratorContextIndex();
+ this.speciesDecoratorContextIndex = speciesDecoratorContextIndex;
+ firePropertyChange(PROPERTY_SPECIES_DECORATOR_CONTEXT_INDEX, oldValue, speciesDecoratorContextIndex);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -42,8 +42,8 @@
import fr.ifremer.tutti.ui.swing.action.CloneProtocolAction;
import fr.ifremer.tutti.ui.swing.action.EditProtocolAction;
import fr.ifremer.tutti.ui.swing.action.ImportProtocolAction;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SpeciesBatchRowHelper;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
-import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUI;
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUIModel;
import jaxx.runtime.SwingUtil;
@@ -299,7 +299,7 @@
EditProtocolSpeciesTableModel.SPECIES_ID);
speciesColumn.setSortable(true);
DecoratorService.SpeciesDecorator speciesDecorator = new DecoratorService.SpeciesDecorator();
- speciesColumn.putClientProperty(TuttiUIUtil.SPECIES_DECORATOR, speciesDecorator);
+ speciesColumn.putClientProperty(SpeciesBatchRowHelper.SPECIES_DECORATOR, speciesDecorator);
speciesColumn.setCellRenderer(newTableCellRender(speciesDecorator));
TableColumnExt speciesSurveyCodeColumn = addColumnToModel(columnModel,
@@ -358,7 +358,7 @@
EditProtocolSpeciesTableModel.SPECIES_ID);
speciesColumn.setSortable(true);
DecoratorService.SpeciesDecorator speciesDecorator = new DecoratorService.SpeciesDecorator();
- speciesColumn.putClientProperty(TuttiUIUtil.SPECIES_DECORATOR, speciesDecorator);
+ speciesColumn.putClientProperty(SpeciesBatchRowHelper.SPECIES_DECORATOR, speciesDecorator);
speciesColumn.setCellRenderer(newTableCellRender(speciesDecorator));
TableColumnExt speciesSurveyCodeColumn = addColumnToModel(columnModel,
@@ -716,7 +716,7 @@
// get column comparator
TuttiDecorator<Species> decorator =
- TuttiUIUtil.getSpeciesColumnDecorator(tableColumn);
+ SpeciesBatchRowHelper.getSpeciesColumnDecorator(tableColumn);
boolean comparatorNull = comparator == null;
if (comparatorNull) {
@@ -739,9 +739,10 @@
// create popup to change species decorator
- TuttiUIUtil.<EditProtocolSpeciesRowModel, EditProtocolSpeciesTableModel>installSpeciesColumnComparatorPopup(
+ SpeciesBatchRowHelper.installSpeciesColumnComparatorPopup(
table,
speciesColumn,
+ null,
_("tutti.species.refTaxCode.tip"),
_("tutti.species.name.tip")
);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java 2014-01-08 12:34:01 UTC (rev 1479)
@@ -24,41 +24,19 @@
* #L%
*/
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
import fr.ifremer.shared.application.ApplicationBusinessException;
-import fr.ifremer.shared.application.swing.table.AbstractApplicationTableModel;
import fr.ifremer.shared.application.swing.util.ApplicationUIUtil;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.service.TuttiDecorator;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import jaxx.runtime.JAXXObject;
import jaxx.runtime.JAXXUtil;
-import jaxx.runtime.SwingUtil;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXTable;
-import org.jdesktop.swingx.table.TableColumnExt;
-import javax.swing.ButtonGroup;
-import javax.swing.JLabel;
-import javax.swing.JPopupMenu;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.JSeparator;
-import javax.swing.SwingUtilities;
-import javax.swing.table.JTableHeader;
-import java.awt.Point;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
import java.io.InputStream;
-import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
-import java.util.List;
import static org.nuiton.i18n.I18n._;
@@ -70,10 +48,6 @@
*/
public final class TuttiUIUtil extends ApplicationUIUtil {
- public static final String SPECIES_DECORATOR = "decorator";
-
- public static final String SPECIES_DECORATOR_INDEX = "decoratorIndex";
-
/** Logger. */
private static final Log log = LogFactory.getLog(TuttiUIUtil.class);
@@ -135,143 +109,4 @@
}
}
- public static <E> TuttiDecorator<E> getSpeciesColumnDecorator(TableColumnExt tableColumn) {
- TuttiDecorator<E> decorator = (TuttiDecorator<E>)
- tableColumn.getClientProperty(SPECIES_DECORATOR);
- return decorator;
- }
-
- public static <R extends Serializable, T extends AbstractApplicationTableModel<R>> void installSpeciesColumnComparatorPopup(JXTable table,
- TableColumnExt speciesColumn,
- String... tips) {
-
- ButtonGroup buttonGroup = new ButtonGroup();
-
- SpeciesDecoratorListener<R, T> speciesDecoratorListener =
- new SpeciesDecoratorListener<R, T>(table, buttonGroup);
-
- TuttiDecorator<Species> decorator =
- getSpeciesColumnDecorator(speciesColumn);
-
- JPopupMenu popup = new JPopupMenu();
- popup.add(new JLabel(_("tutti.ui.change.species.decorator")));
- popup.add(new JSeparator());
-
- for (int i = 0, nbContext = decorator.getNbContext(); i < nbContext; i++) {
- String property = decorator.getProperty(i);
-
- String i18nName = "tutti.property." + property;
- speciesColumn.putClientProperty(i18nName, tips[i]);
- JRadioButtonMenuItem item = new JRadioButtonMenuItem(tips[i]);
- item.putClientProperty(TuttiUIUtil.SPECIES_DECORATOR_INDEX, i);
- item.addActionListener(speciesDecoratorListener);
- if (i == 0) {
- // select the first property (as it is the
- item.setSelected(true);
- }
- buttonGroup.add(item);
- popup.add(item);
- }
-
- // recompute the header tip using the decorator
- speciesDecoratorListener.recomputeSpeciesColumnTip();
-
- // listen when to show popup menu on cell header
- table.getTableHeader().addMouseListener(
- new ShowSpeciesDecoratorPopupListener(popup));
-
- }
-
- protected static class SpeciesDecoratorListener<R extends Serializable, T extends AbstractApplicationTableModel<R>> implements ActionListener {
-
- protected final JXTable table;
-
- protected final ButtonGroup buttonGroup;
-
- protected final TuttiDecorator<Species> decorator;
-
- protected final TableColumnExt column;
-
- public SpeciesDecoratorListener(JXTable table,
- ButtonGroup buttonGroup) {
- this.table = table;
- this.buttonGroup = buttonGroup;
- this.column = (TableColumnExt) table.getColumn(0);
- this.decorator = TuttiUIUtil.getSpeciesColumnDecorator(column);
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- JRadioButtonMenuItem source = (JRadioButtonMenuItem) e.getSource();
- buttonGroup.setSelected(source.getModel(), true);
-
- Integer index =
- (Integer) source.getClientProperty(TuttiUIUtil.SPECIES_DECORATOR_INDEX);
-
- if (log.isInfoEnabled()) {
- log.info("Selected decorator context index: " + index);
- }
-
- decorator.setContextIndex(index);
-
- column.setComparator(decorator.getCurrentComparator());
-
- // recompute the header tip
- recomputeSpeciesColumnTip();
-
- T tableModel = (T) table.getModel();
-
- // keep selected rows
- List<R> rowsToReSelect = Lists.newArrayList();
- for (int rowIndex : SwingUtil.getSelectedModelRows(table)) {
- R row = tableModel.getEntry(rowIndex);
- rowsToReSelect.add(row);
- }
-
- // fire model (will reload the comparator)
- tableModel.fireTableDataChanged();
-
- // reselect rows
- for (R row : rowsToReSelect) {
- int modelRowIndex = tableModel.getRowIndex(row);
- SwingUtil.addRowSelectionInterval(table, modelRowIndex);
- }
- }
-
- public void recomputeSpeciesColumnTip() {
- List<String> tips = Lists.newArrayList();
- for (int i = 0, nbContext = decorator.getNbContext(); i < nbContext; i++) {
- String property = decorator.getProperty(i);
-
- String i18nName = "tutti.property." + property;
- String tip = (String) column.getClientProperty(i18nName);
- tips.add(tip);
- }
- String tip = Joiner.on(" - ").join(tips);
- column.setToolTipText(tip);
- }
- }
-
- protected static class ShowSpeciesDecoratorPopupListener extends MouseAdapter {
-
- private final JPopupMenu popup;
-
- public ShowSpeciesDecoratorPopupListener(JPopupMenu popup) {
- this.popup = popup;
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- JTableHeader source = (JTableHeader) e.getSource();
- Point point = e.getPoint();
- int columnIndex = source.columnAtPoint(point);
-
- boolean rightClick = SwingUtilities.isRightMouseButton(e);
- if (columnIndex == 0 && rightClick) {
- e.consume();
- popup.show(source, e.getX(), e.getY());
- }
- }
- }
}
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2014-01-08 12:34:01 UTC (rev 1479)
@@ -54,6 +54,13 @@
tutti.caracteristicMapEditor.none.tip=
tutti.caracteristicMapEditorTable.table.header.key=
tutti.caracteristicMapEditorTable.table.header.value=
+tutti.catches.action.cancel=
+tutti.catches.sortSpecies.action.accept=
+tutti.catches.sortSpecies.action.accept.mnemonic=
+tutti.catches.sortSpecies.action.accept.tip=
+tutti.catches.sortSpecies.action.cancel.mnemonic=
+tutti.catches.sortSpecies.action.cancel.tip=
+tutti.catches.sortSpecies.title=
tutti.commentEditor.action.close.tip=
tutti.commentEditor.action.tip=
tutti.commentEditor.none.tip=
@@ -429,6 +436,14 @@
tutti.editBenthosBatch.filterBatch.mode.root=
tutti.editBenthosBatch.filterBatch.mode.root.tip=
tutti.editBenthosBatch.filterBatch.tip=
+tutti.editBenthosBatch.sortSpeciesBatch=
+tutti.editBenthosBatch.sortSpeciesBatch.tip=
+tutti.editBenthosBatch.speciesSortMode.asc=
+tutti.editBenthosBatch.speciesSortMode.asc.tip=
+tutti.editBenthosBatch.speciesSortMode.desc=
+tutti.editBenthosBatch.speciesSortMode.desc.tip=
+tutti.editBenthosBatch.speciesSortMode.none=
+tutti.editBenthosBatch.speciesSortMode.none.tip=
tutti.editBenthosBatch.split.weightNotNull.help=
tutti.editBenthosBatch.split.weightNotNull.message=
tutti.editBenthosBatch.split.weightNotNull.title=
@@ -998,6 +1013,14 @@
tutti.editSpeciesBatch.filterBatch.mode.root=
tutti.editSpeciesBatch.filterBatch.mode.root.tip=
tutti.editSpeciesBatch.filterSpeciesBatch.tip=
+tutti.editSpeciesBatch.sortSpeciesBatch=
+tutti.editSpeciesBatch.sortSpeciesBatch.tip=
+tutti.editSpeciesBatch.speciesSortMode.asc=
+tutti.editSpeciesBatch.speciesSortMode.asc.tip=
+tutti.editSpeciesBatch.speciesSortMode.desc=
+tutti.editSpeciesBatch.speciesSortMode.desc.tip=
+tutti.editSpeciesBatch.speciesSortMode.none=
+tutti.editSpeciesBatch.speciesSortMode.none.tip=
tutti.editSpeciesBatch.split.weightNotNull.help=
tutti.editSpeciesBatch.split.weightNotNull.message=
tutti.editSpeciesBatch.split.weightNotNull.title=
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2014-01-07 14:16:06 UTC (rev 1478)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2014-01-08 12:34:01 UTC (rev 1479)
@@ -429,6 +429,14 @@
tutti.editBenthosBatch.filterBatch.mode.root=Parents (%s)
tutti.editBenthosBatch.filterBatch.mode.root.tip=Voir uniquement les lots *parents*
tutti.editBenthosBatch.filterBatch.tip=Pour filtrer les lots
+tutti.editBenthosBatch.sortSpeciesBatch=Tri
+tutti.editBenthosBatch.sortSpeciesBatch.tip=Trier les lignes selon les espèces
+tutti.editBenthosBatch.speciesSortMode.asc=Ascendant
+tutti.editBenthosBatch.speciesSortMode.asc.tip=Utiliser l'ordre ascendant
+tutti.editBenthosBatch.speciesSortMode.desc=Descendant
+tutti.editBenthosBatch.speciesSortMode.desc.tip=Utiliser l'ordre descendant
+tutti.editBenthosBatch.speciesSortMode.none=Saisie
+tutti.editBenthosBatch.speciesSortMode.none.tip=Utiliser l'ordre de saisie
tutti.editBenthosBatch.split.weightNotNull.help=Que voulez-vous faire ? <ul><li><strong>Annuler</strong> pour ne pas catégoriser le lot et garder le poids sous-échantilloné</li><li><strong>OK</strong> pour catégoriser le lot et supprimer le poids sous-échantillonné</li></ul>.
tutti.editBenthosBatch.split.weightNotNull.message=Pour catégoriser un lot, il ne doit pas avoir de poids sous-échantillonné.
tutti.editBenthosBatch.split.weightNotNull.title=Poids sous-échantillonné non nul
@@ -998,6 +1006,14 @@
tutti.editSpeciesBatch.filterBatch.mode.root=Parents (%s)
tutti.editSpeciesBatch.filterBatch.mode.root.tip=Voir uniquement les lots *parents*
tutti.editSpeciesBatch.filterSpeciesBatch.tip=Pour filtrer les lots
+tutti.editSpeciesBatch.sortSpeciesBatch=Tri
+tutti.editSpeciesBatch.sortSpeciesBatch.tip=Trier les lignes selon les espèces
+tutti.editSpeciesBatch.speciesSortMode.asc=Ascendant
+tutti.editSpeciesBatch.speciesSortMode.asc.tip=Utiliser l'ordre ascendant
+tutti.editSpeciesBatch.speciesSortMode.desc=Descendant
+tutti.editSpeciesBatch.speciesSortMode.desc.tip=Utiliser l'ordre descendant
+tutti.editSpeciesBatch.speciesSortMode.none=Saisie
+tutti.editSpeciesBatch.speciesSortMode.none.tip=Utiliser l'ordre de saisie
tutti.editSpeciesBatch.split.weightNotNull.help=Que voulez-vous faire ? <ul><li><strong>Annuler</strong> pour ne pas catégoriser le lot et garder le poids sous-échantilloné</li><li><strong>OK</strong> pour catégoriser le lot et supprimer le poids sous-échantillonné</li></ul>.
tutti.editSpeciesBatch.split.weightNotNull.message=Pour catégoriser un lot, il ne doit pas avoir de poids sous-échantillonné
tutti.editSpeciesBatch.split.weightNotNull.title=Poids sous-échantillonné non nul
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-sort.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-sort.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
1
0
Author: tchemit
Date: 2014-01-07 15:16:06 +0100 (Tue, 07 Jan 2014)
New Revision: 1478
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1478
Log:
utilisation mavenpom 4.5 + mise ?\195?\160 jour du site
Modified:
trunk/README.txt
trunk/pom.xml
trunk/src/site/site_fr.xml
Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2014-01-06 18:37:52 UTC (rev 1477)
+++ trunk/README.txt 2014-01-07 14:16:06 UTC (rev 1478)
@@ -30,3 +30,5 @@
+---------------------+------------+---------------------------+
+ 3.0-rc-2 + 2013.11.29 + 3.4.1 +
+---------------------+------------+---------------------------+
++ 3.0 + 2013.12.19 + 3.4.1 +
++---------------------+------------+---------------------------+
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-01-06 18:37:52 UTC (rev 1477)
+++ trunk/pom.xml 2014-01-07 14:16:06 UTC (rev 1478)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.3</version>
+ <version>4.5</version>
</parent>
<groupId>fr.ifremer</groupId>
@@ -149,7 +149,7 @@
<jreVersion>1.7.45</jreVersion>
<!-- Last tutti db version -->
- <dbVersion>2013.08.22</dbVersion>
+ <dbVersion>2013.12.19</dbVersion>
<!-- Last tutti report version -->
<reportVersion>2013.12.05</reportVersion>
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2014-01-06 18:37:52 UTC (rev 1477)
+++ trunk/src/site/site_fr.xml 2014-01-07 14:16:06 UTC (rev 1478)
@@ -28,7 +28,7 @@
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
- <version>1.3.0</version>
+ <version>${fluidoSkinVersion}</version>
</skin>
<custom>
@@ -60,16 +60,16 @@
<logo href="http://docutils.sourceforge.net/rst.html"
name="ReStructuredText"
- img="http://maven-site.nuiton.org/public/images/logos/restructuredtext-logo.png"/>
+ img="${mavenpomSiteCommonResourcesUrl}/images/logos/restructuredtext-logo.png"/>
<logo href="http://maven-site.nuiton.org/jrst" name="JRst"
- img="http://maven-site.nuiton.org/public/images/logos/jrst-logo.png"/>
+ img="${mavenpomSiteCommonResourcesUrl}/images/logos/jrst-logo.png"/>
<logo href="http://maven-site.nuiton.org/jaxx" name="JAXX"
- img="http://maven-site.nuiton.org/public/images/logos/jaxx-logo.png"/>
+ img="${mavenpomSiteCommonResourcesUrl}/images/logos/jaxx-logo.png"/>
<logo href="http://argouml.tigris.org/" name="ArgoUML"
- img="http://maven-site.nuiton.org/public/images/logos/argouml-logo.png"/>
+ img="${mavenpomSiteCommonResourcesUrl}/images/logos/argouml-logo.png"/>
</poweredBy>
@@ -77,11 +77,11 @@
<head>
<script type="text/javascript"
- src="http://maven-site.nuiton.org/public/js/mavenpom-site.js">
+ src="${mavenpomSiteCommonResourcesUrl}/js/mavenpom-site.js">
</script>
<link rel="stylesheet" type="text/css"
- href="http://maven-site.nuiton.org/public/css/mavenpom-site.css"/>
+ href="${mavenpomSiteCommonResourcesUrl}/css/mavenpom-site.css"/>
</head>
<links>
@@ -125,7 +125,9 @@
scmwebeditorurl='${project.scmwebeditorUrl}'
siteSourcesType='${project.siteSourcesType}'
piwikEnabled='${project.piwikEnabled}'
- piwikId='${project.piwikId}'>
+ piwikId='${project.piwikId}'
+ scmwebeditor_vmFiles=",update.html,"
+ scmwebeditor_skipDefaultFiles="true">
</div>
</footer>
</body>
1
0