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
March 2014
- 5 participants
- 70 discussions
r1653 - in trunk: . tutti-ichtyometer tutti-persistence tutti-service tutti-ui-swing tutti-ui-swing/src/main/filtered-resources
by maven-release@users.forge.codelutin.com 28 Mar '14
by maven-release@users.forge.codelutin.com 28 Mar '14
28 Mar '14
Author: maven-release
Date: 2014-03-28 15:09:06 +0100 (Fri, 28 Mar 2014)
New Revision: 1653
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1653
Log:
optimize dependencies
Modified:
trunk/pom.xml
trunk/tutti-ichtyometer/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-03-28 13:51:57 UTC (rev 1652)
+++ trunk/pom.xml 2014-03-28 14:09:06 UTC (rev 1653)
@@ -32,7 +32,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>3.3-SNAPSHOT</version>
+ <version>3.2.2</version>
<packaging>pom</packaging>
<name>Tutti</name>
@@ -99,13 +99,13 @@
<scm>
<url>
- https://forge.codelutin.com/projects/tutti/repository/trunk
+ https://forge.codelutin.com/projects/tutti/repository/tags/tutti-3.2.2
</url>
<connection>
- scm:svn:http://svn.codelutin.com/tutti/trunk
+ scm:svn:http://svn.codelutin.com/tutti/tags/tutti-3.2.2
</connection>
<developerConnection>
- scm:svn:https://svn.codelutin.com/tutti/trunk
+ scm:svn:https://svn.codelutin.com/tutti/tags/tutti-3.2.2
</developerConnection>
</scm>
<distributionManagement>
Modified: trunk/tutti-ichtyometer/pom.xml
===================================================================
--- trunk/tutti-ichtyometer/pom.xml 2014-03-28 13:51:57 UTC (rev 1652)
+++ trunk/tutti-ichtyometer/pom.xml 2014-03-28 14:09:06 UTC (rev 1653)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>3.3-SNAPSHOT</version>
+ <version>3.2.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2014-03-28 13:51:57 UTC (rev 1652)
+++ trunk/tutti-persistence/pom.xml 2014-03-28 14:09:06 UTC (rev 1653)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>3.3-SNAPSHOT</version>
+ <version>3.2.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2014-03-28 13:51:57 UTC (rev 1652)
+++ trunk/tutti-service/pom.xml 2014-03-28 14:09:06 UTC (rev 1653)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>3.3-SNAPSHOT</version>
+ <version>3.2.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
@@ -92,6 +92,10 @@
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ </dependency>
+ <dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2014-03-28 13:51:57 UTC (rev 1652)
+++ trunk/tutti-ui-swing/pom.xml 2014-03-28 14:09:06 UTC (rev 1653)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>3.3-SNAPSHOT</version>
+ <version>3.2.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
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-03-28 13:51:57 UTC (rev 1652)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-03-28 14:09:06 UTC (rev 1653)
@@ -1,3 +1,26 @@
+###
+# #%L
+# Tutti :: UI
+# $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%
+###
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
#Fri Mar 28 12:07:10 CET 2014
tutti.config.help=config.html
1
0
r1652 - trunk/tutti-ui-swing/src/main/resources/i18n
by tchemit@users.forge.codelutin.com 28 Mar '14
by tchemit@users.forge.codelutin.com 28 Mar '14
28 Mar '14
Author: tchemit
Date: 2014-03-28 14:51:57 +0100 (Fri, 28 Mar 2014)
New Revision: 1652
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1652
Log:
fixes #4847: Renommer les actions d'export
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_fr_FR.properties
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-03-28 13:29:07 UTC (rev 1651)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2014-03-28 13:51:57 UTC (rev 1652)
@@ -1463,6 +1463,8 @@
tutti.selectCruise.action.exportCruiseForSumatra.tip=
tutti.selectCruise.action.exportCruiseForSumatraV2=
tutti.selectCruise.action.exportCruiseForSumatraV2.tip=
+tutti.selectCruise.action.exportCruiseGeneric=
+tutti.selectCruise.action.exportCruiseGeneric.tip=
tutti.selectCruise.action.exportProgram=
tutti.selectCruise.action.exportProgram.tip=
tutti.selectCruise.action.exportProtocol=
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-03-28 13:29:07 UTC (rev 1651)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2014-03-28 13:51:57 UTC (rev 1652)
@@ -541,7 +541,7 @@
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.mnemonic=u
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.tip=Exporter le trait sélectionnée pour Sumatra (au format csv)
tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2=Résumé Sumatra V2
-tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.mnemonic=2
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.mnemonic=m
tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.tip=Exporter le trait sélectionnée pour Sumatra V2 (au format csv)
tutti.editCatchBatch.action.saveCatchBatch=Enregistrer
tutti.editCatchBatch.action.saveCatchBatch.mnemonic=S
@@ -1127,17 +1127,17 @@
tutti.exportDb.step.reloadApplication=Redémarrage de l'application
tutti.exportFishingOperationForSumatra.action.chooseFile=Choisir le fichier d'export
tutti.exportFishingOperationForSumatra.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
-tutti.exportFishingOperationForSumatra.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
+tutti.exportFishingOperationForSumatra.message.model.modified=La capture a été modifiée, veuillez l'enregistrer avant de lancer un export.
tutti.exportFishingOperationForSumatra.title.choose.exportFile=Exporter le trait de la campagne
tutti.exportFishingOperationForSumatra.title.model.modified=Impossible d'exporter, capture modifiée
tutti.exportFishingOperationForSumatraV2.action.chooseFile=Choisir le fichier d'export
tutti.exportFishingOperationForSumatraV2.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
-tutti.exportFishingOperationForSumatraV2.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
+tutti.exportFishingOperationForSumatraV2.message.model.modified=La capture a été modifiée, veuillez l'enregistrer avant de lancer un export.
tutti.exportFishingOperationForSumatraV2.title.choose.exportFile=Exporter le trait de la campagne
tutti.exportFishingOperationForSumatraV2.title.model.modified=Impossible d'exporter, capture modifiée
tutti.exportFishingOperationReport.action.chooseFile=Choisir le fichier de rapport
tutti.exportFishingOperationReport.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
-tutti.exportFishingOperationReport.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
+tutti.exportFishingOperationReport.message.model.modified=La capture a été modifiée, veuillez l'enregistrer avant de lancer un export.
tutti.exportFishingOperationReport.title.choose.exportFile=Exporter le trait de la campagne
tutti.exportFishingOperationReport.title.model.modified=Impossible d'exporter, capture modifiée
tutti.exportProgram.action.exportErrors=Des erreurs sont apparues pendant l'élévation des poids d'une campagne de la série <strong>%s</strong>.<br/>L'export a cependant été réalisé.<hr/>Erreur(s) rencontrée(s) \: <br/>%s
@@ -1441,12 +1441,12 @@
tutti.selectCruise.action.editProgram.tip=Éditer le programme sélectionné
tutti.selectCruise.action.editProtocol=Éditer
tutti.selectCruise.action.editProtocol.tip=Éditer le protocole sélectionné
-tutti.selectCruise.action.exportCruise=Exporter
-tutti.selectCruise.action.exportCruise.tip=Exporter la campagne sélectionnée
-tutti.selectCruise.action.exportCruiseForSumatra=Sumatra
-tutti.selectCruise.action.exportCruiseForSumatra.tip=Exporter la campagne sélectionnée pour Sumatra
-tutti.selectCruise.action.exportCruiseForSumatraV2=Sumatra (V2)
-tutti.selectCruise.action.exportCruiseForSumatraV2.tip=Exporter la campagne sélectionnée pour Sumatra (V2)
+tutti.selectCruise.action.exportCruise=Export Générique
+tutti.selectCruise.action.exportCruise.tip=Exporter la campagne sélectionnée au format générique
+tutti.selectCruise.action.exportCruiseForSumatra=Eport Sumatra (v1)
+tutti.selectCruise.action.exportCruiseForSumatra.tip=Exporter la campagne sélectionnée au format csv pour Sumatra (v1)
+tutti.selectCruise.action.exportCruiseForSumatraV2=Export Sumatra (V2)
+tutti.selectCruise.action.exportCruiseForSumatraV2.tip=Exporter la campagne sélectionnée au format csv pour Sumatra (V2)
tutti.selectCruise.action.exportProgram=Exporter
tutti.selectCruise.action.exportProgram.tip=Exporter la série sélectionnée
tutti.selectCruise.action.exportProtocol=Exporter
@@ -1459,8 +1459,8 @@
tutti.selectCruise.action.newProgram.tip=Créer une nouvelle série de campagne
tutti.selectCruise.action.newProtocol=Nouveau
tutti.selectCruise.action.newProtocol.tip=Créer un nouveau protocole
-tutti.selectCruise.action.sendCruiseReport=Envoyer
-tutti.selectCruise.action.sendCruiseReport.tip=Envoyer le rapport de la campagne
+tutti.selectCruise.action.sendCruiseReport=Export Pdf
+tutti.selectCruise.action.sendCruiseReport.tip=Exporter au format pdf et envoyer par courriel
tutti.selectCruise.action.validateCatches=Valider les captures
tutti.selectCruise.action.validateCatches.mnemonic=V
tutti.selectCruise.action.validateCatches.tip=Lancer le processus de validation des données
1
0
Jenkins build became unstable: tutti-ci » Tutti :: Persistence #34
by admin+ci-codelutin.com@codelutin.com 28 Mar '14
by admin+ci-codelutin.com@codelutin.com 28 Mar '14
28 Mar '14
28 Mar '14
r1651 - trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/config
by tchemit@users.forge.codelutin.com 28 Mar '14
by tchemit@users.forge.codelutin.com 28 Mar '14
28 Mar '14
Author: tchemit
Date: 2014-03-28 14:29:07 +0100 (Fri, 28 Mar 2014)
New Revision: 1651
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1651
Log:
fix test
Modified:
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceConfigTest.java
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceConfigTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceConfigTest.java 2014-03-28 13:11:04 UTC (rev 1650)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceConfigTest.java 2014-03-28 13:29:07 UTC (rev 1651)
@@ -82,7 +82,7 @@
SampleCategoryModelEntry classDeTri = new SampleCategoryModelEntry();
classDeTri.setCategoryId(198);
- classDeTri.setLabel("Class Tri.");
+ classDeTri.setLabel("Class Tri");
classDeTri.setOrder(1);
SampleCategoryModelEntry sex = new SampleCategoryModelEntry();
@@ -92,7 +92,7 @@
SampleCategoryModelEntry maturity = new SampleCategoryModelEntry();
maturity.setCategoryId(174);
- maturity.setLabel("Maturité");
+ maturity.setLabel("Maturite");
maturity.setOrder(3);
SampleCategoryModelEntry age = new SampleCategoryModelEntry();
1
0
28 Mar '14
Author: tchemit
Date: 2014-03-28 14:11:04 +0100 (Fri, 28 Mar 2014)
New Revision: 1650
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1650
Log:
fixes #4845: Evolution format export SUMATRA
Added:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModelV2.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowV2.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceV2.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceV2Test.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportCruiseForSumatraV2Action.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraV2Action.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportBatchEntry.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/pdf/CatchesPdfExportService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModel.java
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/resources/tuttiProtocol.tuttiProtocol
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html
trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
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.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/EditCatchesUI.jaxx
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-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -25,6 +25,7 @@
*/
import com.google.common.base.Predicate;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
@@ -585,6 +586,15 @@
List<SpeciesBatchFrequency> getAllSpeciesBatchFrequency(String speciesBatchId);
/**
+ * Get all frequencies for the given root species batch container.
+ *
+ * @param batchContainer the root batch containter
+ * @return the list of species frequencies indexed by their species
+ * @since 3.3
+ */
+ Multimap<Species, SpeciesBatchFrequency> getAllSpeciesBatchFrequencyForBatch(BatchContainer<SpeciesBatch> batchContainer);
+
+ /**
* Save all given {@link SpeciesBatchFrequency} into the given
* {@code speciesBatchId}. If some are not existing then creates them.
* <p/>
@@ -643,6 +653,15 @@
List<BenthosBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId);
/**
+ * Get all frequencies for the given root benthos batch container.
+ *
+ * @param batchContainer the root batch containter
+ * @return the list of benthos frequencies indexed by their species
+ * @since 3.3
+ */
+ Multimap<Species, BenthosBatchFrequency> getAllBenthosBatchFrequencyForBatch(BatchContainer<BenthosBatch> batchContainer);
+
+ /**
* Save all given {@link BenthosBatchFrequency} into the given
* {@code benthosBatchId}. If some are not existing then creates them.
* <p/>
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -25,7 +25,9 @@
*/
import com.google.common.base.Predicate;
+import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
import fr.ifremer.adagio.core.dao.technical.DatabaseSchemaDao;
import fr.ifremer.adagio.core.dao.technical.DatabaseSchemaUpdateException;
import fr.ifremer.adagio.core.dao.technical.VersionNotFoundException;
@@ -783,6 +785,17 @@
}
@Override
+ public Multimap<Species, SpeciesBatchFrequency> getAllSpeciesBatchFrequencyForBatch(BatchContainer<SpeciesBatch> batchContainer) {
+
+ Multimap<Species, SpeciesBatchFrequency> result = ArrayListMultimap.create();
+ for (SpeciesBatch speciesBatch : batchContainer.getChildren()) {
+ List<SpeciesBatchFrequency> speciesBatchFrequency = getAllSpeciesBatchFrequency(speciesBatch.getId());
+ result.putAll(speciesBatch.getSpecies(), speciesBatchFrequency);
+ }
+ return result;
+ }
+
+ @Override
public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, List<SpeciesBatchFrequency> frequencies) {
return speciesBatchService.saveSpeciesBatchFrequency(speciesBatchId, frequencies);
}
@@ -827,6 +840,17 @@
}
@Override
+ public Multimap<Species, BenthosBatchFrequency> getAllBenthosBatchFrequencyForBatch(BatchContainer<BenthosBatch> batchContainer) {
+
+ Multimap<Species, BenthosBatchFrequency> result = ArrayListMultimap.create();
+ for (BenthosBatch speciesBatch : batchContainer.getChildren()) {
+ List<BenthosBatchFrequency> speciesBatchFrequency = getAllBenthosBatchFrequency(speciesBatch.getId());
+ result.putAll(speciesBatch.getSpecies(), speciesBatchFrequency);
+ }
+ return result;
+ }
+
+ @Override
public List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
List<BenthosBatchFrequency> frequencies) {
return benthosBatchService.saveBenthosBatchFrequency(benthosBatchId, frequencies);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -25,6 +25,7 @@
*/
import com.google.common.base.Predicate;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
@@ -526,6 +527,11 @@
}
@Override
+ public Multimap<Species, SpeciesBatchFrequency> getAllSpeciesBatchFrequencyForBatch(BatchContainer<SpeciesBatch> batchContainer) {
+ throw notImplemented();
+ }
+
+ @Override
public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId, List<SpeciesBatchFrequency> frequencies) {
throw notImplemented();
}
@@ -566,6 +572,11 @@
}
@Override
+ public Multimap<Species, BenthosBatchFrequency> getAllBenthosBatchFrequencyForBatch(BatchContainer<BenthosBatch> batchContainer) {
+ throw notImplemented();
+ }
+
+ @Override
public List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId, List<BenthosBatchFrequency> frequencies) {
throw notImplemented();
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -29,6 +29,7 @@
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.TuttiConfiguration;
import fr.ifremer.tutti.persistence.InvalidBatchModelException;
import fr.ifremer.tutti.persistence.TuttiPersistence;
@@ -66,6 +67,7 @@
import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.vfs2.AllFileSelector;
@@ -74,6 +76,7 @@
import org.apache.commons.vfs2.FileType;
import org.nuiton.jaxx.application.ApplicationBusinessException;
import org.nuiton.jaxx.application.ApplicationIOUtil;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import org.nuiton.util.TimeLog;
import org.nuiton.util.Version;
@@ -605,6 +608,50 @@
return null;
}
+ public void fillSpeciesSurveyCode(Collection<Species> speciesList) {
+
+ TuttiProtocol protocol = getProtocol();
+
+ if (protocol != null) {
+ // fill available species from protocol
+ if (!protocol.isSpeciesEmpty()) {
+
+ Map<Integer, SpeciesProtocol> protocolMap = toSpeciesProtocolMap();
+
+ for (Species species : speciesList) {
+ SpeciesProtocol speciesProtocol = protocolMap.get(species.getReferenceTaxonId());
+ if (speciesProtocol == null ||
+ StringUtils.isEmpty(speciesProtocol.getSpeciesSurveyCode())) {
+ throw new ApplicationTechnicalException(t("tutti.error.species.not.in.protocol", species.getName()));
+ }
+ species.setSurveyCode(speciesProtocol.getSpeciesSurveyCode());
+ }
+ }
+ }
+ }
+
+ public void fillBenthosSurveyCode(Collection<Species> benthosList) {
+
+ TuttiProtocol protocol = getProtocol();
+
+ if (protocol != null) {
+ // fill available benthos from protocol
+ if (!protocol.isBenthosEmpty()) {
+
+ Map<Integer, SpeciesProtocol> protocolMap = toBenthosProtocolMap();
+
+ for (Species species : benthosList) {
+ SpeciesProtocol speciesProtocol = protocolMap.get(species.getReferenceTaxonId());
+ if (speciesProtocol == null ||
+ StringUtils.isEmpty(speciesProtocol.getSpeciesSurveyCode())) {
+ throw new ApplicationTechnicalException(t("tutti.error.benthos.not.in.protocol", species.getName()));
+ }
+ species.setSurveyCode(speciesProtocol.getSpeciesSurveyCode());
+ }
+ }
+ }
+ }
+
public static final TimeLog TIME_LOG = new TimeLog(PersistenceService.class);
@Override
@@ -1154,6 +1201,11 @@
}
@Override
+ public Multimap<Species, SpeciesBatchFrequency> getAllSpeciesBatchFrequencyForBatch(BatchContainer<SpeciesBatch> batchContainer) {
+ return driver.getAllSpeciesBatchFrequencyForBatch(batchContainer);
+ }
+
+ @Override
public List<SpeciesBatchFrequency> saveSpeciesBatchFrequency(String speciesBatchId,
List<SpeciesBatchFrequency> frequencies) {
return driver.saveSpeciesBatchFrequency(speciesBatchId, frequencies);
@@ -1200,6 +1252,11 @@
}
@Override
+ public Multimap<Species, BenthosBatchFrequency> getAllBenthosBatchFrequencyForBatch(BatchContainer<BenthosBatch> batchContainer) {
+ return driver.getAllBenthosBatchFrequencyForBatch(batchContainer);
+ }
+
+ @Override
public List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
List<BenthosBatchFrequency> frequencies) {
return driver.saveBenthosBatchFrequency(benthosBatchId, frequencies);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -26,6 +26,7 @@
import com.google.common.base.Function;
import com.google.common.base.Joiner;
+import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
@@ -117,6 +118,29 @@
}
};
+ public static final ValueFormatter<Species> SPECIES_NAME_FORMATTER = new ValueFormatter<Species>() {
+ @Override
+ public String format(Species s) {
+ Preconditions.checkNotNull(s, t("tutti.service.error.species.null"));
+ return s.getName();
+ }
+ };
+
+ public static final ValueFormatter<Number> NUMBER_OR_NA = new ValueFormatter<Number>() {
+ @Override
+ public String format(Number s) {
+ return s==null?"NA": s.toString();
+ }
+ };
+
+ public static final ValueFormatter<Species> SPECIES_SURVEY_CODE_FORMATTER = new ValueFormatter<Species>() {
+ @Override
+ public String format(Species s) {
+ Preconditions.checkNotNull(s, t("tutti.service.error.species.null"));
+ return s.getSurveyCode();
+ }
+ };
+
public static final ValueFormatter<Serializable> CARACTERISTIC_VALUE_FORMATTER2 = new ValueFormatter<Serializable>() {
@Override
public String format(Serializable value) {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportBatchEntry.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportBatchEntry.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportBatchEntry.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -25,9 +25,13 @@
*/
import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch;
+import org.apache.commons.lang3.mutable.MutableInt;
+import java.util.Map;
+import java.util.TreeMap;
+
/**
- * To store a species or batch entry within his speices informations,
+ * To store a species or batch entry within his species informations,
* his sorted weight, total weight and optional his total number.
*
* @since 3.0-rc-1
@@ -42,8 +46,16 @@
protected int totalNumber;
+ /**
+ * Frequencies (key = step, value = number).
+ *
+ * @since 3.3
+ */
+ protected Map<Float, MutableInt> frequencies;
+
public ExportBatchEntry(SpeciesAbleBatch batch) {
this.batch = batch;
+ this.frequencies = new TreeMap<>();
}
public SpeciesAbleBatch getBatch() {
@@ -62,6 +74,15 @@
totalNumber += number;
}
+ public void addFrequency(float lengthStep, int number) {
+ MutableInt totalNumber = frequencies.get(lengthStep);
+ if (totalNumber == null) {
+ totalNumber = new MutableInt();
+ frequencies.put(lengthStep, totalNumber);
+ }
+ totalNumber.add(number);
+ }
+
public float getSortedWeight() {
return sortedWeight;
}
@@ -73,4 +94,17 @@
public int getTotalNumber() {
return totalNumber;
}
+
+ public Float getAverageFrequency() {
+ int totNumber = 0;
+ float totSize = 0;
+ for (Map.Entry<Float, MutableInt> entry : frequencies.entrySet()) {
+ float size = entry.getKey();
+ int number = entry.getValue().intValue();
+ totSize += (size * number);
+ totNumber += number;
+ }
+ Float result = totNumber == 0 ? null : totSize / (float) totNumber;
+ return result;
+ }
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -27,18 +27,24 @@
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatchFrequency;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.catches.WeightComputingService;
+import org.apache.commons.collections4.CollectionUtils;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -62,11 +68,16 @@
final BatchContainer<MarineLitterBatch> marineLitterBatches;
+ final Multimap<Species, SpeciesBatchFrequency> speciesFrequencies;
+
+ final Multimap<Species, BenthosBatchFrequency> benthosFrequencies;
+
final Predicate<SpeciesAbleBatch> vracPredicate;
public static ExportCatchContext newExportContext(PersistenceService persistenceService,
WeightComputingService weightComputingService,
- String fishingOperationId) {
+ String fishingOperationId,
+ boolean loadFrequencies) {
FishingOperation fishingOperation =
persistenceService.getFishingOperation(fishingOperationId);
@@ -89,13 +100,27 @@
rootBenthosBatch,
marineLitterBatches);
+ Multimap<Species, SpeciesBatchFrequency> speciesFrequencies;
+ Multimap<Species, BenthosBatchFrequency> benthosFrequencies;
+
+ if (loadFrequencies) {
+
+ speciesFrequencies = persistenceService.getAllSpeciesBatchFrequencyForBatch(rootSpeciesBatch);
+ benthosFrequencies = persistenceService.getAllBenthosBatchFrequencyForBatch(rootBenthosBatch);
+ } else {
+ speciesFrequencies = null;
+ benthosFrequencies = null;
+ }
+
Predicate<SpeciesAbleBatch> vracPredicate = persistenceService.getVracBatchPredicate();
ExportCatchContext result = new ExportCatchContext(vracPredicate,
fishingOperation,
catchBatch,
rootSpeciesBatch,
+ speciesFrequencies,
rootBenthosBatch,
+ benthosFrequencies,
marineLitterBatches);
return result;
@@ -105,12 +130,16 @@
FishingOperation fishingOperation,
CatchBatch catchBatch,
BatchContainer<SpeciesBatch> rootSpeciesBatch,
+ Multimap<Species, SpeciesBatchFrequency> speciesFrequencies,
BatchContainer<BenthosBatch> rootBenthosBatch,
+ Multimap<Species, BenthosBatchFrequency> benthosFrequencies,
BatchContainer<MarineLitterBatch> marineLitterBatches) {
this.vracPredicate = vracPredicate;
this.fishingOperation = fishingOperation;
this.catchBatch = catchBatch;
this.rootSpeciesBatch = rootSpeciesBatch;
+ this.speciesFrequencies = speciesFrequencies;
+ this.benthosFrequencies = benthosFrequencies;
this.rootBenthosBatch = rootBenthosBatch;
this.marineLitterBatches = marineLitterBatches;
}
@@ -141,11 +170,21 @@
return rootBenthosBatch != null && !rootBenthosBatch.isEmptyChildren();
}
+ public boolean withSpeciesFrequencies() {
+ return speciesFrequencies != null && !speciesFrequencies.isEmpty();
+ }
+
+ public boolean withBenthosFrequencies() {
+ return benthosFrequencies != null && !benthosFrequencies.isEmpty();
+ }
+
public List<ExportBatchEntry> getSpeciesBatchEntry(boolean computeNumber) {
List<ExportBatchEntry> catchList = Lists.newArrayList();
if (withSpeciesBatches()) {
+ boolean withFrequencies = withSpeciesFrequencies();
+
Map<Species, ExportBatchEntry> catches = Maps.newLinkedHashMap();
// ratio total species weight / total sorted sampled species weight
@@ -154,11 +193,15 @@
List<SpeciesBatch> batches = rootSpeciesBatch.getChildren();
for (SpeciesBatch batch : batches) {
- createExportBatchCatch(
+ ExportBatchEntry aCatch = createExportBatchCatch(
batch,
catches,
rate,
computeNumber);
+
+ if (withFrequencies) {
+ addFrequencies(aCatch, speciesFrequencies);
+ }
}
catchList.addAll(catches.values());
}
@@ -170,6 +213,8 @@
if (withBenthosBatches()) {
+ boolean withFrequencies = withBenthosFrequencies();
+
Map<Species, ExportBatchEntry> catches = Maps.newLinkedHashMap();
// ratio total species weight / total sorted sampled species weight
@@ -178,11 +223,15 @@
List<BenthosBatch> batches = rootBenthosBatch.getChildren();
for (BenthosBatch batch : batches) {
- createExportBatchCatch(
+ ExportBatchEntry aCatch = createExportBatchCatch(
batch,
catches,
rate,
computeNumber);
+
+ if (withFrequencies) {
+ addFrequencies(aCatch, benthosFrequencies);
+ }
}
catchList.addAll(catches.values());
@@ -272,10 +321,10 @@
return result;
}
- protected void createExportBatchCatch(SpeciesAbleBatch batch,
- Map<Species, ExportBatchEntry> catches,
- float ratio,
- boolean computeNumber) {
+ protected ExportBatchEntry createExportBatchCatch(SpeciesAbleBatch batch,
+ Map<Species, ExportBatchEntry> catches,
+ float ratio,
+ boolean computeNumber) {
Species species = batch.getSpecies();
@@ -305,6 +354,7 @@
}
ktch.addNumber(Math.round(number));
}
+ return ktch;
}
protected float computeNumber(SpeciesAbleBatch batch, float rf) {
@@ -361,4 +411,17 @@
}
return result;
}
+
+ protected <F extends SpeciesAbleBatchFrequency> void addFrequencies(ExportBatchEntry aCatch,
+ Multimap<Species, F> frequencies) {
+ Species species = aCatch.getBatch().getSpecies();
+ Collection<F> batchFrequencies = frequencies.get(species);
+ if (CollectionUtils.isNotEmpty(batchFrequencies)) {
+ for (F batchFrequency : batchFrequencies) {
+ Integer number = batchFrequency.getNumber();
+ Float lengthStep = batchFrequency.getLengthStep();
+ aCatch.addFrequency(lengthStep, number);
+ }
+ }
+ }
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/pdf/CatchesPdfExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/pdf/CatchesPdfExportService.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/pdf/CatchesPdfExportService.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -156,7 +156,10 @@
}
ExportCatchContext exportContext = ExportCatchContext.newExportContext(
- persistenceService, weightComputingService, fishingOperationId);
+ persistenceService,
+ weightComputingService,
+ fishingOperationId,
+ false);
// create operation data model
Map<String, Object> op = createOperation(exportContext.getFishingOperation());
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModel.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModel.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -28,6 +28,7 @@
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.TuttiCsvUtil;
+import fr.ifremer.tutti.service.export.ExportBatchEntry;
import org.nuiton.csv.Common;
import org.nuiton.csv.ValueFormatter;
@@ -67,4 +68,13 @@
return new CatchRow();
}
+ public CatchRow newRow(FishingOperation operation, ExportBatchEntry entry) {
+ CatchRow row = newEmptyInstance();
+ row.setFishingOperation(operation);
+ row.setSpecies(entry.getBatch().getSpecies());
+ row.setWeight(entry.getTotalWeight());
+ row.setNumber(entry.getTotalNumber());
+ return row;
+ }
+
}
Copied: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModelV2.java (from rev 1646, trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModel.java)
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModelV2.java (rev 0)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowModelV2.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -0,0 +1,83 @@
+package fr.ifremer.tutti.service.export.sumatra;
+
+/*
+ * #%L
+ * Tutti :: Service
+ * $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 fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.service.TuttiCsvUtil;
+import fr.ifremer.tutti.service.export.ExportBatchEntry;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * @author tchemit
+ * @since 3.3
+ */
+public class CatchRowModelV2 extends TuttiCsvUtil.AbstractTuttiImportExportModel<CatchRowV2> {
+
+ public CatchRowModelV2(char separator) {
+ super(separator);
+
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.year"), CatchRowV2.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.YEAR);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.station"), CatchRowV2.PROPERTY_STATION_NUMBER);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.multirigAggregation"), CatchRowV2.PROPERTY_MULTIRIG_AGGREGATION);
+
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.species"), CatchRowV2.PROPERTY_SPECIES, TuttiCsvUtil.SPECIES_SURVEY_CODE_FORMATTER);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.sign"), CatchRowV2.PROPERTY_SIGN);
+
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.sortedWeight"), CatchRowV2.PROPERTY_SORTED_WEIGHT, TuttiCsvUtil.PRIMITIVE_FLOAT);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.totalWeight"), CatchRowV2.PROPERTY_TOTAL_WEIGHT, TuttiCsvUtil.PRIMITIVE_FLOAT);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.averageWeight"), CatchRowV2.PROPERTY_AVERAGE_WEIGHT, TuttiCsvUtil.NUMBER_OR_NA);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.averageSize"), CatchRowV2.PROPERTY_AVERAGE_SIZE, TuttiCsvUtil.NUMBER_OR_NA);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.number"), CatchRowV2.PROPERTY_NUMBER, TuttiCsvUtil.PRIMITIVE_INTEGER);
+ newColumnForExport(t("tutti.service.exportSumatraV2.header.moule"), CatchRowV2.PROPERTY_MOULE, TuttiCsvUtil.NUMBER_OR_NA);
+ }
+
+ @Override
+ public CatchRowV2 newEmptyInstance() {
+ return new CatchRowV2();
+ }
+
+ public CatchRowV2 newRow(FishingOperation operation, ExportBatchEntry entry) {
+ CatchRowV2 row = newEmptyInstance();
+ row.setFishingOperation(operation);
+ row.setSpecies(entry.getBatch().getSpecies());
+ row.setSortedWeight(entry.getSortedWeight());
+ float totalWeight = entry.getTotalWeight();
+ int number = entry.getTotalNumber();
+
+ row.setNumber(number);
+ row.setTotalWeight(totalWeight);
+
+ // average size
+ row.setAverageSize(entry.getAverageFrequency());
+
+ // avarage weight
+ row.setAverageWeight(number == 0 ? null : totalWeight / (float) number);
+ // moule
+ row.setMoule(totalWeight == 0 ? null : (float) number / totalWeight);
+ return row;
+ }
+
+}
Copied: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowV2.java (from rev 1646, trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRow.java)
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowV2.java (rev 0)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchRowV2.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -0,0 +1,160 @@
+package fr.ifremer.tutti.service.export.sumatra;
+
+/*
+ * #%L
+ * Tutti :: Service
+ * $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 fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.referential.Species;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author tchemit
+ * @since 3.3
+ */
+public class CatchRowV2 implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_STATION_NUMBER = FishingOperation.PROPERTY_STATION_NUMBER;
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_DATE = FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE;
+
+ public static final String PROPERTY_MULTIRIG_AGGREGATION = FishingOperation.PROPERTY_MULTIRIG_AGGREGATION;
+
+ public static final String PROPERTY_SPECIES = "species";
+
+ public static final String PROPERTY_SIGN = "sign";
+
+ public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight";
+
+ public static final String PROPERTY_SORTED_WEIGHT = "sortedWeight";
+
+ public static final String PROPERTY_AVERAGE_WEIGHT = "averageWeight";
+
+ public static final String PROPERTY_AVERAGE_SIZE = "averageSize";
+
+ public static final String PROPERTY_NUMBER = "number";
+
+ public static final String PROPERTY_MOULE = "moule";
+
+ protected FishingOperation fishingOperation;
+
+ protected Species species;
+
+ protected String sign;
+
+ protected Float totalWeight;
+
+ protected Float sortedWeight;
+
+ protected Float averageWeight;
+
+ protected Float averageSize;
+
+ protected Integer number;
+
+ protected Float moule;
+
+ public String getStationNumber() {
+ return fishingOperation.getStationNumber();
+ }
+
+ public Date getGearShootingStartDate() {
+ return fishingOperation.getGearShootingStartDate();
+ }
+
+ public String getMultirigAggregation() {
+ return fishingOperation.getMultirigAggregation();
+ }
+
+ public void setFishingOperation(FishingOperation fishingOperation) {
+ this.fishingOperation = fishingOperation;
+ }
+
+ public Species getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(Species species) {
+ this.species = species;
+ }
+
+ public String getSign() {
+ return sign;
+ }
+
+ public void setSign(String sign) {
+ this.sign = sign;
+ }
+
+ public Float getTotalWeight() {
+ return totalWeight;
+ }
+
+ public void setTotalWeight(Float totalWeight) {
+ this.totalWeight = totalWeight;
+ }
+
+ public Float getSortedWeight() {
+ return sortedWeight;
+ }
+
+ public void setSortedWeight(Float sortedWeight) {
+ this.sortedWeight = sortedWeight;
+ }
+
+ public Float getAverageWeight() {
+ return averageWeight;
+ }
+
+ public void setAverageWeight(Float averageWeight) {
+ this.averageWeight = averageWeight;
+ }
+
+ public Float getAverageSize() {
+ return averageSize;
+ }
+
+ public void setAverageSize(Float averageSize) {
+ this.averageSize = averageSize;
+ }
+
+ public Integer getNumber() {
+ return number;
+ }
+
+ public void setNumber(Integer number) {
+ this.number = number;
+ }
+
+ public Float getMoule() {
+ return moule;
+ }
+
+ public void setMoule(Float moule) {
+ this.moule = moule;
+ }
+}
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportService.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -28,7 +28,6 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.io.Files;
-import org.nuiton.jaxx.application.ApplicationTechnicalException;
import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
@@ -42,6 +41,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.csv.Export;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
import java.io.BufferedWriter;
import java.io.File;
@@ -144,6 +144,9 @@
List<CatchRow> rows = Lists.newArrayList();
+ CatchRowModel csvModel =
+ new CatchRowModel(context.getConfig().getCsvSeparator());
+
if (operations != null) {
for (String operationId : operations) {
@@ -156,13 +159,11 @@
break;
}
- prepareFishingOperation(rows, operationId);
+ prepareFishingOperation(csvModel, rows, operationId);
}
}
progressionModel.increments(t("tutti.service.sumatra.export.step.export", file));
- CatchRowModel csvModel =
- new CatchRowModel(context.getConfig().getCsvSeparator());
BufferedWriter writer = null;
try {
@@ -178,10 +179,15 @@
}
}
- protected void prepareFishingOperation(List<CatchRow> rows, String operationId) {
+ protected void prepareFishingOperation(CatchRowModel csvModel,
+ List<CatchRow> rows,
+ String operationId) {
ExportCatchContext exportContext = ExportCatchContext.newExportContext(
- persistenceService, weightComputingService, operationId);
+ persistenceService,
+ weightComputingService,
+ operationId,
+ false);
FishingOperation operation = exportContext.getFishingOperation();
@@ -193,11 +199,7 @@
for (ExportBatchEntry entry : entries) {
- CatchRow row = new CatchRow();
- row.setFishingOperation(operation);
- row.setSpecies(entry.getBatch().getSpecies());
- row.setWeight(entry.getTotalWeight());
- row.setNumber(entry.getTotalNumber());
+ CatchRow row = csvModel.newRow(operation, entry);
rows.add(row);
}
}
@@ -210,192 +212,9 @@
for (ExportBatchEntry entry : entries) {
- CatchRow row = new CatchRow();
- row.setFishingOperation(operation);
- row.setSpecies(entry.getBatch().getSpecies());
- row.setWeight(entry.getTotalWeight());
- row.setNumber(entry.getTotalNumber());
+ CatchRow row = csvModel.newRow(operation, entry);
rows.add(row);
}
}
-
-// FishingOperation operation = persistenceService.getFishingOperation(operationId);
-//
-// CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(
-// operationId);
-//
-// BatchContainer<SpeciesBatch> speciesBatchContainer =
-// weightComputingService.getComputedSpeciesBatches(operationId);
-// BatchContainer<BenthosBatch> benthosBatchContainer =
-// weightComputingService.getComputedBenthosBatches(operationId);
-//
-// BatchContainer<MarineLitterBatch> marineLitterBatch =
-// weightComputingService.getComputedMarineLitterBatches(
-// operationId, catchBatch.getMarineLitterTotalWeight());
-//
-// weightComputingService.computeCatchBatchWeights(catchBatch,
-// speciesBatchContainer,
-// benthosBatchContainer,
-// marineLitterBatch);
-//
-// Float totalWeight = TuttiEntities.getValueOrComputedValue(
-// catchBatch.getCatchTotalWeight(),
-// catchBatch.getCatchTotalComputedWeight());
-//
-// Float totalUnsortedWeight =
-// TuttiEntities.getValueOrComputedValue(
-// catchBatch.getCatchTotalUnsortedComputedWeight(),
-// 0f);
-//
-// Float totalSortedSpeciesWeight = TuttiEntities.getValueOrComputedValue(
-// catchBatch.getSpeciesTotalSortedWeight(),
-// catchBatch.getSpeciesTotalSortedComputedWeight());
-//
-// Float totalSampleSortedSpeciesWeight =
-// catchBatch.getSpeciesTotalSampleSortedComputedWeight();
-//
-// Float totalSortedBenthosWeight = TuttiEntities.getValueOrComputedValue(
-// catchBatch.getBenthosTotalSortedWeight(),
-// catchBatch.getBenthosTotalSortedComputedWeight());
-//
-// Float totalSampleSortedBenthosWeight =
-// catchBatch.getBenthosTotalSampleSortedComputedWeight();
-//
-// Float totalSortedWeight = catchBatch.getCatchTotalSortedComputedWeight();
-//
-// //FIXME tchemit 2013-07-12 J'utilise en fait la formule (Poids de la capture totale - poids du HV dans la capture totale) / (poids total capture triée)
-// // (Poids de la capture totale - poids du HV dans la capture totale) / (poids total capture triée - poids du HV dans la capture totale)
-//
-// Float catchRaisingFactor = totalWeight == null || totalUnsortedWeight == null || totalSortedWeight == null ? 1 : (totalWeight - totalUnsortedWeight) / totalSortedWeight;
-//
-// Float speciesCatchRaisingFactor = totalSampleSortedSpeciesWeight == null || totalSortedSpeciesWeight == null || totalSampleSortedSpeciesWeight == null ? 1 : (totalSampleSortedSpeciesWeight == 0 ? 0 : (totalSortedSpeciesWeight / totalSampleSortedSpeciesWeight) * catchRaisingFactor);
-// Float benthosCatchRaisingFactor = totalSampleSortedBenthosWeight == null || totalSortedBenthosWeight == null || totalSampleSortedBenthosWeight == null ? 1 : (totalSampleSortedBenthosWeight == 0 ? 0 : (totalSortedBenthosWeight / totalSampleSortedBenthosWeight) * catchRaisingFactor);
-//
-// speciesCatchRaisingFactor *= catchRaisingFactor;
-// benthosCatchRaisingFactor *= catchRaisingFactor;
-//
-// // add species rows
-// Map<Species, CatchRow> rowMap = Maps.newLinkedHashMap();
-// if (speciesBatchContainer != null) {
-// List<SpeciesBatch> speciesBatches = speciesBatchContainer.getChildren();
-// for (SpeciesBatch batch : speciesBatches) {
-// Species sp = batch.getSpecies();
-//
-// int number = Math.round(computeNumber(batch, 1.0f));
-//
-// Float weight = TuttiEntities.getValueOrComputedValue(
-// batch.getSampleCategoryWeight(),
-// batch.getSampleCategoryComputedWeight());
-//
-// weight *= speciesCatchRaisingFactor;
-// number = (int) (speciesCatchRaisingFactor * (float) number);
-//
-// CatchRow row = rowMap.get(sp);
-// if (row == null) {
-// row = new CatchRow();
-// row.setFishingOperation(operation);
-// row.setSpecies(sp);
-// row.setWeight(weight);
-// row.setNumber(number);
-//
-// } else {
-// row.setWeight(row.getWeight() + weight);
-// row.setNumber(row.getNumber() + number);
-// }
-// rowMap.put(sp, row);
-// }
-// rows.addAll(rowMap.values());
-// }
-//
-// // add benthos rows
-// rowMap.clear();
-// if (benthosBatchContainer != null) {
-// List<BenthosBatch> benthosBatches = benthosBatchContainer.getChildren();
-// for (BenthosBatch batch : benthosBatches) {
-// Species sp = batch.getSpecies();
-//
-// int number = Math.round(computeNumber(batch, 1.0f));
-//
-// Float weight = TuttiEntities.getValueOrComputedValue(
-// batch.getSampleCategoryWeight(),
-// batch.getSampleCategoryComputedWeight());
-//
-// weight *= benthosCatchRaisingFactor;
-// number = (int) (benthosCatchRaisingFactor * (float) number);
-//
-// CatchRow row = rowMap.get(sp);
-// if (row == null) {
-// row = new CatchRow();
-// row.setFishingOperation(operation);
-// row.setSpecies(sp);
-// row.setWeight(weight);
-// row.setNumber(number);
-//
-// } else {
-// row.setWeight(row.getWeight() + weight);
-// row.setNumber(row.getNumber() + number);
-// }
-// rowMap.put(sp, row);
-// }
-// }
-//
-// rows.addAll(rowMap.values());
}
-
-
-// protected float computeNumber(SpeciesAbleBatch batch, float rf) {
-// float result;
-//
-// float weight = TuttiEntities.getValueOrComputedValue(
-// batch.getSampleCategoryWeight(),
-// batch.getSampleCategoryComputedWeight());
-//
-// if (batch.isChildBatchsEmpty()) {
-//
-// // on a leaf, get his weight
-//
-// Integer number = TuttiEntities.getValueOrComputedValue(
-// batch.getNumber(),
-// batch.getComputedNumber());
-// if (number == null) {
-//
-// // no count
-// number = 0;
-// }
-//
-// // get the sample weight
-// Float subweight = TuttiEntities.getValueOrComputedValue(
-// batch.getWeight(),
-// batch.getComputedWeight());
-//
-// if (subweight != null) {
-//
-// // with sub sample, update the raising factor
-// rf *= weight / subweight;
-// }
-//
-// result = number.floatValue() * rf;
-// } else {
-//
-// // get total weight of all childs
-// float totalWeight = 0.f;
-// for (SpeciesAbleBatch child : batch.getChildBatchs()) {
-// totalWeight += TuttiEntities.getValueOrComputedValue(
-// child.getSampleCategoryWeight(),
-// child.getSampleCategoryComputedWeight());
-// }
-//
-// result = 0f;
-//
-// float rf2 = rf * weight / totalWeight;
-// // sum result of each child
-// for (SpeciesAbleBatch child : batch.getChildBatchs()) {
-//
-// result += computeNumber(child, rf2);
-// }
-//
-// }
-// return result;
-// }
-
}
Copied: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceV2.java (from rev 1646, 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/CatchesSumatraExportServiceV2.java (rev 0)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceV2.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -0,0 +1,242 @@
+package fr.ifremer.tutti.service.export.sumatra;
+
+/*
+ * #%L
+ * Tutti :: Service
+ * $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.base.Charsets;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.io.Files;
+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.persistence.entities.referential.Species;
+import fr.ifremer.tutti.service.AbstractTuttiService;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.service.TuttiServiceContext;
+import fr.ifremer.tutti.service.catches.WeightComputingService;
+import fr.ifremer.tutti.service.export.ExportBatchEntry;
+import fr.ifremer.tutti.service.export.ExportCatchContext;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.csv.Export;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * To export as sumatra format (v2).
+ *
+ * @author tchemit
+ * @since 3.3
+ */
+public class CatchesSumatraExportServiceV2 extends AbstractTuttiService {
+
+ private static final Log log =
+ LogFactory.getLog(CatchesSumatraExportServiceV2.class);
+
+ protected PersistenceService persistenceService;
+
+ protected WeightComputingService weightComputingService;
+
+ @Override
+ public void setServiceContext(TuttiServiceContext context) {
+ super.setServiceContext(context);
+ persistenceService = getService(PersistenceService.class);
+ weightComputingService = getService(WeightComputingService.class);
+ }
+
+ /**
+ * Export selected cruise with the csv sumatra (v2) format.
+ *
+ * @param file where to generate report
+ * @param cruiseId id of the cruise to export
+ * @since 3.3
+ */
+ public void exportCruiseForSumatra(File file,
+ String cruiseId,
+ ProgressionModel progressionModel) {
+
+ Preconditions.checkNotNull(cruiseId, "Cannot export a null cruise");
+ Preconditions.checkNotNull(file, "Cannot export to a null file");
+
+ if (log.isInfoEnabled()) {
+ log.info("Will export cruise " + cruiseId + " to file: " + file);
+ }
+
+ progressionModel.increments(t("tutti.service.sumatra.export.step.load.cruise", cruiseId));
+
+ Cruise cruise = persistenceService.getCruise(cruiseId);
+ Preconditions.checkNotNull(cruise, "Cruise [" + cruiseId + "] not found");
+
+ progressionModel.increments(t("tutti.service.sumatra.export.step.load.fishingOperationIds"));
+
+ List<String> operations =
+ persistenceService.getAllFishingOperationIds(cruiseId);
+
+ if (log.isInfoEnabled()) {
+ log.info(operations.size() + " operations found for cruise: " + cruiseId);
+ }
+
+ progressionModel.adaptTotal(operations.size() + 3);
+
+ prepareOperationsAndExport(file, operations, progressionModel);
+ }
+
+ /**
+ * Export selected fishing operation with the csv sumatra (v2) format.
+ *
+ * @param file where to generate report
+ * @param cruiseId id of the cruise to export
+ * @param fishingOperationId id of the fishing operation to export
+ * @since 3.3
+ */
+ public void exportFishingOperationForSumatra(File file,
+ String cruiseId,
+ String fishingOperationId,
+ ProgressionModel progressionModel) {
+
+ Preconditions.checkNotNull(file, "Cannot export to a null file");
+ Preconditions.checkNotNull(cruiseId, "Cannot export a null cruise");
+ Preconditions.checkNotNull(fishingOperationId, "Cannot export a null fishing operation");
+
+ if (log.isInfoEnabled()) {
+ log.info("Will export fishing operation " +
+ fishingOperationId + " to file: " + file);
+ }
+
+ progressionModel.increments(t("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, progressionModel);
+ }
+
+ protected void prepareOperationsAndExport(File file,
+ List<String> operations,
+ ProgressionModel progressionModel) {
+
+ List<CatchRowV2> rows = Lists.newArrayList();
+
+ CatchRowModelV2 csvModel =
+ new CatchRowModelV2(context.getConfig().getCsvSeparator());
+
+ if (operations != null) {
+ for (String operationId : operations) {
+
+ progressionModel.increments(t("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(csvModel, rows, operationId);
+ }
+ }
+
+ progressionModel.increments(t("tutti.service.sumatra.export.step.export", file));
+
+
+ BufferedWriter writer = null;
+ try {
+ writer = Files.newWriter(file, Charsets.UTF_8);
+ Export export = Export.newExport(csvModel, rows);
+ export.write(writer);
+ writer.close();
+
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(t("tutti.service.sumatra.export.error", file), e);
+ } finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+
+ protected void prepareFishingOperation(CatchRowModelV2 csvModel,
+ List<CatchRowV2> rows,
+ String operationId) {
+
+ ExportCatchContext exportContext = ExportCatchContext.newExportContext(
+ persistenceService,
+ weightComputingService,
+ operationId,
+ true);
+
+ FishingOperation operation = exportContext.getFishingOperation();
+
+ // Species
+ if (exportContext.withSpeciesBatches()) {
+
+ Set<Species> allspecies = new HashSet<>();
+
+ List<ExportBatchEntry> entries =
+ exportContext.getSpeciesBatchEntry(true);
+
+ for (ExportBatchEntry entry : entries) {
+
+ // get species campaign code from protocol
+
+ allspecies.add(entry.getBatch().getSpecies());
+
+ CatchRowV2 row = csvModel.newRow(operation, entry);
+ row.getSpecies();
+ rows.add(row);
+ }
+
+ // fill survey code in species
+ persistenceService.fillSpeciesSurveyCode(allspecies);
+ }
+
+ // Benthos
+ if (exportContext.withBenthosBatches()) {
+
+ Set<Species> allspecies = new HashSet<>();
+
+ List<ExportBatchEntry> entries =
+ exportContext.getBenthosBatchEntry(true);
+
+ for (ExportBatchEntry entry : entries) {
+
+ CatchRowV2 row = csvModel.newRow(operation, entry);
+ allspecies.add(entry.getBatch().getSpecies());
+ rows.add(row);
+ }
+
+ // fill survey code in benthos
+ persistenceService.fillBenthosSurveyCode(allspecies);
+ }
+ }
+}
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2014-03-28 13:11:04 UTC (rev 1650)
@@ -1,3 +1,5 @@
+tutti.error.benthos.not.in.protocol=
+tutti.error.species.not.in.protocol=
tutti.io.mkDir.error=
tutti.property.attachment=
tutti.property.caracteristic=
@@ -49,6 +51,7 @@
tutti.service.csv.parse.entityNotFound=
tutti.service.cvs.format.error=
tutti.service.cvs.mandatory.value=
+tutti.service.error.species.null=
tutti.service.export.accidentalCatch.error=
tutti.service.export.catches.error=
tutti.service.export.closeContext.error=
@@ -79,6 +82,17 @@
tutti.service.exportSumatra.header.species=
tutti.service.exportSumatra.header.station=
tutti.service.exportSumatra.header.weight=
+tutti.service.exportSumatraV2.header.averageSize=Averagesize
+tutti.service.exportSumatraV2.header.averageWeight=AverageWeight
+tutti.service.exportSumatraV2.header.moule=Moule
+tutti.service.exportSumatraV2.header.multirigAggregation=MultirigAggregation
+tutti.service.exportSumatraV2.header.number=Number
+tutti.service.exportSumatraV2.header.sign=Sign
+tutti.service.exportSumatraV2.header.sortedWeight=SortedWeight
+tutti.service.exportSumatraV2.header.species=Species
+tutti.service.exportSumatraV2.header.station=Station number
+tutti.service.exportSumatraV2.header.totalWeight=TotalWeight
+tutti.service.exportSumatraV2.header.year=Year
tutti.service.multipost.attachment.copy.error=
tutti.service.multipost.attachment.mkdir.error=
tutti.service.multipost.export.attachments.error=
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2014-03-28 13:11:04 UTC (rev 1650)
@@ -1,3 +1,5 @@
+tutti.error.benthos.not.in.protocol=L'espèce (onglet Benthos) %s n'est pas déclarée dans le protocole.
+tutti.error.species.not.in.protocol=L'espèce %s (onglet Espèce) n'est pas déclarée dans le protocole.
tutti.io.mkDir.error=Erreur à la création du dossier %s
tutti.property.attachment=Pièce jointe
tutti.property.caracteristic=Caractéristique
@@ -48,6 +50,7 @@
tutti.service.csv.parse.entityNotFound=L'entité de type %1s avec la propriété %2s de valeur %3s n'a pas été trouvée
tutti.service.cvs.format.error=Erreur lors du formatage de la valeur %s
tutti.service.cvs.mandatory.value=Valeur obligatoire
+tutti.service.error.species.null=
tutti.service.export.accidentalCatch.error=Erreur lors de l'export des captures accidentelles
tutti.service.export.catches.error=Erreur lors de l'export des captures
tutti.service.export.closeContext.error=Erreur lors de la fermeture du contexte d'export
@@ -78,6 +81,17 @@
tutti.service.exportSumatra.header.species=Espèce
tutti.service.exportSumatra.header.station=Station
tutti.service.exportSumatra.header.weight=Total
+tutti.service.exportSumatraV2.header.averageSize=LongueurMoy
+tutti.service.exportSumatraV2.header.averageWeight=PoidsMoy
+tutti.service.exportSumatraV2.header.moule=Moule
+tutti.service.exportSumatraV2.header.multirigAggregation=Poche
+tutti.service.exportSumatraV2.header.number=NbIndividus
+tutti.service.exportSumatraV2.header.sign=Signe
+tutti.service.exportSumatraV2.header.sortedWeight=Tri
+tutti.service.exportSumatraV2.header.species=Espèce
+tutti.service.exportSumatraV2.header.station=Station
+tutti.service.exportSumatraV2.header.totalWeight=Total
+tutti.service.exportSumatraV2.header.year=Année
tutti.service.multipost.attachment.copy.error=Erreur lors de l'export de la pièce-jointe %s
tutti.service.multipost.attachment.mkdir.error=Impossible de créer le répertoire %s
tutti.service.multipost.export.attachments.error=Erreur lors de l'export des pièces-jointes
Copied: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceV2Test.java (from rev 1646, 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/CatchesSumatraExportServiceV2Test.java (rev 0)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/sumatra/CatchesSumatraExportServiceV2Test.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -0,0 +1,123 @@
+package fr.ifremer.tutti.service.export.sumatra;
+
+/*
+ * #%L
+ * Tutti :: Service
+ * $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 fr.ifremer.tutti.persistence.ProgressionModel;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.service.ServiceDbResource;
+import fr.ifremer.tutti.service.TuttiServiceContext;
+import fr.ifremer.tutti.service.catches.TuttiWeightComputingException;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import java.io.File;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 3.3
+ */
+public class CatchesSumatraExportServiceV2Test {
+
+ @ClassRule
+ public static final ServiceDbResource dbResource =
+ ServiceDbResource.readDb("dbExport");
+
+ public static final String PROGRAM_ID = "CAM-TEST_ELEVATION";
+
+ public static final String CRUISE_BAD_ID = "100003";
+
+ public static final String CRUISE_ID = "100004";
+
+ public static final String OPERATION_1_ID = "100116";
+
+ public static final String OPERATION_BAD_1_ID = "100112";
+
+ public static final String OPERATION_BAD_2_ID = "100113";
+
+ public static final String OPERATION_BAD_3_ID = "100115";
+
+ public static final String EXPORT_CONTENT =
+ "Année;Station;Poche;Espèce;Signe;Tri;Total;PoidsMoy;LongueurMoy;NbIndividus;Moule\n" +
+ "2013;A;1;CHAMMAG;;100.0;100.0;2.5;NA;40;0.4\n" +
+ "2013;A;1;ECHIGAM;;100.0;100.0;0.23980816;NA;417;4.17\n" +
+ "2013;A;1;BRISATLAN;;100.0;100.0;1.0638298;NA;94;0.94";
+
+ protected CatchesSumatraExportServiceV2 service;
+
+ protected ServiceDbResource.DataContext dataContext;
+
+ protected File dataDirectory;
+
+ @Before
+ public void setUp() throws Exception {
+
+ dataDirectory = dbResource.getConfig().getDataDirectory();
+
+ TuttiServiceContext serviceContext = dbResource.getServiceContext();
+
+ dbResource.openDataContext();
+
+ File protocolFile = new File("src/test/resources/tuttiProtocol.tuttiProtocol");
+
+ TuttiProtocol protocol = dbResource.loadProtocol(protocolFile);
+
+ serviceContext.getService(PersistenceService.class).setProtocol(protocol);
+
+ service = serviceContext.getService(CatchesSumatraExportServiceV2.class);
+ }
+
+ @Test(expected = TuttiWeightComputingException.class)
+ public void testExportCruiseForSumatraBadCruise() throws Exception {
+
+ dataContext = dbResource.loadContext(PROGRAM_ID, CRUISE_BAD_ID, 3,
+ OPERATION_BAD_2_ID,
+ OPERATION_BAD_1_ID,
+ OPERATION_BAD_3_ID);
+
+ File exportFile = new File(dataDirectory, "exportSumatra.csv");
+
+ ProgressionModel progressionModel = new ProgressionModel();
+ progressionModel.setTotal(3);
+ service.exportCruiseForSumatra(exportFile, CRUISE_BAD_ID, progressionModel);
+ }
+
+ @Test
+ public void testExportCruiseForSumatra() throws Exception {
+
+ dataContext = dbResource.loadContext(PROGRAM_ID, CRUISE_ID, 1, OPERATION_1_ID);
+
+ File exportFile = new File(dataDirectory, "exportSumatra.csv");
+
+ ProgressionModel progressionModel = new ProgressionModel();
+ progressionModel.setTotal(3);
+ service.exportCruiseForSumatra(exportFile, CRUISE_ID, progressionModel);
+
+ ServiceDbResource.assertFileContent("Sumatra export file:\n",
+ exportFile,
+ EXPORT_CONTENT);
+ }
+}
Modified: trunk/tutti-service/src/test/resources/tuttiProtocol.tuttiProtocol
===================================================================
--- trunk/tutti-service/src/test/resources/tuttiProtocol.tuttiProtocol 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-service/src/test/resources/tuttiProtocol.tuttiProtocol 2014-03-28 13:11:04 UTC (rev 1650)
@@ -1,8 +1,18 @@
id: aefaad71-2731-4184-978b-847f6e60c692
name: ano-2486
-benthos:
+benthos:
- !SpeciesProtocol
countIfNoFrequencyEnabled: true
+ speciesReferenceTaxonId: 4622
+ speciesSurveyCode: ABIEABI
+ weightEnabled: true
+- !SpeciesProtocol
+ countIfNoFrequencyEnabled: true
+ speciesReferenceTaxonId: 380
+ speciesSurveyCode: ACANECH
+ weightEnabled: true
+- !SpeciesProtocol
+ countIfNoFrequencyEnabled: true
speciesReferenceTaxonId: 907
speciesSurveyCode: ALPHGLA
weightEnabled: true
@@ -453,13 +463,49 @@
weightEnabled: true
gearUseFeaturePmfmId: []
lengthClassesPmfmId: []
-species:
+species:
- !SpeciesProtocol
countIfNoFrequencyEnabled: true
lengthStepPmfmId: 299
maturityEnabled: true
sexEnabled: true
sizeEnabled: true
+ speciesReferenceTaxonId: 11183
+ speciesSurveyCode: BRISATLAN
+ weightEnabled: true
+- !SpeciesProtocol
+ countIfNoFrequencyEnabled: true
+ lengthStepPmfmId: 299
+ maturityEnabled: true
+ sexEnabled: true
+ sizeEnabled: true
+ speciesReferenceTaxonId: 1938
+ speciesSurveyCode: AGONCAT
+ weightEnabled: true
+- !SpeciesProtocol
+ countIfNoFrequencyEnabled: true
+ lengthStepPmfmId: 299
+ maturityEnabled: true
+ sexEnabled: true
+ sizeEnabled: true
+ speciesReferenceTaxonId: 11654
+ speciesSurveyCode: ECHIGAM
+ weightEnabled: true
+- !SpeciesProtocol
+ countIfNoFrequencyEnabled: true
+ lengthStepPmfmId: 299
+ maturityEnabled: true
+ sexEnabled: true
+ sizeEnabled: true
+ speciesReferenceTaxonId: 11750
+ speciesSurveyCode: CHAMMAG
+ weightEnabled: true
+- !SpeciesProtocol
+ countIfNoFrequencyEnabled: true
+ lengthStepPmfmId: 299
+ maturityEnabled: true
+ sexEnabled: true
+ sizeEnabled: true
speciesReferenceTaxonId: 848
speciesSurveyCode: ARISFOL
weightEnabled: true
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2014-03-28 13:11:04 UTC (rev 1650)
@@ -1,28 +1,5 @@
-###
-# #%L
-# Tutti :: UI
-# $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%
-###
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Wed Jan 29 07:36:56 CET 2014
+#Fri Mar 28 12:07:10 CET 2014
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -144,6 +121,8 @@
tutti.editCatchBatch.action.computeWeights.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.exportFishingOperationReport.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.help=editFishingOperation.html\#captureResumeActions
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra2.help=editFishingOperation.html\#captureResumeActions
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.help=
tutti.editCatchBatch.action.saveCatchBatch.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.field.benthosTotalSampleSortedWeight.help=editFishingOperation.html\#captureResumeFields
tutti.editCatchBatch.field.benthosTotalSortedWeight.help=editFishingOperation.html\#captureResumeFields
@@ -329,6 +308,8 @@
tutti.main.menu.action.changeLocaleFR.help=menu.html\#menu_aide
tutti.main.menu.action.changeLocaleUK.help=menu.html\#menu_aide
tutti.main.menu.action.configuration.help=menu.html\#menu_fichier_configuration
+tutti.main.menu.action.connectIchtyometer.help=menu.html\#menu_fichier
+tutti.main.menu.action.disconnectIchtyometer.help=menu.html\#menu_fichier
tutti.main.menu.action.editCatches.help=menu.html\#menu_action
tutti.main.menu.action.editCruise.help=menu.html\#menu_action
tutti.main.menu.action.editProgram.help=menu.html\#menu_action
@@ -343,8 +324,6 @@
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.connectIchtyometer.help=menu.html\#menu_fichier
-tutti.main.menu.action.disconnectIchtyometer.help=menu.html\#menu_fichier
tutti.main.menu.action.updateReport.help=menu.html\#menu_fichier
tutti.main.menu.action.validateCatches.help=menu.html\#menu_action
tutti.main.status.ichtyometer.help=menu.html\#status
@@ -374,6 +353,7 @@
tutti.selectCruise.action.editProtocol.help=selectCruise.html\#actions
tutti.selectCruise.action.exportCruise.help=selectCruise.html\#actions
tutti.selectCruise.action.exportCruiseForSumatra.help=selectCruise.html\#actions
+tutti.selectCruise.action.exportCruiseForSumatraV2.help=selectCruise.html\#actions
tutti.selectCruise.action.exportProgram.help=selectCruise.html\#actions
tutti.selectCruise.action.exportProtocol.help=selectCruise.html\#actions
tutti.selectCruise.action.generateCruiseReport.help=selectCruise.html\#actions
Modified: trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/help/fr/editFishingOperation.html 2014-03-28 13:11:04 UTC (rev 1650)
@@ -364,6 +364,14 @@
l'échelle de la capture. Le format du fichier est compatible avec le
logiciel SUMATRA
</dd>
+ <dt>Résumé sumatra v2</dt>
+ <dd>
+ déclenche la
+ génération d'un fichier .csv qui contient la composition de la capture
+ du trait par espèce et benthos. les poids et nombre sont élevés à
+ l'échelle de la capture. Le format du fichier est compatible avec le
+ logiciel SUMATRA (V2).
+ </dd>
<dt>Piéces jointes (icone trombone)</dt>
<dd>permet d'associer des pièces jointes au trait. Contiendra aussi les
fichiers en cas d'import pupitri dans l'onglet espèces
Modified: trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/help/fr/selectCruise.html 2014-03-28 13:11:04 UTC (rev 1650)
@@ -83,11 +83,11 @@
<dd>permet de créer une nouvelle série de campagne.</dd>
<dt>Campagne <strong>Éditer</strong></dt>
<dd>permet d'éditer la campagne sélectionnée dans le champ.</dd>
- <dt>Campagne <strong>Éditer...Exporter</strong> </dt>
+ <dt>Campagne <strong>Éditer...Exporter Générique</strong> </dt>
<dd> permet d'exporter toutes les données brutes de la campagne
sélectionnée dans un fichier .zip contenant des fichiers .csv.
</dd>
- <dt>Campagne <strong>Éditer...Envoyer</strong></dt>
+ <dt>Campagne <strong>Éditer...Exporter Pdf</strong></dt>
<dd>génère
un courriel et un fichier PDF qui présente la composition de toutes
les
@@ -97,12 +97,18 @@
liste
de destinataires.
</dd>
- <dt>Campagne <strong>Éditer...Sumatra</strong></dt>
+ <dt>Campagne <strong>Éditer...Exporter Csv v1 (sumatra v1)</strong></dt>
<dd>génère
un fichier .csv qui résume la composition des captures saisies en
espèces scientifiques et les poids associés. Le fichier créé est
compatible avec le système Sumatra disponible à bord de la Thalassa.
</dd>
+ <dt>Campagne <strong>Éditer...Exporter Csv v2 (sumatra v2)</strong></dt>
+ <dd>génère
+ un fichier .csv qui résume la composition des captures saisies en
+ espèces scientifiques et les poids associés. Le fichier créé est
+ compatible avec le système Sumatra (v2) disponible à bord de la Thalassa.
+ </dd>
<dt>Campagne <strong>Nouveau</strong></dt>
<dd>permet de créer une nouvelle campagne.</dd>
<dt>Protocole de saisie <strong>Éditer</strong></dt>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -44,6 +44,7 @@
import fr.ifremer.tutti.service.export.generic.TuttiExportService;
import fr.ifremer.tutti.service.export.pdf.CatchesPdfExportService;
import fr.ifremer.tutti.service.export.sumatra.CatchesSumatraExportService;
+import fr.ifremer.tutti.service.export.sumatra.CatchesSumatraExportServiceV2;
import fr.ifremer.tutti.service.protocol.ProtocolImportExportService;
import fr.ifremer.tutti.service.psionimport.PsionImportService;
import fr.ifremer.tutti.service.pupitri.PupitriImportExportService;
@@ -705,6 +706,10 @@
return serviceContext.getService(CatchesSumatraExportService.class);
}
+ public CatchesSumatraExportServiceV2 getCatchesSumatraExportServiceV2() {
+ return serviceContext.getService(CatchesSumatraExportServiceV2.class);
+ }
+
public MultiPostImportService getMultiPostImportService() {
return serviceContext.getService(MultiPostImportService.class);
}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportCruiseForSumatraV2Action.java (from rev 1646, 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/ExportCruiseForSumatraV2Action.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportCruiseForSumatraV2Action.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -0,0 +1,112 @@
+package fr.ifremer.tutti.ui.swing.action;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.base.Preconditions;
+import fr.ifremer.tutti.persistence.ProgressionModel;
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.service.export.sumatra.CatchesSumatraExportServiceV2;
+import fr.ifremer.tutti.ui.swing.content.MainUIHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.DateUtil;
+
+import java.io.File;
+import java.util.Date;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * Export the hole cruise using the sumatra format (V2).
+ *
+ * @author tchemit
+ * @since 3.3
+ */
+public class ExportCruiseForSumatraV2Action extends AbstractMainUITuttiAction {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ExportCruiseForSumatraV2Action.class);
+
+ protected File file;
+
+ public ExportCruiseForSumatraV2Action(MainUIHandler handler) {
+ super(handler, false);
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+
+ boolean doAction = super.prepareAction();
+
+ if (doAction) {
+
+ String date = DateUtil.formatDate(new Date(), "dd-MM-yyyy");
+ // choose file to export
+ file = saveFile(
+ String.format("sumatra_v2_%s_%s", getDataContext().getCruise().getName(), date),
+ "csv",
+ t("tutti.exportCruiseForSumatraV2.title.choose.exportFile"),
+ t("tutti.exportCruiseForSumatraV2.action.chooseFile"),
+ "^.+\\.csv$", t("tutti.common.file.csv")
+ );
+ doAction = file != null;
+ }
+ return doAction;
+ }
+
+ @Override
+ public void releaseAction() {
+ file = null;
+ super.releaseAction();
+ }
+
+ @Override
+ public void doAction() throws Exception {
+ Cruise cruise = getDataContext().getCruise();
+ Preconditions.checkNotNull(cruise);
+ Preconditions.checkNotNull(file);
+
+ if (log.isInfoEnabled()) {
+ 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
+ CatchesSumatraExportServiceV2 service =
+ getContext().getCatchesSumatraExportServiceV2();
+ service.exportCruiseForSumatra(file, cruise.getId(), pm);
+
+ }
+
+ @Override
+ public void postSuccessAction() {
+ super.postSuccessAction();
+ sendMessage(t("tutti.exportCruiseForSumatraV2.action.success", file));
+ }
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraV2Action.java (from rev 1648, 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/ExportFishingOperationForSumatraV2Action.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraV2Action.java 2014-03-28 13:11:04 UTC (rev 1650)
@@ -0,0 +1,132 @@
+package fr.ifremer.tutti.ui.swing.action;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $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.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.CatchesSumatraExportServiceV2;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.DateUtil;
+
+import java.io.File;
+import java.util.Date;
+
+import static org.nuiton.i18n.I18n.t;
+
+/**
+ * Created on 10/1/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 3.3
+ */
+public class ExportFishingOperationForSumatraV2Action extends AbstractTuttiAction<EditCatchesUIModel, EditCatchesUI, EditCatchesUIHandler> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ExportFishingOperationForSumatraV2Action.class);
+
+ protected File file;
+
+ public ExportFishingOperationForSumatraV2Action(EditCatchesUIHandler handler) {
+ super(handler, true);
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+
+ boolean doAction = super.prepareAction();
+
+ if (getModel().isModify()) {
+
+ displayWarningMessage(
+ t("tutti.exportFishingOperationForSumatraV2.title.model.modified"),
+ t("tutti.exportFishingOperationForSumatraV2.message.model.modified")
+ );
+ doAction = false;
+ }
+
+ if (doAction) {
+
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+
+ String date = DateUtil.formatDate(new Date(), "dd-MM-yyyy");
+ // choose file to export
+ file = saveFile(
+ String.format("sumatra_v2_%s_%s_%s", getDataContext().getCruise().getName(), fishingOperation.getId(), date),
+ "csv",
+ t("tutti.exportFishingOperationForSumatraV2.title.choose.exportFile"),
+ t("tutti.exportFishingOperationForSumatraV2.action.chooseFile"),
+ "^.+\\.csv$", t("tutti.common.file.csv")
+ );
+ doAction = file != null;
+ }
+ return doAction;
+ }
+
+ @Override
+ public void releaseAction() {
+ file = null;
+ super.releaseAction();
+ }
+
+ @Override
+ public void doAction() throws Exception {
+ Cruise cruise = getDataContext().getCruise();
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+ Preconditions.checkNotNull(cruise);
+ Preconditions.checkNotNull(fishingOperation);
+ Preconditions.checkNotNull(file);
+
+ if (log.isInfoEnabled()) {
+ log.info("Will export fishingOperation " + cruise.getId() + "-" + fishingOperation.getStationNumber() +
+ " to file: " + file);
+ }
+
+ ProgressionModel pm = new ProgressionModel();
+ pm.setTotal(3); // loading cruise + loading fishing operationIds + export
+ setProgressionModel(pm);
+
+ // export catches
+ CatchesSumatraExportServiceV2 service =
+ getContext().getCatchesSumatraExportServiceV2();
+ service.exportFishingOperationForSumatra(file,
+ cruise.getId(),
+ fishingOperation.getId(),
+ pm);
+
+ }
+
+ @Override
+ public void postSuccessAction() {
+ super.postSuccessAction();
+ sendMessage(t("tutti.exportFishingOperationForSumatraV2.action.success", file));
+ }
+}
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css 2014-03-28 13:11:04 UTC (rev 1650)
@@ -105,7 +105,7 @@
}
#editCruiseComboBox {
- model: {handler.newComboModel(editCruiseButton, exportCruiseButton, sendCruiseReportButton, exportCruiseForSumatraButton)};
+ model: {handler.newComboModel(editCruiseButton, exportCruiseButton, sendCruiseReportButton, exportCruiseForSumatraButton, exportCruiseForSumatraV2Button)};
enabled: {model.isProgramFound() && model.isCruiseFound()};
renderer: {new ActionListCellRenderer()};
}
@@ -143,6 +143,14 @@
_help: {"tutti.selectCruise.action.exportCruiseForSumatra.help"};
}
+#exportCruiseForSumatraV2Button {
+ actionIcon: export;
+ text: "tutti.selectCruise.action.exportCruiseForSumatraV2";
+ toolTipText: "tutti.selectCruise.action.exportCruiseForSumatraV2.tip";
+ _applicationAction: {fr.ifremer.tutti.ui.swing.action.ExportCruiseForSumatraV2Action.class};
+ _help: {"tutti.selectCruise.action.exportCruiseForSumatraV2.help"};
+}
+
#newCruiseButton {
actionIcon: add;
text: "tutti.selectCruise.action.newCruise";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx 2014-03-28 13:11:04 UTC (rev 1650)
@@ -69,6 +69,7 @@
<JButton id='exportCruiseButton'/>
<JButton id='sendCruiseReportButton'/>
<JButton id='exportCruiseForSumatraButton'/>
+ <JButton id='exportCruiseForSumatraV2Button'/>
<JButton id='newProtocolButton'/>
<JButton id='importProtocolButton'/>
<JButton id='editProtocolButton'/>
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2014-03-28 13:11:04 UTC (rev 1650)
@@ -362,6 +362,15 @@
_help: {"tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.help"};
}
+#exportFishingOperationReportForSumatraV2Button {
+ actionIcon: export;
+ text: "tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2";
+ toolTipText: "tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.tip";
+ i18nMnemonic: "tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.mnemonic";
+ _applicationAction: {fr.ifremer.tutti.ui.swing.action.ExportFishingOperationForSumatraV2Action.class};
+ _help: {"tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.help"};
+}
+
#saveButton {
actionIcon: save;
text: "tutti.editCatchBatch.action.saveCatchBatch";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2014-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2014-03-28 13:11:04 UTC (rev 1650)
@@ -105,6 +105,7 @@
<JToolBar id='catchesCaracteristicsTabToolBar'>
<JButton id='exportFishingOperationReportButton'/>
<JButton id='exportFishingOperationReportForSumatraButton'/>
+ <JButton id='exportFishingOperationReportForSumatraV2Button'/>
<ButtonAttachment id='catchesCaracteristicsAttachmentsButton'
constructorParams='getHandler().getContext(), getModel()'/>
</JToolBar>
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2014-03-28 13:11:04 UTC (rev 1650)
@@ -549,6 +549,9 @@
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra=
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.mnemonic=
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.tip=
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2=
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.mnemonic=
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.tip=
tutti.editCatchBatch.action.saveCatchBatch=
tutti.editCatchBatch.action.saveCatchBatch.mnemonic=
tutti.editCatchBatch.action.saveCatchBatch.tip=
@@ -1128,6 +1131,9 @@
tutti.exportCruiseForSumatra.action.chooseFile=
tutti.exportCruiseForSumatra.action.success=
tutti.exportCruiseForSumatra.title.choose.exportFile=
+tutti.exportCruiseForSumatraV2.action.chooseFile=
+tutti.exportCruiseForSumatraV2.action.success=
+tutti.exportCruiseForSumatraV2.title.choose.exportFile=
tutti.exportDb.step.closeDb=
tutti.exportDb.step.createArchive=
tutti.exportDb.step.openDb=
@@ -1137,6 +1143,11 @@
tutti.exportFishingOperationForSumatra.message.model.modified=Catch was modified, please save it before launching an export.
tutti.exportFishingOperationForSumatra.title.choose.exportFile=
tutti.exportFishingOperationForSumatra.title.model.modified=Can't export, catch is modified
+tutti.exportFishingOperationForSumatraV2.action.chooseFile=
+tutti.exportFishingOperationForSumatraV2.action.success=
+tutti.exportFishingOperationForSumatraV2.message.model.modified=
+tutti.exportFishingOperationForSumatraV2.title.choose.exportFile=
+tutti.exportFishingOperationForSumatraV2.title.model.modified=
tutti.exportFishingOperationReport.action.chooseFile=
tutti.exportFishingOperationReport.action.success=
tutti.exportFishingOperationReport.message.model.modified=Catch was modified, please save it before launching an export.
@@ -1450,6 +1461,8 @@
tutti.selectCruise.action.exportCruise.tip=
tutti.selectCruise.action.exportCruiseForSumatra=
tutti.selectCruise.action.exportCruiseForSumatra.tip=
+tutti.selectCruise.action.exportCruiseForSumatraV2=
+tutti.selectCruise.action.exportCruiseForSumatraV2.tip=
tutti.selectCruise.action.exportProgram=
tutti.selectCruise.action.exportProgram.tip=
tutti.selectCruise.action.exportProtocol=
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-03-28 10:59:34 UTC (rev 1649)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2014-03-28 13:11:04 UTC (rev 1650)
@@ -540,6 +540,9 @@
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra=Résumé Sumatra
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.mnemonic=u
tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.tip=Exporter le trait sélectionnée pour Sumatra (au format csv)
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2=Résumé Sumatra V2
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.mnemonic=2
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatraV2.tip=Exporter le trait sélectionnée pour Sumatra V2 (au format csv)
tutti.editCatchBatch.action.saveCatchBatch=Enregistrer
tutti.editCatchBatch.action.saveCatchBatch.mnemonic=S
tutti.editCatchBatch.action.saveCatchBatch.tip=Enregistrer la capture
@@ -1115,6 +1118,9 @@
tutti.exportCruiseForSumatra.action.chooseFile=Choisir le fichier d'export
tutti.exportCruiseForSumatra.action.success=La campagne sélectionnée a été exportée dans le fichier <strong>%s</strong>
tutti.exportCruiseForSumatra.title.choose.exportFile=Exporter la campagne
+tutti.exportCruiseForSumatraV2.action.chooseFile=Choisir le fichier d'export
+tutti.exportCruiseForSumatraV2.action.success=La campagne sélectionnée a été exportée dans le fichier <strong>%s</strong>
+tutti.exportCruiseForSumatraV2.title.choose.exportFile=Exporter la campagne
tutti.exportDb.step.closeDb=Fermeture de la base courante
tutti.exportDb.step.createArchive=Création de l'archive %s
tutti.exportDb.step.openDb=Réouverture de la base courante
@@ -1124,6 +1130,11 @@
tutti.exportFishingOperationForSumatra.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
tutti.exportFishingOperationForSumatra.title.choose.exportFile=Exporter le trait de la campagne
tutti.exportFishingOperationForSumatra.title.model.modified=Impossible d'exporter, capture modifiée
+tutti.exportFishingOperationForSumatraV2.action.chooseFile=Choisir le fichier d'export
+tutti.exportFishingOperationForSumatraV2.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
+tutti.exportFishingOperationForSumatraV2.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
+tutti.exportFishingOperationForSumatraV2.title.choose.exportFile=Exporter le trait de la campagne
+tutti.exportFishingOperationForSumatraV2.title.model.modified=Impossible d'exporter, capture modifiée
tutti.exportFishingOperationReport.action.chooseFile=Choisir le fichier de rapport
tutti.exportFishingOperationReport.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
tutti.exportFishingOperationReport.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
@@ -1434,6 +1445,8 @@
tutti.selectCruise.action.exportCruise.tip=Exporter la campagne sélectionnée
tutti.selectCruise.action.exportCruiseForSumatra=Sumatra
tutti.selectCruise.action.exportCruiseForSumatra.tip=Exporter la campagne sélectionnée pour Sumatra
+tutti.selectCruise.action.exportCruiseForSumatraV2=Sumatra (V2)
+tutti.selectCruise.action.exportCruiseForSumatraV2.tip=Exporter la campagne sélectionnée pour Sumatra (V2)
tutti.selectCruise.action.exportProgram=Exporter
tutti.selectCruise.action.exportProgram.tip=Exporter la série sélectionnée
tutti.selectCruise.action.exportProtocol=Exporter
1
0
r1649 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic
by tchemit@users.forge.codelutin.com 28 Mar '14
by tchemit@users.forge.codelutin.com 28 Mar '14
28 Mar '14
Author: tchemit
Date: 2014-03-28 11:59:34 +0100 (Fri, 28 Mar 2014)
New Revision: 1649
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1649
Log:
fixes #4844 [EXPORT GENERIQUE] divers modifications
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfigurationOption.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/OperationExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/ParameterExportModel.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportService2Test.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportServiceTest.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfigurationOption.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfigurationOption.java 2014-03-27 16:38:37 UTC (rev 1648)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiConfigurationOption.java 2014-03-28 10:59:34 UTC (rev 1649)
@@ -248,7 +248,7 @@
SAMPLE_CATEGORY_MODEL(
"tutti.persistence.SampleCategoryModel",
n("tutti.config.option.persistence.SampleCategoryModel.description"),
- "1428,V/HV|198,Class Tri.|196,Sexe|174,Maturité|1430,Age",
+ "1428,V/HV|198,Class Tri|196,Sexe|174,Maturite|1430,Age",
SampleCategoryModel.class,
false
),
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/OperationExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/OperationExportModel.java 2014-03-27 16:38:37 UTC (rev 1648)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/OperationExportModel.java 2014-03-28 10:59:34 UTC (rev 1649)
@@ -55,21 +55,21 @@
newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME);
newColumnForExport("Navire", FishingOperation.PROPERTY_VESSEL, TuttiCsvUtil.VESSEL_VALUE_FORMATTER);
- newColumnForExport("DateDeb_Op", FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
+ newColumnForExport("DateDeb", FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("LatDeb", FishingOperation.PROPERTY_GEAR_SHOOTING_START_LATITUDE, TuttiCsvUtil.FLOAT);
newColumnForExport("LongDeb", FishingOperation.PROPERTY_GEAR_SHOOTING_START_LONGITUDE, TuttiCsvUtil.FLOAT);
- newColumnForExport("DateFin_Op", FishingOperation.PROPERTY_GEAR_SHOOTING_END_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
+ newColumnForExport("DateFin", FishingOperation.PROPERTY_GEAR_SHOOTING_END_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("LatFin", FishingOperation.PROPERTY_GEAR_SHOOTING_END_LATITUDE, TuttiCsvUtil.FLOAT);
newColumnForExport("LongFin", FishingOperation.PROPERTY_GEAR_SHOOTING_END_LONGITUDE, TuttiCsvUtil.FLOAT);
newColumnForExport("Duree", OperationExportRow.PROPERTY_DURATION);
newColumnForExport("Strate", FishingOperation.PROPERTY_STRATA, TuttiLocation.PROPERTY_NAME, "NA");
- newColumnForExport("Sous-Strate", FishingOperation.PROPERTY_SUB_STRATA, TuttiLocation.PROPERTY_NAME, "NA");
+ newColumnForExport("Sous_Strate", FishingOperation.PROPERTY_SUB_STRATA, TuttiLocation.PROPERTY_NAME, "NA");
newColumnForExport("Localite", FishingOperation.PROPERTY_LOCATION, TuttiLocation.PROPERTY_NAME, "NA");
newColumnForExport("Validite_OP", FishingOperation.PROPERTY_FISHING_OPERATION_VALID, TuttiCsvUtil.BOOLEAN);
newColumnForExport("Rectiligne", FishingOperation.PROPERTY_FISHING_OPERATION_RECTILIGNE, TuttiCsvUtil.BOOLEAN);
newColumnForExport("Distance", FishingOperation.PROPERTY_TRAWL_DISTANCE, TuttiCsvUtil.FLOAT_NULL_TO_9);
newColumnForExport("Saisisseur", FishingOperation.PROPERTY_RECORDER_PERSON, TuttiCsvUtil.LIST_PERSON_FORMATTER);
- newColumnForExport("NavireAssocie", FishingOperation.PROPERTY_SECONDARY_VESSEL, TuttiCsvUtil.newListVesselFormatter(vesselDecorator));
+ newColumnForExport("Navire_Associe", FishingOperation.PROPERTY_SECONDARY_VESSEL, TuttiCsvUtil.newListVesselFormatter(vesselDecorator));
newColumnForExport("Commentaire", FishingOperation.PROPERTY_COMMENT, TuttiCsvUtil.COMMENT_FORMATTER);
newNullableColumnForExport("Poids_Total", OperationExportRow.PROPERTY_CATCH_TOTAL_WEIGHT, TuttiCsvUtil.FLOAT_NULL_TO_9);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/ParameterExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/ParameterExportModel.java 2014-03-27 16:38:37 UTC (rev 1648)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/ParameterExportModel.java 2014-03-28 10:59:34 UTC (rev 1649)
@@ -55,7 +55,7 @@
newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION);
newColumnForExport("Code_PMFM", ParameterExportRow.PROPERTY_CARACTERISTIC, Caracteristic.PROPERTY_ID);
- newColumnForExportByDecorator("Libelle_PMFm", ParameterExportRow.PROPERTY_CARACTERISTIC, decoratorService.getDecoratorByType(Caracteristic.class));
+ newColumnForExportByDecorator("Libelle_PMFM", ParameterExportRow.PROPERTY_CARACTERISTIC, decoratorService.getDecoratorByType(Caracteristic.class));
newColumnForExport("Valeur", ParameterExportRow.PROPERTY_VALUE, TuttiCsvUtil.CARACTERISTIC_VALUE_FORMATTER);
}
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportService2Test.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportService2Test.java 2014-03-27 16:38:37 UTC (rev 1648)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportService2Test.java 2014-03-28 10:59:34 UTC (rev 1649)
@@ -157,7 +157,7 @@
URL url = new URL(urlPrefix + "operation.csv");
ServiceDbResource.assertFileContent("operation export:\n",
url,
- "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb;LatDeb;LongDeb;DateFin;LatFin;LongFin;Duree;Strate;Sous_Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;Navire_Associe;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2013;test elevation;1;B;2;1;OTB 20/28.10;278970;01/07/2013 00:00:00;;;01/07/2013 00:00:00;;;00;NA;NA;NA;?;N;-9.0;;;Commentaire sur le trait B-2-1@@@@avec@@saut@@de @@ligne;1000.0;Y;280.0;Y;20.0;Y;700.0;N;-9.0;?;-9.0;?;200.0;Y;180.0;Y;180.0;Y;20.0;Y;0.0;Y;0.0;Y;100.0;Y;100.0;N;50.0;Y;0.0;Y;2.0;N;0.0;Y;100.0;N\n" +
"2013;test elevation;1;A;1;1;OTB 20/28.10;278970;01/07/2013 00:00:00;;;01/07/2013 00:00:00;;;00;NA;NA;NA;?;N;-9.0;;;commentaire trait A-1-1@@Avec @@saut@@de@@ligne@@...;1000.0;Y;180.0;Y;20.0;Y;800.0;N;-9.0;?;-9.0;?;200.0;Y;180.0;Y;180.0;Y;20.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y\n" +
"2013;test elevation;1;C;3;1;;278970;25/09/2013 00:00:00;;;25/09/2013 00:00:00;;;00;NA;NA;NA;?;N;-9.0;;;;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?");
@@ -191,7 +191,7 @@
URL url = new URL("jar:" + exportFile.toURI().toURL() + "!/exportCruise-" + CRUISE_ID + "/catch.csv");
ServiceDbResource.assertFileContent("Catch export:\n",
url,
- "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri_;Num_Ordre_Class_Tri__H2;Tot_Class_Tri_;Ech_Class_Tri_;Type_Volume_Poids_Class_Tri_;Unite_Volume_Poids_Class_Tri_;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture;Coef_Final_Elevation\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri;Num_Ordre_Class_Tri_H2;Tot_Class_Tri;Ech_Class_Tri;Type_Volume_Poids_Class_Tri;Unite_Volume_Poids_Class_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture;Coef_Final_Elevation\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;1938;;Agonus cataphractus;Trait B-2-1 AGONCAT-vrac 80;Vrac;1;80.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;80.0;3.5;1.0\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;1358;;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Male 60;Vrac;2;;;Poids;kg;NA;;;;;kg;Mâle;1;60.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;60.0;5.8333335;1.0\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;1358;;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Femelle 40.0;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;40.0;8.75;1.0\n" +
@@ -235,7 +235,7 @@
URL url = new URL(urlPrefix + "parameter.csv");
ServiceDbResource.assertFileContent("parameter export:\n",
url,
- "Annee;Serie;Serie_Partielle;Code_station;Id_Operation;Poche;Code_PMFM;Libelle_PMFm;Valeur");
+ "Annee;Serie;Serie_Partielle;Code_station;Id_Operation;Poche;Code_PMFM;Libelle_PMFM;Valeur");
}
}
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportServiceTest.java 2014-03-27 16:38:37 UTC (rev 1648)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/generic/TuttiExportServiceTest.java 2014-03-28 10:59:34 UTC (rev 1649)
@@ -76,20 +76,20 @@
"2013;Campagne CGFS;;ScientificGear;287;Volet dépresseur (drague) - engin - totale - Déclaration d'un professionnel;Oui";
public static final String OPERATION_WITH_NO_CATCH_CONTENT =
- "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb;LatDeb;LongDeb;DateFin;LatFin;LongFin;Duree;Strate;Sous_Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;Navire_Associe;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2010;Campagne CGFS;;65;65;1;GOV 19.7/25.9;278970;13/10/2010 13:35:00;50.22833;0.31833;13/10/2010 14:05:00;50.22167;0.28333;30;Strate 4J;NA;Localité 4J2;N;Y;2512.0;;;avarie - chalut annulé completement à poil;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?";
public static final String OPERATION_WITH_NO_CATCH_CONTENT_AND_NO_GEAR =
- "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb;LatDeb;LongDeb;DateFin;LatFin;LongFin;Duree;Strate;Sous_Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;Navire_Associe;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2010;Campagne CGFS;;65;65;1;;278970;13/10/2010 13:35:00;50.22833;0.31833;13/10/2010 14:05:00;50.22167;0.28333;30;Strate 4J;NA;Localité 4J2;N;Y;2512.0;;;avarie - chalut annulé completement à poil;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?";
public static final String OPERATION_CONTENT =
- "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb;LatDeb;LongDeb;DateFin;LatFin;LongFin;Duree;Strate;Sous_Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;Navire_Associe;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;278970;01/05/2013 00:00:00;;;01/05/2013 00:23:00;;;23;Strate 1D;NA;Localité 1D2;?;N;-9.0;Vincent AURECHE;;op1;120.0;Y;100.0;Y;20.0;Y;0.0;Y;-9.0;?;-9.0;?;120.0;Y;100.0;Y;100.0;Y;20.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;6.0;Y\n" +
"2013;Campagne CGFS;;A;2;1;GOV 19.7/25.9;278970;11/05/2013 08:00:00;;;11/05/2013 08:23:00;;;23;Strate 1D;NA;Localité 1D2;?;N;-9.0;Robert BELLAIL|Herve BARONE;;OP2;0.0;Y;0.0;Y;0.0;Y;0.0;Y;-9.0;?;-9.0;?;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y";
public static final String PARAMETER_CONTENT =
- "Annee;Serie;Serie_Partielle;Code_station;Id_Operation;Poche;Code_PMFM;Libelle_PMFm;Valeur\n" +
+ "Annee;Serie;Serie_Partielle;Code_station;Id_Operation;Poche;Code_PMFM;Libelle_PMFM;Valeur\n" +
"2013;Campagne CGFS;;A;1;1;1164;Catégorie UE - produit/lot - totale - Diffusion par une Halle à marée;Cat UE10\n" +
"2013;Campagne CGFS;;A;1;1;1302;(Gross Tonnage) : augmentation de tonnage accordée pour des raisons de sécurité - navire - totale - Déclaration d'un professionnel;10.0\n" +
"2013;Campagne CGFS;;A;1;1;194;\"Etat de la mer - masse d'eau, eau brute - totale - Observation par un observateur\";\"2 - belle, vagues de 0.1 à 0.5 mètres\"\n" +
@@ -99,7 +99,7 @@
"2013;Campagne CGFS;;A;2;1;308;Nombre d'engin - engin - totale - Déclaration d'un professionnel;2.0";
public static final String CATCH_CONTENT =
- "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri_;Num_Ordre_Class_Tri__H2;Tot_Class_Tri_;Ech_Class_Tri_;Type_Volume_Poids_Class_Tri_;Unite_Volume_Poids_Class_Tri_;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture;Coef_Final_Elevation\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri;Num_Ordre_Class_Tri_H2;Tot_Class_Tri;Ech_Class_Tri;Type_Volume_Poids_Class_Tri;Unite_Volume_Poids_Class_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture;Coef_Final_Elevation\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;11242;;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;5.0;20.0;2.0\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;11242;;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;5.0;20.0;2.0\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;11242;;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;5.0;20.0;2.0\n" +
@@ -111,7 +111,7 @@
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;11242;;Aaptos;;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;2;20.0;1.0;1.0";
public static final String CATCH_CONTENT_2 =
- "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri_;Num_Ordre_Class_Tri__H2;Tot_Class_Tri_;Ech_Class_Tri_;Type_Volume_Poids_Class_Tri_;Unite_Volume_Poids_Class_Tri_;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture;Coef_Final_Elevation\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri;Num_Ordre_Class_Tri_H2;Tot_Class_Tri;Ech_Class_Tri;Type_Volume_Poids_Class_Tri;Unite_Volume_Poids_Class_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture;Coef_Final_Elevation\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;365;;Aequipecten opercularis;taxon;Vrac;1;0.005;0.005;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.005;1.0001919;1.0\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;491;ALLOSPP;Alloteuthis;taxon;Vrac;2;0.004;0.004;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.004;1.0001919;1.0\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;300;;Buccinum undatum;taxon;Vrac;3;0.015;0.015;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.015;1.0001919;1.0\n" +
1
0
r1648 - in trunk: tutti-service/src/main/java/fr/ifremer/tutti/service/export tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action tutti-ui-swing/src/main/resources/i18n
by tchemit@users.forge.codelutin.com 27 Mar '14
by tchemit@users.forge.codelutin.com 27 Mar '14
27 Mar '14
Author: tchemit
Date: 2014-03-27 17:38:37 +0100 (Thu, 27 Mar 2014)
New Revision: 1648
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1648
Log:
fixes #4841: [ELEVATIONS] probl?\195?\168me d'?\195?\169l?\195?\169vation quand il y a un poids NONTRIE
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java
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/ExportFishingOperationReportAction.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-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java 2014-03-27 14:49:15 UTC (rev 1647)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ExportCatchContext.java 2014-03-27 16:38:37 UTC (rev 1648)
@@ -128,7 +128,9 @@
public float getCatchTotalSortedWeight() {
return catchBatch.getSpeciesTotalSampleSortedComputedWeight() +
- catchBatch.getBenthosTotalSampleSortedComputedWeight();
+ catchBatch.getBenthosTotalSampleSortedComputedWeight() +
+ catchBatch.getSpeciesTotalUnsortedComputedWeight() +
+ catchBatch.getBenthosTotalUnsortedComputedWeight();
}
public boolean withSpeciesBatches() {
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-03-27 14:49:15 UTC (rev 1647)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationForSumatraAction.java 2014-03-27 16:38:37 UTC (rev 1648)
@@ -64,6 +64,15 @@
boolean doAction = super.prepareAction();
+ if (getModel().isModify()) {
+
+ displayWarningMessage(
+ t("tutti.exportFishingOperationForSumatra.title.model.modified"),
+ t("tutti.exportFishingOperationForSumatra.message.model.modified")
+ );
+ doAction = false;
+ }
+
if (doAction) {
FishingOperation fishingOperation = getModel().getFishingOperation();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationReportAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationReportAction.java 2014-03-27 14:49:15 UTC (rev 1647)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/ExportFishingOperationReportAction.java 2014-03-27 16:38:37 UTC (rev 1648)
@@ -61,6 +61,15 @@
boolean doAction = super.prepareAction();
+ if (getModel().isModify()) {
+
+ displayWarningMessage(
+ t("tutti.exportFishingOperationReport.title.model.modified"),
+ t("tutti.exportFishingOperationReport.message.model.modified")
+ );
+ doAction = false;
+ }
+
if (doAction) {
Cruise cruise = getDataContext().getCruise();
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-03-27 14:49:15 UTC (rev 1647)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2014-03-27 16:38:37 UTC (rev 1648)
@@ -1134,10 +1134,14 @@
tutti.exportDb.step.reloadApplication=
tutti.exportFishingOperationForSumatra.action.chooseFile=
tutti.exportFishingOperationForSumatra.action.success=
+tutti.exportFishingOperationForSumatra.message.model.modified=Catch was modified, please save it before launching an export.
tutti.exportFishingOperationForSumatra.title.choose.exportFile=
+tutti.exportFishingOperationForSumatra.title.model.modified=Can't export, catch is modified
tutti.exportFishingOperationReport.action.chooseFile=
tutti.exportFishingOperationReport.action.success=
+tutti.exportFishingOperationReport.message.model.modified=Catch was modified, please save it before launching an export.
tutti.exportFishingOperationReport.title.choose.exportFile=
+tutti.exportFishingOperationReport.title.model.modified=Can't export, catch is modified
tutti.exportProgram.action.exportErrors=
tutti.exportProgram.action.success=
tutti.exportProtocol.action.success=
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-03-27 14:49:15 UTC (rev 1647)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2014-03-27 16:38:37 UTC (rev 1648)
@@ -1121,10 +1121,14 @@
tutti.exportDb.step.reloadApplication=Redémarrage de l'application
tutti.exportFishingOperationForSumatra.action.chooseFile=Choisir le fichier d'export
tutti.exportFishingOperationForSumatra.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
+tutti.exportFishingOperationForSumatra.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
tutti.exportFishingOperationForSumatra.title.choose.exportFile=Exporter le trait de la campagne
+tutti.exportFishingOperationForSumatra.title.model.modified=Impossible d'exporter, capture modifiée
tutti.exportFishingOperationReport.action.chooseFile=Choisir le fichier de rapport
tutti.exportFishingOperationReport.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
+tutti.exportFishingOperationReport.message.model.modified=La capture a été modifié, veuillez l'enregistrer avant de lancer un export.
tutti.exportFishingOperationReport.title.choose.exportFile=Exporter le trait de la campagne
+tutti.exportFishingOperationReport.title.model.modified=Impossible d'exporter, capture modifiée
tutti.exportProgram.action.exportErrors=Des erreurs sont apparues pendant l'élévation des poids d'une campagne de la série <strong>%s</strong>.<br/>L'export a cependant été réalisé.<hr/>Erreur(s) rencontrée(s) \: <br/>%s
tutti.exportProgram.action.success=La série de campagne <strong>%s</strong> a été exportée dans le fichier <strong>%s</strong>.
tutti.exportProtocol.action.success=Protocole [%1s] exporté dans le fichier <strong>%2s</strong>.
1
0
r1647 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches: benthos/frequency species/frequency
by tchemit@users.forge.codelutin.com 27 Mar '14
by tchemit@users.forge.codelutin.com 27 Mar '14
27 Mar '14
Author: tchemit
Date: 2014-03-27 15:49:15 +0100 (Thu, 27 Mar 2014)
New Revision: 1647
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1647
Log:
fixes #4823: [MENSURATION] Pas de la classe de taille non initialis?\195?\169
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2014-03-25 13:11:20 UTC (rev 1646)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2014-03-27 14:49:15 UTC (rev 1647)
@@ -238,15 +238,9 @@
lengthStepCaracterics,
modelCaracteristic);
- // get precision from the pmfm
- Float precision = null;
- if (modelCaracteristic != null) {
- precision = model.getLengthStepCaracteristic().getPrecision();
- }
- if (precision == null) {
- precision = 1f;
- }
- model.setStep(precision);
+ // get step from the pmfm
+ float step = getStep(modelCaracteristic);
+ model.setStep(step);
model.setMinStep(null);
model.setMaxStep(null);
@@ -273,18 +267,12 @@
@Override
public void propertyChange(PropertyChangeEvent evt) {
Caracteristic newValue = (Caracteristic) evt.getNewValue();
+ // get step from the pmfm
+ float step = getStep(newValue);
+ getModel().setStep(step);
if (getModel().getRows()!=null) {
for (BenthosFrequencyRowModel rowModel : getModel().getRows()) {
rowModel.setLengthStepCaracteristic(newValue);
- // get precision from the pmfm
- Float precision = null;
- if (newValue != null) {
- precision = newValue.getPrecision();
- }
- if (precision == null) {
- precision = .5f;
- }
- getModel().setStep(precision);
recomputeRowValidState(rowModel);
}
}
@@ -821,4 +809,15 @@
return doSave;
}
+
+ protected float getStep(Caracteristic caracteristic) {
+ Float precision = null;
+ if (caracteristic != null) {
+ precision = caracteristic.getPrecision();
+ }
+ if (precision == null) {
+ precision = 1f;
+ }
+ return precision;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2014-03-25 13:11:20 UTC (rev 1646)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2014-03-27 14:49:15 UTC (rev 1647)
@@ -281,20 +281,14 @@
speciesProtocol = Maps.newHashMap();
}
- Caracteristic modelCaracteristic = model.getLengthStepCaracteristic();
+ final Caracteristic modelCaracteristic = model.getLengthStepCaracteristic();
initBeanFilterableComboBox(this.ui.getLengthStepCaracteristicComboBox(),
lengthStepCaracterics,
modelCaracteristic);
- // get precision from the pmfm
- Float precision = null;
- if (modelCaracteristic != null) {
- precision = model.getLengthStepCaracteristic().getPrecision();
- }
- if (precision == null) {
- precision = 1f;
- }
- model.setStep(precision);
+ // get step from the pmfm
+ float step = getStep(modelCaracteristic);
+ model.setStep(step);
model.setMinStep(null);
model.setMaxStep(null);
@@ -321,18 +315,12 @@
@Override
public void propertyChange(PropertyChangeEvent evt) {
Caracteristic newValue = (Caracteristic) evt.getNewValue();
+ // get step from the pmfm
+ float step = getStep(newValue);
+ getModel().setStep(step);
if (getModel().getRows() != null) {
for (SpeciesFrequencyRowModel rowModel : getModel().getRows()) {
rowModel.setLengthStepCaracteristic(newValue);
- // get precision from the pmfm
- Float precision = null;
- if (newValue != null) {
- precision = newValue.getPrecision();
- }
- if (precision == null) {
- precision = .5f;
- }
- getModel().setStep(precision);
recomputeRowValidState(rowModel);
}
}
@@ -927,4 +915,15 @@
return doSave;
}
+
+ protected float getStep(Caracteristic caracteristic) {
+ Float precision = null;
+ if (caracteristic != null) {
+ precision = caracteristic.getPrecision();
+ }
+ if (precision == null) {
+ precision = 1f;
+ }
+ return precision;
+ }
}
1
0
The Tutti team is pleased to announce the tutti-3.2.1 release!
Outil de saisie de données d'opérations et de captures au
cours des campagnes halieutiques.
Documentation of the project can be found here:
https://doc.codelutin.com/projects/tutti
Changes
-------
Changes in this version include:
Fixed Bugs:
o [CAPTURE] Impossible de saisir les décimales dans la catégorie Poids sous échantilloné (kg) Issue: 4822. Thanks to Anne-Sophie Cornou. Resolved by tchemit.
o [EXPORT] Erreur export générique sur données CGFS Issue: 4824. Thanks to Anne-Sophie Cornou. Resolved by tchemit.
Downloads
---------
For a manual installation, you can download files here:
https://forge.codelutin.com/projects/tutti/files
* tutti-ichtyometer-3.2.1-tools.zip - https://forge.codelutin.com/attachments/download/1623
Maven artifacts
---------------
Artifacts are deployed in nuiton maven repository
http://maven.nuiton.org/other-releases/
Have fun!
-Tutti team
1
0