Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- 4058 discussions
r779 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/operation/catches/accidental content/operation/catches/benthos content/operation/catches/individualobservation content/operation/catches/individualobservation/caracteristics content/operation/catches/marinelitter content/operation/catches/species content/operation/fishing content/protocol util
by kmorin@users.forge.codelutin.com 15 Apr '13
by kmorin@users.forge.codelutin.com 15 Apr '13
15 Apr '13
Author: kmorin
Date: 2013-04-15 17:39:32 +0200 (Mon, 15 Apr 2013)
New Revision: 779
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/779
Log:
refs #1848 [ERGO] - Touches de raccourcis
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/GearUseFeatureTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/VesselUseFeatureTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -95,7 +95,8 @@
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
<JXTable id='table'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -163,7 +163,8 @@
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
<JXTable id='table'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -94,7 +94,8 @@
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
<JXTable id='table'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -56,7 +56,8 @@
<cell fill='both' columns='2'>
<JScrollPane>
<JXTable id='caracteristicMapEditorTable'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -106,7 +106,8 @@
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
<JXTable id='table'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -163,7 +163,8 @@
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
<JXTable id='table'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/GearUseFeatureTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/GearUseFeatureTabUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/GearUseFeatureTabUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -58,7 +58,8 @@
<cell fill='both' columns='2'>
<JScrollPane>
<JXTable id='gearUseFeatureTable'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/VesselUseFeatureTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/VesselUseFeatureTabUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/VesselUseFeatureTabUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -60,7 +60,8 @@
<cell fill='both' columns='2'>
<JScrollPane>
<JXTable id='vesselUseFeatureTable'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-04-15 15:39:32 UTC (rev 779)
@@ -164,7 +164,8 @@
<cell fill='both' columns='3'>
<JScrollPane>
<JXTable id='speciesTable'
- onMouseClicked='handler.autoSelectRowInTable(event, speciesTablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, speciesTablePopup)'
+ onKeyPressed='handler.openRowMenu(event, speciesTablePopup)'/>
</JScrollPane>
</cell>
</row>
@@ -198,7 +199,8 @@
<cell fill='both' columns='3'>
<JScrollPane>
<JXTable id='benthosTable'
- onMouseClicked='handler.autoSelectRowInTable(event, benthosTablePopup)'/>
+ onMouseClicked='handler.autoSelectRowInTable(event, benthosTablePopup)'
+ onKeyPressed='handler.openRowMenu(event, benthosTablePopup)'/>
</JScrollPane>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-04-15 15:38:46 UTC (rev 778)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-04-15 15:39:32 UTC (rev 779)
@@ -86,22 +86,12 @@
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
+import javax.swing.event.*;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
import javax.swing.text.JTextComponent;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dialog;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Frame;
-import java.awt.Point;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
@@ -998,4 +988,46 @@
}
}
+ public void openRowMenu(KeyEvent e, JPopupMenu popup) {
+
+ if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
+
+ JXTable source = (JXTable) e.getSource();
+
+ // get the lowest selected row
+ int[] selectedRows = source.getSelectedRows();
+ int lowestRow = -1;
+ for (int row : selectedRows) {
+ lowestRow = Math.max(lowestRow, row);
+ }
+ // get the selected column
+ Rectangle r = source.getCellRect(lowestRow, source.getSelectedColumn(), true);
+
+ // get the point in the middle lower of the cell
+ Point p = new Point(r.x + r.width/2, r.y + r.height);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Row " + lowestRow +" found t point [" + p + "]");
+ }
+
+ boolean canContinue = true;
+
+ if (source.isEditing()) {
+
+ // stop editing
+ boolean stopEdit = source.getCellEditor().stopCellEditing();
+ if (!stopEdit) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not stop edit cell...");
+ }
+ canContinue = false;
+ }
+ }
+
+ if (canContinue) {
+ popup.show(source, p.x, p.y);
+ }
+ }
+ }
+
}
1
0
r778 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service tutti-service/src/main/java/fr/ifremer/tutti/service/protocol tutti-service/src/main/resources/i18n tutti-service/src/test/java/fr/ifremer/tutti/service/protocol tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol tutti-ui-swing/src/main/resources/i18n
by tchemit@users.forge.codelutin.com 15 Apr '13
by tchemit@users.forge.codelutin.com 15 Apr '13
15 Apr '13
Author: tchemit
Date: 2013-04-15 17:38:46 +0200 (Mon, 15 Apr 2013)
New Revision: 778
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/778
Log:
fixes #2283: [PROTOCOLE] - A la cr?\195?\169ation d'un nouveau protocole le logiciel d?\195?\169place les esp?\195?\168ces benthos dans esp?\195?\168ces
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceReadTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceWriteTest.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/protocol/SpeciesRow.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/protocol/TuttiProtocolImportExportServiceTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/SaveProtocolAction.java
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/service/ProtocolPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceImpl.java 2013-04-15 15:38:46 UTC (rev 778)
@@ -140,7 +140,7 @@
SpeciesProtocol s = TuttiBeanFactory.newSpeciesProtocol();
speciesProtocolBinder.copy(speciesProtocol, s);
s.setId(UUID.randomUUID().toString());
- species.add(s);
+ benthos.add(s);
}
}
result.setBenthos(benthos);
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceReadTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceReadTest.java 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceReadTest.java 2013-04-15 15:38:46 UTC (rev 778)
@@ -38,12 +38,11 @@
import java.util.List;
/**
- * To test {@link ProtocolPersistenceService} for read operation.
+ * To test {@link ProtocolPersistenceService} for read operations.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
*/
-@Ignore
public class ProtocolPersistenceServiceReadTest {
@ClassRule
@@ -111,6 +110,30 @@
sp2.setSizeEnabled(true);
sp2.setWeightEnabled(true);
protocol.addSpecies(sp2);
+
+ protocol.setBenthos(Lists.<SpeciesProtocol>newArrayList());
+ SpeciesProtocol bp1 = TuttiBeanFactory.newSpeciesProtocol();
+ bp1.setId("21");
+ bp1.setSpeciesReferenceTaxonId(11242);
+ bp1.setLengthStepPmfmId("1394");
+ bp1.setCalcifySampleEnabled(true);
+ bp1.setMaturityEnabled(true);
+ bp1.setSexEnabled(true);
+ bp1.setWeightEnabled(true);
+ protocol.addBenthos(bp1);
+
+ SpeciesProtocol bp2 = TuttiBeanFactory.newSpeciesProtocol();
+ bp2.setId("22");
+ bp2.setSpeciesReferenceTaxonId(3835);
+ bp2.setLengthStepPmfmId("323");
+ bp2.setAgeEnabled(true);
+ bp2.setCalcifySampleEnabled(true);
+ bp2.setCountIfNoFrequencyEnabled(true);
+ bp2.setMaturityEnabled(true);
+ bp2.setSexEnabled(true);
+ bp2.setSizeEnabled(true);
+ bp2.setWeightEnabled(true);
+ protocol.addBenthos(bp2);
return protocol;
}
}
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceWriteTest.java 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProtocolPersistenceServiceWriteTest.java 2013-04-15 15:38:46 UTC (rev 778)
@@ -36,12 +36,11 @@
import org.junit.Test;
/**
- * To test {@link ProtocolPersistenceService} for write operation.
+ * To test {@link ProtocolPersistenceService} for write operations.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
*/
-@Ignore
public class ProtocolPersistenceServiceWriteTest {
@ClassRule
@@ -50,6 +49,26 @@
protected ProtocolPersistenceService service;
public static final String PROTOCOL_FILE_CONTENT =
+ "benthos: \n" +
+ "- !SpeciesProtocol\n" +
+ " id: 21\n" +
+ " calcifySampleEnabled: true\n" +
+ " lengthStepPmfmId: 1394\n" +
+ " maturityEnabled: true\n" +
+ " sexEnabled: true\n" +
+ " speciesReferenceTaxonId: 11242\n" +
+ " weightEnabled: true\n" +
+ "- !SpeciesProtocol\n" +
+ " id: 22\n" +
+ " ageEnabled: true\n" +
+ " calcifySampleEnabled: true\n" +
+ " countIfNoFrequencyEnabled: true\n" +
+ " lengthStepPmfmId: 323\n" +
+ " maturityEnabled: true\n" +
+ " sexEnabled: true\n" +
+ " sizeEnabled: true\n" +
+ " speciesReferenceTaxonId: 3835\n" +
+ " weightEnabled: true\n" +
"id: 1\n" +
"name: protocolName\n" +
"comment: Commentaire\n" +
@@ -160,6 +179,31 @@
sp2.setSizeEnabled(true);
sp2.setWeightEnabled(true);
protocol.addSpecies(sp2);
+
+ protocol.setBenthos(Lists.<SpeciesProtocol>newArrayList());
+ SpeciesProtocol bp1 = TuttiBeanFactory.newSpeciesProtocol();
+ bp1.setId("21");
+ bp1.setSpeciesReferenceTaxonId(11242);
+ bp1.setLengthStepPmfmId("1394");
+ bp1.setCalcifySampleEnabled(true);
+ bp1.setMaturityEnabled(true);
+ bp1.setSexEnabled(true);
+ bp1.setWeightEnabled(true);
+ protocol.addBenthos(bp1);
+
+ SpeciesProtocol bp2 = TuttiBeanFactory.newSpeciesProtocol();
+ bp2.setId("22");
+ bp2.setSpeciesReferenceTaxonId(3835);
+ bp2.setLengthStepPmfmId("323");
+ bp2.setAgeEnabled(true);
+ bp2.setCalcifySampleEnabled(true);
+ bp2.setCountIfNoFrequencyEnabled(true);
+ bp2.setMaturityEnabled(true);
+ bp2.setSexEnabled(true);
+ bp2.setSizeEnabled(true);
+ bp2.setWeightEnabled(true);
+ protocol.addBenthos(bp2);
+
return protocol;
}
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/protocol/SpeciesRow.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/protocol/SpeciesRow.java 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/protocol/SpeciesRow.java 2013-04-15 15:38:46 UTC (rev 778)
@@ -226,4 +226,12 @@
public void setMadeFromAReferentTaxon(boolean referent) {
delegate.setMadeFromAReferentTaxon(referent);
}
+
+ public void setId(String id) {
+ delegate.setId(id);
+ }
+
+ public String getId() {
+ return delegate.getId();
+ }
}
\ No newline at end of file
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 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-04-15 15:38:46 UTC (rev 778)
@@ -1,6 +1,7 @@
tutti.config.option.basedir.description=
tutti.config.option.csv.separator.description=
tutti.config.option.data.directory.description=
+tutti.config.option.export.countryId.description=
tutti.config.option.inceptionYear.description=
tutti.config.option.organizationName.description=
tutti.config.option.site.url.description=
@@ -56,6 +57,8 @@
tutti.service.catches.computeWeights.error.incoherentSampleWeight=
tutti.service.catches.computeWeights.error.incoherentSpeciesTotalSorted=
tutti.service.catches.computeWeights.error.incoherentTotal=
+tutti.service.export.invalid.cruise=
+tutti.service.export.invalid.fishingOperation=
tutti.validator.error.comment.too.long=
tutti.validator.error.cruise.beginDate.required=
tutti.validator.error.cruise.dates.endBeforeStart=
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/protocol/TuttiProtocolImportExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/protocol/TuttiProtocolImportExportServiceTest.java 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/protocol/TuttiProtocolImportExportServiceTest.java 2013-04-15 15:38:46 UTC (rev 778)
@@ -57,6 +57,7 @@
"name: protocolName\n" +
"benthos: \n" +
"- !SpeciesProtocol\n" +
+ " id: 21\n" +
" calcifySampleEnabled: true\n" +
" lengthStepPmfmId: 1394\n" +
" maturityEnabled: true\n" +
@@ -65,6 +66,7 @@
" speciesSurveyCode: cruiseCode1\n" +
" weightEnabled: true\n" +
"- !SpeciesProtocol\n" +
+ " id: 22\n" +
" ageEnabled: true\n" +
" calcifySampleEnabled: true\n" +
" countIfNoFrequencyEnabled: true\n" +
@@ -83,6 +85,7 @@
"- 18\n" +
"species: \n" +
"- !SpeciesProtocol\n" +
+ " id: 1\n" +
" calcifySampleEnabled: true\n" +
" lengthStepPmfmId: 1394\n" +
" maturityEnabled: true\n" +
@@ -91,6 +94,7 @@
" speciesSurveyCode: cruiseCode1\n" +
" weightEnabled: true\n" +
"- !SpeciesProtocol\n" +
+ " id: 2\n" +
" ageEnabled: true\n" +
" calcifySampleEnabled: true\n" +
" countIfNoFrequencyEnabled: true\n" +
@@ -163,6 +167,7 @@
protocol.setSpecies(Lists.<SpeciesProtocol>newArrayList());
SpeciesProtocol sp1 = TuttiBeanFactory.newSpeciesProtocol();
+ sp1.setId(1);
sp1.setSpeciesReferenceTaxonId(11242);
sp1.setSpeciesSurveyCode("cruiseCode1");
sp1.setLengthStepPmfmId("1394");
@@ -173,6 +178,7 @@
protocol.addSpecies(sp1);
SpeciesProtocol sp2 = TuttiBeanFactory.newSpeciesProtocol();
+ sp2.setId(2);
sp2.setSpeciesReferenceTaxonId(3835);
sp2.setLengthStepPmfmId("323");
sp2.setAgeEnabled(true);
@@ -185,27 +191,29 @@
protocol.addSpecies(sp2);
protocol.setBenthos(Lists.<SpeciesProtocol>newArrayList());
- SpeciesProtocol b1 = TuttiBeanFactory.newSpeciesProtocol();
- b1.setSpeciesReferenceTaxonId(11242);
- b1.setSpeciesSurveyCode("cruiseCode1");
- b1.setLengthStepPmfmId("1394");
- b1.setCalcifySampleEnabled(true);
- b1.setMaturityEnabled(true);
- b1.setSexEnabled(true);
- b1.setWeightEnabled(true);
- protocol.addBenthos(b1);
+ SpeciesProtocol bp1 = TuttiBeanFactory.newSpeciesProtocol();
+ bp1.setId(21);
+ bp1.setSpeciesSurveyCode("cruiseCode1");
+ bp1.setSpeciesReferenceTaxonId(11242);
+ bp1.setLengthStepPmfmId("1394");
+ bp1.setCalcifySampleEnabled(true);
+ bp1.setMaturityEnabled(true);
+ bp1.setSexEnabled(true);
+ bp1.setWeightEnabled(true);
+ protocol.addBenthos(bp1);
- SpeciesProtocol b2 = TuttiBeanFactory.newSpeciesProtocol();
- b2.setSpeciesReferenceTaxonId(3835);
- b2.setLengthStepPmfmId("323");
- b2.setAgeEnabled(true);
- b2.setCalcifySampleEnabled(true);
- b2.setCountIfNoFrequencyEnabled(true);
- b2.setMaturityEnabled(true);
- b2.setSexEnabled(true);
- b2.setSizeEnabled(true);
- b2.setWeightEnabled(true);
- protocol.addBenthos(b2);
+ SpeciesProtocol bp2 = TuttiBeanFactory.newSpeciesProtocol();
+ bp2.setId(22);
+ bp2.setSpeciesReferenceTaxonId(3835);
+ bp2.setLengthStepPmfmId("323");
+ bp2.setAgeEnabled(true);
+ bp2.setCalcifySampleEnabled(true);
+ bp2.setCountIfNoFrequencyEnabled(true);
+ bp2.setMaturityEnabled(true);
+ bp2.setSexEnabled(true);
+ bp2.setSizeEnabled(true);
+ bp2.setWeightEnabled(true);
+ protocol.addBenthos(bp2);
service.exportProtocol(protocol, exportFile);
Assert.assertTrue(exportFile.exists());
@@ -237,6 +245,7 @@
Assert.assertEquals(2, protocol.sizeSpecies());
SpeciesProtocol sp1 = protocol.getSpecies(0);
Assert.assertNotNull(sp1);
+ Assert.assertEquals(1, sp1.getIdAsInt(), 0);
Assert.assertEquals(11242, sp1.getSpeciesReferenceTaxonId(), 0);
Assert.assertEquals("cruiseCode1", sp1.getSpeciesSurveyCode());
Assert.assertEquals("1394", sp1.getLengthStepPmfmId());
@@ -250,6 +259,7 @@
SpeciesProtocol sp2 = protocol.getSpecies(1);
Assert.assertNotNull(sp2);
+ Assert.assertEquals(2, sp2.getIdAsInt(), 0);
Assert.assertEquals(3835, sp2.getSpeciesReferenceTaxonId(), 0);
Assert.assertEquals("323", sp2.getLengthStepPmfmId());
Assert.assertTrue(sp2.isAgeEnabled());
@@ -264,6 +274,7 @@
Assert.assertEquals(2, protocol.sizeBenthos());
SpeciesProtocol b1 = protocol.getBenthos(0);
Assert.assertNotNull(b1);
+ Assert.assertEquals(21, b1.getIdAsInt(), 0);
Assert.assertEquals(11242, b1.getSpeciesReferenceTaxonId(), 0);
Assert.assertEquals("cruiseCode1", b1.getSpeciesSurveyCode());
Assert.assertEquals("1394", b1.getLengthStepPmfmId());
@@ -277,6 +288,7 @@
SpeciesProtocol b2 = protocol.getBenthos(1);
Assert.assertNotNull(b2);
+ Assert.assertEquals(22, b2.getIdAsInt(), 0);
Assert.assertEquals(3835, b2.getSpeciesReferenceTaxonId(), 0);
Assert.assertEquals("323", b2.getLengthStepPmfmId());
Assert.assertTrue(b2.isAgeEnabled());
@@ -513,6 +525,7 @@
protocol.setBenthos(Lists.<SpeciesProtocol>newArrayList());
SpeciesProtocol sp1 = TuttiBeanFactory.newSpeciesProtocol();
+ sp1.setId(21);
sp1.setSpeciesReferenceTaxonId(1);
sp1.setSpeciesSurveyCode("cruiseCode1");
sp1.setAgeEnabled(true);
@@ -527,10 +540,11 @@
protocol.addBenthos(sp1);
SpeciesProtocol sp2 = TuttiBeanFactory.newSpeciesProtocol();
+ sp2.setId(22);
sp2.setSpeciesReferenceTaxonId(2);
sp2.setAgeEnabled(true);
- sp1.setSizeEnabled(true);
- sp1.setMaturityEnabled(true);
+ sp2.setSizeEnabled(false);
+ sp2.setMaturityEnabled(false);
sp2.setSexEnabled(true);
sp2.setWeightEnabled(true);
sp2.setCalcifySampleEnabled(true);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-04-15 15:38:46 UTC (rev 778)
@@ -133,48 +133,6 @@
return (EditProtocolSpeciesTableModel) getBenthosTable().getModel();
}
-//
-// @Override
-// public EditProtocolSpeciesTableModel getTableModel() {
-// return (EditProtocolSpeciesTableModel) getTable().getModel();
-// }
-//
-// @Override
-// public JXTable getTable() {
-// return ui.getSpeciesTable();
-// }
-//
-// @Override
-// protected boolean isRowValid(EditProtocolSpeciesRowModel row) {
-// return true;
-// }
-
-// @Override
-// protected void onRowModified(int rowIndex,
-// EditProtocolSpeciesRowModel row,
-// String propertyName,
-// Object oldValue,
-// Object newValue) {
-//
-// recomputeRowValidState(row);
-// }
-//
-//
-// @Override
-// protected void onRowValidStateChanged(int rowIndex,
-// EditProtocolSpeciesRowModel row,
-// Boolean oldValue,
-// Boolean newValue) {
-// super.onRowValidStateChanged(rowIndex, row, oldValue, newValue);
-//
-// if (row != null && row.isModify() && newValue != null && newValue) {
-// // row was modified and is valid, we can save protocol
-// // even if after the row becomes again not valid, this is not a
-// // problem since we will only save valid data!
-// getModel().setModify(true);
-// }
-// }
-
//------------------------------------------------------------------------//
//-- AbstractTuttiUIHandler methods --//
//------------------------------------------------------------------------//
@@ -204,9 +162,6 @@
getDataContext().getReferentSpecies());
model.setAllReferentSpeciesByTaxonId(allReferentSpeciesByTaxonId);
-// List<TuttiProtocol> protocols = Lists.newArrayList(persistenceService.getAllProtocol());
-// model.setExistingProtocols(protocols);
-
List<Caracteristic> caracteristics = Lists.newArrayList(getDataContext().getCaracteristics());
model.setCaracteristics(caracteristics);
@@ -300,7 +255,7 @@
}
}
- // set to model ( will propagate to tableModel)
+ // set to model (will propagate to tableModel)
model.setSpeciesRow(speciesRows);
model.setBenthosRow(benthosRows);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/SaveProtocolAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/SaveProtocolAction.java 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/SaveProtocolAction.java 2013-04-15 15:38:46 UTC (rev 778)
@@ -115,6 +115,4 @@
EditProtocolUIHandler.getTitle(true));
}
-
-
}
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 2013-04-15 14:48:55 UTC (rev 777)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-04-15 15:38:46 UTC (rev 778)
@@ -651,9 +651,9 @@
tutti.editProtocol.action.exportProtocolSpecies=Exporter les espèces
tutti.editProtocol.action.exportProtocolSpecies.mnemonic=è
tutti.editProtocol.action.exportProtocolSpecies.tip=Exporter les espèces du protocole
-tutti.editProtocol.action.exportPupitri=
-tutti.editProtocol.action.exportPupitri.mnemonic=
-tutti.editProtocol.action.exportPupitri.tip=
+tutti.editProtocol.action.exportPupitri=Export pupitri
+tutti.editProtocol.action.exportPupitri.mnemonic=p
+tutti.editProtocol.action.exportPupitri.tip=Exporter les espèces au format Pupitri
tutti.editProtocol.action.importProtocolBenthos=Importer les benthos
tutti.editProtocol.action.importProtocolBenthos.mnemonic=i
tutti.editProtocol.action.importProtocolBenthos.tip=Importer les benthos dans le protocole
1
0
r777 - in trunk/tutti-service/src: main/java/fr/ifremer/tutti/service main/java/fr/ifremer/tutti/service/catches main/java/fr/ifremer/tutti/service/config main/java/fr/ifremer/tutti/service/export main/resources/i18n test/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 15 Apr '13
by tchemit@users.forge.codelutin.com 15 Apr '13
15 Apr '13
Author: tchemit
Date: 2013-04-15 16:48:55 +0200 (Mon, 15 Apr 2013)
New Revision: 777
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/777
Log:
refs #1875: [IMP/EXP] - Export des donn?\195?\169es de campagne : format g?\195?\169n?\195?\169rique
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
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 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -24,9 +24,11 @@
* #L%
*/
+import com.google.common.base.Joiner;
import fr.ifremer.tutti.TuttiTechnicalException;
import fr.ifremer.tutti.persistence.entities.TuttiEntity;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.persistence.entities.referential.Person;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.util.csv.Common;
@@ -44,6 +46,7 @@
import java.text.ParseException;
import java.util.Collections;
import java.util.Date;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -243,15 +246,12 @@
public static final ValueParserFormatter<Date> YEAR =
new DateValue("yyyy");
- public static final ValueParserFormatter<Date> DAY_EMPTY_TIME =
- new DateValue("dd/MM/yyyy 00:00:00");
-
- public static final ValueParserFormatter<Date> TIME =
- new DateValue("HH:mm:ss");
-
public static final ValueFormatter<Serializable> CARACTERISTIC_VALUE_FORMATTER =
new CaracteristicValueFormatter();
+ public static final ValueFormatter<List<Person>> LIST_PERSON_FORMATTER =
+ new ListPersonValueFormatter();
+
public static <E> BeanPropertyFormatter<E> newBeanFormatter(String propertyName,
String defaultNullValue) {
return new BeanPropertyFormatter<E>(propertyName, defaultNullValue);
@@ -351,6 +351,14 @@
}
}
+ protected static class ListPersonValueFormatter implements ValueFormatter<List<Person>> {
+
+ @Override
+ public String format(List<Person> value) {
+ return Joiner.on('|').join(value);
+ }
+ }
+
protected TuttiCsvUtil() {
// no instance
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -24,6 +24,7 @@
* #L%
*/
+import com.google.common.collect.Maps;
import fr.ifremer.tutti.TuttiBusinessException;
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
@@ -45,6 +46,7 @@
import org.nuiton.validator.NuitonValidatorResult;
import java.util.List;
+import java.util.Map;
import static org.nuiton.i18n.I18n._;
@@ -68,6 +70,52 @@
validationService = getService(ValidationService.class);
}
+ /**
+ * To check if can compute for any fishing operation of the cruise given
+ * by his id.
+ * <p/>
+ * If no error found, then return is a empty map, otherwise the first error
+ * found for any bad fishing operation.
+ * <p/>
+ * Result keys are fishing operation id, values the first error for
+ * the fishing operation.
+ *
+ * @param cruiseId id of the cruise to check.
+ * @return map of errors, or empty map if no error found.
+ * @since 1.4
+ */
+ public Map<String, String> checkCruise(String cruiseId) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Will check cruise: " + cruiseId);
+ }
+ Map<String, String> result = Maps.newTreeMap();
+
+ List<FishingOperation> allFishingOperation =
+ persistenceService.getAllFishingOperation(cruiseId);
+
+ for (FishingOperation fishingOperation : allFishingOperation) {
+
+ String fishingOperationId = fishingOperation.getId();
+ CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(fishingOperationId);
+ BatchContainer<SpeciesBatch> rootSpeciesBatch = persistenceService.getRootSpeciesBatch(fishingOperationId);
+ BatchContainer<BenthosBatch> rootBenthosBatch = persistenceService.getRootBenthosBatch(fishingOperationId);
+ BatchContainer<MarineLitterBatch> rootMarineLitterBatch = persistenceService.getRootMarineLitterBatch(fishingOperationId);
+
+ try {
+ if (catchBatch != null) {
+ computeCatchBatchWeights(catchBatch,
+ rootSpeciesBatch,
+ rootBenthosBatch,
+ rootMarineLitterBatch);
+ }
+ } catch (TuttiBusinessException e) {
+ result.put(fishingOperationId, e.getMessage());
+ }
+ }
+ return result;
+ }
+
public void computeCatchBatchWeights(CatchBatch catchBatch,
BatchContainer<SpeciesBatch> rootSpeciesBatch,
BatchContainer<BenthosBatch> rootBenthosBatch,
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -106,6 +106,11 @@
TuttiServiceConfigOption.CSV_SEPARATOR.getKey()).charAt(0);
}
+ public String getExportCountryId() {
+ return applicationConfig.getOption(
+ TuttiServiceConfigOption.EXPORT_COUNTRY_ID.getKey());
+ }
+
public void prepareDirectories() {
File dataDirectory = getDataDirectory();
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -67,6 +67,12 @@
n_("tutti.config.option.csv.separator.description"),
";",
char.class),
+ EXPORT_COUNTRY_ID(
+ "tutti.export.countryId",
+ n_("tutti.config.option.export.countryId.description"),
+ "12",
+ char.class),
+
// TRANSIENT CONFIG
VERSION(
"tutti.version",
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -25,6 +25,7 @@
*/
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.Program;
@@ -52,16 +53,12 @@
newColumnForExport("NumOrdre_Station", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER);
newColumnForExport("Navire", Cruise.PROPERTY_VESSEL, Vessel.PROPERTY_NAME);
-//FIXME newColumnForExport("Pays", Cruise.PROPERTY_VESSEL);
newColumnForExport("Zone_Etude", "programeZoneName");
newColumnForExport("Id_Sismer", Cruise.PROPERTY_NAME);
- newColumnForExport("Date_Deb_Campagne", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.DAY_EMPTY_TIME);
- newColumnForExport("Heure_Deb_Campagne", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.TIME);
+ newColumnForExport("Date_Deb_Campagne", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("Port_Deb_Campagne", Cruise.PROPERTY_DEPARTURE_LOCATION);
- newColumnForExport("Date_Fin_Campagne", Cruise.PROPERTY_END_DATE, TuttiCsvUtil.DAY_EMPTY_TIME);
- newColumnForExport("Heure_Fin_Campagne", Cruise.PROPERTY_END_DATE, TuttiCsvUtil.TIME);
+ newColumnForExport("Date_Fin_Campagne", Cruise.PROPERTY_END_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("Port_Fin_Campagne", Cruise.PROPERTY_RETURN_LOCATION);
-//FIXME newColumnForExport("Responsable_Serie", Cruise.PROPERTY_HEAD_OF_MISSION);
newColumnForExport("Chef_Mission", Cruise.PROPERTY_HEAD_OF_MISSION);
newColumnForExport("Resp_Salle_Tri", Cruise.PROPERTY_HEAD_OF_SORT_ROOM);
newColumnForExport("Commentaire", Cruise.PROPERTY_COMMENT);
@@ -70,10 +67,13 @@
public void prepareRows(List<CatchExportRow> rows,
Cruise cruise,
FishingOperation operation,
- BatchContainer<SpeciesBatch> rootSpeciesBatch) {
+ BatchContainer<SpeciesBatch> rootSpeciesBatch,
+ BatchContainer<BenthosBatch> rootBenthosBatch) {
CatchExportRow row = new CatchExportRow();
row.setCruise(cruise);
row.setFishingOperation(operation);
+// row.setRootSpeciesBatch(rootSpeciesBatch);
+// row.setRootBenthosBatch(rootBenthosBatch);
rows.add(row);
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -66,19 +66,16 @@
newColumnForExport("Engin", Cruise.PROPERTY_GEAR, Gear.PROPERTY_NAME);
newColumnForExport("Navire", Cruise.PROPERTY_VESSEL, Vessel.PROPERTY_NAME);
- newColumnForExport("DateDeb_Op", FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.DAY_EMPTY_TIME);
- newColumnForExport("HeureDeb_Op", FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.TIME);
+ newColumnForExport("DateDeb_Op", 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_EMPTY_TIME);
- newColumnForExport("HeureFin_OP", FishingOperation.PROPERTY_GEAR_SHOOTING_END_DATE, TuttiCsvUtil.TIME);
+ newColumnForExport("DateFin_Op", 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("Localite", FishingOperation.PROPERTY_LOCATION, TuttiLocation.PROPERTY_NAME, "NA");
-//FIXME newColumnForExport("Rectangle_CIEM",); // Carré statistique
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);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -47,24 +47,24 @@
newColumnForExport("Serie", Cruise.PROPERTY_PROGRAM, Program.PROPERTY_NAME);
newColumnForExport("Serie_Partielle", Cruise.PROPERTY_SURVEY_PART);
newColumnForExport("Navire", Cruise.PROPERTY_VESSEL, Vessel.PROPERTY_NAME);
-//FIXME newColumnForExport("Pays", Cruise.PROPERTY_VESSEL);
+ newColumnForExport("Pays", SurveyExportRow.PROPERTY_COUNTRY);
newColumnForExport("Zone_Etude", Program.PROPERTY_ZONE, TuttiLocation.PROPERTY_NAME);
newColumnForExport("Id_Sismer", Cruise.PROPERTY_NAME);
- newColumnForExport("Date_Deb_Campagne", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.DAY_EMPTY_TIME);
- newColumnForExport("Heure_Deb_Campagne", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.TIME);
+ newColumnForExport("Date_Deb_Campagne", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("Port_Deb_Campagne", Cruise.PROPERTY_DEPARTURE_LOCATION, TuttiLocation.PROPERTY_NAME);
- newColumnForExport("Date_Fin_Campagne", Cruise.PROPERTY_END_DATE, TuttiCsvUtil.DAY_EMPTY_TIME);
- newColumnForExport("Heure_Fin_Campagne", Cruise.PROPERTY_END_DATE, TuttiCsvUtil.TIME);
+ newColumnForExport("Date_Fin_Campagne", Cruise.PROPERTY_END_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("Port_Fin_Campagne", Cruise.PROPERTY_RETURN_LOCATION, TuttiLocation.PROPERTY_NAME);
-//FIXME newColumnForExport("Responsable_Serie", Cruise.PROPERTY_HEAD_OF_MISSION);
-// newColumnForExport("Chef_Mission", Cruise.PROPERTY_HEAD_OF_MISSION);
-// newColumnForExport("Resp_Salle_Tri", Cruise.PROPERTY_HEAD_OF_SORT_ROOM);
+ newColumnForExport("Chef_Mission", Cruise.PROPERTY_HEAD_OF_MISSION, TuttiCsvUtil.LIST_PERSON_FORMATTER);
+ newColumnForExport("Resp_Salle_Tri", Cruise.PROPERTY_HEAD_OF_SORT_ROOM, TuttiCsvUtil.LIST_PERSON_FORMATTER);
newColumnForExport("Commentaire", Cruise.PROPERTY_COMMENT);
}
- public void prepareRows(List<SurveyExportRow> rows, Cruise cruise) {
+ public void prepareRows(List<SurveyExportRow> rows,
+ Cruise cruise,
+ TuttiLocation country) {
SurveyExportRow row = new SurveyExportRow();
row.setCruise(cruise);
+ row.setCountry(country);
rows.add(row);
}
}
\ No newline at end of file
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -44,12 +44,20 @@
private static final long serialVersionUID = 1L;
+ public static final String PROPERTY_COUNTRY = "country";
+
protected Cruise cruise;
+ protected TuttiLocation country;
+
public void setCruise(Cruise cruise) {
this.cruise = cruise;
}
+ public void setCountry(TuttiLocation country) {
+ this.country = country;
+ }
+
public Date getBeginDate() {
return cruise.getBeginDate();
}
@@ -71,8 +79,7 @@
}
public String getCountry() {
- //FIXME
- return null;
+ return country.getLabel();
}
public String getName() {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -28,27 +28,40 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.io.Files;
+import fr.ifremer.tutti.TuttiBusinessException;
import fr.ifremer.tutti.TuttiIOUtil;
import fr.ifremer.tutti.TuttiTechnicalException;
+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.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.service.AbstractTuttiService;
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiCsvUtil;
import fr.ifremer.tutti.service.TuttiServiceContext;
+import fr.ifremer.tutti.service.catches.TuttiWeightComputingService;
+import org.apache.commons.collections.MapUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.csv.Export;
+import org.nuiton.util.decorator.Decorator;
import java.io.BufferedWriter;
+import java.io.Closeable;
import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
import java.util.List;
+import java.util.Map;
+import static org.nuiton.i18n.I18n._;
+
/**
* To export data in the generic format.
* <p/>
@@ -66,6 +79,8 @@
protected DecoratorService decoratorService;
+ protected TuttiWeightComputingService tuttiWeightComputingService;
+
protected char csvSeparator;
private Caracteristic verticalOpeningCaracteristic;
@@ -74,17 +89,57 @@
private Caracteristic horizontalOpeningDoorCaracteristic;
+ private TuttiLocation country;
+
@Override
public void setServiceContext(TuttiServiceContext context) {
super.setServiceContext(context);
persistenceService = getService(PersistenceService.class);
decoratorService = getService(DecoratorService.class);
+ tuttiWeightComputingService = getService(TuttiWeightComputingService.class);
+
csvSeparator = context.getConfig().getCsvSeparator();
verticalOpeningCaracteristic = persistenceService.getVerticalOpeningCaracteristic();
horizontalOpeningWingCaracteristic = persistenceService.getHorizontalOpeningWingCaracteristic();
horizontalOpeningDoorCaracteristic = persistenceService.getHorizontalOpeningDoorCaracteristic();
+ List<TuttiLocation> allCountry = persistenceService.getAllCountry();
+ String countryId = context.getConfig().getExportCountryId();
+ country = TuttiEntities.splitById(allCountry).get(countryId);
}
+ public void exportProgram(String programId, File exportFile) {
+ Preconditions.checkNotNull(programId);
+ Preconditions.checkNotNull(exportFile);
+
+ Program program = persistenceService.getProgram(programId);
+ Preconditions.checkNotNull(program);
+
+ List<Cruise> allCruise = persistenceService.getAllCruise(programId);
+ for (Cruise cruise : allCruise) {
+ checkCruise(cruise);
+ }
+
+ File basedir = new File(context.getConfig().newTempFile(
+ "exportProgram"), "exportProgram-" + programId);
+
+ TuttiIOUtil.forceMkdir(basedir, "Could not create directory");
+
+ ExportContext exportContext = createExportContext(basedir);
+
+ try {
+ for (Cruise cruise : allCruise) {
+ // load full cruise
+ cruise = persistenceService.getCruise(cruise.getId());
+ exportCruise(cruise, exportContext);
+ }
+ TuttiIOUtil.close(exportContext, "Could not close export context");
+
+ TuttiIOUtil.zip(basedir, exportFile, "Could not create export zip");
+ } finally {
+ IOUtils.closeQuietly(exportContext);
+ }
+ }
+
public void exportCruise(String cruiseId, File exportFile) {
Preconditions.checkNotNull(cruiseId);
@@ -93,155 +148,249 @@
Cruise cruise = persistenceService.getCruise(cruiseId);
Preconditions.checkNotNull(cruise);
- List<FishingOperation> operations =
- persistenceService.getAllFishingOperation(cruiseId);
+ // check cruise fishing operations
+ checkCruise(cruise);
File basedir = new File(context.getConfig().newTempFile(
"exportCruise"), "exportCruise-" + cruiseId);
TuttiIOUtil.forceMkdir(basedir, "Could not create directory");
- File surveyFile = new File(basedir, "survey.csv");
- exportSurvey(surveyFile, cruise);
- File operationFile = new File(basedir, "operation.csv");
- exportOperations(operationFile, cruise, operations);
+ ExportContext exportContext = createExportContext(basedir);
- File parameterFile = new File(basedir, "parameter.csv");
- exportParameters(parameterFile, cruise, operations);
+ try {
+ exportCruise(cruise, exportContext);
+ TuttiIOUtil.close(exportContext, "Could not close export context");
-// File catchesFile = new File(basedir, "catch.csv");
-// exportCatches(catchesFile, cruise, operations);
+ TuttiIOUtil.zip(basedir, exportFile, "Could not create export zip");
+ } finally {
+ IOUtils.closeQuietly(exportContext);
+ }
+ }
- TuttiIOUtil.zip(basedir, exportFile, "Could not create export zip");
+ protected ExportContext createExportContext(File basedir) {
+ return new ExportContext(
+ basedir,
+ csvSeparator,
+ decoratorService,
+ verticalOpeningCaracteristic,
+ horizontalOpeningWingCaracteristic,
+ horizontalOpeningDoorCaracteristic);
}
- public void exportSurvey(File file, Cruise cruise) {
+ protected void checkCruise(Cruise cruise) {
+ Preconditions.checkNotNull(cruise);
- if (log.isInfoEnabled()) {
- log.info("Will export survey to file: " + file);
+ // check cruise fishing operations
+ Map<String, String> errors =
+ tuttiWeightComputingService.checkCruise(cruise.getId());
+
+ if (MapUtils.isNotEmpty(errors)) {
+
+ // there is some fishing operations with some errors
+
+ Decorator<Cruise> cruiseDecorator =
+ decoratorService.getDecoratorByType(Cruise.class);
+
+ Decorator<FishingOperation> fishingOperationDecorator =
+ decoratorService.getDecoratorByType(FishingOperation.class);
+ StringBuilder sb = new StringBuilder();
+ for (Map.Entry<String, String> entry : errors.entrySet()) {
+ String fishingOperationId = entry.getKey();
+ FishingOperation fishingOperation = persistenceService.getFishingOperation(fishingOperationId);
+ String fishingOperationStr = fishingOperationDecorator.toString(fishingOperation);
+ sb.append(_("tutti.service.export.invalid.fishingOperation", fishingOperationStr, entry.getValue()));
+ }
+ String cruiseStr = cruiseDecorator.toString(cruise);
+ throw new TuttiBusinessException(
+ _("tutti.service.export.invalid.cruise", cruiseStr, sb.toString()));
}
+ }
- BufferedWriter writer = null;
+ protected void exportCruise(Cruise cruise,
+ ExportContext exportContext) {
+
+ List<FishingOperation> operations =
+ persistenceService.getAllFishingOperation(cruise.getId());
+
+ exportSurvey(exportContext, cruise);
+
+ exportOperations(exportContext, cruise, operations);
+
+ exportParameters(exportContext, cruise, operations);
+
+ exportCatches(exportContext, cruise, operations);
+ }
+
+ protected void exportSurvey(ExportContext exportContext,
+ Cruise cruise) {
try {
- writer = Files.newWriter(file, Charsets.UTF_8);
- SurveyExportModel model = new SurveyExportModel(csvSeparator);
-
List<SurveyExportRow> rows = Lists.newArrayList();
- model.prepareRows(rows, cruise);
+ exportContext.surveyModel.prepareRows(rows, cruise, country);
- Export export = Export.newExport(model, rows);
- export.write(writer);
- writer.close();
+ exportContext.surveyExport.write(rows, exportContext.surveyWriter);
} catch (Exception e) {
throw new TuttiTechnicalException(
- "Could not export survey to file: " + file, e);
- } finally {
- IOUtils.closeQuietly(writer);
+ "Could not export survey.", e);
}
}
- public void exportOperations(File file,
- Cruise cruise,
- List<FishingOperation> operations) {
+ protected void exportOperations(ExportContext exportContext,
+ Cruise cruise,
+ List<FishingOperation> operations) {
+ try {
- if (log.isInfoEnabled()) {
- log.info("Will export operations to file: " + file);
+ List<OperationExportRow> rows = Lists.newArrayList();
+ exportContext.operationModel.prepareRows(rows, cruise, operations);
+ exportContext.operationExport.write(rows, exportContext.operationWriter);
+ } catch (Exception e) {
+ throw new TuttiTechnicalException(
+ "Could not export operations.", e);
}
+ }
- BufferedWriter writer = null;
+ protected void exportParameters(ExportContext exportContext,
+ Cruise cruise,
+ List<FishingOperation> operations) {
+
try {
- writer = Files.newWriter(file, Charsets.UTF_8);
- OperationExportModel model =
- new OperationExportModel(
- csvSeparator,
- verticalOpeningCaracteristic,
- horizontalOpeningWingCaracteristic,
- horizontalOpeningDoorCaracteristic);
+ for (FishingOperation operation : operations) {
+ List<ParameterExportRow> rows = Lists.newArrayList();
+ exportContext.parameterModel.prepareRows(rows, cruise, operation);
+ exportContext.parameterExport.write(rows, exportContext.parameterWriter);
+ }
- List<OperationExportRow> rows = Lists.newArrayList();
- model.prepareRows(rows, cruise, operations);
-
- Export export = Export.newExport(model, rows);
- export.write(writer);
- writer.close();
} catch (Exception e) {
throw new TuttiTechnicalException(
- "Could not export operations to file: " + file, e);
- } finally {
- IOUtils.closeQuietly(writer);
+ "Could not export parameters.", e);
}
}
- public void exportParameters(File file,
+ protected void exportCatches(ExportContext exportContext,
Cruise cruise,
List<FishingOperation> operations) {
- if (log.isInfoEnabled()) {
- log.info("Will export parameters to file: " + file);
- }
-
- BufferedWriter writer = null;
try {
- writer = Files.newWriter(file, Charsets.UTF_8);
- ParameterExportModel model =
- new ParameterExportModel(csvSeparator,
- decoratorService);
+ for (FishingOperation operation : operations) {
- TuttiCsvUtil.TuttiRepeatableExport<ParameterExportRow> export =
- TuttiCsvUtil.newRepeatableExport(model);
+ BatchContainer<SpeciesBatch> rootSpeciesBatch =
+ persistenceService.getRootSpeciesBatch(operation.getId());
- for (FishingOperation operation : operations) {
- List<ParameterExportRow> rows = Lists.newArrayList();
- model.prepareRows(rows, cruise, operation);
- export.write(rows, writer);
+ BatchContainer<BenthosBatch> rootBenthosBatch =
+ persistenceService.getRootBenthosBatch(operation.getId());
+
+ List<CatchExportRow> rows = Lists.newArrayList();
+ exportContext.catchModel.prepareRows(rows,
+ cruise,
+ operation,
+ rootSpeciesBatch,
+ rootBenthosBatch);
+// exportContext.catchExport.write(rows, exportContext.catchWriter);
}
- writer.close();
} catch (Exception e) {
throw new TuttiTechnicalException(
- "Could not export parameters to file: " + file, e);
- } finally {
- IOUtils.closeQuietly(writer);
+ "Could not export catches.", e);
}
}
- public void exportCatches(File file,
- Cruise cruise,
- List<FishingOperation> operations) {
+ protected static class ExportContext implements Closeable {
- if (log.isInfoEnabled()) {
- log.info("Will export catches to file: " + file);
- }
+ File surveyFile;
- BufferedWriter writer = null;
- try {
- writer = Files.newWriter(file, Charsets.UTF_8);
+ File operationFile;
- CatchExportModel model = new CatchExportModel(csvSeparator);
+ File parameterFile;
- TuttiCsvUtil.TuttiRepeatableExport<CatchExportRow> export =
- TuttiCsvUtil.newRepeatableExport(model);
+ File catchFile;
- for (FishingOperation operation : operations) {
+ BufferedWriter surveyWriter;
- BatchContainer<SpeciesBatch> rootSpeciesBatch =
- persistenceService.getRootSpeciesBatch(operation.getId());
+ BufferedWriter operationWriter;
- List<CatchExportRow> rows = Lists.newArrayList();
- model.prepareRows(rows, cruise, operation, rootSpeciesBatch);
- export.write(rows, writer);
+ BufferedWriter parameterWriter;
+
+ BufferedWriter catchWriter;
+
+ SurveyExportModel surveyModel;
+
+ OperationExportModel operationModel;
+
+ ParameterExportModel parameterModel;
+
+ CatchExportModel catchModel;
+
+ TuttiCsvUtil.TuttiRepeatableExport<SurveyExportRow> surveyExport;
+
+ TuttiCsvUtil.TuttiRepeatableExport<OperationExportRow> operationExport;
+
+ TuttiCsvUtil.TuttiRepeatableExport<ParameterExportRow> parameterExport;
+
+ TuttiCsvUtil.TuttiRepeatableExport<CatchExportRow> catchExport;
+
+ ExportContext(File basedir,
+ char csvSeparator,
+ DecoratorService decoratorService,
+ Caracteristic verticalOpeningCaracteristic,
+ Caracteristic horizontalOpeningWingCaracteristic,
+ Caracteristic horizontalOpeningDoorCaracteristic) {
+
+ try {
+
+ surveyFile = new File(basedir, "survey.csv");
+ surveyWriter = Files.newWriter(surveyFile, Charsets.UTF_8);
+
+ operationFile = new File(basedir, "operation.csv");
+ operationWriter = Files.newWriter(operationFile, Charsets.UTF_8);
+
+ parameterFile = new File(basedir, "parameter.csv");
+ parameterWriter = Files.newWriter(parameterFile, Charsets.UTF_8);
+
+ catchFile = new File(basedir, "catch.csv");
+ catchWriter = Files.newWriter(catchFile, Charsets.UTF_8);
+
+ } catch (FileNotFoundException e) {
+
+ // should never happen
+ throw new TuttiTechnicalException(
+ "Could not create writer for export", e);
}
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(
- "Could not export catches to file: " + file, e);
- } finally {
- IOUtils.closeQuietly(writer);
+ surveyModel = new SurveyExportModel(csvSeparator);
+
+ operationModel =
+ new OperationExportModel(
+ csvSeparator,
+ verticalOpeningCaracteristic,
+ horizontalOpeningWingCaracteristic,
+ horizontalOpeningDoorCaracteristic);
+
+ parameterModel = new ParameterExportModel(
+ csvSeparator, decoratorService);
+ catchModel = new CatchExportModel(csvSeparator);
+
+ surveyExport = TuttiCsvUtil.newRepeatableExport(
+ surveyModel);
+
+ operationExport = TuttiCsvUtil.newRepeatableExport(
+ operationModel);
+
+ parameterExport = TuttiCsvUtil.newRepeatableExport(
+ parameterModel);
+
+ catchExport = TuttiCsvUtil.newRepeatableExport(catchModel);
}
+
+ @Override
+ public void close() throws IOException {
+ IOUtils.closeQuietly(surveyWriter);
+ IOUtils.closeQuietly(operationWriter);
+ IOUtils.closeQuietly(parameterWriter);
+ IOUtils.closeQuietly(catchWriter);
+ }
}
}
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 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-04-15 14:48:55 UTC (rev 777)
@@ -1,6 +1,7 @@
tutti.config.option.basedir.description=Répertoire principale
tutti.config.option.csv.separator.description=Caractère séparateur pour les import / export de fichier au format csv.
tutti.config.option.data.directory.description=Répertoire de données de l'application. Vous pouvez utiliser l'expression ${tutti.data.directory} pour le référence dans d'autres propriétés de configuration (ex\: ${tutti.data.directory}/tmp).
+tutti.config.option.export.countryId.description=L'id du pays à utiliser pour les exports (il s'agit de la valeur LOCATION.ID).
tutti.config.option.inceptionYear.description=Année de démarrage du projet.
tutti.config.option.organizationName.description=Nom de l'organisation dans la licence
tutti.config.option.site.url.description=Url du site internet de l'application
@@ -43,7 +44,7 @@
tutti.propety.no.vessel.name=Nom inconnu
tutti.propety.no.zone=Pas de zone
tutti.propety.vessel.nation.registrationCode=%s (nat.)
-tutti.service.catches.computeWeights.error.incoherentBenthosTotalSorted=
+tutti.service.catches.computeWeights.error.incoherentBenthosTotalSorted=Le poids total Vrac du benthos est inférieur à la somme des poids Vrac triés, inerte trié et vivant non détaillé trié
tutti.service.catches.computeWeights.error.incoherentCategoryWeight=Le poids total des mensurations est supérieur au poids de la catégorie
tutti.service.catches.computeWeights.error.incoherentMarineLitterTotal=Le poids total des macro-déchets est inférieur à la somme des poids des macro-déchets saisis
tutti.service.catches.computeWeights.error.incoherentParentCategoryWeight=Le poids de la catégorie est différent de la somme des poids de ses sous-catégories
@@ -52,6 +53,8 @@
tutti.service.catches.computeWeights.error.incoherentSampleWeight=Le poids de sous-échantillonage est supérieur au poids de la catégorie
tutti.service.catches.computeWeights.error.incoherentSpeciesTotalSorted=Le poids total Vrac des espèces est inférieur à la somme des poids Vrac triés, inerte trié et vivant non détaillé trié
tutti.service.catches.computeWeights.error.incoherentTotal=Le poids total de la capture ne correspond pas à la somme des poids totaux Vrac, Hors Vrac et non triés
+tutti.service.export.invalid.cruise=L'export de la campagne %s ne peut pas être réalisé suite aux erreurs rencontrées sur ses traits lors de l'élévation des poids \:\n%s
+tutti.service.export.invalid.fishingOperation=L'élévation des poids ne peut pas être réalisé sur le trait %s, pour la raison suivante %s
tutti.validator.error.comment.too.long=Taille de commentaire trop longue (limitée à %s caractères)
tutti.validator.error.cruise.beginDate.required=La date de début est obligatoire
tutti.validator.error.cruise.dates.endBeforeStart=La date de fin doit être après la date de début
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-04-15 10:40:39 UTC (rev 776)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-04-15 14:48:55 UTC (rev 777)
@@ -42,6 +42,7 @@
import fr.ifremer.tutti.service.AbstractServiceTest;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiServiceContext;
+import fr.ifremer.tutti.service.catches.TuttiWeightComputingService;
import fr.ifremer.tutti.service.config.TuttiServiceConfig;
import org.apache.commons.io.Charsets;
import org.apache.commons.lang3.time.DateUtils;
@@ -68,6 +69,10 @@
protected TuttiExportService service;
+ protected List<TuttiLocation> countries;
+
+ protected Program program;
+
protected Cruise cruise;
protected List<FishingOperation> operations;
@@ -84,6 +89,10 @@
createCaracteristics();
+ countries = createCountries();
+
+ program = createProgram();
+
cruise = createCruise();
operations = createOperations(cruise);
@@ -95,7 +104,10 @@
Mockito.when(persistenceService.getVerticalOpeningCaracteristic()).thenReturn(caracteristicVerticalOpening);
Mockito.when(persistenceService.getHorizontalOpeningDoorCaracteristic()).thenReturn(caracteristicHorizontalOpeningDoor);
Mockito.when(persistenceService.getHorizontalOpeningWingCaracteristic()).thenReturn(caracteristicHorizontalOpeningWing);
+ Mockito.when(persistenceService.getProgram(Mockito.<String>any())).thenReturn(program);
Mockito.when(persistenceService.getCruise(Mockito.<String>any())).thenReturn(cruise);
+ Mockito.when(persistenceService.getAllCruise(Mockito.<String>any())).thenReturn(Lists.newArrayList(cruise));
+ Mockito.when(persistenceService.getAllCountry()).thenReturn(countries);
Mockito.when(persistenceService.getAllFishingOperation(Mockito.<String>any())).thenReturn(operations);
TuttiServiceContext serviceContextSpy = Mockito.spy(serviceContext);
@@ -104,91 +116,132 @@
service = Mockito.mock(TuttiExportService.class, Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS));
service.setServiceContext(serviceContextSpy);
+
+ TuttiWeightComputingService tuttiWeightComputingService = Mockito.mock(
+ TuttiWeightComputingService.class,
+ Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS));
+ tuttiWeightComputingService.setServiceContext(serviceContextSpy);
+ service.tuttiWeightComputingService = tuttiWeightComputingService;
+
+
}
@Test
- public void exportCruise() throws Exception {
+ public void exportProgram() throws Exception {
- File exportFile = new File(datadirectory, "exportCruise.zip");
+ File exportFile = new File(datadirectory, "exportProgram.zip");
Files.createParentDirs(exportFile);
Assert.assertFalse(exportFile.exists());
- service.exportCruise(cruise.getId(), exportFile);
+ service.exportProgram(cruise.getId(), exportFile);
Assert.assertTrue(exportFile.exists());
}
@Test
- public void exportSurvey() throws Exception {
+ public void exportCruise() throws Exception {
- File exportFile = new File(datadirectory, "exportSurvey.csv");
+ File exportFile = new File(datadirectory, "exportCruise.zip");
Files.createParentDirs(exportFile);
Assert.assertFalse(exportFile.exists());
- service.exportSurvey(exportFile, cruise);
+ service.exportCruise(cruise.getId(), exportFile);
Assert.assertTrue(exportFile.exists());
+ }
+ @Test
+ public void exportSurvey() throws Exception {
+
+ TuttiExportService.ExportContext exportContext =
+ service.createExportContext(datadirectory);
+
+ try {
+ service.exportSurvey(exportContext, cruise);
+ } finally {
+ exportContext.close();
+ }
+ Assert.assertTrue(exportContext.surveyFile.exists());
+ Assert.assertEquals(Files.readLines(exportContext.surveyFile, Charsets.UTF_8).size(), 1 + 1);
+
if (log.isInfoEnabled()) {
log.info("Survey export:\n" +
- Files.toString(exportFile, Charsets.UTF_8));
+ Files.toString(exportContext.surveyFile, Charsets.UTF_8));
}
}
@Test
public void exportOperations() throws Exception {
- File exportFile = new File(datadirectory, "exportOperations.csv");
+ TuttiExportService.ExportContext exportContext =
+ service.createExportContext(datadirectory);
- Files.createParentDirs(exportFile);
+ try {
+ service.exportOperations(exportContext, cruise, operations);
+ } finally {
+ exportContext.close();
+ }
+ Assert.assertTrue(exportContext.operationFile.exists());
+ Assert.assertEquals(Files.readLines(exportContext.operationFile, Charsets.UTF_8).size(), operations.size() + 1);
- Assert.assertFalse(exportFile.exists());
-
- service.exportOperations(exportFile, cruise, operations);
- Assert.assertTrue(exportFile.exists());
-
if (log.isInfoEnabled()) {
log.info("Operation export:\n" +
- Files.toString(exportFile, Charsets.UTF_8));
+ Files.toString(exportContext.operationFile, Charsets.UTF_8));
}
}
@Test
public void exportParameters() throws Exception {
- File exportFile = new File(datadirectory, "exportParameters.csv");
+ TuttiExportService.ExportContext exportContext =
+ service.createExportContext(datadirectory);
- Files.createParentDirs(exportFile);
+ try {
+ service.exportParameters(exportContext, cruise, operations);
+ } finally {
+ exportContext.close();
+ }
+ Assert.assertTrue(exportContext.parameterFile.exists());
+ Assert.assertEquals(Files.readLines(exportContext.parameterFile, Charsets.UTF_8).size(), 1 + operations.size() * 7);
- Assert.assertFalse(exportFile.exists());
-
- service.exportParameters(exportFile, cruise, operations);
- Assert.assertTrue(exportFile.exists());
-
if (log.isInfoEnabled()) {
log.info("Parameter export:\n" +
- Files.toString(exportFile, Charsets.UTF_8));
+ Files.toString(exportContext.parameterFile, Charsets.UTF_8));
}
}
//TODO
public void exportCatches() throws Exception {
- File exportFile = new File(datadirectory, "exportCatches.csv");
+ TuttiExportService.ExportContext exportContext =
+ service.createExportContext(datadirectory);
- Files.createParentDirs(exportFile);
-
- Assert.assertFalse(exportFile.exists());
-
+ try {
+ service.exportCatches(exportContext, cruise, operations);
+ } finally {
+ exportContext.close();
+ }
+ Assert.assertTrue(exportContext.catchFile.exists());
+ Assert.assertEquals(Files.readLines(exportContext.catchFile, Charsets.UTF_8).size(), 2);
if (log.isInfoEnabled()) {
log.info("Catch export:\n" +
- Files.toString(exportFile, Charsets.UTF_8));
+ Files.toString(exportContext.catchFile, Charsets.UTF_8));
}
}
- private Cruise createCruise() {
+ private List<TuttiLocation> createCountries() {
+ List<TuttiLocation> result = Lists.newArrayList();
+ TuttiLocation country = TuttiBeanFactory.newTuttiLocation();
+ country.setId(serviceContext.getConfig().getExportCountryId());
+ country.setName("CountryName");
+ country.setLabel("CountryLabel");
+ result.add(country);
+ return result;
+ }
+
+ private Program createProgram() {
TuttiLocation programZone = TuttiBeanFactory.newTuttiLocation();
programZone.setId(0);
programZone.setName("ProgramZoneName");
@@ -208,7 +261,21 @@
program.setId(1);
program.setName("ProgramName");
program.setZone(programZone);
+ return program;
+ }
+ private Cruise createCruise() {
+
+ TuttiLocation departureLocation = TuttiBeanFactory.newTuttiLocation();
+ departureLocation.setId(1);
+ departureLocation.setName("DepartureLocationName");
+ departureLocation.setLabel("DepartureLocationLabel");
+
+ TuttiLocation returnLocation = TuttiBeanFactory.newTuttiLocation();
+ returnLocation.setId(2);
+ returnLocation.setName("ReturnLocationName");
+ returnLocation.setLabel("ReturnLocationLabel");
+
Cruise cruise = TuttiBeanFactory.newCruise();
cruise.setId(2);
cruise.setName("CruiseName");
1
0
Author: cbonnet
Date: 2013-04-15 12:40:39 +0200 (Mon, 15 Apr 2013)
New Revision: 776
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/776
Log:
Pr?\195?\169cision sur le lien pour obtenir les ports
Modified:
trunk/src/site/rst/mapping.rst
Modified: trunk/src/site/rst/mapping.rst
===================================================================
--- trunk/src/site/rst/mapping.rst 2013-04-15 10:29:12 UTC (rev 775)
+++ trunk/src/site/rst/mapping.rst 2013-04-15 10:40:39 UTC (rev 776)
@@ -64,10 +64,10 @@
En écriture : valeur dupliquée pour chaque engin (voir "Engin(s)" ci-dessous) dans ScientificCruise.fishingTrip.gearPhysicalFeatures.gearPhysicalMeasurement.numericalvalue (GEAR_PHYSICAL_MEASURMENT.NUMERICAL_VALUE avec PMFM_FK=<PMFM_ID_MULTIRIG_NUMBER>)
Port de départ
- ScientificCruise.fishingTrip.departureLocation (FISHING_TRIP.DEPARTURE_LOCATION_FK)
+ ScientificCruise.fishingTrip.departureLocation (FISHING_TRIP.DEPARTURE_LOCATION_FK) avec le lien avec la campagne via SCIENTIFIC_CRUISE_FK)
Port d'arrivée
- ScientificCruise.fishingTrip.returnLocation (FISHING_TRIP.RETURN_LOCATION_FK)
+ ScientificCruise.fishingTrip.returnLocation (FISHING_TRIP.RETURN_LOCATION_FK) avec le lien avec la campagne via SCIENTIFIC_CRUISE_FK)
Date de début
ScientificCruise.departureDateTime (SCIENTIFIC_CRUISE.DEPARTURE_DATE_TIME)
1
0
Author: cbonnet
Date: 2013-04-15 12:29:12 +0200 (Mon, 15 Apr 2013)
New Revision: 775
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/775
Log:
MAJ pour tenir compte des ?\195?\169volutions du mod?\195?\168le (taxon) et de l'utilisation des ports
Modified:
trunk/src/site/rst/referential.rst
Modified: trunk/src/site/rst/referential.rst
===================================================================
--- trunk/src/site/rst/referential.rst 2013-04-13 20:11:56 UTC (rev 774)
+++ trunk/src/site/rst/referential.rst 2013-04-15 10:29:12 UTC (rev 775)
@@ -61,6 +61,12 @@
+-----------------------------------------------------+-------+-----------------------------------------------------+
| [REF-11] Catégorie Maturité | OK | |
+-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-12] Liste des espèces | OK | A vérifier |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-13] Liste des espèces vernaculaires | OK | A vérifier |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-14] Liste des ports | OK | A vérifier |
++-----------------------------------------------------+-------+-----------------------------------------------------+
[REF-01] Liste des strates / sous-strates / localités
-----------------------------------------------------
@@ -226,6 +232,78 @@
*État:* Valide.
+
+[REF-12] Liste des espèces
+--------------------------
+
+::
+
+ SELECT
+ t.id,
+ t.reference_taxon_fk,
+ t.complete_name,
+ ti.external_code as "code rubin",
+ t.is_referent
+ FROM
+ taxon_name t
+ LEFT JOIN transcribing_item ti on t.reference_taxon_fk = ti.object_id
+ LEFT JOIN transcribing_item_type tt on ti.transcribing_item_type_fk = tt.id
+ and tt.name = 'TAXINOMIE-REFTAX.MNEMONIQUE'
+
+NB :
+- mettre tt.name en paramètre car ça pourrait changer
+- il faut partir du modèle mis à jour pour la V2 (les tables transcribing ont évolué)
+
+*État:* A valider (transformer les requêtes SQL).
+
+
+[REF-13] Liste des espèces vernaculaires
+-------------------------------------------
+
+::
+
+ SELECT
+ t.id,
+ t.reference_taxon_fk,
+ t.complete_name,
+ ti.external_code as "nom vernaculaire",
+ t.is_referent
+ FROM
+ taxon_name t
+ LEFT JOIN transcribing_item ti on t.reference_taxon_fk = ti.object_id
+ LEFT JOIN transcribing_item_type tt on ti.transcribing_item_type_fk = tt.id
+ and tt.name = 'TAXINOMIE-COMMUN.NOM_VERNACULAIRE'
+
+NB :
+- mettre tt.name en paramètre car ça pourrait changer
+- il faut partir du modèle mis à jour pour la V2 (les tables transcribing ont évolué)
+
+*État:* A valider (transformer les requêtes SQL).
+
+
+[REF-14] Liste des ports
+------------------------------------------------
+
+::
+
+ SELECT
+ l.id,
+ l.label,
+ l.name,
+ l.status
+ FROM location l
+ WHERE l.location_level_fk = :locationLevelId)
+ AND l.status.code IN (:statusValidCode, :statusTemporaryCode)
+
+Paramètres :
+
+- :locationLevelId = *LocationLevelId.PORT*
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
+
+*État:* À Valider et définir la variable LocationLevelId.PORT.
+
+
Les requètes techniques
~~~~~~~~~~~~~~~~~~~~~~~
1
0
r774 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service tutti-service/src/main/java/fr/ifremer/tutti/service
by tchemit@users.forge.codelutin.com 13 Apr '13
by tchemit@users.forge.codelutin.com 13 Apr '13
13 Apr '13
Author: tchemit
Date: 2013-04-13 22:11:56 +0200 (Sat, 13 Apr 2013)
New Revision: 774
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/774
Log:
add dummy id on created bean + fix import)
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java 2013-04-13 20:11:56 UTC (rev 774)
@@ -34,6 +34,7 @@
import org.springframework.stereotype.Service;
import java.util.List;
+import java.util.UUID;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -63,6 +64,7 @@
Preconditions.checkNotNull(bean);
Preconditions.checkState(TuttiEntities.isNew(bean));
// TODO
+ bean.setId(UUID.randomUUID().toString());
return bean;
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java 2013-04-13 20:11:56 UTC (rev 774)
@@ -34,6 +34,7 @@
import org.springframework.stereotype.Service;
import java.util.List;
+import java.util.UUID;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -63,6 +64,7 @@
Preconditions.checkNotNull(bean);
Preconditions.checkState(TuttiEntities.isNew(bean));
// TODO
+ bean.setId(UUID.randomUUID().toString());
return bean;
}
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 2013-04-13 20:09:01 UTC (rev 773)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-04-13 20:11:56 UTC (rev 774)
@@ -61,7 +61,6 @@
import org.apache.commons.logging.LogFactory;
import org.apache.commons.vfs2.AllFileSelector;
import org.apache.commons.vfs2.FileObject;
-import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.io.IOException;
@@ -825,19 +824,16 @@
}
@Override
- @Transactional(readOnly = false)
public IndividualObservationBatch createIndividualObservationBatch(IndividualObservationBatch bean) {
return driver.createIndividualObservationBatch(bean);
}
@Override
- @Transactional(readOnly = false)
public IndividualObservationBatch saveIndividualObservationBatch(IndividualObservationBatch bean) {
return driver.saveIndividualObservationBatch(bean);
}
@Override
- @Transactional(readOnly = false)
public void deleteIndividualObservationBatch(String id) {
driver.deleteIndividualObservationBatch(id);
}
1
0
13 Apr '13
Author: tchemit
Date: 2013-04-13 22:09:01 +0200 (Sat, 13 Apr 2013)
New Revision: 773
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/773
Log:
reformat codes + optimize imports
introduce BenthosBatch (to avoid reusage of speciesBatch where we should not)
refs #1866: [CAPTURE] - Captures accidentelles (ajout du service de persistence non encore implant?\195?\169)
refs #1867: [CAPTURE] - Observations individuelles (ajout du service de persistence non encore implant?\195?\169)
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
trunk/tutti-service/src/main/resources/fr/ifremer/tutti/persistence/entities/data/BenthosBatch-error-validation.xml
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-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/BatchPersistenceHelper.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceReadTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceReadTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceWriteTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceWriteTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.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/TuttiDataContext.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDecorator.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ParameterExportRow.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/pupitri/TuttiPupitriImportExportService.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/BeanValidatorDetectorTest.java
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
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/EditCatchesUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyRowModel.java
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/split/SplitBenthosBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
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/split/SplitSpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/AbstractCaracteristicTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/ExportPupitriAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/attachment/AttachmentEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -27,9 +27,12 @@
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
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.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
@@ -497,13 +500,13 @@
//-- Benthos Batch methods --//
//------------------------------------------------------------------------//
- BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId);
+ BatchContainer<BenthosBatch> getRootBenthosBatch(String fishingOperationId);
@Transactional(readOnly = false)
- SpeciesBatch createBenthosBatch(SpeciesBatch bean, String parentBatchId);
+ BenthosBatch createBenthosBatch(BenthosBatch bean, String parentBatchId);
@Transactional(readOnly = false)
- SpeciesBatch saveBenthosBatch(SpeciesBatch bean);
+ BenthosBatch saveBenthosBatch(BenthosBatch bean);
@Transactional(readOnly = false)
void deleteBenthosBatch(String id);
@@ -521,22 +524,22 @@
* @return the list of frequencies for the given specues batch id
* @since 1.0
*/
- List<SpeciesBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId);
+ List<BenthosBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId);
/**
- * Save all given {@link SpeciesBatchFrequency} into the given
+ * Save all given {@link BenthosBatchFrequency} into the given
* {@code benthosBatchId}. If some are not existing then creates them.
* <p/>
* <strong>Note:</strong> This will as a side effect remove all previous frequency for this species batch.
*
- * @param benthosBatchId id of the {@link SpeciesBatch} to use
+ * @param benthosBatchId id of the {@link BenthosBatch} to use
* @param frequencies list of frequencies to create or update
* @return the persisted list of frequencies
* @since 1.0
*/
@Transactional(readOnly = false)
- List<SpeciesBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
- List<SpeciesBatchFrequency> frequencies);
+ List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
+ List<BenthosBatchFrequency> frequencies);
//------------------------------------------------------------------------//
//-- Plancton Batch methods --//
@@ -544,8 +547,6 @@
List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId);
- PlanktonBatch getPlanktonBatch(String id);
-
@Transactional(readOnly = false)
PlanktonBatch createPlanktonBatch(PlanktonBatch bean);
@@ -581,13 +582,11 @@
void deleteMarineLitterBatch(String id);
//------------------------------------------------------------------------//
- //-- Accidentel Batch methods --//
+ //-- Accidental Batch methods --//
//------------------------------------------------------------------------//
List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId);
- AccidentalBatch getAccidentalBatch(String id);
-
@Transactional(readOnly = false)
AccidentalBatch createAccidentalBatch(AccidentalBatch bean);
@@ -596,4 +595,19 @@
@Transactional(readOnly = false)
void deleteAccidentalBatch(String id);
+
+ //------------------------------------------------------------------------//
+ //-- IndividualObservation Batch methods --//
+ //------------------------------------------------------------------------//
+
+ List<IndividualObservationBatch> getAllIndividualObservationBatch(String fishingOperationId);
+
+ @Transactional(readOnly = false)
+ IndividualObservationBatch createIndividualObservationBatch(IndividualObservationBatch bean);
+
+ @Transactional(readOnly = false)
+ IndividualObservationBatch saveIndividualObservationBatch(IndividualObservationBatch bean);
+
+ @Transactional(readOnly = false)
+ void deleteIndividualObservationBatch(String id);
}
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -30,9 +30,12 @@
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
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.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
@@ -53,6 +56,7 @@
import fr.ifremer.tutti.persistence.service.CatchBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.CruisePersistenceService;
import fr.ifremer.tutti.persistence.service.FishingOperationPersistenceService;
+import fr.ifremer.tutti.persistence.service.IndividualObservationBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.MarineLitterBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.PlanktonBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.ProgramPersistenceService;
@@ -111,6 +115,9 @@
protected AccidentalBatchPersistenceService accidentalBatchService;
@Autowired
+ protected IndividualObservationBatchPersistenceService individualObservationBatchService;
+
+ @Autowired
protected ProtocolPersistenceService protocolService;
@Autowired
@@ -144,6 +151,7 @@
planktonBatchService.init();
marineLitterBatchService.init();
accidentalBatchService.init();
+ individualObservationBatchService.init();
protocolService.init();
attachmentService.init();
}
@@ -164,6 +172,7 @@
planktonBatchService.close();
marineLitterBatchService.close();
accidentalBatchService.close();
+ individualObservationBatchService.close();
protocolService.close();
attachmentService.close();
TuttiPersistenceServiceLocator.close();
@@ -604,17 +613,17 @@
//------------------------------------------------------------------------//
@Override
- public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
+ public BatchContainer<BenthosBatch> getRootBenthosBatch(String fishingOperationId) {
return benthosBatchService.getRootBenthosBatch(fishingOperationId);
}
@Override
- public SpeciesBatch createBenthosBatch(SpeciesBatch bean, String parentBatchId) {
+ public BenthosBatch createBenthosBatch(BenthosBatch bean, String parentBatchId) {
return benthosBatchService.createBenthosBatch(bean, parentBatchId);
}
@Override
- public SpeciesBatch saveBenthosBatch(SpeciesBatch bean) {
+ public BenthosBatch saveBenthosBatch(BenthosBatch bean) {
return benthosBatchService.saveBenthosBatch(bean);
}
@@ -634,13 +643,13 @@
}
@Override
- public List<SpeciesBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
+ public List<BenthosBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
return benthosBatchService.getAllBenthosBatchFrequency(benthosBatchId);
}
@Override
- public List<SpeciesBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
- List<SpeciesBatchFrequency> frequencies) {
+ public List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
+ List<BenthosBatchFrequency> frequencies) {
return benthosBatchService.saveBenthosBatchFrequency(benthosBatchId, frequencies);
}
@@ -654,11 +663,6 @@
}
@Override
- public PlanktonBatch getPlanktonBatch(String id) {
- return planktonBatchService.getPlanktonBatch(id);
- }
-
- @Override
public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) {
return planktonBatchService.createPlanktonBatch(bean);
}
@@ -707,11 +711,6 @@
}
@Override
- public AccidentalBatch getAccidentalBatch(String id) {
- return accidentalBatchService.getAccidentalBatch(id);
- }
-
- @Override
public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) {
return accidentalBatchService.createAccidentalBatch(bean);
}
@@ -727,8 +726,26 @@
}
//------------------------------------------------------------------------//
- //-- Internal methods --//
+ //-- IndividualObservation Batch methods --//
//------------------------------------------------------------------------//
+ @Override
+ public List<IndividualObservationBatch> getAllIndividualObservationBatch(String fishingOperationId) {
+ return individualObservationBatchService.getAllIndividualObservationBatch(fishingOperationId);
+ }
+ @Override
+ public IndividualObservationBatch createIndividualObservationBatch(IndividualObservationBatch bean) {
+ return individualObservationBatchService.createIndividualObservationBatch(bean);
+ }
+
+ @Override
+ public IndividualObservationBatch saveIndividualObservationBatch(IndividualObservationBatch bean) {
+ return individualObservationBatchService.saveIndividualObservationBatch(bean);
+ }
+
+ @Override
+ public void deleteIndividualObservationBatch(String id) {
+ individualObservationBatchService.deleteIndividualObservationBatch(id);
+ }
}
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -27,9 +27,12 @@
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
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.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
@@ -402,17 +405,17 @@
}
@Override
- public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
+ public BatchContainer<BenthosBatch> getRootBenthosBatch(String fishingOperationId) {
throw new RuntimeException("method not implemented");
}
@Override
- public SpeciesBatch createBenthosBatch(SpeciesBatch bean, String parentBatchId) {
+ public BenthosBatch createBenthosBatch(BenthosBatch bean, String parentBatchId) {
throw new RuntimeException("method not implemented");
}
@Override
- public SpeciesBatch saveBenthosBatch(SpeciesBatch bean) {
+ public BenthosBatch saveBenthosBatch(BenthosBatch bean) {
throw new RuntimeException("method not implemented");
}
@@ -432,12 +435,12 @@
}
@Override
- public List<SpeciesBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
+ public List<BenthosBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
throw new RuntimeException("method not implemented");
}
@Override
- public List<SpeciesBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId, List<SpeciesBatchFrequency> frequencies) {
+ public List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId, List<BenthosBatchFrequency> frequencies) {
throw new RuntimeException("method not implemented");
}
@@ -447,11 +450,6 @@
}
@Override
- public PlanktonBatch getPlanktonBatch(String id) {
- throw new RuntimeException("method not implemented");
- }
-
- @Override
public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) {
throw new RuntimeException("method not implemented");
}
@@ -492,11 +490,6 @@
}
@Override
- public AccidentalBatch getAccidentalBatch(String id) {
- throw new RuntimeException("method not implemented");
- }
-
- @Override
public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) {
throw new RuntimeException("method not implemented");
}
@@ -536,7 +529,31 @@
throw new RuntimeException("method not implemented");
}
+ //------------------------------------------------------------------------//
+ //-- IndividualObservation Batch methods --//
+ //------------------------------------------------------------------------//
+
@Override
+ public List<IndividualObservationBatch> getAllIndividualObservationBatch(String fishingOperationId) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public IndividualObservationBatch createIndividualObservationBatch(IndividualObservationBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public IndividualObservationBatch saveIndividualObservationBatch(IndividualObservationBatch bean) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
+ public void deleteIndividualObservationBatch(String id) {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
public void init() {
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -57,8 +57,6 @@
import java.util.Properties;
import java.util.Set;
-import static org.nuiton.i18n.I18n._;
-
/**
* Usefull method around tutti entities.
*
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -41,8 +41,6 @@
List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId);
- AccidentalBatch getAccidentalBatch(String id);
-
@Transactional(readOnly = false)
AccidentalBatch createAccidentalBatch(AccidentalBatch bean);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,6 +26,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -50,6 +51,7 @@
@Override
public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) {
+ Preconditions.checkNotNull(fishingOperationId);
List<AccidentalBatch> result = Lists.newArrayList();
// TODO
@@ -57,23 +59,25 @@
}
@Override
- public AccidentalBatch getAccidentalBatch(String id) {
- return null;
- }
-
- @Override
public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) {
- return null;
+ Preconditions.checkNotNull(bean);
+ Preconditions.checkState(TuttiEntities.isNew(bean));
+ // TODO
+ return bean;
}
@Override
public AccidentalBatch saveAccidentalBatch(AccidentalBatch bean) {
- return null;
+ Preconditions.checkNotNull(bean);
+ Preconditions.checkState(!TuttiEntities.isNew(bean));
+ // TODO
+ return bean;
}
@Override
public void deleteAccidentalBatch(String id) {
Preconditions.checkNotNull(id);
+ // TODO
attachmentPersistenceService.deleteAllAttachment(Integer.valueOf(id));
}
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,15 +26,15 @@
import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
- * Service to persist *benthos* {@link SpeciesBatch}.
+ * Service to persist {@link BenthosBatch}.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.2
@@ -47,21 +47,21 @@
//------------------------------------------------------------------------//
/**
- * Get all root {@link SpeciesBatch} for the given fishing operation.
+ * Get all root {@link BenthosBatch} for the given fishing operation.
* <p/>
* <strong>Note:</strong> All childs of the batch should be loaded here.
*
* @param fishingOperationId if of the fishing operation to seek
- * @return the list of root {@link SpeciesBatch}
+ * @return the list of root {@link BenthosBatch}
* @since 1.0
*/
- BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId);
+ BatchContainer<BenthosBatch> getRootBenthosBatch(String fishingOperationId);
@Transactional(readOnly = false)
- SpeciesBatch createBenthosBatch(SpeciesBatch bean, String parentBatchId);
+ BenthosBatch createBenthosBatch(BenthosBatch bean, String parentBatchId);
@Transactional(readOnly = false)
- SpeciesBatch saveBenthosBatch(SpeciesBatch bean);
+ BenthosBatch saveBenthosBatch(BenthosBatch bean);
@Transactional(readOnly = false)
void deleteBenthosBatch(String id);
@@ -90,21 +90,21 @@
* @return the list of frequencies for the given benthos batch id
* @since 1.0
*/
- List<SpeciesBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId);
+ List<BenthosBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId);
/**
- * Save all given {@link SpeciesBatchFrequency} into the given
+ * Save all given {@link BenthosBatchFrequency} into the given
* {@code benthosBatchId}. If some are not existing then creates them.
* <p/>
* <strong>Note:</strong> This will as a side effect remove all previous
* frequency for this benthos batch.
*
- * @param benthosBatchId id of the {@link SpeciesBatch} to use
+ * @param benthosBatchId id of the {@link BenthosBatch} to use
* @param frequencies list of frequencies to create or update
* @return the persisted list of frequencies
* @since 1.0
*/
@Transactional(readOnly = false)
- List<SpeciesBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
- List<SpeciesBatchFrequency> frequencies);
+ List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
+ List<BenthosBatchFrequency> frequencies);
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,14 +26,25 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import fr.ifremer.adagio.core.dao.data.batch.Batch;
import fr.ifremer.adagio.core.dao.data.batch.CatchBatch;
import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
import fr.ifremer.adagio.core.dao.data.batch.SortingBatch;
+import fr.ifremer.adagio.core.dao.data.measure.QuantificationMeasurement;
+import fr.ifremer.adagio.core.dao.data.measure.SortingMeasurement;
+import fr.ifremer.adagio.core.dao.referential.QualityFlag;
+import fr.ifremer.adagio.core.dao.referential.QualityFlagImpl;
+import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxon;
+import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxonImpl;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicType;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.service.batch.BatchPersistenceHelper;
import org.apache.commons.logging.Log;
@@ -44,9 +55,11 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.text.MessageFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Set;
/**
* Default implementation of {@link BenthosBatchPersistenceService}.
@@ -79,7 +92,7 @@
//------------------------------------------------------------------------//
@Override
- public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
+ public BatchContainer<BenthosBatch> getRootBenthosBatch(String fishingOperationId) {
Preconditions.checkNotNull(fishingOperationId);
// Load batch tree
@@ -92,21 +105,21 @@
Collection<Batch> catchBatchChils = catchBatch.getChildBatchs();
// Vrac / Benthos
- SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch(
+ SortingBatch vracBenthosBatch = catchBatchDao.getSortingBatch(
catchBatchChils,
BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS,
BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED
);
- BatchContainer<SpeciesBatch> result = new BatchContainer<SpeciesBatch>();
- result.setId(vracSpeciesBatch.getId());
+ BatchContainer<BenthosBatch> result = new BatchContainer<BenthosBatch>();
+ result.setId(vracBenthosBatch.getId());
- for (Batch batch1 : vracSpeciesBatch.getChildBatchs()) {
+ for (Batch batch1 : vracBenthosBatch.getChildBatchs()) {
SortingBatch source = (SortingBatch) batch1;
- SpeciesBatch target = TuttiBeanFactory.newSpeciesBatch();
- batchHelper.entityToSpeciesBatch(source, target);
+ BenthosBatch target = TuttiBeanFactory.newBenthosBatch();
+ entityToBenthosBatch(source, target);
result.addChildren(target);
if (log.isInfoEnabled()) {
log.info("Loaded CatchBatch Vrac > Benthos > " + target.getSpecies().getReferenceTaxonId() + " : " + target.getId());
@@ -114,16 +127,16 @@
}
// Hors-Vrac / Benthos
- SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch(
+ SortingBatch horsVracBenthosBatch = catchBatchDao.getSortingBatch(
catchBatchChils,
BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS
);
- if (horsVracSpeciesBatch != null) {
- for (Batch batch : horsVracSpeciesBatch.getChildBatchs()) {
+ if (horsVracBenthosBatch != null) {
+ for (Batch batch : horsVracBenthosBatch.getChildBatchs()) {
- SpeciesBatch target = TuttiBeanFactory.newSpeciesBatch();
- batchHelper.entityToSpeciesBatch((SortingBatch) batch, target);
+ BenthosBatch target = TuttiBeanFactory.newBenthosBatch();
+ entityToBenthosBatch((SortingBatch) batch, target);
result.addChildren(target);
if (log.isInfoEnabled()) {
log.info("Loaded CatchBatch Hors Vrac > Benthos > " + target.getSpecies().getReferenceTaxonId() + " : " + target.getId());
@@ -134,7 +147,7 @@
}
@Override
- public SpeciesBatch createBenthosBatch(SpeciesBatch bean,
+ public BenthosBatch createBenthosBatch(BenthosBatch bean,
String parentBatchId) {
Preconditions.checkNotNull(bean);
Preconditions.checkArgument(bean.getId() == null);
@@ -161,7 +174,7 @@
}
@Override
- public SpeciesBatch saveBenthosBatch(SpeciesBatch bean) {
+ public BenthosBatch saveBenthosBatch(BenthosBatch bean) {
Preconditions.checkNotNull(bean);
Preconditions.checkNotNull(bean.getId());
@@ -217,12 +230,12 @@
}
//------------------------------------------------------------------------//
- //-- SpeciesBatchFrequency methods (for benthos) --//
+ //-- BenthosBatchFrequency methods (for benthos) --//
//------------------------------------------------------------------------//
@Override
- public List<SpeciesBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
- List<SpeciesBatchFrequency> results = Lists.newArrayList();
+ public List<BenthosBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
+ List<BenthosBatchFrequency> results = Lists.newArrayList();
Integer catchBatchId = catchBatchDao.getIdBySortingBatchId(Integer.valueOf(benthosBatchId));
if (catchBatchId == null) {
@@ -235,23 +248,23 @@
for (Batch batch : sortingBatch.getChildBatchs()) {
SortingBatch source = (SortingBatch) batch;
- SpeciesBatchFrequency target = TuttiBeanFactory.newSpeciesBatchFrequency();
+ BenthosBatchFrequency target = TuttiBeanFactory.newBenthosBatchFrequency();
- batchHelper.entityToSpeciesBatchFrequency(source, target);
+ entityToBenthosBatchFrequency(source, target);
results.add(target);
}
return Collections.unmodifiableList(results);
}
@Override
- public List<SpeciesBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
- List<SpeciesBatchFrequency> frequencies) {
+ public List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
+ List<BenthosBatchFrequency> frequencies) {
Preconditions.checkNotNull(benthosBatchId);
Preconditions.checkNotNull(frequencies);
// Check that all frequencies have the same length PMFM (before doing any db call)
String pmfmId = null;
- for (SpeciesBatchFrequency source : frequencies) {
+ for (BenthosBatchFrequency source : frequencies) {
if (pmfmId == null) {
pmfmId = source.getLengthStepCaracteristic().getId();
@@ -282,7 +295,7 @@
short rankOrder = 0;
List<SortingBatch> batchsToUpdate = Lists.newArrayList();
- for (SpeciesBatchFrequency source : frequencies) {
+ for (BenthosBatchFrequency source : frequencies) {
rankOrder++;
// Not existing batch
@@ -291,7 +304,7 @@
target = SortingBatch.Factory.newInstance();
// Fill the sorting batch from the source
- batchHelper.speciesBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
+ benthosBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
// Create the targeted batch, then update the source id
catchBatchDao.createSortingBatch(target, catchBatch);
@@ -303,7 +316,7 @@
target = catchBatchDao.getSortingBatchById(catchBatch, source.getIdAsInt());
// Fill the sorting batch from the source
- batchHelper.speciesBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
+ benthosBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
// Add the batch into a list (will be update later, using this list)
batchsToUpdate.add(target);
@@ -333,15 +346,387 @@
//-- Internal methods --//
//------------------------------------------------------------------------//
- protected void benthosBatchToEntity(SpeciesBatch source,
+ protected BenthosBatch entityToBenthosBatch(SortingBatch source,
+ BenthosBatch target) {
+
+ target.setId(source.getId().toString());
+
+ // Individual count
+ target.setNumber(source.getIndividualCount());
+
+ // Convert database weight (and sampling ratio) into UI weight and sampleCategoryWeight
+ if (source.getWeight() != null && source.getWeightBeforeSampling() == null) {
+ target.setSampleCategoryWeight(source.getWeight());
+ } else {
+ target.setWeight(source.getWeight());
+ target.setSampleCategoryWeight(source.getWeightBeforeSampling());
+ }
+
+ // Comments
+ target.setComment(source.getComments());
+
+ // Sample category type (only one is applied)
+ SortingMeasurement sm = null;
+ if (source.getSortingMeasurements().size() == 1) {
+ sm = source.getSortingMeasurements().iterator().next();
+ } else if (source.getReferenceTaxon() != null && source.getReferenceTaxon().getId() != null) {
+ sm = catchBatchDao.getInheritedSortingMeasurement(source, enumeration.PMFM_ID_SORTED_UNSORTED);
+ }
+ if (sm != null) {
+ SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(sm.getPmfm().getId());
+ if (sampleCategory != null) {
+ Integer qualitativeId = null;
+ if (sm.getQualitativeValue() != null) {
+ qualitativeId = sm.getQualitativeValue().getId();
+ }
+ setSampleCategoryQualitative(
+ target,
+ sm.getPmfm().getId(),
+ sm.getNumericalValue(),
+ sm.getAlphanumericalValue(),
+ qualitativeId);
+ }
+ }
+
+ // Species
+ Integer referenceTaxonId = source.getInheritedReferenceTaxonId();
+ if (referenceTaxonId == null && source.getReferenceTaxon() != null) {
+ referenceTaxonId = source.getReferenceTaxon().getId();
+ }
+ if (referenceTaxonId != null) {
+ // TODO : add cache on getSpeciesByReferenceTaxonId
+ Species species = referentialService.getSpeciesByReferenceTaxonId(referenceTaxonId);
+ target.setSpecies(species);
+ }
+ //FIXME-TC Check the test is still ok?
+ //FIXME-TC We should a stronger test
+// if (target.getSampleCategoryType() != null && source.getChildBatchs().size() > 0) {
+ if (target.getSampleCategoryType() != null) {
+ List<BenthosBatch> targetChilds = Lists.newArrayList();
+ for (Batch batch : source.getChildBatchs()) {
+ SortingBatch sourceChild = (SortingBatch) batch;
+ BenthosBatch targetChild = TuttiBeanFactory.newBenthosBatch();
+ entityToBenthosBatch(sourceChild, targetChild);
+ if (log.isInfoEnabled()) {
+ log.info("Loaded CatchBatch Hors Vrac > (Species|Benthos) > " + target.getSpecies().getReferenceTaxonId() + " : " + target.getId());
+ }
+ if (targetChild.getSampleCategoryValue() != null) {
+ targetChilds.add(targetChild);
+ targetChild.setParentBatch(target);
+ }
+ }
+ target.setChildBatchs(targetChilds);
+ }
+
+ QualityFlag qualityFlag = source.getQualityFlag();
+ target.setSpeciesToConfirm(qualityFlag != null && enumeration.QUALITY_FLAG_CODE_DOUBTFUL.equals(qualityFlag.getCode()));
+
+ return target;
+ }
+
+ protected void entityToBenthosBatchFrequency(SortingBatch source,
+ BenthosBatchFrequency target) {
+
+ target.setId(source.getId());
+
+ target.setNumber(source.getIndividualCount());
+ target.setWeight(source.getWeight());
+
+ Preconditions.checkState(source.getSortingMeasurements().size() == 1, "SortingBatch [" + source.getId() + "] need exactly one sortingMeasurement (to store the length step category), but had " + source.getSortingMeasurements().size());
+ SortingMeasurement sm = source.getSortingMeasurements().iterator().next();
+ Preconditions.checkNotNull(sm.getPmfm(), "SortingMeasurement [" + sm.getId() + "] can not have a null pmfm");
+ Preconditions.checkNotNull(sm.getPmfm().getId(), "SortingMeasurement [" + sm.getId() + "] can not have a pmfm with null id");
+
+ // Length step category
+ Caracteristic lengthStepCaracteristic =
+ referentialService.getCaracteristic(sm.getPmfm().getId());
+ target.setLengthStepCaracteristic(lengthStepCaracteristic);
+
+ // Length
+ target.setLengthStep(sm.getNumericalValue());
+ }
+
+ protected void benthosBatchToEntity(BenthosBatch source,
SortingBatch target,
String parentBatchId,
- CatchBatch catchBatch) {
- batchHelper.speciesBatchToEntity(
- source,
- target,
- parentBatchId,
- catchBatch,
- enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
+ fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) {
+
+ Preconditions.checkNotNull(source.getFishingOperation());
+ Preconditions.checkNotNull(source.getFishingOperation().getId());
+
+ Integer batchPmfm = enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS;
+
+ // Retrieve recorder department
+ Integer recorderDepartmentId = batchHelper.getRecorderDepartmentId();
+
+ Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
+ Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
+
+ // Create lists to store all updates, then remove not updated items
+
+ Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
+ if (quantificationMeasurements != null) {
+ notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
+ }
+ Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
+ if (sortingMeasurements != null) {
+ notChangedSortingMeasurements.addAll(sortingMeasurements);
+ }
+
+ // If parent and root need to be set
+ if (target.getId() == null
+ || target.getRootBatch() == null
+ || (target.getParentBatch() != null && !target.getParentBatch().getId().toString().equals(parentBatchId))) {
+ setBatchParents(source, target, parentBatchId, catchBatch, batchPmfm);
+ }
+
+ // RankOrder (initialize once, at creation)
+ if (target.getRankOrder() == null) {
+ // Start rank order at 1
+ short rankOrder = (short) 1;
+ if (source.getParentBatch() != null && source.getParentBatch().getChildBatchs() != null) {
+ rankOrder += (short) source.getParentBatch().getChildBatchs().size();
+ } else if (target.getParentBatch() != null && target.getParentBatch().getChildBatchs() != null) {
+ rankOrder += (short) target.getParentBatch().getChildBatchs().size();
+ }
+ target.setRankOrder(rankOrder);
+ }
+
+ // Force subgroup count to '1', as Allegro
+ target.setSubgroupCount(1f);
+
+ // Weight or SampleCategoryWeight
+ if (source.getWeight() == null && source.getSampleCategoryWeight() == null) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else if (source.getSampleCategoryWeight() != null && source.getWeight() == null) {
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getSampleCategoryWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ } else if (source.getWeight() != null && source.getSampleCategoryWeight() == null) {
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ }
+
+ // Sampling Ratio
+ if (source.getSampleCategoryWeight() == null || source.getWeight() == null) {
+ target.setSamplingRatio(null);
+ target.setSamplingRatioText(null);
+ } else {
+ String samplingRatioText = source.getWeight() + "/" + source.getSampleCategoryWeight();
+ samplingRatioText = samplingRatioText.replaceAll(",", ".");
+ target.setSamplingRatioText(samplingRatioText);
+ target.setSamplingRatio(source.getWeight() / source.getSampleCategoryWeight());
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ }
+
+ // Sorting measurement
+ if ((source.getSampleCategoryType() == null || source.getSampleCategoryValue() == null)) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else {
+ Integer pmfmId = source.getSampleCategoryType().getFieldValue();
+ // Do not store sorting measurement if pmfm = SORTED (already store in an ancestor batch)
+ if (!pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
+ SortingMeasurement sortingMeasurement = batchHelper.setSortingMeasurement(target, recorderDepartmentId,
+ source.getSampleCategoryType(), source.getSampleCategoryValue());
+ notChangedSortingMeasurements.remove(sortingMeasurement);
+ }
+ }
+
+ // Individual count
+ target.setIndividualCount(source.getNumber());
+
+ // Species
+ ReferenceTaxon referenceTaxon;
+ if (source.getSpecies() == null || parentBatchId != null) {
+ referenceTaxon = null;
+ } else {
+ referenceTaxon = load(ReferenceTaxonImpl.class, source.getSpecies().getReferenceTaxonId());
+ }
+ target.setReferenceTaxon(referenceTaxon);
+
+ // QualityFlag
+ String qualityFlag;
+ if (source.isSpeciesToConfirm()) {
+ qualityFlag = enumeration.QUALITY_FLAG_CODE_DOUBTFUL;
+ } else {
+ qualityFlag = enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED;
+ }
+ target.setQualityFlag(load(QualityFlagImpl.class, qualityFlag));
+
+ // Comments
+ target.setComments(source.getComment());
+
+ // Exhaustive inventory (always true under a species batch)
+ target.setExhaustiveInventory(true);
+
+ // Removed not changed measurements (in sorting and quantification measurement lists)
+ if (quantificationMeasurements != null) {
+ quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
+ }
+ if (sortingMeasurements != null) {
+ sortingMeasurements.removeAll(notChangedSortingMeasurements);
+ }
}
+
+ protected void setBatchParents(BenthosBatch source,
+ SortingBatch target,
+ String parentBatchIdStr,
+ fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch,
+ Integer batchPmfmId) {
+
+ Preconditions.checkNotNull(target);
+ Preconditions.checkNotNull(source.getFishingOperation());
+ Preconditions.checkNotNull(source.getFishingOperation().getId());
+
+ SortingBatch parentBatch;
+ if (parentBatchIdStr != null) {
+
+ // Load existing parent and root
+ parentBatch = catchBatchDao.getSortingBatchById(catchBatch, Integer.valueOf(parentBatchIdStr));
+ } else {
+
+ // Or retrieve parent batch, from pmfm id
+ // Retrieve category type
+ Integer pmfmId = source.getSampleCategoryType().getFieldValue();
+ if (pmfmId == null || !pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
+ throw new DataIntegrityViolationException(MessageFormat.format(
+ "A species batch with no parent should have a sampleCategoryType {0} (PMFM.ID={1})",
+ SampleCategoryEnum.sortedUnsorted.name(),
+ enumeration.PMFM_ID_SORTED_UNSORTED));
+ }
+ Integer qualitativeValueId = batchHelper.convertSampleCategoryValueIntoQualitativeId(source.getSampleCategoryValue());
+
+ parentBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
+ BatchPersistenceHelper.BATCH_PMFM_ID, pmfmId, qualitativeValueId, // vrac | hors vrac
+ BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, batchPmfmId, // species | Benthos
+ BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED // vivant trié
+ );
+ }
+
+
+ if (parentBatch == null) {
+ throw new DataIntegrityViolationException(
+ "Could not retrieve parent batch, for a given speciesBatch : invalid batch tree structure. Please make sure CatchBatch has been saved before to create a BenthosBatch.");
+ }
+
+ // Parent Batch
+ target.setParentBatch(parentBatch);
+ target.setRootBatch(catchBatch);
+ }
+
+ protected void benthosBatchFrequencyToEntity(BenthosBatchFrequency source,
+ SortingBatch target,
+ SortingBatch parentBatch,
+ short rankOrder) {
+ Preconditions.checkNotNull(source.getBatch());
+ Preconditions.checkNotNull(source.getBatch().getId());
+
+ // Retrieve recorder department
+ Integer recorderDepartmentId = batchHelper.getRecorderDepartmentId();
+
+ Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
+ Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
+
+ // Create lists to store all updates, then remove not updated items
+ Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
+ if (quantificationMeasurements != null) {
+ notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
+ }
+ Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
+ if (sortingMeasurements != null) {
+ notChangedSortingMeasurements.addAll(sortingMeasurements);
+ }
+
+ // If parent and root need to be set
+ if (target.getId() == null
+ || target.getRootBatch() == null
+ || (target.getParentBatch() != null && !target.getParentBatch().getId().equals(parentBatch.getId()))) {
+
+ target.setParentBatch(parentBatch);
+ target.setRootBatch(parentBatch.getRootBatch());
+ }
+
+ // RankOrder
+ target.setRankOrder(rankOrder);
+
+ // Weight or SampleCategoryWeight
+ if (source.getWeight() == null) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else {
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(
+ target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ }
+
+ // Sorting measurement
+ if ((source.getLengthStepCaracteristic() == null || source.getLengthStep() == null)) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else {
+ Integer pmfmId = source.getLengthStepCaracteristic().getIdAsInt();
+ SortingMeasurement sortingMeasurement = batchHelper.setSortingMeasurement(target, recorderDepartmentId, pmfmId,
+ source.getLengthStep());
+ notChangedSortingMeasurements.remove(sortingMeasurement);
+ }
+
+ // Individual count
+ target.setIndividualCount(source.getNumber());
+
+ // Species
+ target.setReferenceTaxon(null);
+
+ // QualityFlag
+ target.setQualityFlag(parentBatch.getQualityFlag());
+
+ // Exhaustive inventory (always true under a species batch)
+ target.setExhaustiveInventory(true);
+
+ // Removed not changed measurements (in sorting and quantification measurement lists)
+ if (quantificationMeasurements != null) {
+ quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
+ }
+ if (sortingMeasurements != null) {
+ sortingMeasurements.removeAll(notChangedSortingMeasurements);
+ }
+ }
+
+ public void setSampleCategoryQualitative(BenthosBatch target,
+ Integer pmfmId,
+ Float numericalvalue,
+ String alphanumericalValue,
+ Integer qualitativeValueId) {
+ // skip if null or corresponding to the SORTING_TYPE PMFM (Espèce, Benthos, Plancton, etc.)
+ if (pmfmId == null || pmfmId.equals(enumeration.PMFM_ID_SORTING_TYPE)) {
+ return;
+ }
+
+ SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(pmfmId);
+ Preconditions.checkNotNull(sampleCategory, "Unable to find corresponding SampleCategoryEnum for PMFM.ID : " + pmfmId);
+
+ target.setSampleCategoryType(sampleCategory);
+ if (numericalvalue != null) {
+ target.setSampleCategoryValue(numericalvalue);
+ return;
+ }
+ if (alphanumericalValue != null) {
+ target.setSampleCategoryValue(alphanumericalValue);
+ return;
+ }
+
+ Caracteristic caracteristic = referentialService.getCaracteristic(pmfmId);
+ if (caracteristic == null || caracteristic.getCaracteristicType() != CaracteristicType.QUALITATIVE) {
+ return;
+ }
+ CaracteristicQualitativeValue value = null;
+ for (CaracteristicQualitativeValue qv : caracteristic.getQualitativeValue()) {
+ if (qualitativeValueId.equals(qv.getIdAsInt())) {
+ value = qv;
+ break;
+ }
+ }
+ target.setSampleCategoryValue(value);
+ }
}
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceService.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -0,0 +1,51 @@
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $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.TuttiPersistenceServiceImplementor;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * To manager {@link IndividualObservationBatch}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface IndividualObservationBatchPersistenceService extends TuttiPersistenceServiceImplementor {
+
+ List<IndividualObservationBatch> getAllIndividualObservationBatch(String fishingOperationId);
+
+ @Transactional(readOnly = false)
+ IndividualObservationBatch createIndividualObservationBatch(IndividualObservationBatch bean);
+
+ @Transactional(readOnly = false)
+ IndividualObservationBatch saveIndividualObservationBatch(IndividualObservationBatch bean);
+
+ @Transactional(readOnly = false)
+ void deleteIndividualObservationBatch(String id);
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -0,0 +1,84 @@
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $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 com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+@Service("individualObservationBatchPersistenceService")
+public class IndividualObservationBatchPersistenceServiceImpl extends AbstractPersistenceService implements IndividualObservationBatchPersistenceService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(IndividualObservationBatchPersistenceServiceImpl.class);
+
+ @Autowired
+ protected AttachmentPersistenceService attachmentPersistenceService;
+
+ @Override
+ public List<IndividualObservationBatch> getAllIndividualObservationBatch(String fishingOperationId) {
+ Preconditions.checkNotNull(fishingOperationId);
+ List<IndividualObservationBatch> result = Lists.newArrayList();
+
+ // TODO
+ return result;
+ }
+
+ @Override
+ public IndividualObservationBatch createIndividualObservationBatch(IndividualObservationBatch bean) {
+ Preconditions.checkNotNull(bean);
+ Preconditions.checkState(TuttiEntities.isNew(bean));
+ // TODO
+ return bean;
+ }
+
+ @Override
+ public IndividualObservationBatch saveIndividualObservationBatch(IndividualObservationBatch bean) {
+ Preconditions.checkNotNull(bean);
+ Preconditions.checkState(!TuttiEntities.isNew(bean));
+ // TODO
+ return bean;
+ }
+
+ @Override
+ public void deleteIndividualObservationBatch(String id) {
+ Preconditions.checkNotNull(id);
+ // TODO
+ attachmentPersistenceService.deleteAllAttachment(Integer.valueOf(id));
+ }
+
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -41,8 +41,6 @@
List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId);
- PlanktonBatch getPlanktonBatch(String id);
-
@Transactional(readOnly = false)
PlanktonBatch createPlanktonBatch(PlanktonBatch bean);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/PlanktonBatchPersistenceServiceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -58,11 +58,6 @@
}
@Override
- public PlanktonBatch getPlanktonBatch(String id) {
- return null;
- }
-
- @Override
public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) {
return null;
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -34,7 +34,7 @@
import java.util.List;
/**
- * Service to persist *species* {@link SpeciesBatch}.
+ * Service to persist {@link SpeciesBatch}.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.2
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/SpeciesBatchPersistenceServiceImpl.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,14 +26,25 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import fr.ifremer.adagio.core.dao.data.batch.Batch;
import fr.ifremer.adagio.core.dao.data.batch.CatchBatch;
import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
import fr.ifremer.adagio.core.dao.data.batch.SortingBatch;
+import fr.ifremer.adagio.core.dao.data.measure.QuantificationMeasurement;
+import fr.ifremer.adagio.core.dao.data.measure.SortingMeasurement;
+import fr.ifremer.adagio.core.dao.referential.QualityFlag;
+import fr.ifremer.adagio.core.dao.referential.QualityFlagImpl;
+import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxon;
+import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxonImpl;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicType;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.service.batch.BatchPersistenceHelper;
import org.apache.commons.collections.CollectionUtils;
@@ -45,9 +56,11 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.text.MessageFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Set;
/**
* Default implementation of {@link SpeciesBatchPersistenceService}.
@@ -66,6 +79,9 @@
@Autowired
protected AttachmentPersistenceService attachmentPersistenceService;
+ @Autowired
+ protected ReferentialPersistenceService referentialService;
+
@Resource(name = "catchBatchDao")
protected CatchBatchExtendDao catchBatchDao;
@@ -105,7 +121,7 @@
SortingBatch source = (SortingBatch) batch1;
SpeciesBatch target = TuttiBeanFactory.newSpeciesBatch();
- batchHelper.entityToSpeciesBatch(source, target);
+ entityToSpeciesBatch(source, target);
result.addChildren(target);
if (log.isInfoEnabled()) {
@@ -122,7 +138,7 @@
for (Batch batch : horsVracSpeciesBatch.getChildBatchs()) {
SpeciesBatch target = TuttiBeanFactory.newSpeciesBatch();
- batchHelper.entityToSpeciesBatch((SortingBatch) batch, target);
+ entityToSpeciesBatch((SortingBatch) batch, target);
result.addChildren(target);
if (log.isInfoEnabled()) {
log.info("Loaded CatchBatch Hors Vrac > Species > " + target.getSpecies().getReferenceTaxonId() + " : " + target.getId());
@@ -283,7 +299,7 @@
for (SortingBatch child : frequencyChilds) {
SpeciesBatchFrequency target = TuttiBeanFactory.newSpeciesBatchFrequency();
- batchHelper.entityToSpeciesBatchFrequency(child, target);
+ entityToSpeciesBatchFrequency(child, target);
results.add(target);
}
return Collections.unmodifiableList(results);
@@ -349,7 +365,7 @@
target = SortingBatch.Factory.newInstance();
// Fill the sorting batch from the source
- batchHelper.speciesBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
+ speciesBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
// Create the targeted batch, then update the source id
catchBatchDao.createSortingBatch(target, catchBatch);
@@ -366,7 +382,7 @@
target = catchBatchDao.loadSortingBatch(source.getIdAsInt(), catchBatch);
// Fill the sorting batch from the source
- batchHelper.speciesBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
+ speciesBatchFrequencyToEntity(source, target, parentBatch, rankOrder);
// Add the batch into a list (will be update later, using this list)
batchsToUpdate.add(target);
@@ -407,16 +423,390 @@
//-- Internal methods --//
//------------------------------------------------------------------------//
+
+ protected SpeciesBatch entityToSpeciesBatch(SortingBatch source,
+ SpeciesBatch target) {
+
+ target.setId(source.getId().toString());
+
+ // Individual count
+ target.setNumber(source.getIndividualCount());
+
+ // Convert database weight (and sampling ratio) into UI weight and sampleCategoryWeight
+ if (source.getWeight() != null && source.getWeightBeforeSampling() == null) {
+ target.setSampleCategoryWeight(source.getWeight());
+ } else {
+ target.setWeight(source.getWeight());
+ target.setSampleCategoryWeight(source.getWeightBeforeSampling());
+ }
+
+ // Comments
+ target.setComment(source.getComments());
+
+ // Sample category type (only one is applied)
+ SortingMeasurement sm = null;
+ if (source.getSortingMeasurements().size() == 1) {
+ sm = source.getSortingMeasurements().iterator().next();
+ } else if (source.getReferenceTaxon() != null && source.getReferenceTaxon().getId() != null) {
+ sm = catchBatchDao.getInheritedSortingMeasurement(source, enumeration.PMFM_ID_SORTED_UNSORTED);
+ }
+ if (sm != null) {
+ SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(sm.getPmfm().getId());
+ if (sampleCategory != null) {
+ Integer qualitativeId = null;
+ if (sm.getQualitativeValue() != null) {
+ qualitativeId = sm.getQualitativeValue().getId();
+ }
+ setSampleCategoryQualitative(
+ target,
+ sm.getPmfm().getId(),
+ sm.getNumericalValue(),
+ sm.getAlphanumericalValue(),
+ qualitativeId);
+ }
+ }
+
+ // Species
+ Integer referenceTaxonId = source.getInheritedReferenceTaxonId();
+ if (referenceTaxonId == null && source.getReferenceTaxon() != null) {
+ referenceTaxonId = source.getReferenceTaxon().getId();
+ }
+ if (referenceTaxonId != null) {
+ // TODO : add cache on getSpeciesByReferenceTaxonId
+ Species species = referentialService.getSpeciesByReferenceTaxonId(referenceTaxonId);
+ target.setSpecies(species);
+ }
+ //FIXME-TC Check the test is still ok?
+ //FIXME-TC We should a stronger test
+// if (target.getSampleCategoryType() != null && source.getChildBatchs().size() > 0) {
+ if (target.getSampleCategoryType() != null) {
+ List<SpeciesBatch> targetChilds = Lists.newArrayList();
+ for (Batch batch : source.getChildBatchs()) {
+ SortingBatch sourceChild = (SortingBatch) batch;
+ SpeciesBatch targetChild = TuttiBeanFactory.newSpeciesBatch();
+ entityToSpeciesBatch(sourceChild, targetChild);
+ if (log.isInfoEnabled()) {
+ log.info("Loaded CatchBatch Hors Vrac > (Species|Benthos) > " + target.getSpecies().getReferenceTaxonId() + " : " + target.getId());
+ }
+ if (targetChild.getSampleCategoryValue() != null) {
+ targetChilds.add(targetChild);
+ targetChild.setParentBatch(target);
+ }
+ }
+ target.setChildBatchs(targetChilds);
+ }
+
+ QualityFlag qualityFlag = source.getQualityFlag();
+ target.setSpeciesToConfirm(qualityFlag != null && enumeration.QUALITY_FLAG_CODE_DOUBTFUL.equals(qualityFlag.getCode()));
+
+ return target;
+ }
+
+ protected void entityToSpeciesBatchFrequency(SortingBatch source,
+ SpeciesBatchFrequency target) {
+
+ target.setId(source.getId());
+
+ target.setNumber(source.getIndividualCount());
+ target.setWeight(source.getWeight());
+
+ Preconditions.checkState(source.getSortingMeasurements().size() == 1, "SortingBatch [" + source.getId() + "] need exactly one sortingMeasurement (to store the length step category), but had " + source.getSortingMeasurements().size());
+ SortingMeasurement sm = source.getSortingMeasurements().iterator().next();
+ Preconditions.checkNotNull(sm.getPmfm(), "SortingMeasurement [" + sm.getId() + "] can not have a null pmfm");
+ Preconditions.checkNotNull(sm.getPmfm().getId(), "SortingMeasurement [" + sm.getId() + "] can not have a pmfm with null id");
+
+ // Length step category
+ Caracteristic lengthStepCaracteristic =
+ referentialService.getCaracteristic(sm.getPmfm().getId());
+ target.setLengthStepCaracteristic(lengthStepCaracteristic);
+
+ // Length
+ target.setLengthStep(sm.getNumericalValue());
+ }
+
protected void speciesBatchToEntity(SpeciesBatch source,
SortingBatch target,
String parentBatchId,
- CatchBatch catchBatch) {
- batchHelper.speciesBatchToEntity(
- source,
- target,
- parentBatchId,
- catchBatch,
- enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+ fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch
+ ) {
+
+ Preconditions.checkNotNull(source.getFishingOperation());
+ Preconditions.checkNotNull(source.getFishingOperation().getId());
+
+ Integer batchPmfm = enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES;
+
+ // Retrieve recorder department
+ Integer recorderDepartmentId = batchHelper.getRecorderDepartmentId();
+
+ Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
+ Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
+
+ // Create lists to store all updates, then remove not updated items
+
+ Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
+ if (quantificationMeasurements != null) {
+ notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
+ }
+ Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
+ if (sortingMeasurements != null) {
+ notChangedSortingMeasurements.addAll(sortingMeasurements);
+ }
+
+ // If parent and root need to be set
+ if (target.getId() == null
+ || target.getRootBatch() == null
+ || (target.getParentBatch() != null && !target.getParentBatch().getId().toString().equals(parentBatchId))) {
+ setBatchParents(source, target, parentBatchId, catchBatch, batchPmfm);
+ }
+
+ // RankOrder (initialize once, at creation)
+ if (target.getRankOrder() == null) {
+ // Start rank order at 1
+ short rankOrder = (short) 1;
+ if (source.getParentBatch() != null && source.getParentBatch().getChildBatchs() != null) {
+ rankOrder += (short) source.getParentBatch().getChildBatchs().size();
+ } else if (target.getParentBatch() != null && target.getParentBatch().getChildBatchs() != null) {
+ rankOrder += (short) target.getParentBatch().getChildBatchs().size();
+ }
+ target.setRankOrder(rankOrder);
+ }
+
+ // Force subgroup count to '1', as Allegro
+ target.setSubgroupCount(1f);
+
+ // Weight or SampleCategoryWeight
+ if (source.getWeight() == null && source.getSampleCategoryWeight() == null) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else if (source.getSampleCategoryWeight() != null && source.getWeight() == null) {
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getSampleCategoryWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ } else if (source.getWeight() != null && source.getSampleCategoryWeight() == null) {
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ }
+
+ // Sampling Ratio
+ if (source.getSampleCategoryWeight() == null || source.getWeight() == null) {
+ target.setSamplingRatio(null);
+ target.setSamplingRatioText(null);
+ } else {
+ String samplingRatioText = source.getWeight() + "/" + source.getSampleCategoryWeight();
+ samplingRatioText = samplingRatioText.replaceAll(",", ".");
+ target.setSamplingRatioText(samplingRatioText);
+ target.setSamplingRatio(source.getWeight() / source.getSampleCategoryWeight());
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ }
+
+ // Sorting measurement
+ if ((source.getSampleCategoryType() == null || source.getSampleCategoryValue() == null)) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else {
+ Integer pmfmId = source.getSampleCategoryType().getFieldValue();
+ // Do not store sorting measurement if pmfm = SORTED (already store in an ancestor batch)
+ if (!pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
+ SortingMeasurement sortingMeasurement = batchHelper.setSortingMeasurement(target, recorderDepartmentId,
+ source.getSampleCategoryType(), source.getSampleCategoryValue());
+ notChangedSortingMeasurements.remove(sortingMeasurement);
+ }
+ }
+
+ // Individual count
+ target.setIndividualCount(source.getNumber());
+
+ // Species
+ ReferenceTaxon referenceTaxon;
+ if (source.getSpecies() == null || parentBatchId != null) {
+ referenceTaxon = null;
+ } else {
+ referenceTaxon = load(ReferenceTaxonImpl.class, source.getSpecies().getReferenceTaxonId());
+ }
+ target.setReferenceTaxon(referenceTaxon);
+
+ // QualityFlag
+ String qualityFlag;
+ if (source.isSpeciesToConfirm()) {
+ qualityFlag = enumeration.QUALITY_FLAG_CODE_DOUBTFUL;
+ } else {
+ qualityFlag = enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED;
+ }
+ target.setQualityFlag(load(QualityFlagImpl.class, qualityFlag));
+
+ // Comments
+ target.setComments(source.getComment());
+
+ // Exhaustive inventory (always true under a species batch)
+ target.setExhaustiveInventory(true);
+
+ // Removed not changed measurements (in sorting and quantification measurement lists)
+ if (quantificationMeasurements != null) {
+ quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
+ }
+ if (sortingMeasurements != null) {
+ sortingMeasurements.removeAll(notChangedSortingMeasurements);
+ }
}
+ protected void setBatchParents(SpeciesBatch source,
+ SortingBatch target,
+ String parentBatchIdStr,
+ fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch,
+ Integer batchPmfmId) {
+
+ Preconditions.checkNotNull(target);
+ Preconditions.checkNotNull(source.getFishingOperation());
+ Preconditions.checkNotNull(source.getFishingOperation().getId());
+
+ SortingBatch parentBatch;
+ if (parentBatchIdStr != null) {
+
+ // Load existing parent and root
+ parentBatch = catchBatchDao.getSortingBatchById(catchBatch, Integer.valueOf(parentBatchIdStr));
+ } else {
+
+ // Or retrieve parent batch, from pmfm id
+ // Retrieve category type
+ Integer pmfmId = source.getSampleCategoryType().getFieldValue();
+ if (pmfmId == null || !pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
+ throw new DataIntegrityViolationException(MessageFormat.format(
+ "A species batch with no parent should have a sampleCategoryType {0} (PMFM.ID={1})",
+ SampleCategoryEnum.sortedUnsorted.name(),
+ enumeration.PMFM_ID_SORTED_UNSORTED));
+ }
+ Integer qualitativeValueId = batchHelper.convertSampleCategoryValueIntoQualitativeId(source.getSampleCategoryValue());
+
+ parentBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
+ BatchPersistenceHelper.BATCH_PMFM_ID, pmfmId, qualitativeValueId, // vrac | hors vrac
+ BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, batchPmfmId, // species | Benthos
+ BatchPersistenceHelper.BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED // vivant trié
+ );
+ }
+
+
+ if (parentBatch == null) {
+ throw new DataIntegrityViolationException(
+ "Could not retrieve parent batch, for a given speciesBatch : invalid batch tree structure. Please make sure CatchBatch has been saved before to create a SpeciesBatch.");
+ }
+
+ // Parent Batch
+ target.setParentBatch(parentBatch);
+ target.setRootBatch(catchBatch);
+ }
+
+ protected void speciesBatchFrequencyToEntity(SpeciesBatchFrequency source,
+ SortingBatch target,
+ SortingBatch parentBatch,
+ short rankOrder) {
+ Preconditions.checkNotNull(source.getBatch());
+ Preconditions.checkNotNull(source.getBatch().getId());
+
+ // Retrieve recorder department
+ Integer recorderDepartmentId = batchHelper.getRecorderDepartmentId();
+
+ Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
+ Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
+
+ // Create lists to store all updates, then remove not updated items
+ Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
+ if (quantificationMeasurements != null) {
+ notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
+ }
+ Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
+ if (sortingMeasurements != null) {
+ notChangedSortingMeasurements.addAll(sortingMeasurements);
+ }
+
+ // If parent and root need to be set
+ if (target.getId() == null
+ || target.getRootBatch() == null
+ || (target.getParentBatch() != null && !target.getParentBatch().getId().equals(parentBatch.getId()))) {
+
+ target.setParentBatch(parentBatch);
+ target.setRootBatch(parentBatch.getRootBatch());
+ }
+
+ // RankOrder
+ target.setRankOrder(rankOrder);
+
+ // Weight or SampleCategoryWeight
+ if (source.getWeight() == null) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else {
+ QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(
+ target,
+ enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+ notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+ }
+
+ // Sorting measurement
+ if ((source.getLengthStepCaracteristic() == null || source.getLengthStep() == null)) {
+ // Nothing to do : will be removed later, using notChangedSortingMeasurements
+ } else {
+ Integer pmfmId = source.getLengthStepCaracteristic().getIdAsInt();
+ SortingMeasurement sortingMeasurement = batchHelper.setSortingMeasurement(target, recorderDepartmentId, pmfmId,
+ source.getLengthStep());
+ notChangedSortingMeasurements.remove(sortingMeasurement);
+ }
+
+ // Individual count
+ target.setIndividualCount(source.getNumber());
+
+ // Species
+ target.setReferenceTaxon(null);
+
+ // QualityFlag
+ target.setQualityFlag(parentBatch.getQualityFlag());
+
+ // Exhaustive inventory (always true under a species batch)
+ target.setExhaustiveInventory(true);
+
+ // Removed not changed measurements (in sorting and quantification measurement lists)
+ if (quantificationMeasurements != null) {
+ quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
+ }
+ if (sortingMeasurements != null) {
+ sortingMeasurements.removeAll(notChangedSortingMeasurements);
+ }
+ }
+
+ protected void setSampleCategoryQualitative(SpeciesBatch target,
+ Integer pmfmId,
+ Float numericalvalue,
+ String alphanumericalValue,
+ Integer qualitativeValueId) {
+ // skip if null or corresponding to the SORTING_TYPE PMFM (Espèce, Benthos, Plancton, etc.)
+ if (pmfmId == null || pmfmId.equals(enumeration.PMFM_ID_SORTING_TYPE)) {
+ return;
+ }
+
+ SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(pmfmId);
+ Preconditions.checkNotNull(sampleCategory, "Unable to find corresponding SampleCategoryEnum for PMFM.ID : " + pmfmId);
+
+ target.setSampleCategoryType(sampleCategory);
+ if (numericalvalue != null) {
+ target.setSampleCategoryValue(numericalvalue);
+ return;
+ }
+ if (alphanumericalValue != null) {
+ target.setSampleCategoryValue(alphanumericalValue);
+ return;
+ }
+
+ Caracteristic caracteristic = referentialService.getCaracteristic(pmfmId);
+ if (caracteristic == null || caracteristic.getCaracteristicType() != CaracteristicType.QUALITATIVE) {
+ return;
+ }
+ CaracteristicQualitativeValue value = null;
+ for (CaracteristicQualitativeValue qv : caracteristic.getQualitativeValue()) {
+ if (qualitativeValueId.equals(qv.getIdAsInt())) {
+ value = qv;
+ break;
+ }
+ }
+ target.setSampleCategoryValue(value);
+ }
+
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -237,13 +237,13 @@
public final Integer PMFM_ID_VERTICAL_OPENING = null;
@Value("${PmfmId.HORIZONTAL_OPENING_WING}")
- public final Integer PMFM_ID_HORIZONTAL_OPENING_WING= null;
+ public final Integer PMFM_ID_HORIZONTAL_OPENING_WING = null;
@Value("${PmfmId.HORIZONTAL_OPENING_DOOR}")
- public final Integer PMFM_ID_HORIZONTAL_OPENING_DOOR= null;
+ public final Integer PMFM_ID_HORIZONTAL_OPENING_DOOR = null;
@Value("${PmfmId.DEAD_OR_ALIVE}")
- public final Integer PMFM_ID_DEAD_OR_ALIVE= null;
+ public final Integer PMFM_ID_DEAD_OR_ALIVE = null;
//FIXME-TC Remove this when no more used
@Value("${PmfmId.SURVEY_PART}")
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/BatchPersistenceHelper.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/BatchPersistenceHelper.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/BatchPersistenceHelper.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,41 +26,27 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
import fr.ifremer.adagio.core.dao.data.batch.Batch;
import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
import fr.ifremer.adagio.core.dao.data.batch.SortingBatch;
import fr.ifremer.adagio.core.dao.data.measure.Measurement;
-import fr.ifremer.adagio.core.dao.data.measure.QuantificationMeasurement;
import fr.ifremer.adagio.core.dao.data.measure.SortingMeasurement;
-import fr.ifremer.adagio.core.dao.referential.QualityFlag;
-import fr.ifremer.adagio.core.dao.referential.QualityFlagImpl;
import fr.ifremer.adagio.core.dao.referential.pmfm.Pmfm;
import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValue;
import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueImpl;
-import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxon;
-import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxonImpl;
-import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicType;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.service.AbstractPersistenceService;
import fr.ifremer.tutti.persistence.service.ReferentialPersistenceService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.Serializable;
-import java.text.MessageFormat;
-import java.util.Collection;
import java.util.List;
-import java.util.Set;
/**
* Helper around batches.
@@ -134,348 +120,348 @@
return result;
}
- public SpeciesBatch entityToSpeciesBatch(SortingBatch source,
- SpeciesBatch target) {
+// public SpeciesBatch entityToSpeciesBatch(SortingBatch source,
+// SpeciesBatch target) {
+//
+// target.setId(source.getId().toString());
+//
+// // Individual count
+// target.setNumber(source.getIndividualCount());
+//
+// // Convert database weight (and sampling ratio) into UI weight and sampleCategoryWeight
+// if (source.getWeight() != null && source.getWeightBeforeSampling() == null) {
+// target.setSampleCategoryWeight(source.getWeight());
+// } else {
+// target.setWeight(source.getWeight());
+// target.setSampleCategoryWeight(source.getWeightBeforeSampling());
+// }
+//
+// // Comments
+// target.setComment(source.getComments());
+//
+// // Sample category type (only one is applied)
+// SortingMeasurement sm = null;
+// if (source.getSortingMeasurements().size() == 1) {
+// sm = source.getSortingMeasurements().iterator().next();
+// } else if (source.getReferenceTaxon() != null && source.getReferenceTaxon().getId() != null) {
+// sm = catchBatchDao.getInheritedSortingMeasurement(source, enumeration.PMFM_ID_SORTED_UNSORTED);
+// }
+// if (sm != null) {
+// SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(sm.getPmfm().getId());
+// if (sampleCategory != null) {
+// Integer qualitativeId = null;
+// if (sm.getQualitativeValue() != null) {
+// qualitativeId = sm.getQualitativeValue().getId();
+// }
+// setSampleCategoryQualitative(target, sm.getPmfm().getId(), sm.getNumericalValue(), sm.getAlphanumericalValue(), qualitativeId);
+// }
+// }
+//
+// // Species
+// Integer referenceTaxonId = source.getInheritedReferenceTaxonId();
+// if (referenceTaxonId == null && source.getReferenceTaxon() != null) {
+// referenceTaxonId = source.getReferenceTaxon().getId();
+// }
+// if (referenceTaxonId != null) {
+// // TODO : add cache on getSpeciesByReferenceTaxonId
+// Species species = referentialService.getSpeciesByReferenceTaxonId(referenceTaxonId);
+// target.setSpecies(species);
+// }
+// //FIXME-TC Check the test is still ok?
+// //FIXME-TC We should a stronger test
+//// if (target.getSampleCategoryType() != null && source.getChildBatchs().size() > 0) {
+// if (target.getSampleCategoryType() != null) {
+// List<SpeciesBatch> targetChilds = Lists.newArrayList();
+// for (Batch batch : source.getChildBatchs()) {
+// SortingBatch sourceChild = (SortingBatch) batch;
+// SpeciesBatch targetChild = TuttiBeanFactory.newSpeciesBatch();
+// entityToSpeciesBatch(sourceChild, targetChild);
+// if (log.isInfoEnabled()) {
+// log.info("Loaded CatchBatch Hors Vrac > (Species|Benthos) > " + target.getSpecies().getReferenceTaxonId() + " : " + target.getId());
+// }
+// if (targetChild.getSampleCategoryValue() != null) {
+// targetChilds.add(targetChild);
+// targetChild.setParentBatch(target);
+// }
+// }
+// target.setChildBatchs(targetChilds);
+// }
+//
+// QualityFlag qualityFlag = source.getQualityFlag();
+// target.setSpeciesToConfirm(qualityFlag != null && enumeration.QUALITY_FLAG_CODE_DOUBTFUL.equals(qualityFlag.getCode()));
+//
+// return target;
+// }
+//
+// public void entityToSpeciesBatchFrequency(SortingBatch source,
+// SpeciesBatchFrequency target) {
+//
+// target.setId(source.getId());
+//
+// target.setNumber(source.getIndividualCount());
+// target.setWeight(source.getWeight());
+//
+// Preconditions.checkState(source.getSortingMeasurements().size() == 1, "SortingBatch [" + source.getId() + "] need exactly one sortingMeasurement (to store the length step category), but had " + source.getSortingMeasurements().size());
+// SortingMeasurement sm = source.getSortingMeasurements().iterator().next();
+// Preconditions.checkNotNull(sm.getPmfm(), "SortingMeasurement [" + sm.getId() + "] can not have a null pmfm");
+// Preconditions.checkNotNull(sm.getPmfm().getId(), "SortingMeasurement [" + sm.getId() + "] can not have a pmfm with null id");
+//
+// // Length step category
+// Caracteristic lengthStepCaracteristic =
+// referentialService.getCaracteristic(sm.getPmfm().getId());
+// target.setLengthStepCaracteristic(lengthStepCaracteristic);
+//
+// // Length
+// target.setLengthStep(sm.getNumericalValue());
+// }
+//
+// public void speciesBatchToEntity(SpeciesBatch source,
+// SortingBatch target,
+// String parentBatchId,
+// fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch,
+// Integer batchPmfm) {
+//
+// Preconditions.checkNotNull(source.getFishingOperation());
+// Preconditions.checkNotNull(source.getFishingOperation().getId());
+//
+// // Retrieve recorder department
+// Integer recorderDepartmentId = getRecorderDepartmentId();
+//
+// Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
+// Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
+//
+// // Create lists to store all updates, then remove not updated items
+//
+// Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
+// if (quantificationMeasurements != null) {
+// notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
+// }
+// Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
+// if (sortingMeasurements != null) {
+// notChangedSortingMeasurements.addAll(sortingMeasurements);
+// }
+//
+// // If parent and root need to be set
+// if (target.getId() == null
+// || target.getRootBatch() == null
+// || (target.getParentBatch() != null && !target.getParentBatch().getId().toString().equals(parentBatchId))) {
+// setBatchParents(source, target, parentBatchId, catchBatch, batchPmfm);
+// }
+//
+// // RankOrder (initialize once, at creation)
+// if (target.getRankOrder() == null) {
+// // Start rank order at 1
+// short rankOrder = (short) 1;
+// if (source.getParentBatch() != null && source.getParentBatch().getChildBatchs() != null) {
+// rankOrder += (short) source.getParentBatch().getChildBatchs().size();
+// } else if (target.getParentBatch() != null && target.getParentBatch().getChildBatchs() != null) {
+// rankOrder += (short) target.getParentBatch().getChildBatchs().size();
+// }
+// target.setRankOrder(rankOrder);
+// }
+//
+// // Force subgroup count to '1', as Allegro
+// target.setSubgroupCount(1f);
+//
+// // Weight or SampleCategoryWeight
+// if (source.getWeight() == null && source.getSampleCategoryWeight() == null) {
+// // Nothing to do : will be removed later, using notChangedSortingMeasurements
+// } else if (source.getSampleCategoryWeight() != null && source.getWeight() == null) {
+// QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+// enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getSampleCategoryWeight(), true);
+// notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+// } else if (source.getWeight() != null && source.getSampleCategoryWeight() == null) {
+// QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+// enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+// notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+// }
+//
+// // Sampling Ratio
+// if (source.getSampleCategoryWeight() == null || source.getWeight() == null) {
+// target.setSamplingRatio(null);
+// target.setSamplingRatioText(null);
+// } else {
+// String samplingRatioText = source.getWeight() + "/" + source.getSampleCategoryWeight();
+// samplingRatioText = samplingRatioText.replaceAll(",", ".");
+// target.setSamplingRatioText(samplingRatioText);
+// target.setSamplingRatio(source.getWeight() / source.getSampleCategoryWeight());
+// QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
+// enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+// notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+// }
+//
+// // Sorting measurement
+// if ((source.getSampleCategoryType() == null || source.getSampleCategoryValue() == null)) {
+// // Nothing to do : will be removed later, using notChangedSortingMeasurements
+// } else {
+// Integer pmfmId = source.getSampleCategoryType().getFieldValue();
+// // Do not store sorting measurement if pmfm = SORTED (already store in an ancestor batch)
+// if (!pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
+// SortingMeasurement sortingMeasurement = setSortingMeasurement(target, recorderDepartmentId,
+// source.getSampleCategoryType(), source.getSampleCategoryValue());
+// notChangedSortingMeasurements.remove(sortingMeasurement);
+// }
+// }
+//
+// // Individual count
+// target.setIndividualCount(source.getNumber());
+//
+// // Species
+// ReferenceTaxon referenceTaxon;
+// if (source.getSpecies() == null || parentBatchId != null) {
+// referenceTaxon = null;
+// } else {
+// referenceTaxon = load(ReferenceTaxonImpl.class, source.getSpecies().getReferenceTaxonId());
+// }
+// target.setReferenceTaxon(referenceTaxon);
+//
+// // QualityFlag
+// String qualityFlag;
+// if (source.isSpeciesToConfirm()) {
+// qualityFlag = enumeration.QUALITY_FLAG_CODE_DOUBTFUL;
+// } else {
+// qualityFlag = enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED;
+// }
+// target.setQualityFlag(load(QualityFlagImpl.class, qualityFlag));
+//
+// // Comments
+// target.setComments(source.getComment());
+//
+// // Exhaustive inventory (always true under a species batch)
+// target.setExhaustiveInventory(true);
+//
+// // Removed not changed measurements (in sorting and quantification measurement lists)
+// if (quantificationMeasurements != null) {
+// quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
+// }
+// if (sortingMeasurements != null) {
+// sortingMeasurements.removeAll(notChangedSortingMeasurements);
+// }
+// }
- target.setId(source.getId().toString());
+// protected void setBatchParents(SpeciesBatch source,
+// SortingBatch target,
+// String parentBatchIdStr,
+// fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch,
+// Integer batchPmfmId) {
+//
+// Preconditions.checkNotNull(target);
+// Preconditions.checkNotNull(source.getFishingOperation());
+// Preconditions.checkNotNull(source.getFishingOperation().getId());
+//
+// SortingBatch parentBatch;
+// if (parentBatchIdStr != null) {
+//
+// // Load existing parent and root
+// parentBatch = catchBatchDao.getSortingBatchById(catchBatch, Integer.valueOf(parentBatchIdStr));
+// } else {
+//
+// // Or retrieve parent batch, from pmfm id
+// // Retrieve category type
+// Integer pmfmId = source.getSampleCategoryType().getFieldValue();
+// if (pmfmId == null || !pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
+// throw new DataIntegrityViolationException(MessageFormat.format(
+// "A species batch with no parent should have a sampleCategoryType {0} (PMFM.ID={1})",
+// SampleCategoryEnum.sortedUnsorted.name(),
+// enumeration.PMFM_ID_SORTED_UNSORTED));
+// }
+// Integer qualitativeValueId = convertSampleCategoryValueIntoQualitativeId(source.getSampleCategoryValue());
+//
+// parentBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
+// BATCH_PMFM_ID, pmfmId, qualitativeValueId, // vrac | hors vrac
+// BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, batchPmfmId, // species | Benthos
+// BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED // vivant trié
+// );
+// }
+//
+//
+// if (parentBatch == null) {
+// throw new DataIntegrityViolationException(
+// "Could not retrieve parent batch, for a given speciesBatch : invalid batch tree structure. Please make sure CatchBatch has been saved before to create a SpeciesBatch.");
+// }
+//
+// // Parent Batch
+// target.setParentBatch(parentBatch);
+// target.setRootBatch(catchBatch);
+// }
+//
+// public void speciesBatchFrequencyToEntity(SpeciesBatchFrequency source,
+// SortingBatch target,
+// SortingBatch parentBatch,
+// short rankOrder) {
+// Preconditions.checkNotNull(source.getBatch());
+// Preconditions.checkNotNull(source.getBatch().getId());
+//
+// // Retrieve recorder department
+// Integer recorderDepartmentId = getRecorderDepartmentId();
+//
+// Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
+// Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
+//
+// // Create lists to store all updates, then remove not updated items
+// Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
+// if (quantificationMeasurements != null) {
+// notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
+// }
+// Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
+// if (sortingMeasurements != null) {
+// notChangedSortingMeasurements.addAll(sortingMeasurements);
+// }
+//
+// // If parent and root need to be set
+// if (target.getId() == null
+// || target.getRootBatch() == null
+// || (target.getParentBatch() != null && !target.getParentBatch().getId().equals(parentBatch.getId()))) {
+//
+// target.setParentBatch(parentBatch);
+// target.setRootBatch(parentBatch.getRootBatch());
+// }
+//
+// // RankOrder
+// target.setRankOrder(rankOrder);
+//
+// // Weight or SampleCategoryWeight
+// if (source.getWeight() == null) {
+// // Nothing to do : will be removed later, using notChangedSortingMeasurements
+// } else {
+// QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(
+// target,
+// enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
+// notChangedQuantificationMeasurements.remove(quantificationMeasurement);
+// }
+//
+// // Sorting measurement
+// if ((source.getLengthStepCaracteristic() == null || source.getLengthStep() == null)) {
+// // Nothing to do : will be removed later, using notChangedSortingMeasurements
+// } else {
+// Integer pmfmId = source.getLengthStepCaracteristic().getIdAsInt();
+// SortingMeasurement sortingMeasurement = setSortingMeasurement(target, recorderDepartmentId, pmfmId,
+// source.getLengthStep());
+// notChangedSortingMeasurements.remove(sortingMeasurement);
+// }
+//
+// // Individual count
+// target.setIndividualCount(source.getNumber());
+//
+// // Species
+// target.setReferenceTaxon(null);
+//
+// // QualityFlag
+// target.setQualityFlag(parentBatch.getQualityFlag());
+//
+// // Exhaustive inventory (always true under a species batch)
+// target.setExhaustiveInventory(true);
+//
+// // Removed not changed measurements (in sorting and quantification measurement lists)
+// if (quantificationMeasurements != null) {
+// quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
+// }
+// if (sortingMeasurements != null) {
+// sortingMeasurements.removeAll(notChangedSortingMeasurements);
+// }
+// }
- // Individual count
- target.setNumber(source.getIndividualCount());
-
- // Convert database weight (and sampling ratio) into UI weight and sampleCategoryWeight
- if (source.getWeight() != null && source.getWeightBeforeSampling() == null) {
- target.setSampleCategoryWeight(source.getWeight());
- } else {
- target.setWeight(source.getWeight());
- target.setSampleCategoryWeight(source.getWeightBeforeSampling());
- }
-
- // Comments
- target.setComment(source.getComments());
-
- // Sample category type (only one is applied)
- SortingMeasurement sm = null;
- if (source.getSortingMeasurements().size() == 1) {
- sm = source.getSortingMeasurements().iterator().next();
- } else if (source.getReferenceTaxon() != null && source.getReferenceTaxon().getId() != null) {
- sm = catchBatchDao.getInheritedSortingMeasurement(source, enumeration.PMFM_ID_SORTED_UNSORTED);
- }
- if (sm != null) {
- SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(sm.getPmfm().getId());
- if (sampleCategory != null) {
- Integer qualitativeId = null;
- if (sm.getQualitativeValue() != null) {
- qualitativeId = sm.getQualitativeValue().getId();
- }
- setSampleCategoryQualitative(target, sm.getPmfm().getId(), sm.getNumericalValue(), sm.getAlphanumericalValue(), qualitativeId);
- }
- }
-
- // Species
- Integer referenceTaxonId = source.getInheritedReferenceTaxonId();
- if (referenceTaxonId == null && source.getReferenceTaxon() != null) {
- referenceTaxonId = source.getReferenceTaxon().getId();
- }
- if (referenceTaxonId != null) {
- // TODO : add cache on getSpeciesByReferenceTaxonId
- Species species = referentialService.getSpeciesByReferenceTaxonId(referenceTaxonId);
- target.setSpecies(species);
- }
- //FIXME-TC Check the test is still ok?
- //FIXME-TC We should a stronger test
-// if (target.getSampleCategoryType() != null && source.getChildBatchs().size() > 0) {
- if (target.getSampleCategoryType() != null) {
- List<SpeciesBatch> targetChilds = Lists.newArrayList();
- for (Batch batch : source.getChildBatchs()) {
- SortingBatch sourceChild = (SortingBatch) batch;
- SpeciesBatch targetChild = TuttiBeanFactory.newSpeciesBatch();
- entityToSpeciesBatch(sourceChild, targetChild);
- if (log.isInfoEnabled()) {
- log.info("Loaded CatchBatch Hors Vrac > (Species|Benthos) > " + target.getSpecies().getReferenceTaxonId() + " : " + target.getId());
- }
- if (targetChild.getSampleCategoryValue() != null) {
- targetChilds.add(targetChild);
- targetChild.setParentBatch(target);
- }
- }
- target.setChildBatchs(targetChilds);
- }
-
- QualityFlag qualityFlag = source.getQualityFlag();
- target.setSpeciesToConfirm(qualityFlag != null && enumeration.QUALITY_FLAG_CODE_DOUBTFUL.equals(qualityFlag.getCode()));
-
- return target;
- }
-
- public void entityToSpeciesBatchFrequency(SortingBatch source,
- SpeciesBatchFrequency target) {
-
- target.setId(source.getId());
-
- target.setNumber(source.getIndividualCount());
- target.setWeight(source.getWeight());
-
- Preconditions.checkState(source.getSortingMeasurements().size() == 1, "SortingBatch [" + source.getId() + "] need exactly one sortingMeasurement (to store the length step category), but had " + source.getSortingMeasurements().size());
- SortingMeasurement sm = source.getSortingMeasurements().iterator().next();
- Preconditions.checkNotNull(sm.getPmfm(), "SortingMeasurement [" + sm.getId() + "] can not have a null pmfm");
- Preconditions.checkNotNull(sm.getPmfm().getId(), "SortingMeasurement [" + sm.getId() + "] can not have a pmfm with null id");
-
- // Length step category
- Caracteristic lengthStepCaracteristic =
- referentialService.getCaracteristic(sm.getPmfm().getId());
- target.setLengthStepCaracteristic(lengthStepCaracteristic);
-
- // Length
- target.setLengthStep(sm.getNumericalValue());
- }
-
- public void speciesBatchToEntity(SpeciesBatch source,
- SortingBatch target,
- String parentBatchId,
- fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch,
- Integer batchPmfm) {
-
- Preconditions.checkNotNull(source.getFishingOperation());
- Preconditions.checkNotNull(source.getFishingOperation().getId());
-
- // Retrieve recorder department
- Integer recorderDepartmentId = getRecorderDepartmentId();
-
- Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
- Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
-
- // Create lists to store all updates, then remove not updated items
-
- Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
- if (quantificationMeasurements != null) {
- notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
- }
- Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
- if (sortingMeasurements != null) {
- notChangedSortingMeasurements.addAll(sortingMeasurements);
- }
-
- // If parent and root need to be set
- if (target.getId() == null
- || target.getRootBatch() == null
- || (target.getParentBatch() != null && !target.getParentBatch().getId().toString().equals(parentBatchId))) {
- setBatchParents(source, target, parentBatchId, catchBatch, batchPmfm);
- }
-
- // RankOrder (initialize once, at creation)
- if (target.getRankOrder() == null) {
- // Start rank order at 1
- short rankOrder = (short) 1;
- if (source.getParentBatch() != null && source.getParentBatch().getChildBatchs() != null) {
- rankOrder += (short) source.getParentBatch().getChildBatchs().size();
- } else if (target.getParentBatch() != null && target.getParentBatch().getChildBatchs() != null) {
- rankOrder += (short) target.getParentBatch().getChildBatchs().size();
- }
- target.setRankOrder(rankOrder);
- }
-
- // Force subgroup count to '1', as Allegro
- target.setSubgroupCount(1f);
-
- // Weight or SampleCategoryWeight
- if (source.getWeight() == null && source.getSampleCategoryWeight() == null) {
- // Nothing to do : will be removed later, using notChangedSortingMeasurements
- } else if (source.getSampleCategoryWeight() != null && source.getWeight() == null) {
- QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getSampleCategoryWeight(), true);
- notChangedQuantificationMeasurements.remove(quantificationMeasurement);
- } else if (source.getWeight() != null && source.getSampleCategoryWeight() == null) {
- QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
- notChangedQuantificationMeasurements.remove(quantificationMeasurement);
- }
-
- // Sampling Ratio
- if (source.getSampleCategoryWeight() == null || source.getWeight() == null) {
- target.setSamplingRatio(null);
- target.setSamplingRatioText(null);
- } else {
- String samplingRatioText = source.getWeight() + "/" + source.getSampleCategoryWeight();
- samplingRatioText = samplingRatioText.replaceAll(",", ".");
- target.setSamplingRatioText(samplingRatioText);
- target.setSamplingRatio(source.getWeight() / source.getSampleCategoryWeight());
- QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
- notChangedQuantificationMeasurements.remove(quantificationMeasurement);
- }
-
- // Sorting measurement
- if ((source.getSampleCategoryType() == null || source.getSampleCategoryValue() == null)) {
- // Nothing to do : will be removed later, using notChangedSortingMeasurements
- } else {
- Integer pmfmId = source.getSampleCategoryType().getFieldValue();
- // Do not store sorting measurement if pmfm = SORTED (already store in an ancestor batch)
- if (!pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
- SortingMeasurement sortingMeasurement = setSortingMeasurement(target, recorderDepartmentId,
- source.getSampleCategoryType(), source.getSampleCategoryValue());
- notChangedSortingMeasurements.remove(sortingMeasurement);
- }
- }
-
- // Individual count
- target.setIndividualCount(source.getNumber());
-
- // Species
- ReferenceTaxon referenceTaxon;
- if (source.getSpecies() == null || parentBatchId != null) {
- referenceTaxon = null;
- } else {
- referenceTaxon = load(ReferenceTaxonImpl.class, source.getSpecies().getReferenceTaxonId());
- }
- target.setReferenceTaxon(referenceTaxon);
-
- // QualityFlag
- String qualityFlag;
- if (source.isSpeciesToConfirm()) {
- qualityFlag = enumeration.QUALITY_FLAG_CODE_DOUBTFUL;
- } else {
- qualityFlag = enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED;
- }
- target.setQualityFlag(load(QualityFlagImpl.class, qualityFlag));
-
- // Comments
- target.setComments(source.getComment());
-
- // Exhaustive inventory (always true under a species batch)
- target.setExhaustiveInventory(true);
-
- // Removed not changed measurements (in sorting and quantification measurement lists)
- if (quantificationMeasurements != null) {
- quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
- }
- if (sortingMeasurements != null) {
- sortingMeasurements.removeAll(notChangedSortingMeasurements);
- }
- }
-
- protected void setBatchParents(SpeciesBatch source,
- SortingBatch target,
- String parentBatchIdStr,
- fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch,
- Integer batchPmfmId) {
-
- Preconditions.checkNotNull(target);
- Preconditions.checkNotNull(source.getFishingOperation());
- Preconditions.checkNotNull(source.getFishingOperation().getId());
-
- SortingBatch parentBatch;
- if (parentBatchIdStr != null) {
-
- // Load existing parent and root
- parentBatch = catchBatchDao.getSortingBatchById(catchBatch, Integer.valueOf(parentBatchIdStr));
- } else {
-
- // Or retrieve parent batch, from pmfm id
- // Retrieve category type
- Integer pmfmId = source.getSampleCategoryType().getFieldValue();
- if (pmfmId == null || !pmfmId.equals(enumeration.PMFM_ID_SORTED_UNSORTED)) {
- throw new DataIntegrityViolationException(MessageFormat.format(
- "A species batch with no parent should have a sampleCategoryType {0} (PMFM.ID={1})",
- SampleCategoryEnum.sortedUnsorted.name(),
- enumeration.PMFM_ID_SORTED_UNSORTED));
- }
- Integer qualitativeValueId = convertSampleCategoryValueIntoQualitativeId(source.getSampleCategoryValue());
-
- parentBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
- BATCH_PMFM_ID, pmfmId, qualitativeValueId, // vrac | hors vrac
- BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE, batchPmfmId, // species | Benthos
- BATCH_PMFM_ID, enumeration.PMFM_ID_SORTING_TYPE_2, enumeration.QUALITATIVE_ID_SORTING_TYPE_2_ALIVE_ITEMIZED // vivant trié
- );
- }
-
-
- if (parentBatch == null) {
- throw new DataIntegrityViolationException(
- "Could not retrieve parent batch, for a given speciesBatch : invalid batch tree structure. Please make sure CatchBatch has been saved before to create a SpeciesBatch.");
- }
-
- // Parent Batch
- target.setParentBatch(parentBatch);
- target.setRootBatch(catchBatch);
- }
-
- public void speciesBatchFrequencyToEntity(SpeciesBatchFrequency source,
- SortingBatch target,
- SortingBatch parentBatch,
- short rankOrder) {
- Preconditions.checkNotNull(source.getBatch());
- Preconditions.checkNotNull(source.getBatch().getId());
-
- // Retrieve recorder department
- Integer recorderDepartmentId = getRecorderDepartmentId();
-
- Collection<QuantificationMeasurement> quantificationMeasurements = target.getQuantificationMeasurements();
- Collection<SortingMeasurement> sortingMeasurements = target.getSortingMeasurements();
-
- // Create lists to store all updates, then remove not updated items
- Set<QuantificationMeasurement> notChangedQuantificationMeasurements = Sets.newHashSet();
- if (quantificationMeasurements != null) {
- notChangedQuantificationMeasurements.addAll(quantificationMeasurements);
- }
- Set<SortingMeasurement> notChangedSortingMeasurements = Sets.newHashSet();
- if (sortingMeasurements != null) {
- notChangedSortingMeasurements.addAll(sortingMeasurements);
- }
-
- // If parent and root need to be set
- if (target.getId() == null
- || target.getRootBatch() == null
- || (target.getParentBatch() != null && !target.getParentBatch().getId().equals(parentBatch.getId()))) {
-
- target.setParentBatch(parentBatch);
- target.setRootBatch(parentBatch.getRootBatch());
- }
-
- // RankOrder
- target.setRankOrder(rankOrder);
-
- // Weight or SampleCategoryWeight
- if (source.getWeight() == null) {
- // Nothing to do : will be removed later, using notChangedSortingMeasurements
- } else {
- QuantificationMeasurement quantificationMeasurement = catchBatchDao.setQuantificationMeasurement(
- target,
- enumeration.PMFM_ID_WEIGHT_MEASURED, recorderDepartmentId, source.getWeight(), true);
- notChangedQuantificationMeasurements.remove(quantificationMeasurement);
- }
-
- // Sorting measurement
- if ((source.getLengthStepCaracteristic() == null || source.getLengthStep() == null)) {
- // Nothing to do : will be removed later, using notChangedSortingMeasurements
- } else {
- Integer pmfmId = source.getLengthStepCaracteristic().getIdAsInt();
- SortingMeasurement sortingMeasurement = setSortingMeasurement(target, recorderDepartmentId, pmfmId,
- source.getLengthStep());
- notChangedSortingMeasurements.remove(sortingMeasurement);
- }
-
- // Individual count
- target.setIndividualCount(source.getNumber());
-
- // Species
- target.setReferenceTaxon(null);
-
- // QualityFlag
- target.setQualityFlag(parentBatch.getQualityFlag());
-
- // Exhaustive inventory (always true under a species batch)
- target.setExhaustiveInventory(true);
-
- // Removed not changed measurements (in sorting and quantification measurement lists)
- if (quantificationMeasurements != null) {
- quantificationMeasurements.removeAll(notChangedQuantificationMeasurements);
- }
- if (sortingMeasurements != null) {
- sortingMeasurements.removeAll(notChangedSortingMeasurements);
- }
- }
-
- protected Integer convertSampleCategoryValueIntoQualitativeId(Serializable value) {
+ public Integer convertSampleCategoryValueIntoQualitativeId(Serializable value) {
if (value == null)
return null;
Integer qualitativeValueId = null;
@@ -488,43 +474,43 @@
return qualitativeValueId;
}
- protected void setSampleCategoryQualitative(SpeciesBatch target,
- Integer pmfmId,
- Float numericalvalue,
- String alphanumericalValue,
- Integer qualitativeValueId) {
- // skip if null or corresponding to the SORTING_TYPE PMFM (Espèce, Benthos, Plancton, etc.)
- if (pmfmId == null || pmfmId.equals(enumeration.PMFM_ID_SORTING_TYPE)) {
- return;
- }
+// public void setSampleCategoryQualitative(SpeciesBatch target,
+// Integer pmfmId,
+// Float numericalvalue,
+// String alphanumericalValue,
+// Integer qualitativeValueId) {
+// // skip if null or corresponding to the SORTING_TYPE PMFM (Espèce, Benthos, Plancton, etc.)
+// if (pmfmId == null || pmfmId.equals(enumeration.PMFM_ID_SORTING_TYPE)) {
+// return;
+// }
+//
+// SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(pmfmId);
+// Preconditions.checkNotNull(sampleCategory, "Unable to find corresponding SampleCategoryEnum for PMFM.ID : " + pmfmId);
+//
+// target.setSampleCategoryType(sampleCategory);
+// if (numericalvalue != null) {
+// target.setSampleCategoryValue(numericalvalue);
+// return;
+// }
+// if (alphanumericalValue != null) {
+// target.setSampleCategoryValue(alphanumericalValue);
+// return;
+// }
+//
+// Caracteristic caracteristic = referentialService.getCaracteristic(pmfmId);
+// if (caracteristic == null || caracteristic.getCaracteristicType() != CaracteristicType.QUALITATIVE) {
+// return;
+// }
+// CaracteristicQualitativeValue value = null;
+// for (CaracteristicQualitativeValue qv : caracteristic.getQualitativeValue()) {
+// if (qualitativeValueId.equals(qv.getIdAsInt())) {
+// value = qv;
+// break;
+// }
+// }
+// target.setSampleCategoryValue(value);
+// }
- SampleCategoryEnum sampleCategory = enumeration.getSampleCategoryByPmfmId(pmfmId);
- Preconditions.checkNotNull(sampleCategory, "Unable to find corresponding SampleCategoryEnum for PMFM.ID : " + pmfmId);
-
- target.setSampleCategoryType(sampleCategory);
- if (numericalvalue != null) {
- target.setSampleCategoryValue(numericalvalue);
- return;
- }
- if (alphanumericalValue != null) {
- target.setSampleCategoryValue(alphanumericalValue);
- return;
- }
-
- Caracteristic caracteristic = referentialService.getCaracteristic(pmfmId);
- if (caracteristic == null || caracteristic.getCaracteristicType() != CaracteristicType.QUALITATIVE) {
- return;
- }
- CaracteristicQualitativeValue value = null;
- for (CaracteristicQualitativeValue qv : caracteristic.getQualitativeValue()) {
- if (qualitativeValueId.equals(qv.getIdAsInt())) {
- value = qv;
- break;
- }
- }
- target.setSampleCategoryValue(value);
- }
-
public Integer getRecorderDepartmentId() {
// TODO BL : voir si on peut récupérer le departement (du 1er saisisseur ?)
return enumeration.DEPARTMENT_ID_UNKNOWN_RECORDER_DEPARTMENT;
@@ -554,8 +540,10 @@
}
public SortingMeasurement setSortingMeasurement(
- SortingBatch sortingBatch, Integer recorderDepartmentId,
- SampleCategoryEnum sampleCategory, Serializable value) {
+ SortingBatch sortingBatch,
+ Integer recorderDepartmentId,
+ SampleCategoryEnum sampleCategory,
+ Serializable value) {
Preconditions.checkNotNull(sampleCategory);
Preconditions.checkNotNull(value);
@@ -569,8 +557,10 @@
}
public SortingMeasurement setSortingMeasurement(
- SortingBatch sortingBatch, Integer recorderDepartmentId,
- Integer pmfmId, Serializable value) {
+ SortingBatch sortingBatch,
+ Integer recorderDepartmentId,
+ Integer pmfmId,
+ Serializable value) {
Preconditions.checkNotNull(pmfmId);
Preconditions.checkNotNull(value);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,6 +26,7 @@
import com.google.common.collect.Lists;
import fr.ifremer.adagio.core.dao.data.batch.Batch;
+import fr.ifremer.adagio.core.dao.data.batch.CatchBatch;
import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
import fr.ifremer.adagio.core.dao.data.batch.SortingBatch;
import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidationError;
@@ -60,13 +61,13 @@
protected TuttiEnumerationFile enumeration;
@Override
- public boolean isEnable(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) {
+ public boolean isEnable(CatchBatch catchBatch) {
// Apply validation only on catch batch for fishingOperation
return (catchBatch.getFishingOperation() != null);
}
@Override
- public List<CatchBatchValidationError> validate(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) {
+ public List<CatchBatchValidationError> validate(CatchBatch catchBatch) {
List<CatchBatchValidationError> errors = Lists.newArrayList();
validate(catchBatch.getChildBatchs(), errors);
return errors;
@@ -175,7 +176,7 @@
addWarning(errors, n_("tutti.persistence.batch.validation.vracBenthosAliveItemizedNotFound"));
}
}
- // TODO : Plancton...
+ // TODO : Plankton...
}
// Hors Vrac
@@ -216,7 +217,7 @@
if (marineLitterBatch == null) {
addWarning(errors, n_("tutti.persistence.batch.validation.horsVracMarineLitterNotFound"));
}
- // TODO : Plancton...
+ // TODO : Plankton...
}
// Unsorted
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceReadTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceReadTest.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AccidentalBatchPersistenceServiceReadTest.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -54,8 +54,4 @@
}
- @Test
- public void getAccidentalBatch(/*String id*/) {
-
- }
}
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceReadTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceReadTest.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceReadTest.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -27,6 +27,7 @@
import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.DatabaseResource;
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
@@ -85,7 +86,7 @@
@Ignore
@Test
- public void getAllBenthosBatchFrequency(/*String speciesBatchId*/) {
+ public void getAllBenthosBatchFrequency(/*String benthosBatchId*/) {
//TODO Do me!
service.getAllBenthosBatchFrequency(fishingOperation.getId());
}
@@ -115,7 +116,7 @@
assertEquals(expectedBatch.getComment(), actualBatch.getComment());
// Check species only if Vrac/HorsVrac or if batch has been load throw getAllxxx method
- // (Because getSpeciesBatch(id) could not always retrieve the species)
+ // (Because getBenthosBatch(id) could not always retrieve the species)
if (expectedBatch.getSpecies() != null && (
expectedBatch.getSampleCategoryType() == SampleCategoryEnum.sortedUnsorted
|| actualBatch.getSpecies() != null)) {
@@ -159,23 +160,23 @@
}
}
- public SpeciesBatch getSpeciesBatch(String fishingOperationId,
+ public BenthosBatch getBenthosBatch(String fishingOperationId,
String speciesBatchId) {
- BatchContainer<SpeciesBatch> rootSpeciesBatch = service.getRootBenthosBatch(fishingOperationId);
- return getSpeciesBatch(speciesBatchId, rootSpeciesBatch.getChildren());
+ BatchContainer<BenthosBatch> rootSpeciesBatch = service.getRootBenthosBatch(fishingOperationId);
+ return getBenthosBatch(speciesBatchId, rootSpeciesBatch.getChildren());
}
- public static SpeciesBatch getSpeciesBatch(String speciesBatchId,
- List<SpeciesBatch> speciesBatchs) {
+ public static BenthosBatch getBenthosBatch(String speciesBatchId,
+ List<BenthosBatch> speciesBatchs) {
if (speciesBatchs == null) {
return null;
}
- for (SpeciesBatch speciesBatch : speciesBatchs) {
+ for (BenthosBatch speciesBatch : speciesBatchs) {
if (speciesBatchId.equals(speciesBatch.getId())) {
return speciesBatch;
}
if (speciesBatch.getChildBatchs() != null) {
- speciesBatch = getSpeciesBatch(speciesBatchId, speciesBatch.getChildBatchs());
+ speciesBatch = getBenthosBatch(speciesBatchId, speciesBatch.getChildBatchs());
if (speciesBatch != null) {
return speciesBatch;
}
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceWriteTest.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/BenthosBatchPersistenceServiceWriteTest.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -28,12 +28,12 @@
import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.DatabaseResource;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
+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.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicType;
@@ -200,10 +200,10 @@
@Test
public void createAndSaveBenthosBatchAndFrequencies() {
- SpeciesBatch esp1Batch;
- SpeciesBatch esp2Batch;
- SpeciesBatch frequenciesParentBatch;
- SpeciesBatch batch;
+ BenthosBatch esp1Batch;
+ BenthosBatch esp2Batch;
+ BenthosBatch frequenciesParentBatch;
+ BenthosBatch batch;
Species taxon1 = species.get(0);
Species taxon2 = species.get(1);
@@ -211,7 +211,7 @@
// 1. Test with only mandatory properties
// -----------------------------------------------------------------------------
// batch : "ESP1 - Vrac/5"
- batch = TuttiBeanFactory.newSpeciesBatch();
+ batch = TuttiBeanFactory.newBenthosBatch();
batch.setParentBatch(null);
batch.setFishingOperation(fishingOperationNoCatchBatch);
batch.setSpecies(taxon1);
@@ -228,7 +228,7 @@
// 2. Test child "Male/2"
// -----------------------------------------------------------------------------
// Batch : ESP1 - Vrac/5 Male/2 ss-ech/1 Nombre/7
- batch = TuttiBeanFactory.newSpeciesBatch();
+ batch = TuttiBeanFactory.newBenthosBatch();
batch.setId((String) null);
batch.setParentBatch(esp1Batch);
batch.setSpecies(taxon1);
@@ -245,7 +245,7 @@
// 3. Test child "Female/2"
// -----------------------------------------------------------------------------
// Batch : ESP1 - Vrac/5 Female/3 Nombre/14
- batch = TuttiBeanFactory.newSpeciesBatch();
+ batch = TuttiBeanFactory.newBenthosBatch();
batch.setId((String) null);
batch.setParentBatch(esp1Batch);
batch.setSpecies(taxon1);
@@ -263,7 +263,7 @@
// \- ESP2 - Vrac/7 UNK/2 ss-ech/1 Nombre/11
// -----------------------------------------------------------------------------
// batch : "ESP2 - Vrac/7 "
- batch = TuttiBeanFactory.newSpeciesBatch();
+ batch = TuttiBeanFactory.newBenthosBatch();
batch.setParentBatch(null);
batch.setSpecies(taxon2);
batch.setSampleCategoryType(SampleCategoryEnum.sortedUnsorted);
@@ -274,7 +274,7 @@
esp2Batch = batch;
// Batch : ESP2 - Vrac/7 UNK/2 ss-ech/1 Nombre/11
- batch = TuttiBeanFactory.newSpeciesBatch();
+ batch = TuttiBeanFactory.newBenthosBatch();
batch.setId((String) null);
batch.setParentBatch(esp2Batch);
batch.setSpecies(taxon2);
@@ -300,10 +300,10 @@
batch.setNumber(99);
// Save and reload, then check
- SpeciesBatch savedBatch = service.saveBenthosBatch(batch);
- assertSpeciesBatch(savedBatch, batch, false);
- SpeciesBatch reloadedBatch = getBenthosBatch(fishingOperationWithEmptyBatch.getId(), savedBatch.getId());
- assertSpeciesBatch(savedBatch, reloadedBatch, true);
+ BenthosBatch savedBatch = service.saveBenthosBatch(batch);
+ assertBenthosBatch(savedBatch, batch, false);
+ BenthosBatch reloadedBatch = getBenthosBatch(fishingOperationWithEmptyBatch.getId(), savedBatch.getId());
+ assertBenthosBatch(savedBatch, reloadedBatch, true);
// Save batch for later
frequenciesParentBatch = batch;
@@ -313,29 +313,29 @@
// -----------------------------------------------------------------------------
esp2Batch.setSpecies(taxon1);
service.changeBenthosBatchSpecies(esp2Batch.getId(), taxon1);
- assertSpeciesBatch(savedBatch, batch, false);
+ assertBenthosBatch(savedBatch, batch, false);
reloadedBatch = getBenthosBatch(fishingOperationWithEmptyBatch.getId(), esp2Batch.getId());
- assertSpeciesBatch(esp2Batch, reloadedBatch, true);
+ assertBenthosBatch(esp2Batch, reloadedBatch, true);
// -----------------------------------------------------------------------------
// 7. Test get all root species
// -----------------------------------------------------------------------------
- List<SpeciesBatch> rootSpeciesBatch = service.getRootBenthosBatch(fishingOperationWithEmptyBatch.getId()).getChildren();
- assertNotNull(rootSpeciesBatch);
- assertEquals(2, rootSpeciesBatch.size());
- assertNotNull(rootSpeciesBatch.get(0).getChildBatchs());
- assertTrue(rootSpeciesBatch.get(0).getChildBatchs().size() > 0);
- assertNotNull(rootSpeciesBatch.get(1).getChildBatchs());
- assertTrue(rootSpeciesBatch.get(1).getChildBatchs().size() > 0);
+ List<BenthosBatch> rootBenthosBatch = service.getRootBenthosBatch(fishingOperationWithEmptyBatch.getId()).getChildren();
+ assertNotNull(rootBenthosBatch);
+ assertEquals(2, rootBenthosBatch.size());
+ assertNotNull(rootBenthosBatch.get(0).getChildBatchs());
+ assertTrue(rootBenthosBatch.get(0).getChildBatchs().size() > 0);
+ assertNotNull(rootBenthosBatch.get(1).getChildBatchs());
+ assertTrue(rootBenthosBatch.get(1).getChildBatchs().size() > 0);
// -----------------------------------------------------------------------------
// 8. Test batch frequency creation
// -----------------------------------------------------------------------------
- List<SpeciesBatchFrequency> frequencies = Lists.newArrayList();
+ List<BenthosBatchFrequency> frequencies = Lists.newArrayList();
float lengthStep = 0.5f;
for (float length = lengthStep; length < lengthStep * 20; length += lengthStep) {
- SpeciesBatchFrequency frequency = TuttiBeanFactory.newSpeciesBatchFrequency();
+ BenthosBatchFrequency frequency = TuttiBeanFactory.newBenthosBatchFrequency();
frequency.setLengthStep(length);
frequency.setNumber((int) (length * 2));
frequency.setWeight(0.01f * length * 2);
@@ -343,13 +343,13 @@
frequency.setBatch(frequenciesParentBatch);
frequencies.add(frequency);
}
- List<SpeciesBatchFrequency> createdFrequencies = assertCreateAndReloadBenthosBatchFrequency(frequencies, frequenciesParentBatch.getId());
+ List<BenthosBatchFrequency> createdFrequencies = assertCreateAndReloadBenthosBatchFrequency(frequencies, frequenciesParentBatch.getId());
// -----------------------------------------------------------------------------
// 9. Test batch frequency update
// -----------------------------------------------------------------------------
// Update some batchs (1cm, 2cm, etc)
- for (SpeciesBatchFrequency speciesBatchFrequency : createdFrequencies) {
+ for (BenthosBatchFrequency speciesBatchFrequency : createdFrequencies) {
float length = speciesBatchFrequency.getLengthStep();
if ((float) (int) length == length) {
speciesBatchFrequency.setNumber(12);
@@ -360,21 +360,21 @@
createdFrequencies = Lists.newArrayList(createdFrequencies);
createdFrequencies.remove(createdFrequencies.size() - 1);
- List<SpeciesBatchFrequency> savedFrequencies = service.saveBenthosBatchFrequency(frequenciesParentBatch.getId(), createdFrequencies);
+ List<BenthosBatchFrequency> savedFrequencies = service.saveBenthosBatchFrequency(frequenciesParentBatch.getId(), createdFrequencies);
assertBatchFrequencies(createdFrequencies, savedFrequencies, true);
}
@Test
public void deleteBenthosBatch(/* String id */) {
- SpeciesBatch esp1Batch;
- SpeciesBatch batch;
+ BenthosBatch esp1Batch;
+ BenthosBatch batch;
Species taxon1 = species.get(0);
// -----------------------------------------------------------------------------
// 1. Create two batchs (parent + child), then remove the parent batch
// -----------------------------------------------------------------------------
// batch : ESP1 Vrac/5
- batch = TuttiBeanFactory.newSpeciesBatch();
+ batch = TuttiBeanFactory.newBenthosBatch();
batch.setParentBatch(null);
batch.setFishingOperation(fishingOperationWithEmptyBatch);
batch.setSpecies(taxon1);
@@ -385,7 +385,7 @@
esp1Batch = batch;
// batch : ESP1 Vrac/5 Male/2
- batch = TuttiBeanFactory.newSpeciesBatch();
+ batch = TuttiBeanFactory.newBenthosBatch();
batch.setParentBatch(esp1Batch);
batch.setFishingOperation(fishingOperationWithEmptyBatch);
batch.setSpecies(taxon1);
@@ -406,27 +406,27 @@
}
}
- protected void assertCreateAndReloadBenthosBatch(SpeciesBatch batch, String parentBatchId) {
+ protected void assertCreateAndReloadBenthosBatch(BenthosBatch batch, String parentBatchId) {
batch.setFishingOperation(fishingOperationWithEmptyBatch);
// Create batch
- SpeciesBatch createdBatch = service.createBenthosBatch(batch, parentBatchId);
- assertSpeciesBatch(batch, createdBatch, false);
+ BenthosBatch createdBatch = service.createBenthosBatch(batch, parentBatchId);
+ assertBenthosBatch(batch, createdBatch, false);
// then reload (for round trip check)
- SpeciesBatch reloadedBatch = getBenthosBatch(fishingOperationWithEmptyBatch.getId(), createdBatch.getId());
+ BenthosBatch reloadedBatch = getBenthosBatch(fishingOperationWithEmptyBatch.getId(), createdBatch.getId());
if (parentBatchId == null) {
assertNull(reloadedBatch.getParentBatch());
} else {
assertNotNull(reloadedBatch.getParentBatch());
assertEquals(parentBatchId, reloadedBatch.getParentBatch().getId());
}
- assertSpeciesBatch(createdBatch, reloadedBatch, false);
+ assertBenthosBatch(createdBatch, reloadedBatch, false);
batch.setId(createdBatch.getId());
}
- protected void assertSpeciesBatch(SpeciesBatch expectedBatch, SpeciesBatch actualBatch, boolean assertIdEquals) {
+ protected void assertBenthosBatch(BenthosBatch expectedBatch, BenthosBatch actualBatch, boolean assertIdEquals) {
assertNotNull(actualBatch);
assertNotNull(actualBatch.getId());
if (assertIdEquals && expectedBatch.getId() != null) {
@@ -449,7 +449,7 @@
assertEquals(expectedBatch.getComment(), actualBatch.getComment());
// Check species only if Vrac/HorsVrac or if batch has been load throw getAllxxx method
- // (Because getSpeciesBatch(id) could not always retrieve the species)
+ // (Because getBenthosBatch(id) could not always retrieve the species)
if (expectedBatch.getSpecies() != null && (
expectedBatch.getSampleCategoryType() == SampleCategoryEnum.sortedUnsorted
|| actualBatch.getSpecies() != null)) {
@@ -458,34 +458,34 @@
}
}
- protected List<SpeciesBatchFrequency> assertCreateAndReloadBenthosBatchFrequency(List<SpeciesBatchFrequency> frequencies, String parentBatchId) {
+ protected List<BenthosBatchFrequency> assertCreateAndReloadBenthosBatchFrequency(List<BenthosBatchFrequency> frequencies, String parentBatchId) {
// Create batch
- List<SpeciesBatchFrequency> createdFrequencies = service.saveBenthosBatchFrequency(parentBatchId, frequencies);
+ List<BenthosBatchFrequency> createdFrequencies = service.saveBenthosBatchFrequency(parentBatchId, frequencies);
assertBatchFrequencies(frequencies, createdFrequencies, false);
// then reload (for round trip check)
- List<SpeciesBatchFrequency> reloadedFrequencies = service.getAllBenthosBatchFrequency(parentBatchId);
+ List<BenthosBatchFrequency> reloadedFrequencies = service.getAllBenthosBatchFrequency(parentBatchId);
assertBatchFrequencies(createdFrequencies, reloadedFrequencies, true);
return createdFrequencies;
}
- protected void assertBatchFrequencies(List<SpeciesBatchFrequency> expectedFrequencies,
- List<SpeciesBatchFrequency> actualFrequencies,
+ protected void assertBatchFrequencies(List<BenthosBatchFrequency> expectedFrequencies,
+ List<BenthosBatchFrequency> actualFrequencies,
boolean assertIdEquals) {
assertNotNull(actualFrequencies);
assertEquals(expectedFrequencies.size(), actualFrequencies.size());
// Store actual batches into a map, using the length as key
- Map<Float, SpeciesBatchFrequency> expectedLengthMap = Maps.newHashMap();
- for (SpeciesBatchFrequency speciesBatchFrequency : expectedFrequencies) {
+ Map<Float, BenthosBatchFrequency> expectedLengthMap = Maps.newHashMap();
+ for (BenthosBatchFrequency speciesBatchFrequency : expectedFrequencies) {
expectedLengthMap.put(speciesBatchFrequency.getLengthStep(), speciesBatchFrequency);
}
// Store expected batches into a map, using the length as key
- Map<Float, SpeciesBatchFrequency> actualLengthMap = Maps.newHashMap();
- for (SpeciesBatchFrequency speciesBatchFrequency : actualFrequencies) {
+ Map<Float, BenthosBatchFrequency> actualLengthMap = Maps.newHashMap();
+ for (BenthosBatchFrequency speciesBatchFrequency : actualFrequencies) {
assertFalse("Duplicate lengthStep found in batchFrequencies, for length=" + speciesBatchFrequency.getLengthStep(),
actualLengthMap.containsKey(speciesBatchFrequency.getLengthStep()));
actualLengthMap.put(speciesBatchFrequency.getLengthStep(), speciesBatchFrequency);
@@ -493,8 +493,8 @@
}
for (Float lengthStep : expectedLengthMap.keySet()) {
- SpeciesBatchFrequency expectedBatchFrequency = expectedLengthMap.get(lengthStep);
- SpeciesBatchFrequency actualBatchFrequency = actualLengthMap.get(lengthStep);
+ BenthosBatchFrequency expectedBatchFrequency = expectedLengthMap.get(lengthStep);
+ BenthosBatchFrequency actualBatchFrequency = actualLengthMap.get(lengthStep);
if (assertIdEquals) {
assertEquals(expectedBatchFrequency.getId(), actualBatchFrequency.getId());
}
@@ -507,20 +507,20 @@
}
}
- protected SpeciesBatch getBenthosBatch(String fishingOperationId, String speciesBatchId) {
- return getSpeciesBatch(speciesBatchId, service.getRootBenthosBatch(fishingOperationId).getChildren());
+ protected BenthosBatch getBenthosBatch(String fishingOperationId, String speciesBatchId) {
+ return getBenthosBatch(speciesBatchId, service.getRootBenthosBatch(fishingOperationId).getChildren());
}
- protected SpeciesBatch getSpeciesBatch(String speciesBatchId, List<SpeciesBatch> speciesBatchs) {
+ protected BenthosBatch getBenthosBatch(String speciesBatchId, List<BenthosBatch> speciesBatchs) {
if (speciesBatchs == null) {
return null;
}
- for (SpeciesBatch speciesBatch : speciesBatchs) {
+ for (BenthosBatch speciesBatch : speciesBatchs) {
if (speciesBatchId.equals(speciesBatch.getId())) {
return speciesBatch;
}
if (speciesBatch.getChildBatchs() != null) {
- speciesBatch = getSpeciesBatch(speciesBatchId, speciesBatch.getChildBatchs());
+ speciesBatch = getBenthosBatch(speciesBatchId, speciesBatch.getChildBatchs());
if (speciesBatch != null) {
return speciesBatch;
}
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceWriteTest.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceServiceWriteTest.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -36,7 +36,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
/**
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -201,7 +201,7 @@
getLastUpdateDate(TuttiTable.VESSEL_TYPE, internalDb, getSqlDate(2012, 4, 25));
getLastUpdateDate(TuttiTable.VESSEL, internalDb, getSqlDate(2013, 3, 29));
getLastUpdateDate(TuttiTable.USER_PROFIL, internalDb, getSqlDate(2009, 6, 18));
- getLastUpdateDate(TuttiTable.DEPARTMENT, internalDb, getSqlDate(2013,2, 14));
+ getLastUpdateDate(TuttiTable.DEPARTMENT, internalDb, getSqlDate(2013, 2, 14));
getLastUpdateDate(TuttiTable.PERSON, internalDb, getSqlDate(2013, 4, 2));
getLastUpdateDate(TuttiTable.FRACTION2MATRIX, internalDb, null);
getLastUpdateDate(TuttiTable.PMFM2QUALITATIVE_VALUE, internalDb, null);
@@ -748,7 +748,7 @@
} else {
if (expected == null) {
- if(actual!=null) {
+ if (actual != null) {
if (log.isWarnEnabled()) {
log.warn("getLastUpdateDate(TuttiTable." + tuttiTable.name() + ", internalDb, null);");
}
@@ -890,8 +890,8 @@
Calendar actualCal = Calendar.getInstance();
actualCal.setTime(actual);
boolean result = expectedCal.get(Calendar.YEAR) == actualCal.get(Calendar.YEAR);
- result &= expectedCal.get(Calendar.MONTH)== actualCal.get(Calendar.MONTH);
- result &= expectedCal.get(Calendar.DAY_OF_MONTH)== actualCal.get(Calendar.DAY_OF_MONTH);
+ result &= expectedCal.get(Calendar.MONTH) == actualCal.get(Calendar.MONTH);
+ result &= expectedCal.get(Calendar.DAY_OF_MONTH) == actualCal.get(Calendar.DAY_OF_MONTH);
return result;
}
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -34,9 +34,12 @@
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
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.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
@@ -58,6 +61,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.commons.vfs2.AllFileSelector;
import org.apache.commons.vfs2.FileObject;
+import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.io.IOException;
@@ -698,18 +702,18 @@
//------------------------------------------------------------------------//
@Override
- public BatchContainer<SpeciesBatch> getRootBenthosBatch(String fishingOperationId) {
+ public BatchContainer<BenthosBatch> getRootBenthosBatch(String fishingOperationId) {
return driver.getRootBenthosBatch(fishingOperationId);
}
@Override
- public SpeciesBatch createBenthosBatch(SpeciesBatch bean,
+ public BenthosBatch createBenthosBatch(BenthosBatch bean,
String parentBatchId) {
return driver.createBenthosBatch(bean, parentBatchId);
}
@Override
- public SpeciesBatch saveBenthosBatch(SpeciesBatch bean) {
+ public BenthosBatch saveBenthosBatch(BenthosBatch bean) {
return driver.saveBenthosBatch(bean);
}
@@ -729,18 +733,18 @@
}
@Override
- public List<SpeciesBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
+ public List<BenthosBatchFrequency> getAllBenthosBatchFrequency(String benthosBatchId) {
return driver.getAllBenthosBatchFrequency(benthosBatchId);
}
@Override
- public List<SpeciesBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
- List<SpeciesBatchFrequency> frequencies) {
+ public List<BenthosBatchFrequency> saveBenthosBatchFrequency(String benthosBatchId,
+ List<BenthosBatchFrequency> frequencies) {
return driver.saveBenthosBatchFrequency(benthosBatchId, frequencies);
}
//------------------------------------------------------------------------//
- //-- Plancton Batch methods --//
+ //-- Plankton Batch methods --//
//------------------------------------------------------------------------//
@Override
@@ -749,11 +753,6 @@
}
@Override
- public PlanktonBatch getPlanktonBatch(String id) {
- return driver.getPlanktonBatch(id);
- }
-
- @Override
public PlanktonBatch createPlanktonBatch(PlanktonBatch bean) {
return driver.createPlanktonBatch(bean);
}
@@ -772,7 +771,6 @@
//-- Macrodechet Batch methods --//
//------------------------------------------------------------------------//
-
@Override
public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) {
return driver.getRootMarineLitterBatch(fishingOperationId);
@@ -794,7 +792,7 @@
}
//------------------------------------------------------------------------//
- //-- Accidentel Batch methods --//
+ //-- Accidental Batch methods --//
//------------------------------------------------------------------------//
@Override
@@ -803,11 +801,6 @@
}
@Override
- public AccidentalBatch getAccidentalBatch(String id) {
- return driver.getAccidentalBatch(id);
- }
-
- @Override
public AccidentalBatch createAccidentalBatch(AccidentalBatch bean) {
return driver.createAccidentalBatch(bean);
}
@@ -823,7 +816,29 @@
}
//------------------------------------------------------------------------//
- //-- Internal methods --//
+ //-- IndividualObservation Batch methods --//
//------------------------------------------------------------------------//
+ @Override
+ public List<IndividualObservationBatch> getAllIndividualObservationBatch(String fishingOperationId) {
+ return driver.getAllIndividualObservationBatch(fishingOperationId);
+ }
+
+ @Override
+ @Transactional(readOnly = false)
+ public IndividualObservationBatch createIndividualObservationBatch(IndividualObservationBatch bean) {
+ return driver.createIndividualObservationBatch(bean);
+ }
+
+ @Override
+ @Transactional(readOnly = false)
+ public IndividualObservationBatch saveIndividualObservationBatch(IndividualObservationBatch bean) {
+ return driver.saveIndividualObservationBatch(bean);
+ }
+
+ @Override
+ @Transactional(readOnly = false)
+ public void deleteIndividualObservationBatch(String id) {
+ driver.deleteIndividualObservationBatch(id);
+ }
}
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -249,7 +249,7 @@
public static final ValueParserFormatter<Date> TIME =
new DateValue("HH:mm:ss");
- public static final ValueFormatter<Serializable> CARACTERISTIC_VALUE_FORMATTER=
+ public static final ValueFormatter<Serializable> CARACTERISTIC_VALUE_FORMATTER =
new CaracteristicValueFormatter();
public static <E> BeanPropertyFormatter<E> newBeanFormatter(String propertyName,
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -32,7 +32,12 @@
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
-import fr.ifremer.tutti.persistence.entities.referential.*;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.Person;
+import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDecorator.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDecorator.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDecorator.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -29,7 +29,6 @@
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Maps;
-import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.beans.BeanUtil;
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -112,7 +112,7 @@
}
public <S extends TuttiService> S getService(Class<S> serviceType) {
- if (serviceType==null) {
+ if (serviceType == null) {
return null;
}
try {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -24,7 +24,14 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.data.*;
+import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
+import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import org.nuiton.validator.NuitonValidator;
import org.nuiton.validator.NuitonValidatorFactory;
@@ -68,9 +75,27 @@
return result;
}
+ public NuitonValidatorResult validateBenthosBatch(BenthosBatch benthosBatch) {
+ NuitonValidator<BenthosBatch> validator = NuitonValidatorFactory.newValidator(BenthosBatch.class);
+ NuitonValidatorResult result = validator.validate(benthosBatch);
+ return result;
+ }
+
public NuitonValidatorResult validateMarineLitterBatch(MarineLitterBatch marineLitterBatch) {
NuitonValidator<MarineLitterBatch> validator = NuitonValidatorFactory.newValidator(MarineLitterBatch.class);
NuitonValidatorResult result = validator.validate(marineLitterBatch);
return result;
}
+
+ public NuitonValidatorResult validateAccidentalBatch(AccidentalBatch accidentalBatch) {
+ NuitonValidator<AccidentalBatch> validator = NuitonValidatorFactory.newValidator(AccidentalBatch.class);
+ NuitonValidatorResult result = validator.validate(accidentalBatch);
+ return result;
+ }
+
+ public NuitonValidatorResult validateIndividualObservationBatch(IndividualObservationBatch individualObservationBatch) {
+ NuitonValidator<IndividualObservationBatch> validator = NuitonValidatorFactory.newValidator(IndividualObservationBatch.class);
+ NuitonValidatorResult result = validator.validate(individualObservationBatch);
+ return result;
+ }
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -25,7 +25,15 @@
*/
import fr.ifremer.tutti.TuttiBusinessException;
-import fr.ifremer.tutti.persistence.entities.data.*;
+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.SortedUnsortedEnum;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.service.AbstractTuttiService;
import fr.ifremer.tutti.service.PersistenceService;
@@ -36,7 +44,6 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorResult;
-import javax.swing.*;
import java.util.List;
import static org.nuiton.i18n.I18n._;
@@ -62,9 +69,9 @@
}
public void computeCatchBatchWeights(CatchBatch catchBatch,
- BatchContainer<SpeciesBatch> rootSpeciesBatch,
- BatchContainer<SpeciesBatch> rootBenthosBatch,
- BatchContainer<MarineLitterBatch> rootMarineLitterBatch) {
+ BatchContainer<SpeciesBatch> rootSpeciesBatch,
+ BatchContainer<BenthosBatch> rootBenthosBatch,
+ BatchContainer<MarineLitterBatch> rootMarineLitterBatch) {
// Species
Float speciesTotalComputedSortedWeight = 0f;
@@ -125,7 +132,7 @@
Float benthosTotalComputedUnsortedWeight = 0f;
for (int i = 0; i < rootBenthosBatch.getChildren().size(); i++) {
- SpeciesBatch row = rootBenthosBatch.getChildren().get(i);
+ BenthosBatch row = rootBenthosBatch.getChildren().get(i);
Float weight = row.getSampleCategoryWeight();
if (weight == null) {
weight = row.getSampleCategoryComputedWeight();
@@ -216,8 +223,8 @@
} else {
catchBatch.setCatchTotalRejectedComputedWeight(totalWeight
- - totalUnsortedWeight
- - totalSortedWeight);
+ - totalUnsortedWeight
+ - totalSortedWeight);
}
} else if (totalWeight == null) {
@@ -226,8 +233,8 @@
catchBatch.setCatchTotalRejectedComputedWeight(0f);
}
catchBatch.setCatchTotalComputedWeight(totalUnsortedWeight
- + totalSortedWeight
- + rejectedWeight);
+ + totalSortedWeight
+ + rejectedWeight);
} else if (!totalWeight.equals(totalUnsortedWeight + totalSortedWeight + rejectedWeight)) {
throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentTotal"));
@@ -242,8 +249,7 @@
if (rootSpeciesBatch != null) {
List<SpeciesBatch> roots = rootSpeciesBatch.getChildren();
- for (int i = 0; i < roots.size(); i++) {
- SpeciesBatch batch = roots.get(i);
+ for (SpeciesBatch batch : roots) {
computeSpeciesBatch(batch);
}
}
@@ -251,16 +257,15 @@
return rootSpeciesBatch;
}
- public BatchContainer<SpeciesBatch> getComputedBenthosBatches(FishingOperation operation) {
+ public BatchContainer<BenthosBatch> getComputedBenthosBatches(FishingOperation operation) {
- BatchContainer<SpeciesBatch> rootBenthosBatch =
+ BatchContainer<BenthosBatch> rootBenthosBatch =
persistenceService.getRootBenthosBatch(operation.getId());
- List<SpeciesBatch> roots = rootBenthosBatch.getChildren();
+ List<BenthosBatch> roots = rootBenthosBatch.getChildren();
- for (int i = 0; i < roots.size(); i++) {
- SpeciesBatch batch = roots.get(i);
- computeSpeciesBatch(batch);
+ for (BenthosBatch batch : roots) {
+ computeBenthosBatch(batch);
}
return rootBenthosBatch;
@@ -347,7 +352,7 @@
result = frequencyWeight;
} else if (frequencyWeight != null
- && !frequencyWeight.equals(categoryWeight)) {
+ && !frequencyWeight.equals(categoryWeight)) {
// if the weight of the frequencies is different from the category
// weight, then set the weight of the sample
@@ -374,4 +379,103 @@
return result;
}
+
+ protected Float computeBenthosBatch(BenthosBatch batch) {
+ Float result = null;
+ Float categoryWeight = batch.getSampleCategoryWeight();
+ Float rowWeight = batch.getWeight();
+
+ NuitonValidatorResult validation = validationService.validateBenthosBatch(batch);
+ if (!validation.isValid()) {
+ List<String> messages = validation.getErrorMessages(SpeciesBatch.PROPERTY_WEIGHT);
+ throw new TuttiBusinessException(_(messages.get(0)));
+ }
+
+ List<BenthosBatch> children = batch.getChildBatchs();
+ // if the row is not a leaf
+ if (batch.sizeChildBatchs() > 0) {
+ Float sum = 0f;
+ // make the sum of the children weights
+ for (BenthosBatch child : children) {
+ Float weight = computeBenthosBatch(child);
+ if (weight == null) {
+ sum = null;
+ break;
+ }
+ sum += weight;
+ }
+
+ if (sum != null) {
+ if (categoryWeight == null) {
+ batch.setSampleCategoryComputedWeight(sum);
+
+ } else if (categoryWeight < sum) {
+ throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentParentCategoryWeight"));
+
+ } else {
+ sum = categoryWeight;
+ }
+ result = sum;
+ }
+
+ } else {// the row is a leaf
+
+ batch.setComputedWeight(null);
+
+ List<BenthosBatchFrequency> frequencies = persistenceService.getAllBenthosBatchFrequency(batch.getId());
+
+ if (CollectionUtils.isNotEmpty(frequencies)) {
+ // if there are frequencies, then compute their weight
+ Float frequencyWeight = 0f;
+ for (BenthosBatchFrequency frequency : frequencies) {
+ Float w = frequency.getWeight();
+ if (w == null) {
+
+ // can't sum when a null value appears
+ frequencyWeight = null;
+ break;
+
+ } else if (frequencyWeight != null) {
+
+ // still can sum weights
+ frequencyWeight += w;
+ }
+ }
+
+ if (categoryWeight == null && rowWeight != null) {
+// throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentRowWeightCategory"));
+
+ } else if (categoryWeight == null && frequencyWeight != null) {
+ // if the category weight is null and the frequencies have a weight,
+ // then this weight is the result
+ batch.setSampleCategoryComputedWeight(frequencyWeight);
+ result = frequencyWeight;
+
+ } else if (frequencyWeight != null
+ && !frequencyWeight.equals(categoryWeight)) {
+
+ // if the weight of the frequencies is different from the category
+ // weight, then set the weight of the sample
+ if (frequencyWeight > categoryWeight) {
+ throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentCategoryWeight"));
+
+ } else if (rowWeight == null) {
+ batch.setComputedWeight(frequencyWeight);
+
+ } else if (!rowWeight.equals(frequencyWeight)) {
+ throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentRowWeightFrequency"));
+ }
+ result = categoryWeight;
+
+ } else {
+ result = categoryWeight;
+ }
+
+ } else {
+ result = categoryWeight;
+ }
+ }
+
+ return result;
+ }
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -127,6 +127,6 @@
public void setCsvSeparator(char c) {
applicationConfig.setOption(
- TuttiServiceConfigOption.CSV_SEPARATOR.getKey(), c+"");
+ TuttiServiceConfigOption.CSV_SEPARATOR.getKey(), c + "");
}
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ParameterExportRow.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ParameterExportRow.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/ParameterExportRow.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -43,6 +43,7 @@
private static final long serialVersionUID = 1L;
public static final String PROPERTY_CARACTERISTIC = "caracteristic";
+
public static final String PROPERTY_VALUE = "value";
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/pupitri/TuttiPupitriImportExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/pupitri/TuttiPupitriImportExportService.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/pupitri/TuttiPupitriImportExportService.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -27,7 +27,11 @@
import com.google.common.base.Charsets;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
-import com.google.common.collect.*;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.ListMultimap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.Sets;
import com.google.common.io.Files;
import fr.ifremer.tutti.TuttiTechnicalException;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
@@ -61,7 +65,9 @@
import java.io.File;
import java.io.IOException;
import java.io.Reader;
-import java.util.*;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -113,7 +119,6 @@
}
/**
- *
* @param trunkFile
* @param carrouselFile
* @param operation
@@ -121,9 +126,9 @@
* @return the number of rows of the .car file which have not been imported
*/
public int importPupitri(File trunkFile,
- File carrouselFile,
- FishingOperation operation,
- CatchBatch catchBatch) {
+ File carrouselFile,
+ FishingOperation operation,
+ CatchBatch catchBatch) {
importPupitriTrunk(trunkFile, operation, catchBatch);
@@ -220,8 +225,8 @@
}
protected int importPupitriCarrousel(File carrouselFile,
- FishingOperation operation,
- CatchBatch catchBatch) {
+ FishingOperation operation,
+ CatchBatch catchBatch) {
if (log.isInfoEnabled()) {
log.info("Will import pupitri operation [" + operation.toString() +
@@ -243,14 +248,14 @@
speciesBySurveyCode.putAll(
Multimaps.index(dataContext.getReferentSpeciesWithSurveyCode(),
- new Function<Species, String>() {
- @Override
- public String apply(Species input) {
- String surveyCode = String.valueOf(input.getSurveyCode());
- int end = Math.min(surveyCode.length(), 7);
- return surveyCode.substring(0, end);
- }
- })
+ new Function<Species, String>() {
+ @Override
+ public String apply(Species input) {
+ String surveyCode = String.valueOf(input.getSurveyCode());
+ int end = Math.min(surveyCode.length(), 7);
+ return surveyCode.substring(0, end);
+ }
+ })
);
speciesBySurveyCode.putAll(TuttiEntities.splitByRefTaxCode(dataContext.getReferentSpecies()));
Copied: trunk/tutti-service/src/main/resources/fr/ifremer/tutti/persistence/entities/data/BenthosBatch-error-validation.xml (from rev 772, trunk/tutti-service/src/main/resources/fr/ifremer/tutti/persistence/entities/data/SpeciesBatch-error-validation.xml)
===================================================================
--- trunk/tutti-service/src/main/resources/fr/ifremer/tutti/persistence/entities/data/BenthosBatch-error-validation.xml (rev 0)
+++ trunk/tutti-service/src/main/resources/fr/ifremer/tutti/persistence/entities/data/BenthosBatch-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="weight">
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ !(sampleCategoryWeight == null && weight != null) ]]>
+ </param>
+ <message>tutti.service.catches.computeWeights.error.incoherentRowWeightCategory</message>
+ </field-validator>
+
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ weight == null || sampleCategoryWeight == null || weight <= sampleCategoryWeight ]]>
+ </param>
+ <message>tutti.service.catches.computeWeights.error.incoherentSampleWeight</message>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/BeanValidatorDetectorTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/BeanValidatorDetectorTest.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/BeanValidatorDetectorTest.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -24,9 +24,11 @@
*/
package fr.ifremer.tutti.service;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -65,6 +67,8 @@
Cruise.class,
Program.class,
TuttiProtocol.class,
+ SpeciesBatch.class,
+ BenthosBatch.class,
FishingOperation.class
};
}
@@ -80,7 +84,7 @@
SortedSet<NuitonValidator<?>> validators = detectValidators(ALL_TYPES);
assertFalse(validators.isEmpty());
- assertEquals(5, validators.size());
+ assertEquals(7, validators.size());
}
@Test
@@ -91,8 +95,10 @@
validators = detectValidators(Pattern.compile(contextName), ALL_TYPES);
assertValidatorSetWithSameContextName(validators, null,
+ BenthosBatch.class,
Cruise.class,
Program.class,
+ SpeciesBatch.class,
TuttiProtocol.class
);
}
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-04-13 20:09:01 UTC (rev 773)
@@ -1,3 +1,26 @@
+###
+# #%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%
+###
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
#Thu Apr 11 16:29:39 CEST 2013
tutti.createAccidentalBatch.action.cancel.help=
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-04-13 20:09:01 UTC (rev 773)
@@ -1,3 +1,26 @@
+###
+# #%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%
+###
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
#Thu Apr 11 16:29:39 CEST 2013
tutti.createAccidentalBatch.action.cancel.help=
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -43,7 +43,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import javax.swing.table.TableCellEditor;
import java.awt.BorderLayout;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -42,7 +42,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -30,7 +30,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.SwingUtilities;
import static org.nuiton.i18n.I18n._;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -38,7 +38,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.AbstractButton;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -29,16 +29,11 @@
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
-import jaxx.runtime.SwingUtil;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.sort.TableSortController;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
import javax.swing.table.TableColumnModel;
import javax.swing.table.TableModel;
-import java.awt.Component;
-import java.awt.event.FocusEvent;
/**
* Abstract ui handler forbatch ui.
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -54,7 +54,10 @@
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXDatePicker;
-import javax.swing.*;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.JTabbedPane;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -811,7 +811,7 @@
Object oldValue = null;
List<Person> oldRecorderPerson = getRecorderPerson();
if (oldRecorderPerson != null) {
- oldValue= Lists.newArrayList(oldRecorderPerson);
+ oldValue = Lists.newArrayList(oldRecorderPerson);
}
editObject.setRecorderPerson(Lists.<Person>newArrayList());
if (recorderPerson != null) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -39,7 +39,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JTabbedPane;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -27,17 +27,18 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.TuttiBusinessException;
-import fr.ifremer.tutti.persistence.entities.data.*;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
+import fr.ifremer.tutti.persistence.entities.data.SortedUnsortedEnum;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.service.catches.TuttiWeightComputingService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
-import org.apache.commons.collections.CollectionUtils;
import javax.swing.JOptionPane;
import java.util.List;
@@ -64,7 +65,7 @@
tuttiWeightComputingService.getComputedSpeciesBatches(model.getFishingOperation());
Float totalSpeciesSortedWeight = computeSpeciesBatches(computedSpeciesBatches);
- BatchContainer<SpeciesBatch> computedBenthosBatches =
+ BatchContainer<BenthosBatch> computedBenthosBatches =
tuttiWeightComputingService.getComputedBenthosBatches(model.getFishingOperation());
Float totalBenthosSortedWeight = computeBenthosBatches(computedBenthosBatches);
@@ -74,8 +75,8 @@
Float rate = getConfig().getDifferenceRateBetweenSortedAndTotalWeights();
if (model.getSpeciesTotalSortedWeight() != null
- && model.getSpeciesTotalSortedWeight() >= totalSpeciesSortedWeight
- && model.getSpeciesTotalSortedWeight() < (1 + rate / 100) * totalSpeciesSortedWeight) {
+ && model.getSpeciesTotalSortedWeight() >= totalSpeciesSortedWeight
+ && model.getSpeciesTotalSortedWeight() < (1 + rate / 100) * totalSpeciesSortedWeight) {
// Si le "Poids total VRAC" est saisi est que sa valeur
// est supérieure de moins de x% (x en configuration)
@@ -88,10 +89,10 @@
_("tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.help"));
int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(),
- htmlMessage,
- _("tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.title"),
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ htmlMessage,
+ _("tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.title"),
+ JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
if (answer == JOptionPane.NO_OPTION) {
model.setSpeciesTotalSortedWeight(null);
@@ -99,8 +100,8 @@
}
}
if (model.getBenthosTotalSortedWeight() != null
- && model.getBenthosTotalSortedWeight() >= totalBenthosSortedWeight
- && model.getBenthosTotalSortedWeight() < (1 + rate / 100) * totalSpeciesSortedWeight) {
+ && model.getBenthosTotalSortedWeight() >= totalBenthosSortedWeight
+ && model.getBenthosTotalSortedWeight() < (1 + rate / 100) * totalSpeciesSortedWeight) {
// Si le "Poids total VRAC" est saisi est que sa valeur
// est supérieure de moins de x% (x en configuration)
@@ -113,10 +114,10 @@
_("tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.help"));
int answer = JOptionPane.showConfirmDialog(getContext().getActionUI(),
- htmlMessage,
- _("tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.title"),
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ htmlMessage,
+ _("tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.title"),
+ JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
if (answer == JOptionPane.NO_OPTION) {
model.setBenthosTotalSortedWeight(null);
@@ -177,13 +178,13 @@
return totalSortedWeight;
}
- protected Float computeBenthosBatches(BatchContainer<SpeciesBatch> computedBenthosBatches) {
+ protected Float computeBenthosBatches(BatchContainer<BenthosBatch> computedBenthosBatches) {
Float totalSortedWeight = 0f;
List<BenthosBatchRowModel> rows = Lists.newArrayList();
- List<SpeciesBatch> children = computedBenthosBatches.getChildren();
+ List<BenthosBatch> children = computedBenthosBatches.getChildren();
int rowIndex = 0;
- for (SpeciesBatch batch : children) {
+ for (BenthosBatch batch : children) {
BenthosBatchRowModel row = getUI().getBenthosTabContent().getHandler().loadBatch(batch, null, rows);
Float weight = row.getSortedUnsortedCategoryWeight();
if (weight == null) {
@@ -211,9 +212,8 @@
protected Float computeMarineLitterBatches(BatchContainer<MarineLitterBatch> computedMarineLitterBatches) {
Float totalWeight = 0f;
- List<MarineLitterBatchRowModel> rows = Lists.newArrayList();
List<MarineLitterBatch> children = computedMarineLitterBatches.getChildren();
- for (int i = 0 ; i < children.size() ; i++) {
+ for (int i = 0; i < children.size(); i++) {
MarineLitterBatch batch = children.get(i);
Float weight = batch.getWeight();
if (weight == null) {
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -145,7 +145,7 @@
<JLabel id='catchTotalSortedWeightLabel'/>
</cell>
<cell columns='4' weightx='1.0'>
- <JTextField id='catchTotalSortedWeightField'/>
+ <JTextField id='catchTotalSortedWeightField'/>
</cell>
</row>
<row>
@@ -297,8 +297,8 @@
</cell>
<cell weightx='1.0'>
<TuttiComputedOrNotDataEditor
- id='marineLitterTotalWeightField'
- constructorParams='this'/>
+ id='marineLitterTotalWeightField'
+ constructorParams='this'/>
</cell>
</row>
@@ -382,32 +382,35 @@
<JPanel id='accidentalTabPanel'>
<JXTitledPanel id='accidentalTabFishingOperationReminderLabel'
constraints='EditCatchesUIHandler.MAIN_CARD'>
- <AccidentalBatchUI id='accidentalTabContent' constructorParams='this'/>
+ <AccidentalBatchUI id='accidentalTabContent'
+ constructorParams='this'/>
</JXTitledPanel>
<JXTitledPanel id='accidentalTabCreateBatchReminderLabel'
constraints='EditCatchesUIHandler.CREATE_BATCH_CARD'>
<CreateAccidentalBatchUI id='accidentalTabCreateBatch'
- constructorParams='this'/>
+ constructorParams='this'/>
</JXTitledPanel>
</JPanel>
</tab>
<tab id='individualObservationTab'
title='tutti.label.tab.individualObservation'>
<JPanel id='individualObservationTabPanel'>
- <JXTitledPanel id='individualObservationTabFishingOperationReminderLabel'
- constraints='EditCatchesUIHandler.MAIN_CARD'>
+ <JXTitledPanel
+ id='individualObservationTabFishingOperationReminderLabel'
+ constraints='EditCatchesUIHandler.MAIN_CARD'>
<IndividualObservationBatchUI id='individualObservationTabContent'
- constructorParams='this'/>
+ constructorParams='this'/>
</JXTitledPanel>
<JXTitledPanel id='individualObservationTabCreateBatchReminderLabel'
constraints='EditCatchesUIHandler.CREATE_BATCH_CARD'>
- <CreateIndividualObservationBatchUI id='individualObservationTabCreateBatch'
- constructorParams='this'/>
+ <CreateIndividualObservationBatchUI
+ id='individualObservationTabCreateBatch'
+ constructorParams='this'/>
</JXTitledPanel>
<JXTitledPanel id='CaracteristicMapEditorReminderLabel'
constraints='EditCatchesUIHandler.EDIT_CARACTERISTICS_CARD'>
<CaracteristicMapEditorUI id='caracteristicMapEditor'
- constructorParams='individualObservationTabContent'/>
+ constructorParams='individualObservationTabContent'/>
</JXTitledPanel>
</JPanel>
</tab>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -33,14 +33,15 @@
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.action.TuttiActionHelper;
import jaxx.runtime.swing.CardLayout2Ext;
-import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTitledPanel;
-import javax.swing.*;
-import java.awt.*;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
import java.util.Set;
import static org.nuiton.i18n.I18n._;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -88,8 +88,10 @@
protected Float planktonTotalSampleWeight;
- protected TuttiComputedOrNotData<Float> marineLitterTotalComputedOrNotWeight = new TuttiComputedOrNotData<Float>();;
+ protected TuttiComputedOrNotData<Float> marineLitterTotalComputedOrNotWeight = new TuttiComputedOrNotData<Float>();
+ ;
+
protected TuttiComputedOrNotData<Float> catchTotalComputedOrNotWeight
= new TuttiComputedOrNotData<Float>();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -25,7 +25,6 @@
*/
import com.google.common.collect.Lists;
-import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
@@ -70,18 +69,18 @@
protected static final Binder<AccidentalBatch, AccidentalBatchRowModel> fromBeanBinder =
BinderFactory.newBinder(AccidentalBatch.class,
- AccidentalBatchRowModel.class);
+ AccidentalBatchRowModel.class);
protected static final Binder<AccidentalBatchRowModel, AccidentalBatch> toBeanBinder =
BinderFactory.newBinder(AccidentalBatchRowModel.class,
- AccidentalBatch.class);
+ AccidentalBatch.class);
public AccidentalBatchRowModel() {
super(AccidentalBatch.class, fromBeanBinder, toBeanBinder);
}
public AccidentalBatchRowModel(AccidentalBatch aBatch,
- List<Attachment> attachments) {
+ List<Attachment> attachments) {
this();
fromBean(aBatch);
this.attachment.addAll(attachments);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -25,9 +25,10 @@
*/
import com.google.common.collect.Lists;
-import fr.ifremer.tutti.PropagatePropertyChangeListener;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
-import fr.ifremer.tutti.persistence.entities.data.*;
+import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
+import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
@@ -38,9 +39,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create.CreateAccidentalBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create.CreateAccidentalBatchUIModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchTableModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
@@ -62,8 +61,9 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
-import java.awt.*;
+import javax.swing.JComponent;
+import java.awt.Color;
+import java.awt.Component;
import java.util.Collection;
import java.util.List;
@@ -299,9 +299,9 @@
{ // Gender caracteristic column
addComboDataColumnToModel(columnModel,
- AccidentalBatchTableModel.GENDER,
- caracteristicQualitativeValueDecorator,
- getDataContext().getGenderValues());
+ AccidentalBatchTableModel.GENDER,
+ caracteristicQualitativeValueDecorator,
+ getDataContext().getGenderValues());
}
@@ -316,26 +316,26 @@
{ // Size column
addFloatColumnToModel(columnModel,
- AccidentalBatchTableModel.SIZE,
- TuttiUI.DECIMAL3_PATTERN);
+ AccidentalBatchTableModel.SIZE,
+ TuttiUI.DECIMAL3_PATTERN);
}
{ // Length step caracteristic column
Decorator<Caracteristic> caracteristicDecorator =
getDecorator(Caracteristic.class, null);
addComboDataColumnToModel(columnModel,
- AccidentalBatchTableModel.LENGTH_STEP_CARACTERISTIC,
- caracteristicDecorator,
- getDataContext().getLengthStepCaracteristics());
+ AccidentalBatchTableModel.LENGTH_STEP_CARACTERISTIC,
+ caracteristicDecorator,
+ getDataContext().getLengthStepCaracteristics());
}
{ // Dead or alive caracteristic column
addComboDataColumnToModel(columnModel,
- AccidentalBatchTableModel.DEAD_OR_ALIVE,
- caracteristicQualitativeValueDecorator,
- getDataContext().getDeadOrAliveValues());
+ AccidentalBatchTableModel.DEAD_OR_ALIVE,
+ caracteristicQualitativeValueDecorator,
+ getDataContext().getDeadOrAliveValues());
}
@@ -435,20 +435,20 @@
protected void saveRow(AccidentalBatchRowModel row) {
-// AccidentalBatch catchBean = row.toBean();
-//
-// FishingOperation fishingOperation = getModel().getFishingOperation();
-// catchBean.setFishingOperation(fishingOperation);
-// if (log.isInfoEnabled()) {
-// log.info("Selected fishingOperation: " + fishingOperation.getId());
-// }
-//
-// if (TuttiEntities.isNew(catchBean)) {
-//
-// catchBean = persistenceService.createAccidentalBatch(catchBean);
-// row.setId(catchBean.getId());
-// } else {
-// persistenceService.saveAccidentalBatch(catchBean);
-// }
+ AccidentalBatch catchBean = row.toBean();
+
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+ catchBean.setFishingOperation(fishingOperation);
+ if (log.isInfoEnabled()) {
+ log.info("Selected fishingOperation: " + fishingOperation.getId());
+ }
+
+ if (TuttiEntities.isNew(catchBean)) {
+
+ catchBean = persistenceService.createAccidentalBatch(catchBean);
+ row.setId(catchBean.getId());
+ } else {
+ persistenceService.saveAccidentalBatch(catchBean);
+ }
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -41,7 +41,7 @@
* @since 0.2
*/
public class AccidentalBatchUIModel extends AbstractTuttiBatchUIModel<AccidentalBatchRowModel, AccidentalBatchUIModel>
- implements AttachmentModelAware, TabContentModel {
+ implements AttachmentModelAware, TabContentModel {
private static final long serialVersionUID = 1L;
@@ -49,9 +49,7 @@
protected final List<Attachment> attachment = Lists.newArrayList();
- /**
- * Can user remove a selected batch?
- */
+ /** Can user remove a selected batch? */
protected boolean removeBatchEnabled;
private String rootBatchId;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -54,7 +54,7 @@
rowIndex = table.getSelectedRow();
Preconditions.checkState(rowIndex != -1,
- "Cant remove batch if none is selected");
+ "Cant remove batch if none is selected");
AccidentalBatchTableModel tableModel = handler.getTableModel();
AccidentalBatchRowModel selectedBatch = tableModel.getEntry(rowIndex);
@@ -74,7 +74,7 @@
TuttiPersistence persistenceService =
getContext().getPersistenceService();
-// persistenceService.deleteMarineLitterBatch(id);
+ persistenceService.deleteMarineLitterBatch(id);
}
}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -51,10 +51,10 @@
]]></script>
<CreateAccidentalBatchUIHandler id='handler'
- initializer='getContextValue(CreateAccidentalBatchUIHandler.class)'/>
+ initializer='getContextValue(CreateAccidentalBatchUIHandler.class)'/>
<CreateAccidentalBatchUIModel id='model'
- initializer='getContextValue(CreateAccidentalBatchUIModel.class)'/>
+ initializer='getContextValue(CreateAccidentalBatchUIModel.class)'/>
<BeanValidator id='validator' bean='model'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -22,7 +22,6 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
@@ -36,25 +35,23 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
-import java.awt.*;
+import javax.swing.JComponent;
+import java.awt.Dimension;
import java.util.List;
/**
* @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
*/
public class CreateAccidentalBatchUIHandler extends AbstractTuttiUIHandler<CreateAccidentalBatchUIModel, CreateAccidentalBatchUI>
- implements Cancelable {
+ implements Cancelable {
private static final Log log =
LogFactory.getLog(CreateAccidentalBatchUIHandler.class);
- private final TuttiPersistence persistenceService;
-
public CreateAccidentalBatchUIHandler(TuttiUI parentUi,
CreateAccidentalBatchUI ui) {
super(parentUi.getHandler().getContext(), ui);
- this.persistenceService = context.getPersistenceService();
}
//------------------------------------------------------------------------//
@@ -74,20 +71,20 @@
initUI(ui);
initBeanFilterableComboBox(ui.getAccidentalSpeciesComboBox(),
- getDataContext().getReferentSpecies(),
- null);
+ getDataContext().getReferentSpecies(),
+ null);
initBeanFilterableComboBox(ui.getAccidentalGenderComboBox(),
- getDataContext().getGenderValues(),
- null);
+ getDataContext().getGenderValues(),
+ null);
initBeanFilterableComboBox(ui.getAccidentalLengthStepCaracteristicComboBox(),
- getDataContext().getLengthStepCaracteristics(),
- null);
+ getDataContext().getLengthStepCaracteristics(),
+ null);
initBeanFilterableComboBox(ui.getAccidentalDeadOrAliveComboBox(),
- getDataContext().getDeadOrAliveValues(),
- null);
+ getDataContext().getDeadOrAliveValues(),
+ null);
listenValidatorValid(ui.getValidator(), getModel());
}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -24,7 +24,6 @@
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
-import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -28,13 +28,13 @@
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
@@ -54,7 +54,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
-public class BenthosBatchRowModel extends AbstractTuttiBeanUIModel<SpeciesBatch, BenthosBatchRowModel> implements SpeciesBatch, AttachmentModelAware {
+public class BenthosBatchRowModel extends AbstractTuttiBeanUIModel<BenthosBatch, BenthosBatchRowModel> implements BenthosBatch, AttachmentModelAware {
private static final long serialVersionUID = 1L;
@@ -234,16 +234,16 @@
*/
protected List<BenthosBatchRowModel> childBatch;
- protected static final Binder<SpeciesBatch, BenthosBatchRowModel> fromBeanBinder =
- BinderFactory.newBinder(SpeciesBatch.class,
+ protected static final Binder<BenthosBatch, BenthosBatchRowModel> fromBeanBinder =
+ BinderFactory.newBinder(BenthosBatch.class,
BenthosBatchRowModel.class);
- protected static final Binder<BenthosBatchRowModel, SpeciesBatch> toBeanBinder =
+ protected static final Binder<BenthosBatchRowModel, BenthosBatch> toBeanBinder =
BinderFactory.newBinder(BenthosBatchRowModel.class,
- SpeciesBatch.class);
+ BenthosBatch.class);
public BenthosBatchRowModel() {
- super(SpeciesBatch.class, fromBeanBinder, toBeanBinder);
+ super(BenthosBatch.class, fromBeanBinder, toBeanBinder);
sortedUnsortedCategory = SampleCategory.newSample(SampleCategoryEnum.sortedUnsorted);
sizeCategory = SampleCategory.newSample(SampleCategoryEnum.size);
sexCategory = SampleCategory.newSample(SampleCategoryEnum.sex);
@@ -256,8 +256,8 @@
computedOrNotNumber.addPropagateListener(PROPERTY_COMPUTED_NUMBER, this);
}
- public BenthosBatchRowModel(SpeciesBatch aBatch,
- List<SpeciesBatchFrequency> frequencies,
+ public BenthosBatchRowModel(BenthosBatch aBatch,
+ List<BenthosBatchFrequency> frequencies,
List<Attachment> attachments) {
this();
fromBean(aBatch);
@@ -269,8 +269,8 @@
}
@Override
- protected SpeciesBatch newEntity() {
- return TuttiBeanFactory.newSpeciesBatch();
+ protected BenthosBatch newEntity() {
+ return TuttiBeanFactory.newBenthosBatch();
}
//------------------------------------------------------------------------//
@@ -778,7 +778,7 @@
}
@Override
- public SpeciesBatch getChildBatchs(int index) {
+ public BenthosBatch getChildBatchs(int index) {
return null;
}
@@ -793,44 +793,44 @@
}
@Override
- public void addChildBatchs(SpeciesBatch childBatchs) {
+ public void addChildBatchs(BenthosBatch childBatchs) {
}
@Override
- public void addAllChildBatchs(Collection<SpeciesBatch> childBatchs) {
+ public void addAllChildBatchs(Collection<BenthosBatch> childBatchs) {
}
@Override
- public boolean removeChildBatchs(SpeciesBatch childBatchs) {
+ public boolean removeChildBatchs(BenthosBatch childBatchs) {
return false;
}
@Override
- public boolean removeAllChildBatchs(Collection<SpeciesBatch> childBatchs) {
+ public boolean removeAllChildBatchs(Collection<BenthosBatch> childBatchs) {
return false;
}
@Override
- public boolean containsChildBatchs(SpeciesBatch childBatchs) {
+ public boolean containsChildBatchs(BenthosBatch childBatchs) {
return false;
}
@Override
- public boolean containsAllChildBatchs(Collection<SpeciesBatch> childBatchs) {
+ public boolean containsAllChildBatchs(Collection<BenthosBatch> childBatchs) {
return false;
}
@Override
- public List<SpeciesBatch> getChildBatchs() {
+ public List<BenthosBatch> getChildBatchs() {
return null;
}
@Override
- public void setChildBatchs(List<SpeciesBatch> childBatchs) {
+ public void setChildBatchs(List<BenthosBatch> childBatchs) {
}
@Override
- public void setParentBatch(SpeciesBatch parentBatch) {
+ public void setParentBatch(BenthosBatch parentBatch) {
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -25,9 +25,9 @@
*/
import com.google.common.collect.Sets;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryColumnIdentifier;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -30,10 +30,11 @@
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
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.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
@@ -41,7 +42,6 @@
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 fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.CreateBenthosBatchUI;
@@ -76,7 +76,10 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.RowFilter;
+import javax.swing.UIManager;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
import java.awt.Color;
@@ -205,7 +208,7 @@
if (!TuttiEntities.isNew(bean)) {
// get all batch species root (says the one with only a species sample category)
- BatchContainer<SpeciesBatch> rootBenthosBatch =
+ BatchContainer<BenthosBatch> rootBenthosBatch =
persistenceService.getRootBenthosBatch(bean.getId());
model.setRootBatchId(rootBenthosBatch.getId());
@@ -219,9 +222,9 @@
log.info("species root batch id: " + model.getRootBatchId());
}
- List<SpeciesBatch> catches = rootBenthosBatch.getChildren();
+ List<BenthosBatch> catches = rootBenthosBatch.getChildren();
- for (SpeciesBatch aBatch : catches) {
+ for (BenthosBatch aBatch : catches) {
// root batch sample categroy is species
Preconditions.checkState(
@@ -822,7 +825,7 @@
Preconditions.checkNotNull(sampleCategory.getCategoryType());
Preconditions.checkNotNull(sampleCategory.getCategoryValue());
- SpeciesBatch catchBean = row.toBean();
+ BenthosBatch catchBean = row.toBean();
catchBean.setFishingOperation(fishingOperation);
BenthosBatchRowModel parent = row.getParentBatch();
@@ -860,7 +863,7 @@
List<BenthosFrequencyRowModel> frequencyRows = row.getFrequency();
- List<SpeciesBatchFrequency> frequency =
+ List<BenthosBatchFrequency> frequency =
BenthosFrequencyRowModel.toBeans(frequencyRows, catchBean);
if (log.isInfoEnabled()) {
@@ -990,13 +993,13 @@
}
}
- public BenthosBatchRowModel loadBatch(SpeciesBatch aBatch,
- BenthosBatchRowModel parentRow,
- List<BenthosBatchRowModel> rows) {
+ public BenthosBatchRowModel loadBatch(BenthosBatch aBatch,
+ BenthosBatchRowModel parentRow,
+ List<BenthosBatchRowModel> rows) {
String id = aBatch.getId();
- List<SpeciesBatchFrequency> frequencies =
+ List<BenthosBatchFrequency> frequencies =
persistenceService.getAllBenthosBatchFrequency(id);
List<Attachment> attachments =
@@ -1036,7 +1039,7 @@
List<BenthosBatchRowModel> batchChilds = Lists.
newArrayListWithCapacity(aBatch.sizeChildBatchs());
- for (SpeciesBatch childBatch : aBatch.getChildBatchs()) {
+ for (BenthosBatch childBatch : aBatch.getChildBatchs()) {
BenthosBatchRowModel childRow = loadBatch(childBatch, newRow, rows);
batchChilds.add(childRow);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -45,7 +45,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -27,8 +27,8 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
+import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import org.nuiton.util.beans.Binder;
@@ -42,7 +42,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
-public class BenthosFrequencyRowModel extends AbstractTuttiBeanUIModel<SpeciesBatchFrequency, BenthosFrequencyRowModel> implements Comparable<BenthosFrequencyRowModel>, SpeciesBatchFrequency {
+public class BenthosFrequencyRowModel extends AbstractTuttiBeanUIModel<BenthosBatchFrequency, BenthosFrequencyRowModel> implements Comparable<BenthosFrequencyRowModel>, BenthosBatchFrequency {
private static final long serialVersionUID = 1L;
@@ -82,19 +82,19 @@
*/
protected Caracteristic lengthStepCaracteristic;
- protected static final Binder<SpeciesBatchFrequency, BenthosFrequencyRowModel> fromBeanBinder =
- BinderFactory.newBinder(SpeciesBatchFrequency.class,
+ protected static final Binder<BenthosBatchFrequency, BenthosFrequencyRowModel> fromBeanBinder =
+ BinderFactory.newBinder(BenthosBatchFrequency.class,
BenthosFrequencyRowModel.class);
- protected static final Binder<BenthosFrequencyRowModel, SpeciesBatchFrequency> toBeanBinder =
+ protected static final Binder<BenthosFrequencyRowModel, BenthosBatchFrequency> toBeanBinder =
BinderFactory.newBinder(BenthosFrequencyRowModel.class,
- SpeciesBatchFrequency.class);
+ BenthosBatchFrequency.class);
private static final Ordering<Float> ordering = Ordering.natural().nullsFirst();
- public static List<BenthosFrequencyRowModel> fromBeans(List<SpeciesBatchFrequency> frequency) {
+ public static List<BenthosFrequencyRowModel> fromBeans(List<BenthosBatchFrequency> frequency) {
List<BenthosFrequencyRowModel> result = Lists.newArrayList();
- for (SpeciesBatchFrequency b : frequency) {
+ for (BenthosBatchFrequency b : frequency) {
BenthosFrequencyRowModel model = new BenthosFrequencyRowModel();
fromBeanBinder.copy(b, model);
result.add(model);
@@ -102,11 +102,11 @@
return result;
}
- public static List<SpeciesBatchFrequency> toBeans(List<BenthosFrequencyRowModel> frequency, SpeciesBatch batch) {
- List<SpeciesBatchFrequency> result = Lists.newArrayList();
+ public static List<BenthosBatchFrequency> toBeans(List<BenthosFrequencyRowModel> frequency, BenthosBatch batch) {
+ List<BenthosBatchFrequency> result = Lists.newArrayList();
for (BenthosFrequencyRowModel b : frequency) {
- SpeciesBatchFrequency model =
- TuttiBeanFactory.newSpeciesBatchFrequency();
+ BenthosBatchFrequency model =
+ TuttiBeanFactory.newBenthosBatchFrequency();
toBeanBinder.copy(b, model);
model.setBatch(batch);
result.add(model);
@@ -115,7 +115,7 @@
}
public BenthosFrequencyRowModel() {
- super(SpeciesBatchFrequency.class, fromBeanBinder, toBeanBinder);
+ super(BenthosBatchFrequency.class, fromBeanBinder, toBeanBinder);
}
@Override
@@ -167,12 +167,12 @@
}
@Override
- public SpeciesBatch getBatch() {
+ public BenthosBatch getBatch() {
return null;
}
@Override
- public void setBatch(SpeciesBatch batch) {
+ public void setBatch(BenthosBatch batch) {
}
@Override
@@ -182,7 +182,7 @@
}
@Override
- protected SpeciesBatchFrequency newEntity() {
- return TuttiBeanFactory.newSpeciesBatchFrequency();
+ protected BenthosBatchFrequency newEntity() {
+ return TuttiBeanFactory.newBenthosBatchFrequency();
}
}
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -49,7 +49,8 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JTextField;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -24,9 +24,9 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import org.nuiton.util.beans.Binder;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,13 +26,13 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchUI;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
@@ -46,7 +46,9 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.*;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -25,9 +25,11 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
-import fr.ifremer.tutti.persistence.entities.data.*;
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
+import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
-import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
@@ -42,7 +44,7 @@
* @since 1.4
*/
public class IndividualObservationBatchRowModel extends AbstractTuttiBeanUIModel<IndividualObservationBatch, IndividualObservationBatchRowModel>
- implements AttachmentModelAware, IndividualObservationBatch {
+ implements AttachmentModelAware, IndividualObservationBatch {
private static final long serialVersionUID = 1L;
@@ -63,18 +65,18 @@
protected static final Binder<IndividualObservationBatch, IndividualObservationBatchRowModel> fromBeanBinder =
BinderFactory.newBinder(IndividualObservationBatch.class,
- IndividualObservationBatchRowModel.class);
+ IndividualObservationBatchRowModel.class);
protected static final Binder<IndividualObservationBatchRowModel, IndividualObservationBatch> toBeanBinder =
BinderFactory.newBinder(IndividualObservationBatchRowModel.class,
- IndividualObservationBatch.class);
+ IndividualObservationBatch.class);
public IndividualObservationBatchRowModel() {
super(IndividualObservationBatch.class, fromBeanBinder, toBeanBinder);
}
public IndividualObservationBatchRowModel(IndividualObservationBatch aBatch,
- List<Attachment> attachments) {
+ List<Attachment> attachments) {
this();
fromBean(aBatch);
this.attachment.addAll(attachments);
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -22,7 +22,6 @@
* #L%
*/
-import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import org.jdesktop.swingx.table.TableColumnModelExt;
@@ -31,6 +30,7 @@
/**
* @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
*/
public class IndividualObservationBatchTableModel extends AbstractTuttiTableModel<IndividualObservationBatchRowModel> {
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -20,7 +20,8 @@
#L%
-->
-<JPanel id='editIndividualObservationBatchTopPanel' layout='{new BorderLayout()}'
+<JPanel id='editIndividualObservationBatchTopPanel'
+ layout='{new BorderLayout()}'
decorator='help'
implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<IndividualObservationBatchUIModel, IndividualObservationBatchUIHandler>'>
@@ -54,10 +55,10 @@
]]></script>
<IndividualObservationBatchUIHandler id='handler'
- initializer='getContextValue(IndividualObservationBatchUIHandler.class)'/>
+ initializer='getContextValue(IndividualObservationBatchUIHandler.class)'/>
<IndividualObservationBatchUIModel id='model'
- initializer='getContextValue(IndividualObservationBatchUIModel.class)'/>
+ initializer='getContextValue(IndividualObservationBatchUIModel.class)'/>
<BeanValidator id='validator' bean='model'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -38,7 +38,6 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics.CaracteristicMapCellComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.create.CreateIndividualObservationBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.create.CreateIndividualObservationBatchUIModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchTableModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
@@ -60,8 +59,9 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
-import java.awt.*;
+import javax.swing.JComponent;
+import java.awt.Color;
+import java.awt.Component;
import java.util.Collection;
import java.util.List;
@@ -77,15 +77,15 @@
public IndividualObservationBatchUIHandler(TuttiUI<?, ?> parentUi, IndividualObservationBatchUI ui) {
super(parentUi, ui,
- IndividualObservationBatchRowModel.PROPERTY_SPECIES,
- IndividualObservationBatchRowModel.PROPERTY_WEIGHT,
- IndividualObservationBatchRowModel.PROPERTY_SIZE,
- IndividualObservationBatchRowModel.PROPERTY_LENGTH_STEP_CARACTERISTIC,
- IndividualObservationBatchRowModel.PROPERTY_CARACTERISTICS,
- IndividualObservationBatchRowModel.PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE,
- IndividualObservationBatchRowModel.PROPERTY_SAMPLING_CODE,
- IndividualObservationBatchRowModel.PROPERTY_COMMENT,
- IndividualObservationBatchRowModel.PROPERTY_ATTACHMENT);
+ IndividualObservationBatchRowModel.PROPERTY_SPECIES,
+ IndividualObservationBatchRowModel.PROPERTY_WEIGHT,
+ IndividualObservationBatchRowModel.PROPERTY_SIZE,
+ IndividualObservationBatchRowModel.PROPERTY_LENGTH_STEP_CARACTERISTIC,
+ IndividualObservationBatchRowModel.PROPERTY_CARACTERISTICS,
+ IndividualObservationBatchRowModel.PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE,
+ IndividualObservationBatchRowModel.PROPERTY_SAMPLING_CODE,
+ IndividualObservationBatchRowModel.PROPERTY_COMMENT,
+ IndividualObservationBatchRowModel.PROPERTY_ATTACHMENT);
}
//------------------------------------------------------------------------//
@@ -107,7 +107,7 @@
if (log.isInfoEnabled()) {
log.info("Get individualObservation batch for fishingOperation: " +
- bean.getId());
+ bean.getId());
}
rows = Lists.newArrayList();
@@ -303,29 +303,29 @@
Decorator<Species> speciesDecorator = getDecorator(
Species.class, DecoratorService.FROM_PROTOCOL);
addComboDataColumnToModel(columnModel,
- IndividualObservationBatchTableModel.SPECIES,
- speciesDecorator, getDataContext().getReferentSpecies());
+ IndividualObservationBatchTableModel.SPECIES,
+ speciesDecorator, getDataContext().getReferentSpecies());
}
{ // Weight column
addFloatColumnToModel(columnModel,
- IndividualObservationBatchTableModel.WEIGHT,
- TuttiUI.DECIMAL3_PATTERN);
+ IndividualObservationBatchTableModel.WEIGHT,
+ TuttiUI.DECIMAL3_PATTERN);
}
{ // Size column
addFloatColumnToModel(columnModel,
- IndividualObservationBatchTableModel.SIZE,
- TuttiUI.DECIMAL3_PATTERN);
+ IndividualObservationBatchTableModel.SIZE,
+ TuttiUI.DECIMAL3_PATTERN);
}
{ // Length step caracteristic column
addComboDataColumnToModel(columnModel,
- IndividualObservationBatchTableModel.LENGTH_STEP_CARACTERISTIC,
- caracteristicDecorator, getDataContext().getLengthStepCaracteristics());
+ IndividualObservationBatchTableModel.LENGTH_STEP_CARACTERISTIC,
+ caracteristicDecorator, getDataContext().getLengthStepCaracteristics());
}
@@ -333,38 +333,38 @@
Color computedDataColor = getConfig().getColorComputedWeights();
addColumnToModel(columnModel,
- CaracteristicMapCellComponent.newEditor(ui),
- CaracteristicMapCellComponent.newRender(getContext()),
- IndividualObservationBatchTableModel.OTHER_CARACTERISTICS);
+ CaracteristicMapCellComponent.newEditor(ui),
+ CaracteristicMapCellComponent.newRender(getContext()),
+ IndividualObservationBatchTableModel.OTHER_CARACTERISTICS);
}
{ // Calcified piece sampling code column
addColumnToModel(columnModel,
- IndividualObservationBatchTableModel.CALCIFIED_PIECE_SAMPLING_CODE);
+ IndividualObservationBatchTableModel.CALCIFIED_PIECE_SAMPLING_CODE);
}
{ // Sampling code column
addColumnToModel(columnModel,
- IndividualObservationBatchTableModel.SAMPLING_CODE);
+ IndividualObservationBatchTableModel.SAMPLING_CODE);
}
{ // Comment column
addColumnToModel(columnModel,
- CommentCellEditor.newEditor(ui),
- CommentCellRenderer.newRender(),
- IndividualObservationBatchTableModel.COMMENT);
+ CommentCellEditor.newEditor(ui),
+ CommentCellRenderer.newRender(),
+ IndividualObservationBatchTableModel.COMMENT);
}
{ // File column
addColumnToModel(columnModel,
- AttachmentCellEditor.newEditor(ui),
- AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)),
- IndividualObservationBatchTableModel.ATTACHMENT);
+ AttachmentCellEditor.newEditor(ui),
+ AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)),
+ IndividualObservationBatchTableModel.ATTACHMENT);
}
// create table model
@@ -447,20 +447,20 @@
protected void saveRow(IndividualObservationBatchRowModel row) {
-// IndividualObservationBatch catchBean = row.toBean();
-//
-// FishingOperation fishingOperation = getModel().getFishingOperation();
-// catchBean.setFishingOperation(fishingOperation);
-// if (log.isInfoEnabled()) {
-// log.info("Selected fishingOperation: " + fishingOperation.getId());
-// }
-//
-// if (TuttiEntities.isNew(catchBean)) {
-//
-// catchBean = persistenceService.createMarineLitterBatch(catchBean);
-// row.setId(catchBean.getId());
-// } else {
-// persistenceService.saveMarineLitterBatch(catchBean);
-// }
+ IndividualObservationBatch catchBean = row.toBean();
+
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+ catchBean.setFishingOperation(fishingOperation);
+ if (log.isInfoEnabled()) {
+ log.info("Selected fishingOperation: " + fishingOperation.getId());
+ }
+
+ if (TuttiEntities.isNew(catchBean)) {
+
+ catchBean = persistenceService.createIndividualObservationBatch(catchBean);
+ row.setId(catchBean.getId());
+ } else {
+ persistenceService.saveIndividualObservationBatch(catchBean);
+ }
}
}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -27,7 +27,6 @@
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.TabContentModel;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
import org.apache.commons.collections.CollectionUtils;
@@ -48,9 +47,7 @@
protected final List<Attachment> attachment = Lists.newArrayList();
- /**
- * Can user remove a selected batch?
- */
+ /** Can user remove a selected batch? */
protected boolean removeBatchEnabled;
private String rootBatchId;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -25,8 +25,6 @@
import com.google.common.base.Preconditions;
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.RemoveMarineLitterBatchAction;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.species.RemoveSpeciesSubBatchAction;
import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
import org.apache.commons.logging.Log;
@@ -35,6 +33,7 @@
/**
* @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
*/
public class RemoveIndividualObservationBatchAction
extends AbstractTuttiAction<IndividualObservationBatchUIModel, IndividualObservationBatchUI, IndividualObservationBatchUIHandler> {
@@ -56,7 +55,7 @@
rowIndex = table.getSelectedRow();
Preconditions.checkState(rowIndex != -1,
- "Cant remove batch if none is selected");
+ "Cant remove batch if none is selected");
IndividualObservationBatchTableModel tableModel = handler.getTableModel();
IndividualObservationBatchRowModel selectedBatch = tableModel.getEntry(rowIndex);
@@ -76,7 +75,7 @@
TuttiPersistence persistenceService =
getContext().getPersistenceService();
-// persistenceService.deleteMarineLitterBatch(id);
+ persistenceService.deleteIndividualObservationBatch(id);
}
}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -39,12 +39,15 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
+import javax.swing.AbstractCellEditor;
+import javax.swing.JTable;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Font;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
@@ -52,6 +55,7 @@
/**
* @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
*/
public class CaracteristicMapCellComponent extends DefaultTableCellRenderer {
@@ -97,7 +101,7 @@
tooltipText = "<html><ul>";
for (Caracteristic caracteristic : map.keySet()) {
tooltipText += "<li>" + caracteristicDecorator.toString(caracteristic) +
- " : " + valueDecorator.toString(map.get(caracteristic)) + "</li>";
+ " : " + valueDecorator.toString(map.get(caracteristic)) + "</li>";
}
tooltipText += "</ul></html>";
}
@@ -140,7 +144,7 @@
@Override
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER ||
- e.getKeyCode() == KeyEvent.VK_SPACE) {
+ e.getKeyCode() == KeyEvent.VK_SPACE) {
e.consume();
startEdit();
}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,6 +26,7 @@
/**
* @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
*/
public class CaracteristicMapEditorRowModel extends AbstractCaracteristicRowModel<CaracteristicMapEditorRowModel> {
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorTableModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -19,7 +19,8 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<Table implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<CaracteristicMapEditorUIModel, CaracteristicMapEditorUIHandler>'>
+<Table
+ implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<CaracteristicMapEditorUIModel, CaracteristicMapEditorUIHandler>'>
<import>
fr.ifremer.tutti.persistence.entities.referential.Caracteristic
@@ -32,10 +33,10 @@
</import>
<CaracteristicMapEditorUIHandler id='handler'
- initializer='getContextValue(CaracteristicMapEditorUIHandler.class)'/>
+ initializer='getContextValue(CaracteristicMapEditorUIHandler.class)'/>
<CaracteristicMapEditorUIModel id='model'
- initializer='getContextValue(CaracteristicMapEditorUIModel.class)'/>
+ initializer='getContextValue(CaracteristicMapEditorUIModel.class)'/>
<JPopupMenu id='tablePopup'>
<JMenuItem id='removeCaracteristicMenu'
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -47,7 +47,7 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.util.List;
import static fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics.CaracteristicMapCellComponent.CaracteristicMapCellEditor;
@@ -134,17 +134,17 @@
{
addColumnToModel(columnModel,
- null,
- newTableCellRender(Caracteristic.class, DecoratorService.CARACTERISTIC_WITH_UNIT),
- CaracteristicMapEditorTableModel.KEY);
+ null,
+ newTableCellRender(Caracteristic.class, DecoratorService.CARACTERISTIC_WITH_UNIT),
+ CaracteristicMapEditorTableModel.KEY);
}
{
addColumnToModel(columnModel,
- new CaracteristicValueEditor(context),
- new CaracteristicValueRenderer(context),
- CaracteristicMapEditorTableModel.VALUE);
+ new CaracteristicValueEditor(context),
+ new CaracteristicValueRenderer(context),
+ CaracteristicMapEditorTableModel.VALUE);
}
// create table model
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -22,12 +22,8 @@
* #L%
*/
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
-import fr.ifremer.tutti.ui.swing.content.operation.fishing.AbstractCaracteristicRowModel;
-import fr.ifremer.tutti.ui.swing.content.operation.fishing.AbstractCaracteristicTabUIModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
import java.util.List;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -19,7 +19,8 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-<JPanel id='createIndividualObservationBatchTopPanel' layout='{new BorderLayout()}'
+<JPanel id='createIndividualObservationBatchTopPanel'
+ layout='{new BorderLayout()}'
decorator='help'
implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<CreateIndividualObservationBatchUIModel, CreateIndividualObservationBatchUIHandler>'>
<import>
@@ -50,10 +51,10 @@
]]></script>
<CreateIndividualObservationBatchUIHandler id='handler'
- initializer='getContextValue(CreateIndividualObservationBatchUIHandler.class)'/>
+ initializer='getContextValue(CreateIndividualObservationBatchUIHandler.class)'/>
<CreateIndividualObservationBatchUIModel id='model'
- initializer='getContextValue(CreateIndividualObservationBatchUIModel.class)'/>
+ initializer='getContextValue(CreateIndividualObservationBatchUIModel.class)'/>
<BeanValidator id='validator' bean='model'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
@@ -90,7 +91,8 @@
<JLabel id='individualObservationWeightLabel'/>
</cell>
<cell weightx='1.0' columns='2'>
- <NumberEditor id='individualObservationWeightField' constructorParams='this'/>
+ <NumberEditor id='individualObservationWeightField'
+ constructorParams='this'/>
</cell>
</row>
@@ -100,7 +102,8 @@
<JLabel id='individualObservationSizeLabel'/>
</cell>
<cell weightx='1.0' columns='2'>
- <NumberEditor id='individualObservationSizeField' constructorParams='this'/>
+ <NumberEditor id='individualObservationSizeField'
+ constructorParams='this'/>
</cell>
</row>
@@ -110,9 +113,10 @@
<JLabel id='individualObservationLengthStepCaracteristicLabel'/>
</cell>
<cell weightx='1.0' columns='2'>
- <BeanFilterableComboBox id='individualObservationLengthStepCaracteristicComboBox'
- constructorParams='this'
- genericType='Caracteristic'/>
+ <BeanFilterableComboBox
+ id='individualObservationLengthStepCaracteristicComboBox'
+ constructorParams='this'
+ genericType='Caracteristic'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -22,13 +22,9 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.TuttiPersistence;
-import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Species;
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.marinelitter.create.CreateMarineLitterBatchUI;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.create.CreateMarineLitterBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
@@ -39,25 +35,23 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
-import java.awt.*;
+import javax.swing.JComponent;
+import java.awt.Dimension;
import java.util.List;
/**
* @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
*/
public class CreateIndividualObservationBatchUIHandler extends AbstractTuttiUIHandler<CreateIndividualObservationBatchUIModel, CreateIndividualObservationBatchUI>
- implements Cancelable {
+ implements Cancelable {
private static final Log log =
LogFactory.getLog(CreateIndividualObservationBatchUIHandler.class);
- private final TuttiPersistence persistenceService;
-
public CreateIndividualObservationBatchUIHandler(TuttiUI parentUi,
CreateIndividualObservationBatchUI ui) {
super(parentUi.getHandler().getContext(), ui);
- this.persistenceService = context.getPersistenceService();
}
//------------------------------------------------------------------------//
@@ -77,12 +71,12 @@
initUI(ui);
initBeanFilterableComboBox(ui.getIndividualObservationSpeciesComboBox(),
- getDataContext().getReferentSpecies(),
- null);
+ getDataContext().getReferentSpecies(),
+ null);
initBeanFilterableComboBox(ui.getIndividualObservationLengthStepCaracteristicComboBox(),
- getDataContext().getLengthStepCaracteristics(),
- null);
+ getDataContext().getLengthStepCaracteristics(),
+ null);
listenValidatorValid(ui.getValidator(), getModel());
}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -86,7 +86,7 @@
</cell>
<cell weightx='1.0'>
<TuttiComputedOrNotDataEditor id='marineLitterTotalWeightField'
- constructorParams='this'/>
+ constructorParams='this'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -60,7 +60,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Component;
import java.util.Collection;
@@ -474,12 +474,12 @@
Preconditions.checkNotNull(row.getMarineLitterSizeCategory());
if (log.isInfoEnabled()) {
log.info("Remove from speciesUsed: " +
- decorate(row.getMarineLitterSizeCategory()) +
- " - " + decorate(row.getMarineLitterCategory()));
+ decorate(row.getMarineLitterSizeCategory()) +
+ " - " + decorate(row.getMarineLitterCategory()));
}
MarineLitterBatchUIModel model = getModel();
model.getMarineLitterCategoriesUsed().remove(row.getMarineLitterSizeCategory(),
- row.getMarineLitterCategory());
+ row.getMarineLitterCategory());
}
@@ -489,12 +489,12 @@
Preconditions.checkNotNull(row.getMarineLitterSizeCategory());
if (log.isDebugEnabled()) {
log.debug("Add to marineLitterCategoriesUsed: " +
- decorate(row.getMarineLitterSizeCategory()) +
- " - " + decorate(row.getMarineLitterCategory()));
+ decorate(row.getMarineLitterSizeCategory()) +
+ " - " + decorate(row.getMarineLitterCategory()));
}
MarineLitterBatchUIModel model = getModel();
model.getMarineLitterCategoriesUsed().put(row.getMarineLitterSizeCategory(),
- row.getMarineLitterCategory());
+ row.getMarineLitterCategory());
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.jaxx 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -50,10 +50,10 @@
]]></script>
<CreateMarineLitterBatchUIHandler id='handler'
- initializer='getContextValue(CreateMarineLitterBatchUIHandler.class)'/>
+ initializer='getContextValue(CreateMarineLitterBatchUIHandler.class)'/>
<CreateMarineLitterBatchUIModel id='model'
- initializer='getContextValue(CreateMarineLitterBatchUIModel.class)'/>
+ initializer='getContextValue(CreateMarineLitterBatchUIModel.class)'/>
<BeanValidator id='validator' bean='model'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
@@ -75,7 +75,8 @@
<JLabel id='marineLitterCategoryLabel'/>
</cell>
<cell weightx='1.0'>
- <BeanFilterableComboBox id='marineLitterCategoryComboBox' constructorParams='this'
+ <BeanFilterableComboBox id='marineLitterCategoryComboBox'
+ constructorParams='this'
genericType='CaracteristicQualitativeValue'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
@@ -43,7 +42,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.awt.Dimension;
import java.util.List;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -100,12 +100,12 @@
CaracteristicQualitativeValue sizeCategory = getMarineLitterSizeCategory();
boolean result = category != null && sizeCategory != null &&
- isCategoryAndSizeCategoryAvailable(category, sizeCategory);
+ isCategoryAndSizeCategoryAvailable(category, sizeCategory);
return result;
}
public boolean isCategoryAndSizeCategoryAvailable(CaracteristicQualitativeValue category,
- CaracteristicQualitativeValue sizeCategory) {
+ CaracteristicQualitativeValue sizeCategory) {
boolean result = !marineLitterCategoryUsed.containsEntry(sizeCategory, category);
return result;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -45,7 +45,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.util.List;
/**
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -29,12 +29,12 @@
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -25,9 +25,9 @@
*/
import com.google.common.collect.Sets;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryColumnIdentifier;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -28,7 +28,13 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
-import fr.ifremer.tutti.persistence.entities.data.*;
+import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
+import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
@@ -36,7 +42,11 @@
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.*;
+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 fr.ifremer.tutti.ui.swing.content.operation.catches.SampleCategoryComponent;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.TableViewMode;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyCellComponent;
@@ -68,10 +78,15 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.RowFilter;
+import javax.swing.UIManager;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
@@ -269,8 +284,8 @@
&& (!speciesProtocol.isMaturityEnabled() || row.getMaturityCategoryValue() != null)
&& (!speciesProtocol.isAgeEnabled() || row.getAgeCategoryValue() != null)
&& (!speciesProtocol.isCountIfNoFrequencyEnabled()
- || !CollectionUtils.isEmpty(row.getFrequency())
- || row.getNumber() != null);
+ || !CollectionUtils.isEmpty(row.getFrequency())
+ || row.getNumber() != null);
}
}
}
@@ -1009,8 +1024,8 @@
}
public SpeciesBatchRowModel loadBatch(SpeciesBatch aBatch,
- SpeciesBatchRowModel parentRow,
- List<SpeciesBatchRowModel> rows) {
+ SpeciesBatchRowModel parentRow,
+ List<SpeciesBatchRowModel> rows) {
String id = aBatch.getId();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -45,7 +45,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -50,7 +50,8 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JTextField;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -24,9 +24,9 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import java.io.Serializable;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,13 +26,13 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
-import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
@@ -46,7 +46,9 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.*;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/AbstractCaracteristicTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/AbstractCaracteristicTabUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/AbstractCaracteristicTabUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -42,7 +42,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.util.List;
/**
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -33,7 +33,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import static org.nuiton.i18n.I18n._;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -91,6 +91,7 @@
public EditProtocolSpeciesRowModel() {
super(SpeciesProtocol.class, fromBeanBinder, toBeanBinder);
}
+
@Override
public Integer getSpeciesReferenceTaxonId() {
return species.getReferenceTaxonId();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-04-13 20:09:01 UTC (rev 773)
@@ -83,7 +83,7 @@
</JPopupMenu>
<JTabbedPane id='tabPanel'
- constraints='BorderLayout.CENTER'>
+ constraints='BorderLayout.CENTER'>
<tab title='tutti.editProtocol.tab.info'>
<Table id='protocolInfoForm' fill='both'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -60,7 +60,10 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.*;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JTabbedPane;
+import javax.swing.ListSelectionModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.ListSelectionEvent;
@@ -70,9 +73,6 @@
import javax.swing.table.TableColumnModel;
import java.awt.Component;
import java.awt.Dimension;
-import java.awt.event.ComponentEvent;
-import java.awt.event.HierarchyEvent;
-import java.awt.event.HierarchyListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Collection;
@@ -657,9 +657,9 @@
ComboBoxCellEditor editor = new ComboBoxCellEditor(comboBox);
addColumnToModel(model,
- editor,
- newTableCellRender(decorator),
- EditProtocolSpeciesTableModel.LENGTH_STEP_PMFM_ID);
+ editor,
+ newTableCellRender(decorator),
+ EditProtocolSpeciesTableModel.LENGTH_STEP_PMFM_ID);
}
protected void initTable(JXTable table) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/ExportPupitriAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/ExportPupitriAction.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/ExportPupitriAction.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,7 +26,6 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import fr.ifremer.tutti.TuttiIOUtil;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.pupitri.TuttiPupitriImportExportService;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -102,7 +102,16 @@
import java.awt.Font;
import java.awt.Frame;
import java.awt.Point;
-import java.awt.event.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
@@ -409,13 +418,13 @@
}
}
- ((Component)ui).addHierarchyListener(new HierarchyListener() {
+ ((Component) ui).addHierarchyListener(new HierarchyListener() {
@Override
public void hierarchyChanged(HierarchyEvent e) {
JComponent component = getComponentToFocus();
if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0
- && e.getChanged() .isShowing()
- && component != null) {
+ && e.getChanged().isShowing()
+ && component != null) {
component.requestFocus();
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -37,7 +37,6 @@
import java.awt.Font;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.lang.reflect.InvocationTargetException;
import static org.nuiton.i18n.I18n._;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -26,7 +26,6 @@
import com.google.common.base.Preconditions;
import fr.ifremer.tutti.TuttiTechnicalException;
-import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import jaxx.runtime.FileChooserUtil;
import jaxx.runtime.JAXXBinding;
import jaxx.runtime.JAXXObject;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -36,8 +36,6 @@
import org.jdesktop.beans.AbstractBean;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.SwingUtilities;
-
/**
* Tutti base action.
*
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -33,7 +33,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.awt.Container;
import java.awt.Cursor;
import java.beans.PropertyChangeEvent;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/attachment/AttachmentEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -32,7 +32,6 @@
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
-import fr.ifremer.tutti.ui.swing.util.action.TuttiActionException;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.swing.ComponentMover;
import jaxx.runtime.swing.ComponentResizer;
@@ -267,7 +266,7 @@
} catch (TuttiTechnicalException e) {
String message;
- if (e.getCause() instanceof TuttiTechnicalException) {
+ if (e.getCause() instanceof TuttiTechnicalException) {
message = e.getCause().getMessage();
} else {
message = _("swing.error.cannot.open.file");
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java 2013-04-13 20:09:01 UTC (rev 773)
@@ -33,7 +33,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.*;
+import javax.swing.JComponent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -28,13 +28,13 @@
<validators>
<field name="name">
-
+
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ name == null || name.equals(getGeneratedCampaignName()) ]]></param>
<message>tutti.validator.warning.cruise.name.format</message>
</field-validator>
-
+
</field>
</validators>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -35,7 +35,9 @@
<param name="expression">
<![CDATA[ gearShootingStartDate == null || isDateInCruise(gearShootingStartDate) ]]>
</param>
- <message>tutti.validator.error.fishingOperation.dates.startOutOfCruiseDates</message>
+ <message>
+ tutti.validator.error.fishingOperation.dates.startOutOfCruiseDates
+ </message>
</field-validator>
<field-validator type="fieldexpression" short-circuit="true">
@@ -52,14 +54,18 @@
<field name="gearShootingEndDate">
<field-validator type="required" short-circuit="true">
- <message>tutti.validator.error.fishingOperation.date.end.required</message>
+ <message>
+ tutti.validator.error.fishingOperation.date.end.required
+ </message>
</field-validator>
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ gearShootingEndDate == null || isDateInCruise(gearShootingEndDate) ]]>
</param>
- <message>tutti.validator.error.fishingOperation.dates.endOutOfCruiseDates</message>
+ <message>
+ tutti.validator.error.fishingOperation.dates.endOutOfCruiseDates
+ </message>
</field-validator>
<field-validator type="fieldexpression" short-circuit="true">
@@ -77,7 +83,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDegree() != null
]]>
</param>
@@ -88,7 +94,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
|| (
@@ -110,7 +116,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalDegree() != null
]]>
</param>
@@ -121,7 +127,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
( -ints.min < getGearShootingStartLatitudeDecimalDegree() && getGearShootingStartLatitudeDecimalDegree() < ints.max )
|| (
@@ -142,7 +148,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeMinute() != null
]]>
</param>
@@ -153,7 +159,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max )
]]>
@@ -169,7 +175,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalMinute() != null
]]>
</param>
@@ -180,7 +186,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( doubles.min <= getGearShootingStartLatitudeDecimalMinute() && getGearShootingStartLatitudeDecimalMinute() < doubles.max )
]]>
@@ -195,7 +201,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeSecond() != null
]]>
</param>
@@ -206,7 +212,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max )
]]>
@@ -222,7 +228,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDegree() != null
]]>
</param>
@@ -233,7 +239,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
(-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
|| (
@@ -255,7 +261,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalDegree() != null
]]>
</param>
@@ -266,7 +272,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
(-ints.min < getGearShootingStartLongitudeDecimalDegree() && getGearShootingStartLongitudeDecimalDegree() < ints.max)
|| (
@@ -287,7 +293,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeMinute() != null
]]>
</param>
@@ -298,7 +304,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max )
]]>
@@ -314,7 +320,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalMinute() != null
]]>
</param>
@@ -325,7 +331,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( doubles.min <= getGearShootingStartLongitudeDecimalMinute() && getGearShootingStartLongitudeDecimalMinute() < doubles.max )
]]>
@@ -340,7 +346,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeSecond() != null
]]>
</param>
@@ -351,7 +357,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max )
]]>
@@ -367,7 +373,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDegree() != null
]]>
</param>
@@ -378,7 +384,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
(-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
|| (
@@ -400,7 +406,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalDegree() != null
]]>
</param>
@@ -411,7 +417,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
(-ints.min < getGearShootingEndLatitudeDecimalDegree() && getGearShootingEndLatitudeDecimalDegree() < ints.max)
|| (
@@ -432,7 +438,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeMinute() != null
]]>
</param>
@@ -443,7 +449,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max )
]]>
@@ -459,7 +465,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalMinute() != null
]]>
</param>
@@ -470,7 +476,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( doubles.min <= getGearShootingEndLatitudeDecimalMinute() && getGearShootingEndLatitudeDecimalMinute() < doubles.max )
]]>
@@ -485,7 +491,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeSecond() != null
]]>
</param>
@@ -496,7 +502,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max )
]]>
@@ -512,7 +518,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
]]>
</param>
@@ -523,7 +529,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
(-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
|| (
@@ -545,7 +551,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalDegree() != null
]]>
</param>
@@ -556,7 +562,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
(-ints.min < getGearShootingEndLongitudeDecimalDegree() && getGearShootingEndLongitudeDecimalDegree() < ints.max)
|| (
@@ -577,7 +583,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
]]>
</param>
@@ -588,7 +594,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max )
]]>
@@ -604,7 +610,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalMinute() != null
]]>
</param>
@@ -615,7 +621,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( doubles.min <= getGearShootingEndLongitudeDecimalMinute() && getGearShootingEndLongitudeDecimalMinute() < doubles.max )
]]>
@@ -630,7 +636,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeSecond() != null
]]>
</param>
@@ -641,7 +647,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max )
]]>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -31,7 +31,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDegree() != null
]]>
</param>
@@ -42,7 +42,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
getGearShootingStartLatitudeDegree() != null &&
(( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
@@ -65,7 +65,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalDegree() != null
]]>
</param>
@@ -76,7 +76,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
getGearShootingStartLatitudeDecimalDegree() != null &&
(( -ints.min < getGearShootingStartLatitudeDecimalDegree() && getGearShootingStartLatitudeDecimalDegree() < ints.max )
@@ -98,7 +98,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeMinute() != null
]]>
</param>
@@ -109,7 +109,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingStartLatitudeMinute() != null
&& ints.min <= getGearShootingStartLatitudeMinute()
@@ -127,7 +127,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalMinute() != null
]]>
</param>
@@ -138,7 +138,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( getGearShootingStartLatitudeDecimalMinute() != null
&& doubles.min <= getGearShootingStartLatitudeDecimalMinute()
@@ -155,7 +155,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeSecond() != null
]]>
</param>
@@ -166,7 +166,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingStartLatitudeSecond() != null
&& ints.min <= getGearShootingStartLatitudeSecond()
@@ -184,7 +184,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDegree() != null
]]>
</param>
@@ -195,7 +195,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
getGearShootingStartLongitudeDegree() != null &&
((-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
@@ -218,7 +218,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalDegree() != null
]]>
</param>
@@ -229,7 +229,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
getGearShootingStartLongitudeDecimalDegree() != null &&
(( -ints.min < getGearShootingStartLongitudeDecimalDegree() && getGearShootingStartLongitudeDecimalDegree() < ints.max)
@@ -251,7 +251,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeMinute() != null
]]>
</param>
@@ -262,7 +262,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingStartLongitudeMinute() != null
&& ints.min <= getGearShootingStartLongitudeMinute()
@@ -280,7 +280,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalMinute() != null
]]>
</param>
@@ -291,7 +291,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( getGearShootingStartLongitudeDecimalMinute() != null
&& doubles.min <= getGearShootingStartLongitudeDecimalMinute()
@@ -308,7 +308,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeSecond() != null
]]>
</param>
@@ -319,7 +319,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingStartLongitudeSecond() != null
&& ints.min <= getGearShootingStartLongitudeSecond()
@@ -337,7 +337,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDegree() != null
]]>
</param>
@@ -348,7 +348,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
getGearShootingEndLatitudeDegree() != null &&
(( -ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
@@ -371,7 +371,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalDegree() != null
]]>
</param>
@@ -382,7 +382,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:90|max:90</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
getGearShootingEndLatitudeDecimalDegree() != null &&
(( -ints.min < getGearShootingEndLatitudeDecimalDegree() && getGearShootingEndLatitudeDecimalDegree() < ints.max)
@@ -404,7 +404,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeMinute() != null
]]>
</param>
@@ -415,7 +415,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingEndLatitudeMinute() != null
&& ints.min <= getGearShootingEndLatitudeMinute()
@@ -433,7 +433,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalMinute() != null
]]>
</param>
@@ -444,7 +444,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( getGearShootingEndLatitudeDecimalMinute() != null
&& doubles.min <= getGearShootingEndLatitudeDecimalMinute()
@@ -461,7 +461,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeSecond() != null
]]>
</param>
@@ -472,7 +472,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingEndLatitudeSecond() != null
&& ints.min <= getGearShootingEndLatitudeSecond()
@@ -490,7 +490,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
]]>
</param>
@@ -501,7 +501,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || (
getGearShootingEndLongitudeDegree() != null &&
((-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
@@ -524,7 +524,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalDegree() != null
]]>
</param>
@@ -535,7 +535,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:180|max:180</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || (
getGearShootingEndLongitudeDecimalDegree() != null &&
(( -ints.min < getGearShootingEndLongitudeDecimalDegree() && getGearShootingEndLongitudeDecimalDegree() < ints.max)
@@ -557,7 +557,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
]]>
</param>
@@ -568,7 +568,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingEndLongitudeMinute() != null
&& ints.min <= getGearShootingEndLongitudeMinute()
@@ -586,7 +586,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalMinute() != null
]]>
</param>
@@ -597,7 +597,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="doubleParams">min:0.0|max:60.0</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMD".equals(coordinateEditorType.toString()) ||
( getGearShootingEndLongitudeDecimalMinute() != null
&& doubles.min <= getGearShootingEndLongitudeDecimalMinute()
@@ -614,7 +614,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeSecond() != null
]]>
</param>
@@ -625,7 +625,7 @@
<field-validator type="fieldexpressionwithparams">
<param name="intParams">min:0|max:60</param>
<param name="expression">
- <![CDATA[
+ <![CDATA[
!"DMS".equals(coordinateEditorType.toString()) ||
( getGearShootingEndLongitudeSecond() != null
&& ints.min <= getGearShootingEndLongitudeSecond()
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -44,7 +44,8 @@
<field name="sortedUnsortedCategory">
<field-validator type="required" short-circuit="true">
- <message>tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required
+ <message>
+ tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required
</message>
</field-validator>
<field-validator type="fieldexpression" short-circuit="true">
@@ -60,7 +61,9 @@
<field name="batchWeight">
<field-validator type="fieldexpression" short-circuit="true">
- <param name="expression"><![CDATA[ batchWeight == null || batchWeight > 0 ]]></param>
+ <param name="expression">
+ <![CDATA[ batchWeight == null || batchWeight > 0 ]]>
+ </param>
<message>
tutti.validator.error.createSpeciesBatch.batchWeight.invalidValue
</message>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIModel-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIModel-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -33,9 +33,11 @@
<param name="expression">
<![CDATA[ isSimpleCountingMode() || lengthStepCaracteristic != null ]]>
</param>
- <message>tutti.validator.error.speciesFrequency.lengthStepCaracteristic.required</message>
+ <message>
+ tutti.validator.error.speciesFrequency.lengthStepCaracteristic.required
+ </message>
</field-validator>
-
+
</field>
<field name="rows">
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -38,7 +38,8 @@
<field name="sampleWeight">
<field-validator type="fieldexpression" short-circuit="true">
- <param name="expression"><![CDATA[ sampleWeight == null || sampleWeight > 0 ]]></param>
+ <param name="expression">
+ <![CDATA[ sampleWeight == null || sampleWeight > 0 ]]></param>
<message>
tutti.validator.error.splitSpeciesBatch.sampleWeight.invalidValue
</message>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -22,8 +22,8 @@
-->
<!DOCTYPE validators PUBLIC
- "-//Apache Struts//XWork Validator 1.0.3//EN"
- "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+ "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
<validators>
<field name="species">
Property changes on: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -44,7 +44,8 @@
<field name="sortedUnsortedCategory">
<field-validator type="required" short-circuit="true">
- <message>tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required
+ <message>
+ tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required
</message>
</field-validator>
<field-validator type="fieldexpression" short-circuit="true">
@@ -60,7 +61,8 @@
<field name="batchWeight">
<field-validator type="fieldexpression" short-circuit="true">
- <param name="expression"><![CDATA[ batchWeight == null || batchWeight > 0 ]]></param>
+ <param name="expression">
+ <![CDATA[ batchWeight == null || batchWeight > 0 ]]></param>
<message>
tutti.validator.error.createSpeciesBatch.batchWeight.invalidValue
</message>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -33,9 +33,11 @@
<param name="expression">
<![CDATA[ isSimpleCountingMode() || lengthStepCaracteristic != null ]]>
</param>
- <message>tutti.validator.error.speciesFrequency.lengthStepCaracteristic.required</message>
+ <message>
+ tutti.validator.error.speciesFrequency.lengthStepCaracteristic.required
+ </message>
</field-validator>
-
+
</field>
<field name="rows">
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel-error-validation.xml 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel-error-validation.xml 2013-04-13 20:09:01 UTC (rev 773)
@@ -38,7 +38,8 @@
<field name="sampleWeight">
<field-validator type="fieldexpression" short-circuit="true">
- <param name="expression"><![CDATA[ sampleWeight == null || sampleWeight > 0 ]]></param>
+ <param name="expression">
+ <![CDATA[ sampleWeight == null || sampleWeight > 0 ]]></param>
<message>
tutti.validator.error.splitSpeciesBatch.sampleWeight.invalidValue
</message>
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 2013-04-12 07:22:09 UTC (rev 772)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-04-13 20:09:01 UTC (rev 773)
@@ -1115,6 +1115,7 @@
tutti.update.tutti=
tutti.validator.error.comment.too.long=
tutti.validator.error.createIndividualObservationBatch.individualObservationSpecies.required=
+tutti.validator.error.createMarineLitterBatch.categoryAndSizeCategory.notAvailable=
tutti.validator.error.createMarineLitterBatch.marineLitterCategory.required=
tutti.validator.error.createMarineLitterBatch.marineLitterSizeCategory.required=
tutti.validator.error.createMarineLitterBatch.number.invalidValue=
1
0
r772 - trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches
by kmorin@users.forge.codelutin.com 12 Apr '13
by kmorin@users.forge.codelutin.com 12 Apr '13
12 Apr '13
Author: kmorin
Date: 2013-04-12 09:22:09 +0200 (Fri, 12 Apr 2013)
New Revision: 772
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/772
Log:
fixes #2272 [MACRODECHET] - l'?\195?\169l?\195?\169vation des poids ne marche pas
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-11 16:50:23 UTC (rev 771)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-12 07:22:09 UTC (rev 772)
@@ -195,7 +195,7 @@
} else if (marineLitterTotalComputedWeight != null && marineLitterTotalWeight < marineLitterTotalComputedWeight) {
throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentMarineLitterTotal"));
}
- //TODO kmorin 20130411 add marine litter batch to the right category (or directly to the total weight)
+ // nothing to do with the marine litter weight, it is an isolated weight
// Catch
Float totalUnsortedWeight = catchBatch.getSpeciesTotalUnsortedComputedWeight() +
1
0
r771 - in trunk: tutti-service/src/main/java/fr/ifremer/tutti/service tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content
by kmorin@users.forge.codelutin.com 11 Apr '13
by kmorin@users.forge.codelutin.com 11 Apr '13
11 Apr '13
Author: kmorin
Date: 2013-04-11 18:50:23 +0200 (Thu, 11 Apr 2013)
New Revision: 771
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/771
Log:
refs #2276 [ERGO] - Non rafraichissement du libell?\195?\169 de la campgne quand on change le protocole cf pi?\195?\168ce jointe
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-04-11 16:29:57 UTC (rev 770)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-04-11 16:50:23 UTC (rev 771)
@@ -606,6 +606,10 @@
return scientificGears;
}
+ public void resetCruise() {
+ cruise = null;
+ }
+
public void resetProtocol() {
protocol = null;
lengthStepCaracteristics = null;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java 2013-04-11 16:29:57 UTC (rev 770)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java 2013-04-11 16:50:23 UTC (rev 771)
@@ -109,6 +109,16 @@
String propertyName = evt.getPropertyName();
if (TuttiUIContext.PROPERTIES_TO_SAVE.contains(propertyName)) {
+ // reset cruise in case the listener which is supposed to reset
+ // the cruise is called after this one (cf #2276)
+ if (TuttiUIContext.PROPERTY_CRUISE_ID.equals(propertyName)) {
+ getDataContext().resetCruise();
+ }
+ // reset protocol in case the listener which is supposed to reset
+ // the protocol is called after this one (cf #2276)
+ if (TuttiUIContext.PROPERTY_PROTOCOL_ID.equals(propertyName)) {
+ getDataContext().resetProtocol();
+ }
// change the ui title
changeTitle();
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/627/>
------------------------------------------
Started by an SCM change
Building on master in workspace <http://ci.nuiton.org/jenkins/job/tutti/ws/>
Updating http://svn.forge.codelutin.com/svn/tutti/trunk to revision '2013-04-11T17:01:24.627 +0200'
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchTableModel.java
A tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create
A tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css
A tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx
A tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java
A tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
A tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.css
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.css
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorTableModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
U tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
G tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
ERROR: Failed to update http://svn.forge.codelutin.com/svn/tutti/trunk
org.tmatesoft.svn.core.SVNException: svn: E175002: REPORT /svn/tutti/!svn/vcc/default failed
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:304)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:289)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:277)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:696)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:328)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.runReport(DAVRepository.java:1289)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.update(DAVRepository.java:837)
at org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.update(SVNUpdateClient16.java:557)
at org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.doUpdate(SVNUpdateClient16.java:414)
at org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.doUpdate(SVNUpdateClient16.java:324)
at org.tmatesoft.svn.core.internal.wc2.old.SvnOldUpdate.run(SvnOldUpdate.java:27)
at org.tmatesoft.svn.core.internal.wc2.old.SvnOldUpdate.run(SvnOldUpdate.java:11)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1221)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:292)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:315)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:295)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:391)
at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:143)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:152)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:824)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:805)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:788)
at hudson.FilePath.act(FilePath.java:865)
at hudson.FilePath.act(FilePath.java:838)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:771)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:713)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:683)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:588)
at hudson.model.Run.execute(Run.java:1567)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Caused by: svn: E175002: REPORT /svn/tutti/!svn/vcc/default failed
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:154)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:97)
... 35 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E155017: REPORT request failed on '/svn/tutti/!svn/vcc/default'
svn: E155017: Checksum mismatch while updating '<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk2/tutti-ui-swing/src/main/re…';> expected: 'a27d3bbca523f6b229484ee16fa751c5', actual: '3c049f81639998b74779a295e89f0a34'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:675)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:298)
... 34 more
Caused by: svn: E155017: REPORT request failed on '/svn/tutti/!svn/vcc/default'
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:154)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:97)
at org.tmatesoft.svn.core.SVNErrorMessage.wrap(SVNErrorMessage.java:414)
... 36 more
Caused by: svn: E155017: Checksum mismatch while updating '<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk2/tutti-ui-swing/src/main/re…';> expected: 'a27d3bbca523f6b229484ee16fa751c5', actual: '3c049f81639998b74779a295e89f0a34'
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:189)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:141)
at org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor15.textDeltaEnd(SVNUpdateEditor15.java:634)
at org.tmatesoft.svn.core.internal.wc.SVNAmbientDepthFilterEditor.textDeltaEnd(SVNAmbientDepthFilterEditor.java:221)
at org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor.textDeltaEnd(SVNCancellableEditor.java:130)
at org.tmatesoft.svn.core.internal.io.dav.handlers.BasicDAVDeltaHandler.setDeltaProcessing(BasicDAVDeltaHandler.java:41)
at org.tmatesoft.svn.core.internal.io.dav.handlers.DAVEditorHandler.endElement(DAVEditorHandler.java:548)
at org.tmatesoft.svn.core.internal.io.dav.handlers.BasicDAVHandler.endElement(BasicDAVHandler.java:103)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:796)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:761)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:218)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:385)
... 35 more
ERROR: Subversion update failed
java.io.IOException
at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:184)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:152)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:824)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:805)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:788)
at hudson.FilePath.act(FilePath.java:865)
at hudson.FilePath.act(FilePath.java:838)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:771)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:713)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:683)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:588)
at hudson.model.Run.execute(Run.java:1567)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Caused by: hudson.scm.subversion.UpdaterException: failed to perform svn update
... 17 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: REPORT /svn/tutti/!svn/vcc/default failed
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:304)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:289)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:277)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:696)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doReport(DAVConnection.java:328)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.runReport(DAVRepository.java:1289)
at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.update(DAVRepository.java:837)
at org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.update(SVNUpdateClient16.java:557)
at org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.doUpdate(SVNUpdateClient16.java:414)
at org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.doUpdate(SVNUpdateClient16.java:324)
at org.tmatesoft.svn.core.internal.wc2.old.SvnOldUpdate.run(SvnOldUpdate.java:27)
at org.tmatesoft.svn.core.internal.wc2.old.SvnOldUpdate.run(SvnOldUpdate.java:11)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1221)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:292)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:315)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:295)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:391)
at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:143)
... 16 more
Caused by: svn: E175002: REPORT /svn/tutti/!svn/vcc/default failed
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:154)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:97)
... 35 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E155017: REPORT request failed on '/svn/tutti/!svn/vcc/default'
svn: E155017: Checksum mismatch while updating '<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk2/tutti-ui-swing/src/main/re…';> expected: 'a27d3bbca523f6b229484ee16fa751c5', actual: '3c049f81639998b74779a295e89f0a34'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:675)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:298)
... 34 more
Caused by: svn: E155017: REPORT request failed on '/svn/tutti/!svn/vcc/default'
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:154)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:97)
at org.tmatesoft.svn.core.SVNErrorMessage.wrap(SVNErrorMessage.java:414)
... 36 more
Caused by: svn: E155017: Checksum mismatch while updating '<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk2/tutti-ui-swing/src/main/re…';> expected: 'a27d3bbca523f6b229484ee16fa751c5', actual: '3c049f81639998b74779a295e89f0a34'
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:189)
at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:141)
at org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor15.textDeltaEnd(SVNUpdateEditor15.java:634)
at org.tmatesoft.svn.core.internal.wc.SVNAmbientDepthFilterEditor.textDeltaEnd(SVNAmbientDepthFilterEditor.java:221)
at org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor.textDeltaEnd(SVNCancellableEditor.java:130)
at org.tmatesoft.svn.core.internal.io.dav.handlers.BasicDAVDeltaHandler.setDeltaProcessing(BasicDAVDeltaHandler.java:41)
at org.tmatesoft.svn.core.internal.io.dav.handlers.DAVEditorHandler.endElement(DAVEditorHandler.java:548)
at org.tmatesoft.svn.core.internal.io.dav.handlers.BasicDAVHandler.endElement(BasicDAVHandler.java:103)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:796)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.readData(HTTPConnection.java:761)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:218)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:385)
... 35 more
1
2