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
October 2013
- 5 participants
- 76 discussions
r1270 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: . content/operation content/operation/catches/benthos content/operation/catches/individualobservation content/operation/catches/individualobservation/create content/operation/catches/marinelitter content/operation/catches/species util/action
by tchemit@users.forge.codelutin.com 03 Oct '13
by tchemit@users.forge.codelutin.com 03 Oct '13
03 Oct '13
Author: tchemit
Date: 2013-10-03 11:07:04 +0200 (Thu, 03 Oct 2013)
New Revision: 1270
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1270
Log:
improve logs
fixes #3420: [DONNEES INDIVIDUELLES] Mauvaise liste de choix d'esp?\195?\168ces
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.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/individualobservation/IndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.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/util/action/TuttiUIAction.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-10-03 09:07:04 UTC (rev 1270)
@@ -176,27 +176,6 @@
*/
protected final TuttiErrorHelper errorHelper;
-// /**
-// * Id of last selected program (can be null if none ever selected).
-// *
-// * @since 0.1
-// */
-// protected String programId;
-//
-// /**
-// * Id of last selected cruise (can be null if none ever selected).
-// *
-// * @since 0.1
-// */
-// protected String cruiseId;
-//
-// /**
-// * Id of last selected protocol (can be null if none ever selected).
-// *
-// * @since 0.1
-// */
-// protected String protocolId;
-
/**
* Shared data context.
*
@@ -307,6 +286,12 @@
@Override
public void showInformationMessage(String message) {
if (StringUtils.isNotBlank(message)) {
+ message = message.replaceAll("\\<strong\\>","");
+ message = message.replaceAll("\\<.strong\\>","");
+ message = message.replaceAll("\\<li\\>","");
+ message = message.replaceAll("\\<.li\\>","");
+ message = message.replaceAll("\\<ul\\>","");
+ message = message.replaceAll("\\<.ul\\>","");
if (log.isInfoEnabled()) {
log.info(message);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-03 09:07:04 UTC (rev 1270)
@@ -27,6 +27,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.InvalidBatchModelException;
+import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -340,17 +341,13 @@
errorMessages.clear();
- if (log.isInfoEnabled()) {
- log.info("Try to edit fishingOperation: " + fishingOperation);
- }
-
FishingOperationsUI ui = getUI();
FishingOperationsUIModel model = ui.getModel();
// edit new fishing operation
if (log.isInfoEnabled()) {
- log.info("Edit in ui fishingOperation: " + fishingOperation);
+ log.info("Edit fishingOperation: " + fishingOperation);
}
// now fishing operation is edited
@@ -593,11 +590,21 @@
boolean catchNotFound;
boolean catchEnabled;
+ String operationId = bean == null ? null : bean.getId();
+
+ ProgressionModel progressionModel = getProgressionModel();
+ if (progressionModel == null) {
+ progressionModel = new ProgressionModel();
+ setProgressionModel(progressionModel);
+ }
+ progressionModel.adaptTotal(empty ? 1 : 6);
+
if (empty) {
// create a new CatchBatch
- if (log.isInfoEnabled()) {
- log.info("Create a new CatchBatch (fishing operation is null)");
+ progressionModel.increments("Create new catch batch");
+ if (log.isDebugEnabled()) {
+ log.debug("Create a new CatchBatch (fishing operation is null)");
}
batch = CatchBatchs.newCatchBatch();
batch.setFishingOperation(bean);
@@ -609,16 +616,17 @@
} else {
- String operationId = bean.getId();
-
- if (log.isInfoEnabled()) {
- log.info("Load existing CatchBatch from operation id: " +
- operationId);
+ if (log.isDebugEnabled()) {
+ log.debug("Load existing CatchBatch from operation id: " +
+ operationId);
}
PersistenceService persistenceService =
getContext().getPersistenceService();
+ progressionModel.increments("Loading catch batch for fishingOperation: " +
+ operationId);
+
boolean withCatchBath =
persistenceService.isFishingOperationWithCatchBatch(
operationId);
@@ -629,7 +637,7 @@
try {
batch = persistenceService.getCatchBatchFromFishingOperation(operationId);
batch.setFishingOperation(bean);
- Integer objectId = Integer.valueOf(batch.getId());
+ Integer objectId = batch.getIdAsInt();
attachments = persistenceService.getAllAttachments(catchesUIModel.getObjectType(), objectId);
catchNotFound = false;
catchEnabled = true;
@@ -657,8 +665,7 @@
}
}
- setCatch(//bean,
- attachments,
+ setCatch(attachments,
catchesUIModel,
catchBatchMonitor,
batch,
@@ -674,6 +681,9 @@
boolean catchValid = true;
try {
+ progressionModel.increments("Loading species batch for fishingOperation: " +
+ operationId);
+
ui.getSpeciesTabContent().getHandler().selectFishingOperation(operationToLoad);
} catch (InvalidBatchModelException e) {
@@ -686,6 +696,8 @@
}
try {
+ progressionModel.increments("Loading benthos batch for fishingOperation: " +
+ operationId);
ui.getBenthosTabContent().getHandler().selectFishingOperation(operationToLoad);
} catch (InvalidBatchModelException e) {
@@ -701,15 +713,22 @@
// load other tabs
+ progressionModel.increments("Loading marine lietterbatch for fishingOperation: " +
+ operationId);
ui.getMarineLitterTabContent().getHandler().selectFishingOperation(operationToLoad);
+
+ progressionModel.increments("Loading accidental batch for fishingOperation: " +
+ operationId);
ui.getAccidentalTabContent().getHandler().selectFishingOperation(operationToLoad);
+
+ progressionModel.increments("Loading individual observation batch for fishingOperation: " +
+ operationId);
ui.getIndividualObservationTabContent().getHandler().selectFishingOperation(operationToLoad);
} else {
// remove catch
- setCatch(//bean,
- Collections.<Attachment>emptyList(),
+ setCatch(Collections.<Attachment>emptyList(),
catchesUIModel,
catchBatchMonitor,
null,
@@ -727,8 +746,7 @@
}
- protected void setCatch(//FishingOperation bean,
- List<Attachment> attachments,
+ protected void setCatch(List<Attachment> attachments,
EditCatchesUIModel catchesUIModel,
TuttiBeanMonitor<EditCatchesUIModel> catchBatchMonitor,
CatchBatch batch,
@@ -740,8 +758,6 @@
getModel().setCatchNotFound(catchNotFound);
getModel().setSampleCatchModelValid(sampleModelValid);
-// catchesUIModel.setCatchBatch(batch);
-// catchesUIModel.setFishingOperation(bean);
catchesUIModel.fromEntity(batch);
catchesUIModel.addAllAttachment(attachments);
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-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270)
@@ -221,8 +221,8 @@
rows = null;
} else {
- if (log.isInfoEnabled()) {
- log.info("Get species batch for fishingOperation: " +
+ if (log.isDebugEnabled()) {
+ log.debug("Get species batch for fishingOperation: " +
bean.getId());
}
rows = Lists.newArrayList();
@@ -307,11 +307,6 @@
recomputeRowValidState(row);
- if (log.isInfoEnabled()) {
- log.info("Property modified [" + propertyName + "] <" +
- oldValue + ":" + newValue + ">");
- }
-
if (SpeciesBatchRowModel.PROPERTY_SAMPLE_CATEGORY_WEIGHT.equals(propertyName)) {
// sampling category weight has changed, must then save the top
@@ -330,8 +325,8 @@
// ancestor is not this row
// then only save ancestor
- if (log.isInfoEnabled()) {
- log.info("Sample category " + sampleCategoryId +
+ if (log.isDebugEnabled()) {
+ log.debug("Sample category " + sampleCategoryId +
" weight was modified, First ancestor row: " +
firstAncestorIndex + " will save it");
}
@@ -699,8 +694,8 @@
List<Integer> samplingOrder = sampleCategoryModel.getSamplingOrder();
- if (log.isInfoEnabled()) {
- log.info("Will use sampling order: " + samplingOrder);
+ if (log.isDebugEnabled()) {
+ log.debug("Will use sampling order: " + samplingOrder);
}
JXTable table = getTable();
@@ -1087,8 +1082,8 @@
}
}
- if (log.isInfoEnabled()) {
- log.info("New selected category: " + selectedItem);
+ if (log.isDebugEnabled()) {
+ log.debug("New selected category: " + selectedItem);
}
if (selectedItem != null) {
@@ -1146,9 +1141,6 @@
// add new batches to his parent
parentBatch.setChildBatch(newBatches);
- //TODO Should only save parentBatch (will persist all his childs)
- //saveRow(parentBatch);
-
// save new batches
saveRows(newBatches);
@@ -1346,8 +1338,8 @@
SampleCategory<?> firstSampleCategory = row.getFirstSampleCategory();
CaracteristicQualitativeValue categoryValue = (CaracteristicQualitativeValue) firstSampleCategory.getCategoryValue();
Preconditions.checkNotNull(firstSampleCategory);
- if (log.isInfoEnabled()) {
- log.info("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies()));
+ if (log.isDebugEnabled()) {
+ log.debug("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies()));
}
BenthosBatchUIModel model = getModel();
model.getSpeciesUsed().remove(categoryValue, row.getSpecies());
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-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270)
@@ -130,8 +130,8 @@
rows = null;
} else {
- if (log.isInfoEnabled()) {
- log.info("Get individualObservation batch for fishingOperation: " +
+ if (log.isDebugEnabled()) {
+ log.debug("Get individualObservation batch for fishingOperation: " +
bean.getId());
}
rows = Lists.newArrayList();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-10-03 09:07:04 UTC (rev 1270)
@@ -46,6 +46,7 @@
#individualObservationSpeciesComboBox {
property: species;
selectedItem: {model.getSpecies()};
+ data: {model.getAvailableSpecies()};
}
#individualObservationWeightLabel {
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-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270)
@@ -114,8 +114,8 @@
rows = null;
} else {
- if (log.isInfoEnabled()) {
- log.info("Get marineLitter batch for fishingOperation: " +
+ if (log.isDebugEnabled()) {
+ log.debug("Get marineLitter batch for fishingOperation: " +
bean.getId());
}
rows = Lists.newArrayList();
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-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-10-03 09:07:04 UTC (rev 1270)
@@ -227,8 +227,8 @@
rows = null;
} else {
- if (log.isInfoEnabled()) {
- log.info("Get species batch for fishingOperation: " +
+ if (log.isDebugEnabled()) {
+ log.debug("Get species batch for fishingOperation: " +
bean.getId());
}
rows = Lists.newArrayList();
@@ -333,8 +333,8 @@
// ancestor is not this row
// then only save ancestor
- if (log.isInfoEnabled()) {
- log.info("Sample category " + sampleCategoryId +
+ if (log.isDebugEnabled()) {
+ log.debug("Sample category " + sampleCategoryId +
" weight was modified, First ancestor row: " +
firstAncestorIndex + " will save it");
}
@@ -703,8 +703,8 @@
List<Integer> samplingOrder = sampleCategoryModel.getSamplingOrder();
- if (log.isInfoEnabled()) {
- log.info("Will use sampling order: " + samplingOrder);
+ if (log.isDebugEnabled()) {
+ log.debug("Will use sampling order: " + samplingOrder);
}
JXTable table = getTable();
@@ -935,8 +935,8 @@
}
if (split) {
- if (log.isInfoEnabled()) {
- log.info("Open split batch ui for row [" + rowIndex + ']');
+ if (log.isDebugEnabled()) {
+ log.debug("Open split batch ui for row [" + rowIndex + ']');
}
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
@@ -1090,8 +1090,8 @@
}
}
- if (log.isInfoEnabled()) {
- log.info("New selected category: " + selectedItem);
+ if (log.isDebugEnabled()) {
+ log.debug("New selected category: " + selectedItem);
}
if (selectedItem != null) {
@@ -1149,9 +1149,6 @@
// add new batches to his parent
parentBatch.setChildBatch(newBatches);
- //TODO Should only save parentBatch (will persist all his childs)
- //saveRow(parentBatch);
-
// save new batches
saveRows(newBatches);
@@ -1350,8 +1347,8 @@
SampleCategory<?> firstSampleCategory = row.getFirstSampleCategory();
CaracteristicQualitativeValue categoryValue = (CaracteristicQualitativeValue) firstSampleCategory.getCategoryValue();
Preconditions.checkNotNull(firstSampleCategory);
- if (log.isInfoEnabled()) {
- log.info("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies()));
+ if (log.isDebugEnabled()) {
+ log.debug("Remove from speciesUsed: " + decorate(categoryValue) + " - " + decorate(row.getSpecies()));
}
SpeciesBatchUIModel model = getModel();
model.getSpeciesUsed().remove(categoryValue, row.getSpecies());
@@ -1548,10 +1545,6 @@
protected Set<Serializable> getSampleUsedValues(SpeciesBatchRowModel row,
int sampleCategoryId) {
-// // get the first ancestor for the sample category
-// SampleCategory<?> sampleCategory = row.getSampleCategoryById(sampleCategoryId);
-// SpeciesBatchRowModel firstAncestor = row.getFirstAncestor(sampleCategory);
-
Set<Serializable> usedValues = Sets.newHashSet();
List<SpeciesBatchRowModel> childs;
if (row.isBatchRoot()) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java 2013-10-03 08:27:10 UTC (rev 1269)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java 2013-10-03 09:07:04 UTC (rev 1270)
@@ -84,7 +84,7 @@
public final void actionPerformed(final ActionEvent event) {
if (log.isInfoEnabled()) {
- log.info("Task [" + getLogicAction() + "] starting");
+ log.info("Task [" + getLogicAction().getClass().getSimpleName() + "] starting");
}
// prepare action
1
0
03 Oct '13
Author: tchemit
Date: 2013-10-03 10:27:10 +0200 (Thu, 03 Oct 2013)
New Revision: 1269
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1269
Log:
fixes #3419: [CAPTURES] Impossible de saisir des mensurations si pas de protocole renseign?\195?\169
improve logs
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
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/benthos/BenthosBatchUIHandler.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/individualobservation/create/CreateIndividualObservationBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.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/util/AbstractTuttiUIHandler.java
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-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-10-03 08:27:10 UTC (rev 1269)
@@ -73,6 +73,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.commons.vfs2.AllFileSelector;
import org.apache.commons.vfs2.FileObject;
+import org.nuiton.util.TimeLog;
import org.nuiton.util.Version;
import java.io.File;
@@ -534,11 +535,15 @@
return null;
}
+ public static final TimeLog TIME_LOG = new TimeLog(PersistenceService.class);
+
@Override
public void init() {
- if (log.isInfoEnabled()) {
- log.info("Open persistence service");
+ long t0 = TimeLog.getTime();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Opening persistence service...");
}
TuttiServiceConfig serviceConfig = context.getConfig();
@@ -562,25 +567,33 @@
driver.init();
}
- if (log.isInfoEnabled()) {
- log.info("Persistence driver *" +
- driver.getImplementationName() + "* opened.");
- }
+// if (log.isInfoEnabled()) {
+// log.info("Persistence driver *" +
+// driver.getImplementationName() + "* opened.");
+// }
+
+ TIME_LOG.log(t0,"Persistence driver *" +
+ driver.getImplementationName() + "* opened.");
}
@Override
public void close() throws IOException {
- if (log.isInfoEnabled()) {
- log.info("Close persistence Service");
+ long t0 = TimeLog.getTime();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Closing persistence Service...");
}
IOUtils.closeQuietly(driver);
- if (log.isInfoEnabled()) {
- log.info("Persistence driver *" +
- driver.getImplementationName() + "* closed.");
- }
+// if (log.isInfoEnabled()) {
+// log.info("Persistence driver *" +
+// driver.getImplementationName() + "* closed.");
+// }
+
+ TIME_LOG.log(t0,"Persistence driver *" +
+ driver.getImplementationName() + "* closed.");
}
//------------------------------------------------------------------------//
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-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269)
@@ -601,22 +601,22 @@
}
}
- protected String buildReminderLabelTitle(Species species,
- Iterable<SampleCategory<?>> categories,
- String prefix,
- String suffix) {
- StringBuilder title = new StringBuilder(prefix);
-
- title.append(" - [").append(decorate(species)).append("]");
-
- for (SampleCategory<?> sampleCategory : categories) {
- if (sampleCategory.getCategoryValue() != null) {
- title.append(" - ");
- title.append(decorate(sampleCategory.getCategoryValue()));
- }
- }
-
- title.append(" - ").append(suffix);
- return title.toString();
- }
+// public String buildReminderLabelTitle(Species species,
+// Iterable<SampleCategory<?>> categories,
+// String prefix,
+// String suffix) {
+// StringBuilder title = new StringBuilder(prefix);
+//
+// title.append(" - [").append(decorate(species)).append("]");
+//
+// for (SampleCategory<?> sampleCategory : categories) {
+// if (sampleCategory.getCategoryValue() != null) {
+// title.append(" - ");
+// title.append(decorate(sampleCategory.getCategoryValue()));
+// }
+// }
+//
+// title.append(" - ").append(suffix);
+// return title.toString();
+// }
}
\ No newline at end of file
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-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269)
@@ -41,6 +41,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.service.ValidationService;
+import fr.ifremer.tutti.service.WeightUnit;
import fr.ifremer.tutti.service.catches.ValidateCruiseOperationsService;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
@@ -59,7 +60,6 @@
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
-import fr.ifremer.tutti.service.WeightUnit;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer;
import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor;
@@ -356,14 +356,17 @@
if (rowMonitor.wasModified()) {
// monitored bean was modified, save it
- if (log.isInfoEnabled()) {
- log.info("Row " + row + " was modified, will save it");
+ if (log.isDebugEnabled()) {
+ log.debug("Row " + row + " was modified, will save it");
}
- showInformationMessage(
- "[ Captures - Benthos ] " +
- "Sauvegarde des modifications de " + row + '.');
+ String title = buildReminderLabelTitle(row.getSpecies(),
+ row,
+ "Sauvegarde du lot Capture - Benthos : ",
+ "Ligne :" + getTableModel().getRowIndex(row));
+ showInformationMessage(title);
+
rowMonitor.setBean(null);
saveRow(row);
rowMonitor.setBean(row);
@@ -1398,16 +1401,16 @@
parentBatchId = batchParent.getId();
}
- if (log.isInfoEnabled()) {
- log.info("Persist new species batch with parentId: " +
- parentBatchId);
+ if (log.isDebugEnabled()) {
+ log.debug("Persist new species batch with parentId: " +
+ parentBatchId);
}
entityToSave = persistenceService.createBenthosBatch(entityToSave,
parentBatchId);
row.setId(entityToSave.getId());
} else {
- if (log.isInfoEnabled()) {
- log.info("Persist existing species batch: " + entityToSave.getId() + " (parent : " + entityToSave.getParentBatch() + ")");
+ if (log.isDebugEnabled()) {
+ log.debug("Persist existing species batch: " + entityToSave.getId() + " (parent : " + entityToSave.getParentBatch() + ")");
}
persistenceService.saveBenthosBatch(entityToSave);
}
@@ -1419,8 +1422,8 @@
frequencyRows,
entityToSave);
- if (log.isInfoEnabled()) {
- log.info("Will save " + frequency.size() + " frequencies.");
+ if (log.isDebugEnabled()) {
+ log.debug("Will save " + frequency.size() + " frequencies.");
}
frequency = persistenceService.saveBenthosBatchFrequency(
entityToSave.getId(), frequency);
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-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269)
@@ -227,20 +227,10 @@
if (context.isProtocolFilled()) {
-// // get loaded protocol
-// protocol = getDataContext().getProtocol();
-// Preconditions.checkNotNull(protocol,
-// "Could not find protocol in ui context");
-
// FIXME 20130128 kmorin: the species have no technical id
speciesProtocol =
getContext().getPersistenceService().toBenthosProtocolMap();
-// speciesProtocol = Maps.newHashMap();
-// for (SpeciesProtocol sp : protocol.getBenthos()) {
-// speciesProtocol.put(sp.getSpeciesReferenceTaxonId(), sp);
-// }
-
} else {
speciesProtocol = Maps.newHashMap();
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-10-03 08:27:10 UTC (rev 1269)
@@ -59,7 +59,6 @@
#individualObservationWeightField {
property: weight;
model: {model.getWeight()};
- /*numberPattern: {DECIMAL3_PATTERN};*/
}
#individualObservationSizeLabel {
@@ -72,7 +71,6 @@
#individualObservationSizeField {
property: size;
model: {model.getSize()};
- /*numberPattern: {DECIMAL3_PATTERN};*/
}
#individualObservationLengthStepCaracteristicLabel {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css 2013-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUI.css 2013-10-03 08:27:10 UTC (rev 1269)
@@ -86,7 +86,6 @@
#marineLitterWeightField {
property: weight;
model: {model.getWeight()};
- /*numberPattern: {DECIMAL3_PATTERN};*/
}
#saveAndContinueButton {
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-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269)
@@ -41,6 +41,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.service.ValidationService;
+import fr.ifremer.tutti.service.WeightUnit;
import fr.ifremer.tutti.service.catches.ValidateCruiseOperationsService;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
@@ -58,7 +59,6 @@
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
-import fr.ifremer.tutti.service.WeightUnit;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer;
import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor;
@@ -359,14 +359,17 @@
if (rowMonitor.wasModified()) {
// monitored bean was modified, save it
- if (log.isInfoEnabled()) {
- log.info("Row " + row + " was modified, will save it");
+ if (log.isDebugEnabled()) {
+ log.debug("Row " + row + " was modified, will save it");
}
- showInformationMessage(
- "[ Captures - Espèces ] " +
- "Sauvegarde des modifications de " + row + '.');
+ String title = buildReminderLabelTitle(row.getSpecies(),
+ row,
+ "Sauvegarde des modifications du lot Capture - Espèces : ",
+ "Ligne :" + getTableModel().getRowIndex(row));
+ showInformationMessage(title);
+
rowMonitor.setBean(null);
saveRow(row);
rowMonitor.setBean(row);
@@ -1413,16 +1416,16 @@
parentBatchId = parent.getId();
}
- if (log.isInfoEnabled()) {
- log.info("Persist new species batch with parentId: " +
- parentBatchId);
+ if (log.isDebugEnabled()) {
+ log.debug("Persist new species batch with parentId: " +
+ parentBatchId);
}
catchBean = persistenceService.createSpeciesBatch(catchBean,
parentBatchId);
row.setId(catchBean.getId());
} else {
- if (log.isInfoEnabled()) {
- log.info("Persist existing species batch: " + catchBean.getId() + " (parent : " + catchBean.getParentBatch() + ")");
+ if (log.isDebugEnabled()) {
+ log.debug("Persist existing species batch: " + catchBean.getId() + " (parent : " + catchBean.getParentBatch() + ")");
}
persistenceService.saveSpeciesBatch(catchBean);
}
@@ -1434,8 +1437,8 @@
frequencyRows,
catchBean);
- if (log.isInfoEnabled()) {
- log.info("Will save " + frequency.size() + " frequencies.");
+ if (log.isDebugEnabled()) {
+ log.debug("Will save " + frequency.size() + " frequencies.");
}
frequency = persistenceService.saveSpeciesBatchFrequency(
catchBean.getId(), frequency);
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-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269)
@@ -25,6 +25,7 @@
*/
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
@@ -224,18 +225,11 @@
if (context.isProtocolFilled()) {
-// // get loaded protocol
-// protocol = getDataContext().getProtocol();
-// Preconditions.checkNotNull(protocol,
-// "Could not find protocol in ui context");
-
// FIXME 20130128 kmorin: the species have no technical id
speciesProtocol = persistenceService.toSpeciesProtocolMap();
-// speciesProtocol = Maps.newHashMap();
-// for (SpeciesProtocol sp : protocol.getSpecies()) {
-// speciesProtocol.put(sp.getSpeciesReferenceTaxonId(), sp);
-// }
+ } else {
+ speciesProtocol = Maps.newHashMap();
}
Caracteristic modelCaracteristic = model.getLengthStepCaracteristic();
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-10-02 23:39:48 UTC (rev 1268)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-10-03 08:27:10 UTC (rev 1269)
@@ -29,6 +29,8 @@
import com.google.common.collect.Sets;
import fr.ifremer.tutti.LabelAware;
import fr.ifremer.tutti.persistence.entities.TuttiEntity;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
+import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.service.TuttiDataContext;
import fr.ifremer.tutti.service.WeightUnit;
@@ -1136,4 +1138,22 @@
}
+ protected String buildReminderLabelTitle(Species species,
+ Iterable<SampleCategory<?>> categories,
+ String prefix,
+ String suffix) {
+ StringBuilder title = new StringBuilder(prefix);
+
+ title.append(" - [").append(decorate(species)).append("]");
+
+ for (SampleCategory<?> sampleCategory : categories) {
+ if (sampleCategory.getCategoryValue() != null) {
+ title.append(" - ");
+ title.append(decorate(sampleCategory.getCategoryValue()));
+ }
+ }
+
+ title.append(" - ").append(suffix);
+ return title.toString();
+ }
}
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/1052/changes>
Changes:
[Tony Chemit] fixes #3333: [CAMPAGNE] pouvoir ajouter plusieur engins professionnels de même type à une campagne
------------------------------------------
Started by an SCM change
Building on master in workspace <http://ci.nuiton.org/jenkins/job/tutti/ws/>
Updating https://forge.codelutin.com/svn/tutti/trunk at revision '2013-10-02T18:41:17.020 +0200'
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/GearCaracteristicsEditorUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditGearCaracteristicsAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/SaveCruiseAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ViewGearCaracteristicsAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
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/util/table/AbstractTuttiTableUIHandler.java
AU tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java
U tutti-service/src/test/java/fr/ifremer/tutti/service/ValidationServiceTest.java
U tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
U tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
D tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/Gears.java
AU tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java
AU tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java
AU tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
U tutti-persistence/src/main/xmi/tutti-persistence.zargo
At revision 1266
Parsing POMs
[trunk] $ /opt/jdk/bin/java -Xmx256m -XX:-UseGCOverheadLimit -cp /var/local/jenkins/data/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.3.jar:/opt/maven3/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /opt/maven3 /opt/repository/apache-tomcat-7.0.42/webapps/jenkins/WEB-INF/lib/remoting-2.28.jar /var/local/jenkins/data/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.3.jar 55010
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> -U -e clean install
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Tutti
[INFO] Tutti :: Persistence
[INFO] Tutti :: Service
[INFO] Tutti :: UI
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti 2.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ tutti ---
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ tutti ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/surefire-workdir>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ tutti ---
[INFO]
[INFO] --- maven-install-plugin:2.5:install (default-install) @ tutti ---
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> to /var/local/maven/data/repository/fr/ifremer/tutti/2.7-SNAPSHOT/tutti-2.7-SNAPSHOT.pom
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-2.7-SNAPSHOT-s…> to /var/local/maven/data/repository/fr/ifremer/tutti/2.7-SNAPSHOT/tutti-2.7-SNAPSHOT-site_fr.xml
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 2.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target>
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ tutti-persistence ---
[INFO]
[INFO] --- eugene-maven-plugin:2.7.2:generate (default) @ tutti-persistence ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…> to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Generate one file in 14.085ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…> for 1 file(s).
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…> to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Generate one file in 1.011s.
[INFO] Process phase [model] for one entry.
WARN [pool-1-thread-1] (AbstractObjectModelReader.java:126) beforeReadFile - No properties provider filled, will instanciate a new default one
INFO [pool-1-thread-1] (AbstractObjectModelReader.java:270) loadModelProperties - 23 tag values were succesfull imported from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] No file generated.
[INFO] Apply generator JavaInterfaceTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.TuttiEntity], already found in class-path.
[INFO] Apply generator SimpleJavaBeanTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder], already found in class-path.
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrderBean], already found in class-path.
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders], already found in class-path.
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocols], already found in class-path.
[INFO] Apply generator JavaEnumerationTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum], already found in class-path.
[INFO] Add compile source root : <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:parserJava (scan-sources) @ tutti-persistence ---
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:get (get) @ tutti-persistence ---
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:gen (scan-sources) @ tutti-persistence ---
[WARNING] bundle en_GB contains 59/59 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ tutti-persistence ---
[INFO] Compiling 184 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/cl…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>: Recompile with -Xlint:unchecked for details.
[INFO] 3 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[270,15] method setGear in interface fr.ifremer.tutti.persistence.entities.data.Cruise cannot be applied to given types;
required: java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder>
found: java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear>
reason: actual argument java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear> cannot be converted to java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder> by method invocation conversion
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [2.113s]
[INFO] Tutti :: Persistence .............................. FAILURE [5.156s]
[INFO] Tutti :: Service .................................. SKIPPED
[INFO] Tutti :: UI ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.875s
[INFO] Finished at: Wed Oct 02 18:41:29 CEST 2013
[INFO] Final Memory: 30M/233M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-service/builds/2013-10-02_18-41-19/archive/fr.ifremer.tutti/tutti-service/2.7-SNAPSHOT/tutti-service-2.7-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-ui-swing/builds/2013-10-02_18-41-19/archive/fr.ifremer.tutti/tutti-ui-swing/2.7-SNAPSHOT/tutti-ui-swing-2.7-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-10-02_18-41-19/archive/fr.ifremer/tutti/2.7-SNAPSHOT/tutti-2.7-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-2.7-SNAPSHOT-s…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-10-02_18-41-19/archive/fr.ifremer/tutti/2.7-SNAPSHOT/tutti-2.7-SNAPSHOT-site_fr.xml
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-persistence/builds/2013-10-02_18-41-19/archive/fr.ifremer.tutti/tutti-persistence/2.7-SNAPSHOT/tutti-persistence-2.7-SNAPSHOT.pom
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project tutti-persistence: Compilation failure
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[270,15] method setGear in interface fr.ifremer.tutti.persistence.entities.data.Cruise cannot be applied to given types;
required: java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder>
found: java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear>
reason: actual argument java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear> cannot be converted to java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder> by method invocation conversion
cause : Compilation failure
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[270,15] method setGear in interface fr.ifremer.tutti.persistence.entities.data.Cruise cannot be applied to given types;
required: java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder>
found: java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear>
reason: actual argument java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear> cannot be converted to java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder> by method invocation conversion
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project tutti-persistence: Compilation failure
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[270,15] method setGear in interface fr.ifremer.tutti.persistence.entities.data.Cruise cannot be applied to given types;
required: java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder>
found: java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear>
reason: actual argument java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear> cannot be converted to java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder> by method invocation conversion
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:174)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>:[270,15] method setGear in interface fr.ifremer.tutti.persistence.entities.data.Cruise cannot be applied to given types;
required: java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder>
found: java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear>
reason: actual argument java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear> cannot be converted to java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder> by method invocation conversion
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 26 more
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com chemit(a)codelutin.com
channel stopped
1
3
Build failed in Jenkins: tutti » Tutti :: Persistence #1052
by admin+hudson@codelutin.com 02 Oct '13
by admin+hudson@codelutin.com 02 Oct '13
02 Oct '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/1…>
Changes:
[Tony Chemit] fixes #3333: [CAMPAGNE] pouvoir ajouter plusieur engins professionnels de même type à une campagne
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 2.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ tutti-persistence ---
[INFO]
[INFO] --- eugene-maven-plugin:2.7.2:generate (default) @ tutti-persistence ---
[INFO] Process phase [zargo] for one entry.
[INFO] Expanding 1 xmi file(s) from <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Generate one file in 14.085ms.
[INFO] Process phase [xmi] for one entry.
[INFO] Processing XSL tranformation on <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> for 1 file(s).
[INFO] Will generate <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Copy file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…> to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Generate one file in 1.011s.
[INFO] Process phase [model] for one entry.
WARN [pool-1-thread-1] (AbstractObjectModelReader.java:126) beforeReadFile - No properties provider filled, will instanciate a new default one
INFO [pool-1-thread-1] (AbstractObjectModelReader.java:270) loadModelProperties - 23 tag values were succesfull imported from <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] No file generated.
[INFO] Apply generator JavaInterfaceTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.TuttiEntity], already found in class-path.
[INFO] Apply generator SimpleJavaBeanTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder], already found in class-path.
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrderBean], already found in class-path.
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders], already found in class-path.
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocols], already found in class-path.
[INFO] Apply generator JavaEnumerationTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:995) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum], already found in class-path.
[INFO] Add compile source root : <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Add resource root :Resource {targetPath: null, filtering: false, FileSet {directory: <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…,> PatternSet [includes: {}, excludes: {**/*.java}]}}
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:parserJava (scan-sources) @ tutti-persistence ---
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:get (get) @ tutti-persistence ---
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:gen (scan-sources) @ tutti-persistence ---
[WARNING] bundle en_GB contains 59/59 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ tutti-persistence ---
[INFO] Compiling 184 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>: Recompile with -Xlint:unchecked for details.
[INFO] 3 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[270,15] method setGear in interface fr.ifremer.tutti.persistence.entities.data.Cruise cannot be applied to given types;
required: java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder>
found: java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear>
reason: actual argument java.util.ArrayList<fr.ifremer.tutti.persistence.entities.referential.Gear> cannot be converted to java.util.List<fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder> by method invocation conversion
[INFO] 1 error
[INFO] -------------------------------------------------------------
1
3
02 Oct '13
Author: tchemit
Date: 2013-10-03 01:39:48 +0200 (Thu, 03 Oct 2013)
New Revision: 1268
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1268
Log:
fix test build
add missing license header + svn properties
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceWriteTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.persistence.entities.referential;
+/*
+ * #%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 javax.annotation.Generated;
@Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Wed Oct 02 14:29:49 CEST 2013")
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.persistence.entities.referential;
+/*
+ * #%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 org.apache.commons.lang3.ObjectUtils;
import javax.annotation.Generated;
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.persistence.entities.referential;
+/*
+ * #%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 org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -338,8 +338,8 @@
Preconditions.checkNotNull(cruiseId, "Cruise 'id' must not be null or empty");
Preconditions.checkNotNull(gearId, "Gear 'id' must not be null or empty");
- if (log.isInfoEnabled()) {
- log.info("Get caracteristic for gear " + gearId + " - " + rankOrder);
+ if (log.isDebugEnabled()) {
+ log.debug("Get caracteristic for gear " + gearId + " - " + rankOrder);
}
CaracteristicMap result = new CaracteristicMap();
@@ -405,8 +405,8 @@
List<Integer> measurementsToRemove = Lists.newArrayList();
- if (log.isInfoEnabled()) {
- log.info("Save caracteristic for gear " + gear.getIdAsInt() + " - " + rankOrder);
+ if (log.isDebugEnabled()) {
+ log.debug("Save caracteristic for gear " + gear.getIdAsInt() + " - " + rankOrder);
}
GearPhysicalFeatures gpf = gearPhysicalFeaturesDao.getGearPhysicalfeatures(
fishingTrip,
@@ -573,14 +573,14 @@
// try with new rankOrder
// in facts, only means create a new one
guf = gearPhysicalFeaturesDao.getGearPhysicalfeatures(fishingTrip, gear.getIdAsInt(), rankOrder, true);
- if (log.isInfoEnabled()) {
- log.info("Will create guf: " + guf.getId() + " for gear: " + gear.getId() + " - " + gear.getRankOrder());
+ if (log.isDebugEnabled()) {
+ log.debug("Will create guf: " + guf.getId() + " for gear: " + gear.getId() + " - " + gear.getRankOrder());
}
} else {
// got an old guf to update
- if (log.isInfoEnabled()) {
- log.info("Will update guf: " + guf.getId() + " for gear: " + gear.getId() + " - " + gear.getOriginalRankOrder() + ", new rankOrder: " + gear.getRankOrder());
+ if (log.isDebugEnabled()) {
+ log.debug("Will update guf: " + guf.getId() + " for gear: " + gear.getId() + " - " + gear.getOriginalRankOrder() + ", new rankOrder: " + gear.getRankOrder());
}
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -322,8 +322,8 @@
Gear toSet = GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear);
toSet.setRankOrder(rankOrder);
- if (log.isInfoEnabled()) {
- log.info("FishingOperation: " + id + ", use gear: " + gearId + " - " + rankOrder);
+ if (log.isDebugEnabled()) {
+ log.debug("FishingOperation: " + id + ", use gear: " + gearId + " - " + rankOrder);
}
result.setGear(toSet);
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceWriteTest.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceWriteTest.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -28,6 +28,8 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Cruises;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
@@ -104,7 +106,11 @@
cruise.setReturnLocation(allHarbour.get(1));
List<Gear> gears = referentialService.getAllFishingGear();
- cruise.setGear(gears);
+ List<GearWithOriginalRankOrder> gears2 = Lists.newArrayListWithCapacity(gears.size());
+ for (Gear gear : gears) {
+ gears2.add(GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear));
+ }
+ cruise.setGear(gears2);
cruise.setComment("My comments on cruise");
cruise.setSurveyPart("SurveyPart");
@@ -246,8 +252,8 @@
List<Gear> gears = referentialService.getAllFishingGear();
for (Gear gear : gears) {
// Make sure the gear is different before to add it
- if (gear.getId() != null && !gear.getId().equals(previousGear.getId())) {
- cruise.addGear(gear);
+ if (!gear.equals(previousGear)) {
+ cruise.addGear(GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear));
break;
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation;
+/*
+ * #%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%
+ */
+
/**
* Created on 10/2/13.
*
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.base.Preconditions;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java 2013-10-02 23:25:24 UTC (rev 1267)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java 2013-10-02 23:39:48 UTC (rev 1268)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.util.caracteristics;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
1
0
02 Oct '13
Author: tchemit
Date: 2013-10-03 01:25:24 +0200 (Thu, 03 Oct 2013)
New Revision: 1267
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1267
Log:
refs #3418: [TECH] updates JAXX to 2.5.28
fixes #3334: [CAMPAGNE] gestion des navires asoci?\195?\169 (ex. chalutage en boeuf)
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java
Modified:
trunk/pom.xml
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/service/FishingOperationPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/test/DatabaseFixtures.java
trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java
trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties
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/operation/EditFishingOperationAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/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/NewFishingOperationAction.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/pom.xml 2013-10-02 23:25:24 UTC (rev 1267)
@@ -131,7 +131,7 @@
<eugenePluginVersion>2.7.2</eugenePluginVersion>
<hibernateVersion>3.6.10.Final</hibernateVersion>
- <jaxxVersion>2.5.27</jaxxVersion>
+ <jaxxVersion>2.5.28-SNAPSHOT</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.15.1</xworkVersion>
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -480,6 +480,8 @@
FishingOperation getFishingOperation(String id);
+ List<Vessel> getFishingOperationSecondaryVessel(String fishingOperationId);
+
@Transactional(readOnly = false)
FishingOperation createFishingOperation(FishingOperation bean);
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -646,6 +646,11 @@
}
@Override
+ public List<Vessel> getFishingOperationSecondaryVessel(String fishingOperationId) {
+ return fishingOperationService.getFishingOperationSecondaryVessel(fishingOperationId);
+ }
+
+ @Override
public FishingOperation createFishingOperation(FishingOperation bean) {
return fishingOperationService.createFishingOperation(bean);
}
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -436,6 +436,11 @@
}
@Override
+ public List<Vessel> getFishingOperationSecondaryVessel(String fishingOperationId) {
+ throw notImplemented();
+ }
+
+ @Override
public FishingOperation createFishingOperation(FishingOperation bean) {
throw notImplemented();
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
@@ -48,6 +49,8 @@
FishingOperation getFishingOperation(String id);
+ List<Vessel> getFishingOperationSecondaryVessel(String fishingOperationId);
+
@Transactional(readOnly = false)
FishingOperation createFishingOperation(FishingOperation bean);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -292,6 +292,7 @@
// End date
result.setGearShootingEndDate(convertDatabase2UI((Timestamp) source[colIndex++]));
+ // RecorderPerson
result.setRecorderPerson(Lists.<Person>newArrayList());
Iterator<Object[]> vesselPersonFeaturesList = queryList(
"fishingOperationVesselPersonFeatures",
@@ -376,6 +377,10 @@
result.setVessel(vessel);
}
+ // Retrieve secondary vessels
+ List<Vessel> secondaryVessel = getFishingOperationSecondaryVessel(id);
+ result.setSecondaryVessel(secondaryVessel);
+
// Retrieve gear use features
getGearUseCaracteristics(id, result);
@@ -386,6 +391,27 @@
}
@Override
+ public List<Vessel> getFishingOperationSecondaryVessel(String fishingOperationId) {
+ Iterator<Object[]> secondaryVesselList = queryList(
+ "fishingOperationSecondaryVessel",
+ "fishingOperationId", IntegerType.INSTANCE, Integer.valueOf(fishingOperationId));
+ List<Vessel> result = Lists.newArrayList();
+ while (secondaryVesselList.hasNext()) {
+
+ Object[] next = secondaryVesselList.next();
+ String secondaryVesselCode = (String) next[0];
+ if (secondaryVesselCode != null) {
+ Boolean isCatchOnOperationVessel = (Boolean) next[1];
+ if (isCatchOnOperationVessel == null || !isCatchOnOperationVessel) {
+
+ Vessel vessel = referentialService.getVessel(secondaryVesselCode);
+ result.add(vessel);
+ }
+ }
+ }
+ return result;
+ }
+ @Override
public FishingOperation createFishingOperation(FishingOperation bean) {
Preconditions.checkNotNull(bean);
Preconditions.checkArgument(bean.getId() == null);
@@ -537,7 +563,13 @@
}
// remove operation vessel associations
- removeAllOperationVesselAssociation(fishingOperation);
+ if (CollectionUtils.isNotEmpty(fishingOperation.getOperationVesselAssociations())) {
+ for (OperationVesselAssociation asso : fishingOperation.getOperationVesselAssociations()) {
+ operationVesselAssociationDao.remove(asso);
+ }
+ fishingOperation.getOperationVesselAssociations().clear();
+ }
+// removeAllOperationVesselAssociation(fishingOperation);
// remove fishing areas
if (CollectionUtils.isNotEmpty(fishingAreas)) {
@@ -895,14 +927,14 @@
target.setVessel(fishingTrip.getVessel());
// Associated vessel
- if (source.getVessel() == null && target.getOperationVesselAssociations() != null) {
- target.getOperationVesselAssociations().clear();
- } else if (source.getVessel() != null
- && source.getVessel().getId() != null) {
- setOperationVesselAssociation(target, source.getVessel().getId());
+ List<String> vesselIds = Lists.newArrayList();
+ if (!source.isSecondaryVesselEmpty()) {
+ for (Vessel vessel : source.getSecondaryVessel()) {
+ vesselIds.add(vessel.getId());
+ }
}
+ setOperationVesselAssociation(target, vesselIds);
-
// Quality Flag :
if (target.getQualityFlag() == null) {
target.setQualityFlag(load(QualityFlagImpl.class, enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED));
@@ -1341,47 +1373,73 @@
return gearUseMeasurement;
}
- protected void setOperationVesselAssociation(Operation target, String vesselCode) {
- OperationVesselAssociation ova = null;
- OperationVesselAssociationPK ovaPK = new OperationVesselAssociationPK();
- ovaPK.setVessel(load(VesselImpl.class, vesselCode));
- ovaPK.setOperation(target);
+ protected void setOperationVesselAssociation(Operation target, List<String> vesselCodes) {
- // If vessel is equal as cruise vessel : do note store any VesselOperationAssociation entity
- if (vesselCode.equals(target.getVessel().getCode())) {
- removeAllOperationVesselAssociation(target);
- return;
+ boolean noOperationVesselAssociations =
+ target.getOperationVesselAssociations() == null;
+
+ Set<OperationVesselAssociation> toAdd = Sets.newHashSet();
+ Set<OperationVesselAssociation> notChanged = Sets.newHashSet();
+
+ if (!noOperationVesselAssociations) {
+ notChanged.addAll(target.getOperationVesselAssociations());
}
- // Retrieve existing association
- for (OperationVesselAssociation asso : target.getOperationVesselAssociations()) {
- if (asso.getOperationVesselAssociationPk().equals(ovaPK)) {
- ova = asso;
+ for (String vesselCode : vesselCodes) {
+
+ OperationVesselAssociation ova = null;
+ OperationVesselAssociationPK ovaPK =
+ OperationVesselAssociationPK.Factory.newInstance();
+ ovaPK.setVessel(load(VesselImpl.class, vesselCode));
+ ovaPK.setOperation(target);
+
+ // If vessel is equal as cruise vessel : do note store any VesselOperationAssociation entity
+ if (vesselCode.equals(target.getVessel().getCode())) {
+ //removeAllOperationVesselAssociation(target);
break;
}
+
+ // Retrieve existing association
+ for (OperationVesselAssociation asso : notChanged) {
+ if (asso.getOperationVesselAssociationPk().equals(ovaPK)) {
+ ova = asso;
+ break;
+ }
+ }
+
+ // Create a new association
+ if (ova == null) {
+ ova = OperationVesselAssociation.Factory.newInstance();
+ ova.setOperationVesselAssociationPk(ovaPK);
+// if (target.getOperationVesselAssociations() == null) {
+// target.setOperationVesselAssociations(Lists.newArrayList(ova));
+// } else {
+// removeAllOperationVesselAssociation(target);
+// target.getOperationVesselAssociations().add(ova);
+// }
+ }
+
+ ova.setIsCatchOnOperationVessel(Boolean.FALSE);
+ toAdd.add(ova);
+ notChanged.remove(ova);
}
- // Create a new association
- if (ova == null) {
- ova = OperationVesselAssociation.Factory.newInstance();
- ova.setOperationVesselAssociationPk(ovaPK);
- if (target.getOperationVesselAssociations() == null) {
- target.setOperationVesselAssociations(Lists.newArrayList(ova));
- } else {
- removeAllOperationVesselAssociation(target);
- target.getOperationVesselAssociations().add(ova);
+ if (!noOperationVesselAssociations) {
+
+ // remove all not changed
+
+ for (OperationVesselAssociation operationVesselAssociation : notChanged) {
+ operationVesselAssociationDao.remove(operationVesselAssociation);
}
+ target.getOperationVesselAssociations().removeAll(notChanged);
}
- ova.setIsCatchOnOperationVessel(Boolean.FALSE);
- }
+ if (!toAdd.isEmpty()) {
- protected void removeAllOperationVesselAssociation(Operation target) {
- if (target.getOperationVesselAssociations() != null) {
- for (OperationVesselAssociation asso : target.getOperationVesselAssociations()) {
- operationVesselAssociationDao.remove(asso);
+ if (noOperationVesselAssociations) {
+ target.setOperationVesselAssociations(Sets.<OperationVesselAssociation>newHashSet());
}
- target.getOperationVesselAssociations().clear();
+ target.getOperationVesselAssociations().addAll(toAdd);
}
}
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/test/DatabaseFixtures.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/test/DatabaseFixtures.java 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/test/DatabaseFixtures.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -39,6 +39,8 @@
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicType;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocations;
@@ -267,7 +269,16 @@
cruise.setReturnLocation(allHarbour.get(1));
List<Gear> gears = referentialService.getAllFishingGear();
- cruise.setGear(Lists.newArrayList(gears));
+ List<GearWithOriginalRankOrder> gearsWithOrder = Lists.newArrayListWithCapacity(gears.size());
+ short rankOrder = (short) 0;
+ for (Gear gear : gears) {
+ GearWithOriginalRankOrder gearWithOriginalRankOrder = GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear);
+ gearWithOriginalRankOrder.setOriginalRankOrder(rankOrder);
+ gearWithOriginalRankOrder.setRankOrder(rankOrder);
+ rankOrder++;
+ gearsWithOrder.add(gearWithOriginalRankOrder);
+ }
+ cruise.setGear(Lists.newArrayList(gearsWithOrder));
cruise.setComment("My comments on cruise");
cruise.setSurveyPart("SurveyPart");
Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-10-02 23:25:24 UTC (rev 1267)
@@ -296,7 +296,7 @@
max(case when (rl.locationLevel.id = :locationLevelIdStrata) then rl.id else null end) AS strataId,
max(case when (rl.locationLevel.id = :locationLevelIdSubStrata) then rl.id else null end) AS subStrataId,
max(case when (rl.locationLevel.id = :locationLevelIdLocalite) then rl.id else null end) AS localiteId,
- max(case when (va.isCatchOnOperationVessel = false) then va.id.vessel.code else o.vessel.code end) as vesselCode
+ max(o.vessel.code) as vesselCode
FROM
FishingOperationImpl o
INNER JOIN o.gearUseFeatures guf
@@ -304,20 +304,35 @@
LEFT OUTER JOIN guf.fishingAreas fa
LEFT OUTER JOIN fa.regulationLocation fa2rl
LEFT OUTER JOIN fa2rl.id.location rl
- LEFT OUTER JOIN o.operationVesselAssociations va
WHERE
o.id=:fishingOperationId
GROUP BY o.name, guf.rankOrder
]]>
+ <!--LEFT OUTER JOIN o.operationVesselAssociations va-->
+ <!--max(case when (va.isCatchOnOperationVessel = false) then va.id.vessel.code else o.vessel.code end) as vesselCode-->
<query-param name="fishingOperationId" type="java.lang.Integer"/>
<query-param name="locationLevelIdStrata" type="java.lang.Integer"/>
<query-param name="locationLevelIdSubStrata" type="java.lang.Integer"/>
<query-param name="locationLevelIdLocalite" type="java.lang.Integer"/>
</query>
-
+
+ <query cacheable="true" name="fishingOperationSecondaryVessel">
+ <![CDATA[
+ SELECT
+ va.operationVesselAssociationPk.vessel.code,
+ va.isCatchOnOperationVessel
+ FROM
+ FishingOperationImpl o
+ LEFT OUTER JOIN o.operationVesselAssociations va
+ WHERE
+ o.id=:fishingOperationId
+ ]]>
+ <query-param name="fishingOperationId" type="java.lang.Integer"/>
+ </query>
+
<query cacheable="true" name="fishingOperationRankOrder">
<![CDATA[
- SELECT
+ SELECT
count(o1.id) + 1 as fishingOperationRankOrder
FROM
FishingOperationImpl o1,
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
===================================================================
--- trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-10-02 23:25:24 UTC (rev 1267)
@@ -37,7 +37,9 @@
fr.ifremer.tutti.persistence.entities.data.Cruise.attribute.gear.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.Cruise.attribute.headOfMission.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.Cruise.attribute.headOfSortRoom.stereotype=ordered
+
fr.ifremer.tutti.persistence.entities.data.FishingOperation.attribute.recorderPerson.stereotype=ordered
+fr.ifremer.tutti.persistence.entities.data.FishingOperation.attribute.secondaryVessel.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.SpeciesBatch.attribute.childBatchs.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.BenthosBatch.attribute.childBatchs.stereotype=ordered
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -982,6 +982,11 @@
}
@Override
+ public List<Vessel> getFishingOperationSecondaryVessel(String fishingOperationId) {
+ return driver.getFishingOperationSecondaryVessel(fishingOperationId);
+ }
+
+ @Override
public FishingOperation createFishingOperation(FishingOperation bean) {
// see http://forge.codelutin.com/issues/2014
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -26,7 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
-import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
@@ -89,7 +89,7 @@
return cruise.getName();
}
- public List<Gear> getGear() {
+ public List<GearWithOriginalRankOrder> getGear() {
return cruise.getGear();
}
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/log4j.properties 2013-10-02 23:25:24 UTC (rev 1267)
@@ -34,12 +34,14 @@
log4j.logger.fr.ifremer.tutti=INFO
#log4j.logger.fr.ifremer.tutti.ui.swing.util=WARN
#log4j.logger.fr.ifremer.tutti.ui.swing.util.action=INFO
-#log4j.logger.fr.ifremer.tutti.ui.swing.util.attachment=INFO
+#log4j.logger.org.hibernate.SQL=DEBUG
+#log4j.logger.org.hibernate.hql.ast.QueryTranslatorImpl=DEBUG
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.file=${tutti.log.file}
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=4
+
log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %5p [%20t] %c - %m%n
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %5p %c - %m%n
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-10-02 23:25:24 UTC (rev 1267)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Sat Sep 28 07:21:51 CEST 2013
+#Wed Oct 02 19:41:03 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -111,8 +111,10 @@
tutti.editBenthosFrequencies.field.totalWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosFrequencies.help=editFishingOperation.html\#captureBenthos
tutti.editCatchBatch.action.cancelEditCatchBatch.help=editFishingOperation.html\#captureResumeActions
-tutti.editCatchBatch.action.cleanWeights.help=
+tutti.editCatchBatch.action.cleanWeights.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.computeWeights.help=editFishingOperation.html\#captureResumeActions
+tutti.editCatchBatch.action.exportFishingOperationReport.help=editFishingOperation.html\#captureResumeActions
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.importPupitri.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.saveCatchBatch.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.field.benthosTotalSampleSortedWeight.help=editFishingOperation.html\#captureResumeFields
@@ -177,11 +179,13 @@
tutti.editFishingOperation.field.location.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.multirigAggregation.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.recorderPerson.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.field.secondaryVessel.help=
tutti.editFishingOperation.field.stationNumber.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.strata.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.subStrata.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.trawlDistance.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.vessel.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.filterSecondaryVesselType.help=
tutti.editFishingOperation.help=editFishingOperation.html\#traitFields
tutti.editIndividualObservationBatch.action.createBatch.help=editFishingOperation.html\#captureObservationsIndividuellesActions
tutti.editIndividualObservationBatch.action.exportMultiPost.help=editFishingOperation.html\#captureObservationsIndividuellesActions
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-10-02 23:25:24 UTC (rev 1267)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Sat Sep 28 07:21:51 CEST 2013
+#Wed Oct 02 19:41:03 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -111,8 +111,10 @@
tutti.editBenthosFrequencies.field.totalWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosFrequencies.help=editFishingOperation.html\#captureBenthos
tutti.editCatchBatch.action.cancelEditCatchBatch.help=editFishingOperation.html\#captureResumeActions
-tutti.editCatchBatch.action.cleanWeights.help=
+tutti.editCatchBatch.action.cleanWeights.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.computeWeights.help=editFishingOperation.html\#captureResumeActions
+tutti.editCatchBatch.action.exportFishingOperationReport.help=editFishingOperation.html\#captureResumeActions
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.importPupitri.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.action.saveCatchBatch.help=editFishingOperation.html\#captureResumeActions
tutti.editCatchBatch.field.benthosTotalSampleSortedWeight.help=editFishingOperation.html\#captureResumeFields
@@ -177,11 +179,13 @@
tutti.editFishingOperation.field.location.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.multirigAggregation.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.recorderPerson.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.field.secondaryVessel.help=
tutti.editFishingOperation.field.stationNumber.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.strata.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.subStrata.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.trawlDistance.help=editFishingOperation.html\#traitFields
tutti.editFishingOperation.field.vessel.help=editFishingOperation.html\#traitFields
+tutti.editFishingOperation.filterSecondaryVesselType.help=
tutti.editFishingOperation.help=editFishingOperation.html\#traitFields
tutti.editIndividualObservationBatch.action.createBatch.help=editFishingOperation.html\#captureObservationsIndividuellesActions
tutti.editIndividualObservationBatch.action.exportMultiPost.help=editFishingOperation.html\#captureObservationsIndividuellesActions
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -25,6 +25,7 @@
*/
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.InvalidBatchModelException;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
@@ -38,6 +39,7 @@
import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
+import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.content.operation.catches.ComputeBatchWeightsAction;
@@ -61,6 +63,7 @@
import java.beans.PropertyChangeListener;
import java.util.Collections;
import java.util.List;
+import java.util.Set;
import static org.nuiton.i18n.I18n._;
@@ -350,20 +353,6 @@
log.info("Edit in ui fishingOperation: " + fishingOperation);
}
-// // get the rankorder of the gear from cruise gears
-// Gear gear = fishingOperation == null ? null : fishingOperation.getGear();
-// if (gear != null) {
-// Gear newGear = Gears.newGearWithRankOrder(gear);
-// fishingOperation.setGear(newGear);
-// Cruise cruise = getDataContext().getCruise();
-// for (Gear cruiseGear : cruise.getGear()) {
-// if (Gears.equals(cruiseGear, newGear)) {
-// newGear.setRankOrder(cruiseGear.getRankOrder());
-// break;
-// }
-// }
-// }
-
// now fishing operation is edited
model.setEditFishingOperation(fishingOperation);
@@ -441,6 +430,12 @@
editFishingOperationUIModel.setFishingOperation(bean);
+ editFishingOperationUIModel.setAllSecondaryVessel(null);
+ editFishingOperationUIModel.setFishingSecondaryVessel(null);
+ editFishingOperationUIModel.setScientificSecondaryVessel(null);
+ editFishingOperationUIModel.setOnlyCruisSecondaryVessel(null);
+ editFishingOperationUIModel.setSecondaryVesselType(null);
+
handler.clearValidators();
handler.resetAllModels();
@@ -519,6 +514,53 @@
editFishingOperationUIModel.addAllAttachment(attachments);
}
+ Vessel cruiseVessel = getDataContext().getCruise().getVessel();
+ List<Vessel> scientificVessels = getDataContext().getScientificVessels();
+ List<Vessel> fishingVessels = getDataContext().getFishingVessels();
+
+ { // update all secondary vessel universe
+ List<Vessel> vessels = Lists.newArrayList();
+ vessels.addAll(scientificVessels);
+ vessels.addAll(fishingVessels);
+ vessels.remove(cruiseVessel);
+ editFishingOperationUIModel.setAllSecondaryVessel(vessels);
+ }
+
+ { // update scientific secondary vessel universe
+ List<Vessel> vessels = Lists.newArrayList();
+ vessels.addAll(scientificVessels);
+ vessels.remove(cruiseVessel);
+ editFishingOperationUIModel.setScientificSecondaryVessel(vessels);
+ }
+
+ { // update fishing secondary vessel universe
+ List<Vessel> vessels = Lists.newArrayList();
+ vessels.addAll(fishingVessels);
+ vessels.remove(cruiseVessel);
+ editFishingOperationUIModel.setFishingSecondaryVessel(vessels);
+ }
+
+ { // update only cruise vessel universe
+
+ List<FishingOperation> fishingOperation =
+ getModel().getFishingOperation();
+
+ Set<Vessel> vesselSet = Sets.newHashSet();
+ for (FishingOperation operation : fishingOperation) {
+ List<Vessel> secondaryVessel = persistenceService.getFishingOperationSecondaryVessel(operation.getId());
+ if (CollectionUtils.isNotEmpty(secondaryVessel)) {
+ vesselSet.addAll(secondaryVessel);
+ }
+ }
+ List<Vessel> vessel = Lists.newArrayList(vesselSet);
+ editFishingOperationUIModel.setOnlyCruisSecondaryVessel(vessel);
+ }
+
+ // will propagate to model
+ ui.getSecondaryVesselList().getModel().setSelected(bean.getSecondaryVessel());
+
+ editFishingOperationUIModel.setSecondaryVesselType(SecondaryVesselTypeEnum.ALL);
+
editFishingOperationUIModel.setModify(false);
handler.getFishingOperationMonitor().clearModified();
handler.registerValidator();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-10-02 23:25:24 UTC (rev 1267)
@@ -236,6 +236,56 @@
_validatorLabel: {_("tutti.editFishingOperation.field.multirigAggregation")};
}
+#filterSecondaryVesselLabel {
+ text: "tutti.editFishingOperation.filterSecondaryVesselType";
+ _strongStyle: true;
+ actionIcon: filter;
+ toolTipText: "tutti.editFishingOperation.filterSecondaryVesselType.tip";
+ _help: {"tutti.editFishingOperation.filterSecondaryVesselType.help"};
+}
+
+#filterSecondaryVesselAllButton {
+ text: "tutti.editFishingOperation.filterSecondaryVesselType.all";
+ toolTipText: "tutti.editFishingOperation.filterSecondaryVesselType.all.tip";
+ value: "all";
+ selected: {model.isSecondaryVesselTypeAll()};
+ buttonGroup: "filterSecondaryVesselType";
+}
+
+#filterSecondaryVesselScientificButton {
+ text: "tutti.editFishingOperation.filterSecondaryVesselType.scientific";
+ toolTipText: "tutti.editFishingOperation.filterSecondaryVesselType.scientific.tip";
+ value: "scientific";
+ selected: {model.isSecondaryVesselTypeScientific()};
+ buttonGroup: "filterSecondaryVesselType";
+}
+
+#filterSecondaryVesselFishingButton {
+ text: "tutti.editFishingOperation.filterSecondaryVesselType.fishing";
+ toolTipText: "tutti.editFishingOperation.filterSecondaryVesselType.fishing.tip";
+ value: "fishing";
+ selected: {model.isSecondaryVesselTypeFishing()};
+ buttonGroup: "filterSecondaryVesselType";
+}
+
+#filterSecondaryVesselOnlyCruiseButton {
+ text: "tutti.editFishingOperation.filterSecondaryVesselType.onlyCruise";
+ toolTipText: "tutti.editFishingOperation.filterSecondaryVesselType.onlyCruise.tip";
+ value: "onlyCruise";
+ selected: {model.isSecondaryVesselTypeOnlyCruise()};
+ buttonGroup: "filterSecondaryVesselType";
+}
+
+#secondaryVesselList {
+ property: secondaryVessel;
+ border: {BorderFactory.createTitledBorder(_("tutti.editFishingOperation.field.secondaryVessel"))};
+ useMultiSelect: false;
+ showSelectPopupEnabled: false;
+ _validatorLabel: {_("tutti.editFishingOperation.field.secondaryVessel")};
+ toolTipText: "tutti.editFishingOperation.field.secondaryVessel.tip";
+ _help: {"tutti.editFishingOperation.field.secondaryVessel.help"};
+}
+
.degree {
showReset: false;
useFloat: false;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-10-02 23:25:24 UTC (rev 1267)
@@ -478,6 +478,27 @@
genericType='Gear'/>
</cell>
</row>
+ <row>
+ <cell columns='2'>
+ <JPanel id='secondaryVesselFilterPane'>
+ <JLabel id='filterSecondaryVesselLabel'/>
+ <JRadioButton id='filterSecondaryVesselAllButton'
+ onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.ALL)'/>
+ <JRadioButton id='filterSecondaryVesselScientificButton'
+ onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.SCIENTIFIC)'/>
+ <JRadioButton id='filterSecondaryVesselFishingButton'
+ onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.FISHING)'/>
+ <JRadioButton id='filterSecondaryVesselOnlyCruiseButton'
+ onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.ONLY_CRUISE)'/>
+ </JPanel>
+ </cell>
+ </row>
+ <row weighty='0.3'>
+ <cell columns="4">
+ <BeanDoubleList id='secondaryVesselList'
+ genericType='Vessel'/>
+ </cell>
+ </row>
</Table>
</JPanel>
</cell>
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -28,9 +28,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
-import fr.ifremer.tutti.persistence.entities.data.Attachment;
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.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -62,8 +60,11 @@
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
+import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@@ -177,6 +178,7 @@
EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_VALID,
EditFishingOperationUIModel.PROPERTY_LOCATION,
EditFishingOperationUIModel.PROPERTY_RECORDER_PERSON,
+ EditFishingOperationUIModel.PROPERTY_SECONDARY_VESSEL,
EditFishingOperationUIModel.PROPERTY_VESSEL,
EditFishingOperationUIModel.PROPERTY_GEAR,
EditFishingOperationUIModel.PROPERTY_MULTIRIG_AGGREGATION,
@@ -248,6 +250,9 @@
@Override
public void afterInitUI() {
+
+ ui.getSecondaryVesselList().getBeforeFilterPanel().add(ui.getSecondaryVesselFilterPane(), BorderLayout.CENTER);
+
ui.getFishingOperationValidPanel().remove(
ui.getFishingOperationResetRadio());
@@ -336,6 +341,74 @@
initBeanFilterableComboBox(ui.getLocationComboBox(), locations, location);
+ initBeanList(ui.getSecondaryVesselList(),
+ Lists.<Vessel>newArrayList(),
+ model.getSecondaryVessel());
+
+ model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_NUMBER,
+ new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ }
+ });
+ // Change vessel list and gear list when vessel type changes
+ model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_SECONDARY_VESSEL_TYPE, new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ EditFishingOperationUIModel model =
+ (EditFishingOperationUIModel) evt.getSource();
+
+ boolean modify = model.isModify();
+
+ SecondaryVesselTypeEnum vesselType =
+ (SecondaryVesselTypeEnum) evt.getNewValue();
+
+ List<Vessel> vessels = Lists.newArrayList();
+
+ if (vesselType != null) {
+ switch (vesselType) {
+
+ case SCIENTIFIC:
+
+ vessels = model.getScientificSecondaryVessel();
+ break;
+ case FISHING:
+
+ vessels = model.getFishingSecondaryVessel();
+ break;
+ case ONLY_CRUISE:
+
+ vessels = model.getOnlyCruisSecondaryVessel();
+ break;
+ case ALL:
+ default:
+
+ vessels = model.getAllSecondaryVessel();
+ }
+ }
+
+ // clean vessel filter
+ ui.getSecondaryVesselList().getHandler().clearFilters();
+
+ // get selected vessel
+ List<Vessel> selected = Lists.newArrayList(ui.getSecondaryVesselList().getModel().getSelected());
+
+ // set new universe of vessel
+ ui.getSecondaryVesselList().getModel().setUniverse(vessels);
+
+ // push back selected vessel
+ ui.getSecondaryVesselList().getModel().setSelected(selected);
+
+ // push back modify state
+ model.setModify(modify);
+ }
+ });
+
+ model.setSecondaryVesselType(null);
+
changeValidatorContext(model.getValidationContext(), ui.getValidator());
listenValidationTableHasNoFatalError(ui.getValidator(), model);
@@ -389,6 +462,11 @@
protected Set<String> getPropertiesToIgnore() {
Set<String> result = super.getPropertiesToIgnore();
result.add(EditFishingOperationUIModel.PROPERTY_ATTACHMENT);
+ result.add(EditFishingOperationUIModel.PROPERTY_SECONDARY_VESSEL_TYPE);
+ result.add(EditFishingOperationUIModel.PROPERTY_SECONDARY_VESSEL_TYPE_ALL);
+ result.add(EditFishingOperationUIModel.PROPERTY_SECONDARY_VESSEL_TYPE_SCIENTIFIC);
+ result.add(EditFishingOperationUIModel.PROPERTY_SECONDARY_VESSEL_TYPE_FISHING);
+ result.add(EditFishingOperationUIModel.PROPERTY_SECONDARY_VESSEL_TYPE_ONLY_CRUISE);
return result;
}
@@ -677,15 +755,4 @@
getModel().setModify(false);
}
- public void reset(FishingOperation bean) {
-
- List<Attachment> attachments =
- getContext().getPersistenceService().getAllAttachments(
- getModel().getObjectType(),
- bean.getIdAsInt());
-
- getModel().removeAllAttachment(getModel().getAttachment());
- getModel().addAllAttachment(attachments);
- }
-
}
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -104,6 +104,16 @@
public static final String PROPERTY_VALIDATION_CONTEXT = "validationContext";
+ public static final String PROPERTY_SECONDARY_VESSEL_TYPE = "secondaryVesselType";
+
+ public static final String PROPERTY_SECONDARY_VESSEL_TYPE_ALL = "secondaryVesselTypeAll";
+
+ public static final String PROPERTY_SECONDARY_VESSEL_TYPE_SCIENTIFIC = "secondaryVesselTypeScientific";
+
+ public static final String PROPERTY_SECONDARY_VESSEL_TYPE_FISHING = "secondaryVesselTypeFishing";
+
+ public static final String PROPERTY_SECONDARY_VESSEL_TYPE_ONLY_CRUISE = "secondaryVesselTypeOnlyCruise";
+
/**
* Delegate edit object.
*
@@ -129,6 +139,8 @@
protected boolean loadingData;
+ protected SecondaryVesselTypeEnum secondaryVesselType;
+
protected static Binder<EditFishingOperationUIModel, FishingOperation> toBeanBinder =
BinderFactory.newBinder(EditFishingOperationUIModel.class,
FishingOperation.class);
@@ -475,14 +487,6 @@
return minutes <= 45 && minutes >= 20;
}
-// public List<FishingOperation> getExistingOperations() {
-// return existingOperations;
-// }
-
-// public void setExistingOperations(List<FishingOperation> existingOperations) {
-// this.existingOperations = existingOperations;
-// }
-
public void convertGearShootingCoordinatesDDToDMS() {
SexagecimalPosition position;
Integer degree;
@@ -560,6 +564,34 @@
}
}
+ public SecondaryVesselTypeEnum getSecondaryVesselType() {
+ return secondaryVesselType;
+ }
+
+ public boolean isSecondaryVesselTypeAll() {
+ return SecondaryVesselTypeEnum.ALL.equals(getSecondaryVesselType());
+ }
+
+ public boolean isSecondaryVesselTypeScientific() {
+ return SecondaryVesselTypeEnum.SCIENTIFIC.equals(getSecondaryVesselType());
+ }
+
+ public boolean isSecondaryVesselTypeFishing() {
+ return SecondaryVesselTypeEnum.FISHING.equals(getSecondaryVesselType());
+ }
+
+ public boolean isSecondaryVesselTypeOnlyCruise() {
+ return SecondaryVesselTypeEnum.ONLY_CRUISE.equals(getSecondaryVesselType());
+ }
+
+ public void setSecondaryVesselType(SecondaryVesselTypeEnum secondaryVesselType) {
+ this.secondaryVesselType = secondaryVesselType;
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE, null, secondaryVesselType);
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE_ALL, null, isSecondaryVesselTypeAll());
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE_SCIENTIFIC, null, isSecondaryVesselTypeScientific());
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE_FISHING, null, isSecondaryVesselTypeFishing());
+ }
+
//------------------------------------------------------------------------//
//-- AttachmentModelAware methods --//
//------------------------------------------------------------------------//
@@ -867,6 +899,106 @@
}
@Override
+ public Vessel getSecondaryVessel(int index) {
+ return editObject.getSecondaryVessel(index);
+ }
+
+ @Override
+ public boolean isSecondaryVesselEmpty() {
+ return editObject.isSecondaryVesselEmpty();
+ }
+
+ @Override
+ public int sizeSecondaryVessel() {
+ return editObject.sizeSecondaryVessel();
+ }
+
+ @Override
+ public void addSecondaryVessel(Vessel secondaryVessel) {
+ editObject.addSecondaryVessel(secondaryVessel);
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
+ }
+
+ @Override
+ public void addAllSecondaryVessel(Collection<Vessel> secondaryVessel) {
+ editObject.addAllSecondaryVessel(secondaryVessel);
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
+ }
+
+ @Override
+ public boolean removeSecondaryVessel(Vessel secondaryVessel) {
+ boolean result = editObject.removeSecondaryVessel(secondaryVessel);
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
+ return result;
+ }
+
+ @Override
+ public boolean removeAllSecondaryVessel(Collection<Vessel> secondaryVessel) {
+ boolean result = editObject.removeAllSecondaryVessel(secondaryVessel);
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
+ return result;
+ }
+
+ @Override
+ public boolean containsSecondaryVessel(Vessel secondaryVessel) {
+ return editObject.containsSecondaryVessel(secondaryVessel);
+ }
+
+ @Override
+ public boolean containsAllSecondaryVessel(Collection<Vessel> secondaryVessel) {
+ return editObject.containsAllSecondaryVessel(secondaryVessel);
+ }
+
+ @Override
+ public List<Vessel> getSecondaryVessel() {
+ return editObject.getSecondaryVessel();
+ }
+
+ @Override
+ public void setSecondaryVessel(List<Vessel> secondaryVessel) {
+ editObject.setSecondaryVessel(secondaryVessel);
+ firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
+ }
+
+ List<Vessel> allSecondaryVessel;
+
+ List<Vessel> onlyCruisSecondaryVessel;
+ List<Vessel> scientificSecondaryVessel;
+ List<Vessel> fishingSecondaryVessel;
+
+ public List<Vessel> getAllSecondaryVessel() {
+ return allSecondaryVessel;
+ }
+
+ public void setAllSecondaryVessel(List<Vessel> allSecondaryVessel) {
+ this.allSecondaryVessel = allSecondaryVessel;
+ }
+
+ public List<Vessel> getOnlyCruisSecondaryVessel() {
+ return onlyCruisSecondaryVessel;
+ }
+
+ public void setOnlyCruisSecondaryVessel(List<Vessel> onlyCruisSecondaryVessel) {
+ this.onlyCruisSecondaryVessel = onlyCruisSecondaryVessel;
+ }
+
+ public List<Vessel> getFishingSecondaryVessel() {
+ return fishingSecondaryVessel;
+ }
+
+ public void setFishingSecondaryVessel(List<Vessel> fishingSecondaryVessel) {
+ this.fishingSecondaryVessel = fishingSecondaryVessel;
+ }
+
+ public List<Vessel> getScientificSecondaryVessel() {
+ return scientificSecondaryVessel;
+ }
+
+ public void setScientificSecondaryVessel(List<Vessel> scientificSecondaryVessel) {
+ this.scientificSecondaryVessel = scientificSecondaryVessel;
+ }
+
+ @Override
public boolean isPlanktonObserved() {
return false;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/NewFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/NewFishingOperationAction.java 2013-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/NewFishingOperationAction.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -27,7 +27,7 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.FishingOperations;
-import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
import java.util.List;
@@ -68,7 +68,7 @@
newFishingOperation.setCruise(cruise);
newFishingOperation.setVessel(cruise.getVessel());
- List<Gear> gears = cruise.getGear();
+ List<GearWithOriginalRankOrder> gears = cruise.getGear();
if (gears.size() == 1) {
newFishingOperation.setGear(gears.get(0));
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java 2013-10-02 23:25:24 UTC (rev 1267)
@@ -0,0 +1,14 @@
+package fr.ifremer.tutti.ui.swing.content.operation;
+
+/**
+ * Created on 10/2/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.7
+ */
+public enum SecondaryVesselTypeEnum {
+ ALL,
+ SCIENTIFIC,
+ FISHING,
+ ONLY_CRUISE
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SecondaryVesselTypeEnum.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-10-02 23:25:24 UTC (rev 1267)
@@ -688,6 +688,8 @@
tutti.editFishingOperation.field.multirigAggregation.tip=
tutti.editFishingOperation.field.recorderPerson=
tutti.editFishingOperation.field.recorderPerson.tip=
+tutti.editFishingOperation.field.secondaryVessel=
+tutti.editFishingOperation.field.secondaryVessel.tip=
tutti.editFishingOperation.field.stationNumber=
tutti.editFishingOperation.field.stationNumber.tip=
tutti.editFishingOperation.field.strata=
@@ -699,6 +701,16 @@
tutti.editFishingOperation.field.trawlDistance.tip=
tutti.editFishingOperation.field.vessel=
tutti.editFishingOperation.field.vessel.tip=
+tutti.editFishingOperation.filterSecondaryVesselType=
+tutti.editFishingOperation.filterSecondaryVesselType.all=
+tutti.editFishingOperation.filterSecondaryVesselType.all.tip=
+tutti.editFishingOperation.filterSecondaryVesselType.fishing=
+tutti.editFishingOperation.filterSecondaryVesselType.fishing.tip=
+tutti.editFishingOperation.filterSecondaryVesselType.onlyCruise=
+tutti.editFishingOperation.filterSecondaryVesselType.onlyCruise.tip=
+tutti.editFishingOperation.filterSecondaryVesselType.scientific=
+tutti.editFishingOperation.filterSecondaryVesselType.scientific.tip=
+tutti.editFishingOperation.filterSecondaryVesselType.tip=
tutti.editFishingOperation.label.traitReminder=
tutti.editFishingOperation.label.traitReminder.inCreation=
tutti.editFishingOperation.message.operation.deleted=
@@ -1116,6 +1128,8 @@
tutti.flash.info.species.imported.in.protocol.severalReplaced=
tutti.flash.info.species.remove.from.protocol=
tutti.flash.info.species.replaced=
+tutti.gear.noCaracteristics=
+tutti.gear.withCaracteristics=
tutti.gearCaracteristicsEditorTable.table.header.key=
tutti.gearCaracteristicsEditorTable.table.header.value=
tutti.gearUseFeatureTable.action.removeCaracteristic=
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-10-02 16:26:49 UTC (rev 1266)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-10-02 23:25:24 UTC (rev 1267)
@@ -688,6 +688,8 @@
tutti.editFishingOperation.field.multirigAggregation.tip=N° de la poche au regard du nombre de poches précisé dans la campagne
tutti.editFishingOperation.field.recorderPerson=Saisisseur(s)
tutti.editFishingOperation.field.recorderPerson.tip=Nom(s) du (des) personnes qui ont saisi la données de ce trait
+tutti.editFishingOperation.field.secondaryVessel=Navire(s) associé(s)
+tutti.editFishingOperation.field.secondaryVessel.tip=Navire(s) associé(s) au trait
tutti.editFishingOperation.field.stationNumber=Code Station
tutti.editFishingOperation.field.stationNumber.tip=Identifiant de la station
tutti.editFishingOperation.field.strata=Strate
@@ -699,6 +701,16 @@
tutti.editFishingOperation.field.trawlDistance.tip=Distance chalutée en mètres
tutti.editFishingOperation.field.vessel=Navire
tutti.editFishingOperation.field.vessel.tip=Navire du trait
+tutti.editFishingOperation.filterSecondaryVesselType=Filtre \:
+tutti.editFishingOperation.filterSecondaryVesselType.all=Tout
+tutti.editFishingOperation.filterSecondaryVesselType.all.tip=Tous les navires possibles
+tutti.editFishingOperation.filterSecondaryVesselType.fishing=Professionnels
+tutti.editFishingOperation.filterSecondaryVesselType.fishing.tip=Uniquement les navires professionnels
+tutti.editFishingOperation.filterSecondaryVesselType.onlyCruise=Associés
+tutti.editFishingOperation.filterSecondaryVesselType.onlyCruise.tip=Uniquement les navires déjà associés à d'autres traits de cette campagne
+tutti.editFishingOperation.filterSecondaryVesselType.scientific=Scientifiques
+tutti.editFishingOperation.filterSecondaryVesselType.scientific.tip=Uniquement les navires scientifiques
+tutti.editFishingOperation.filterSecondaryVesselType.tip=Filter les navires associés possible pour ce trait
tutti.editFishingOperation.label.traitReminder=Trait \: %s
tutti.editFishingOperation.label.traitReminder.inCreation=en cours de création
tutti.editFishingOperation.message.operation.deleted=Opération de pêche <strong>%s</strong> supprimée.
@@ -1117,6 +1129,8 @@
tutti.flash.info.species.imported.in.protocol.severalReplaced=Espèces importées dans le protocole depuis le fichier <strong>%s</strong>. %s remplacées par leur référent.
tutti.flash.info.species.remove.from.protocol=L'espèce <strong>%s</strong> a été retirée du protocole.
tutti.flash.info.species.replaced=L'espèce <strong>%s</strong> a été remplacée par son référent <strong>%s</strong>.
+tutti.gear.noCaracteristics=Pas de caractéristiques.
+tutti.gear.withCaracteristics=Caractéristiques de l'engin %s
tutti.gearCaracteristicsEditorTable.table.header.key=Caractéristique
tutti.gearCaracteristicsEditorTable.table.header.value=Valeur
tutti.gearUseFeatureTable.action.removeCaracteristic=Supprimer
1
0
02 Oct '13
Author: tchemit
Date: 2013-10-02 18:26:49 +0200 (Wed, 02 Oct 2013)
New Revision: 1266
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1266
Log:
fixes #3333: [CAMPAGNE] pouvoir ajouter plusieur engins professionnels de m?\195?\170me type ?\195?\160 une campagne
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java
Removed:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/Gears.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/ValidationServiceTest.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/cruise/EditCruiseUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditGearCaracteristicsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/GearCaracteristicsEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/SaveCruiseAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ViewGearCaracteristicsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.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/util/table/AbstractTuttiTableUIHandler.java
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-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -24,6 +24,7 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -421,7 +422,9 @@
@Transactional(readOnly = false)
Cruise saveCruise(Cruise bean);
- Gear getGearWithCaracteristics(Gear gear, Cruise cruise);
+ CaracteristicMap getGearCaracteristics(String cruiseId,
+ String gearId,
+ short rankOrder);
@Transactional(readOnly = false)
void saveGearCaracteristics(Gear gear, Cruise cruise);
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-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -31,6 +31,7 @@
import fr.ifremer.adagio.core.dao.technical.VersionNotFoundException;
import fr.ifremer.adagio.core.service.technical.CacheService;
import fr.ifremer.tutti.TuttiTechnicalException;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
@@ -562,8 +563,8 @@
}
@Override
- public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
- return cruiseService.getGearWithCaracteristics(gear, cruise);
+ public CaracteristicMap getGearCaracteristics(String cruiseId, String gearId, short rankOrder) {
+ return cruiseService.getGearCaracteristics(cruiseId, gearId, rankOrder);
}
@Override
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-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -24,6 +24,7 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -360,7 +361,7 @@
}
@Override
- public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
+ public CaracteristicMap getGearCaracteristics(String cruiseId, String gearId, short rankOrder) {
throw notImplemented();
}
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -0,0 +1,14 @@
+package fr.ifremer.tutti.persistence.entities.referential;
+
+import javax.annotation.Generated;
+
+@Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Wed Oct 02 14:29:49 CEST 2013")
+public interface GearWithOriginalRankOrder extends Gear {
+
+ String PROPERTY_ORIGINAL_RANK_ORDER = "originalRankOrder";
+
+ Short getOriginalRankOrder();
+
+ void setOriginalRankOrder(Short originalRankOrder);
+
+} //GearWithOriginalRankOrder
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrder.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -0,0 +1,38 @@
+package fr.ifremer.tutti.persistence.entities.referential;
+
+import org.apache.commons.lang3.ObjectUtils;
+
+import javax.annotation.Generated;
+
+@Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Wed Oct 02 14:23:47 CEST 2013")
+public class GearWithOriginalRankOrderBean extends GearBean implements GearWithOriginalRankOrder {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Short originalRankOrder;
+
+ @Override
+ public Short getOriginalRankOrder() {
+ return originalRankOrder;
+ }
+
+ @Override
+ public void setOriginalRankOrder(Short originalRankOrder) {
+ this.originalRankOrder = originalRankOrder;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ boolean result = super.equals(o);
+ if (result) {
+ result = ObjectUtils.equals(rankOrder, ((GearWithOriginalRankOrder) o).getRankOrder());
+ }
+ return result;
+ }
+
+ @Override
+ public int hashCode() {
+ return super.hashCode() + 13 * (rankOrder == null ? 0 : rankOrder.hashCode());
+ }
+
+} //GearWithOriginalRankOrderBean
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrderBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -0,0 +1,18 @@
+package fr.ifremer.tutti.persistence.entities.referential;
+
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+import javax.annotation.Generated;
+
+@Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Wed Oct 02 14:29:49 CEST 2013")
+public class GearWithOriginalRankOrders extends AbstractGearWithOriginalRankOrders {
+
+ public static <BeanType extends GearWithOriginalRankOrder> BeanType newGearWithOriginalRankOrder(Gear source) {
+ Class<BeanType> sourceType = typeOfGearWithOriginalRankOrder();
+ Binder<Gear,BeanType> binder = BinderFactory.newBinder(Gear.class, sourceType);
+ BeanType result = (BeanType) newGearWithOriginalRankOrder();
+ binder.copy(source, result);
+ return result;
+ }
+} //GearWithOriginalRankOrders
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearWithOriginalRankOrders.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/Gears.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/Gears.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/Gears.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -1,65 +0,0 @@
-package fr.ifremer.tutti.persistence.entities.referential;
-
-/*
- * #%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 org.apache.commons.lang3.ObjectUtils;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderFactory;
-
-import javax.annotation.Generated;
-
-@Generated(value = "org.nuiton.eugene.java.SimpleJavaBeanTransformer", date = "Mon Sep 30 14:14:53 CEST 2013")
-public class Gears extends AbstractGears {
-
- public static boolean equals(Gear g0, Gear g1) {
- return ObjectUtils.equals(g0.getId(), g1.getId()) && ObjectUtils.equals(g0.getRankOrder(), g1.getRankOrder());
- }
-
- public static Gear newGearWithRankOrder(Gear gear) {
- Binder<Gear, Gear> binder = BinderFactory.newBinder(Gear.class);
- GearBean2 result = new GearBean2();
- binder.copy(gear, result);
- return result;
- }
-
-
- public static class GearBean2 extends GearBean {
-
- @Override
- public boolean equals(Object o) {
- boolean result = super.equals(o);
- if (result) {
- result = ObjectUtils.equals(rankOrder, ((GearBean2) o).rankOrder);
- }
- return result;
- }
-
- @Override
- public int hashCode() {
- return super.hashCode() + 13 * (rankOrder == null ? 0 : rankOrder.hashCode());
- }
-
- }
-} //Gears
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceService.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -25,6 +25,7 @@
*/
import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
import org.springframework.transaction.annotation.Transactional;
@@ -50,7 +51,7 @@
@Transactional(readOnly = false)
Cruise saveCruise(Cruise bean);
- Gear getGearWithCaracteristics(Gear gear, Cruise cruise);
+ CaracteristicMap getGearCaracteristics(String cruiseId, String gearId, short rankOrder);
@Transactional(readOnly = false)
void saveGearCaracteristics(Gear gear, Cruise cruise);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -68,6 +68,8 @@
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.GearWithOriginalRankOrder;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
@@ -226,11 +228,12 @@
"cruiseId", IntegerType.INSTANCE, Integer.valueOf(id),
"pmfmIdTrawlNet", IntegerType.INSTANCE, enumeration.PMFM_ID_MULTIRIG_NUMBER);
- List<Gear> gears = Lists.newArrayList();
+ List<GearWithOriginalRankOrder> gears = Lists.newArrayList();
int maxMultirigNumberFound = 0;
while (list.hasNext()) {
Object[] gearRow = list.next();
- Gear target = referentialService.getGear((Integer) gearRow[0]);
+ Gear simpleGear = referentialService.getGear((Integer) gearRow[0]);
+ GearWithOriginalRankOrder target = GearWithOriginalRankOrders.newGearWithOriginalRankOrder(simpleGear);
target.setRankOrder((Short) gearRow[1]);
Float multirigNumber = (Float) gearRow[2];
if (multirigNumber != null && multirigNumber.intValue() > maxMultirigNumberFound) {
@@ -329,30 +332,22 @@
}
@Override
- public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
- Preconditions.checkNotNull(cruise);
- Preconditions.checkNotNull(cruise.getId(), "Cruise 'id' must not be null or empty");
- Preconditions.checkNotNull(gear);
- Preconditions.checkNotNull(gear.getId(), "Gear 'id' must not be null or empty");
+ public CaracteristicMap getGearCaracteristics(String cruiseId,
+ String gearId,
+ short rankOrder) {
+ Preconditions.checkNotNull(cruiseId, "Cruise 'id' must not be null or empty");
+ Preconditions.checkNotNull(gearId, "Gear 'id' must not be null or empty");
- short rankOrder;
-
- if (gear.getRankOrder() == null) {
- rankOrder = 1;
- } else {
- rankOrder = gear.getRankOrder();
- }
-
if (log.isInfoEnabled()) {
- log.info("Get caracteristic for gear " + gear.getIdAsInt() + " - " + rankOrder);
+ log.info("Get caracteristic for gear " + gearId + " - " + rankOrder);
}
CaracteristicMap result = new CaracteristicMap();
Iterator<GearPhysicalMeasurement> list = queryListTyped(
"gearCaracteristics",
- "cruiseId", IntegerType.INSTANCE, cruise.getIdAsInt(),
- "gearId", IntegerType.INSTANCE, gear.getIdAsInt(),
+ "cruiseId", IntegerType.INSTANCE, Integer.valueOf(cruiseId),
+ "gearId", IntegerType.INSTANCE, Integer.valueOf(gearId),
"rankOrder", ShortType.INSTANCE, rankOrder);
while (list.hasNext()) {
@@ -381,9 +376,7 @@
result.put(caracteristic, value);
}
}
-
- gear.setCaracteristics(result);
- return gear;
+ return result;
}
@Override
@@ -566,9 +559,31 @@
short gearRankOrder = 1;
// Create or update a geaPhysicalFeatures for each gears in the cruise
- for (Gear gear : source.getGear()) {
+ for (GearWithOriginalRankOrder gear : source.getGear()) {
+
Short rankOrder = gear.getRankOrder();
- GearPhysicalFeatures guf = gearPhysicalFeaturesDao.getGearPhysicalfeatures(fishingTrip, gear.getIdAsInt(), rankOrder, true);
+
+ GearPhysicalFeatures guf;
+
+ // try first to get the guf with originalRankOrder
+ guf = gearPhysicalFeaturesDao.getGearPhysicalfeatures(fishingTrip, gear.getIdAsInt(), gear.getOriginalRankOrder(), false);
+
+ if (guf == null) {
+
+ // try with new rankOrder
+ // in facts, only means create a new one
+ guf = gearPhysicalFeaturesDao.getGearPhysicalfeatures(fishingTrip, gear.getIdAsInt(), rankOrder, true);
+ if (log.isInfoEnabled()) {
+ log.info("Will create guf: " + guf.getId() + " for gear: " + gear.getId() + " - " + gear.getRankOrder());
+ }
+ } else {
+
+ // got an old guf to update
+ if (log.isInfoEnabled()) {
+ log.info("Will update guf: " + guf.getId() + " for gear: " + gear.getId() + " - " + gear.getOriginalRankOrder() + ", new rankOrder: " + gear.getRankOrder());
+ }
+ }
+
notChangedGearPhysicalFeatures.remove(guf);
guf.setStartDate(fishingTrip.getDepartureDateTime());
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -70,7 +70,7 @@
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicType;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
-import fr.ifremer.tutti.persistence.entities.referential.Gears;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
@@ -160,10 +160,8 @@
public int getFishingOperationCount(String cruiseId) {
Preconditions.checkNotNull(cruiseId);
Iterator<Object[]> list = queryList(
- "allFishingOperations",
- "cruiseId", IntegerType.INSTANCE, Integer.valueOf(cruiseId),
- "pmfmIdStationNumber", IntegerType.INSTANCE, enumeration.PMFM_ID_STATION_NUMBER,
- "pmfmIdMultirigAggregation", IntegerType.INSTANCE, enumeration.PMFM_ID_MULTIRIG_AGGREGATION
+ "allFishingOperationIds",
+ "cruiseId", IntegerType.INSTANCE, Integer.valueOf(cruiseId)
);
int result = 0;
while (list.hasNext()) {
@@ -320,9 +318,13 @@
Gear gear = referentialService.getGear(gearId);
Preconditions.checkNotNull(gear);
// use a copy of it with rankOrder
- Gear toSet = Gears.newGear(gear);
+ Gear toSet = GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear);
toSet.setRankOrder(rankOrder);
+ if (log.isInfoEnabled()) {
+ log.info("FishingOperation: " + id + ", use gear: " + gearId + " - " + rankOrder);
+ }
+
result.setGear(toSet);
}
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
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-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -34,6 +34,7 @@
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.TuttiPersistenceNoDbImpl;
import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
@@ -885,10 +886,15 @@
}
@Override
- public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
- return driver.getGearWithCaracteristics(gear, cruise);
+ public CaracteristicMap getGearCaracteristics(String cruiseId, String gearId, short rankOrder) {
+ return driver.getGearCaracteristics(cruiseId, gearId, rankOrder);
}
+// @Override
+// public Gear getGearWithCaracteristics(Gear gear, short rankOrder, Cruise cruise) {
+// return driver.getGearWithCaracteristics(gear, rankOrder, cruise);
+// }
+
@Override
public void saveGearCaracteristics(Gear gear, Cruise cruise) {
driver.saveGearCaracteristics(gear, cruise);
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-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -33,6 +33,7 @@
import fr.ifremer.tutti.TuttiIOUtil;
import fr.ifremer.tutti.TuttiTechnicalException;
import fr.ifremer.tutti.persistence.ProgressionModel;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
@@ -45,6 +46,7 @@
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.Gears;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.service.AbstractTuttiService;
@@ -364,7 +366,14 @@
for (Gear gear : cruise.getGear()) {
- Gear gearWithCaracteristics = persistenceService.getGearWithCaracteristics(gear, cruise);
+ CaracteristicMap caracteristics =
+ persistenceService.getGearCaracteristics(
+ cruise.getId(),
+ gear.getId(),
+ gear.getRankOrder());
+
+ Gear gearWithCaracteristics = Gears.newGear(gear);
+ gearWithCaracteristics.setCaracteristics(caracteristics);
exportContext.gearCaracteristicsModel.prepareRows(rows, cruise, gearWithCaracteristics);
}
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/ValidationServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/ValidationServiceTest.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/ValidationServiceTest.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -32,7 +32,7 @@
import fr.ifremer.tutti.persistence.entities.data.Programs;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocols;
-import fr.ifremer.tutti.persistence.entities.referential.Gears;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Persons;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocations;
@@ -86,7 +86,7 @@
c.setReturnLocation(TuttiLocations.newTuttiLocation());
c.setProgram(Programs.newProgram());
c.setVessel(Vessels.newVessel());
- c.setGear(Lists.newArrayList(Gears.newGear()));
+ c.setGear(Lists.newArrayList(GearWithOriginalRankOrders.newGearWithOriginalRankOrder()));
c.setHeadOfMission(Lists.newArrayList(Persons.newPerson()));
c.setHeadOfSortRoom(Lists.newArrayList(Persons.newPerson()));
assertIsValid(service.validateCruise(c));
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-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -31,7 +31,8 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
-import fr.ifremer.tutti.persistence.entities.referential.Gears;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.service.DecoratorService;
@@ -39,6 +40,8 @@
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.CloseableUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.context.JAXXContextEntryDef;
import jaxx.runtime.swing.editor.bean.BeanDoubleListModel;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
@@ -122,6 +125,16 @@
model.fromBean(cruise);
+ if (!model.isGearEmpty()) {
+
+ // load gear caracteristics + set originalRankOrder
+ for (GearWithOriginalRankOrder gear : model.getGear()) {
+
+ // original rank order is the incoming rank order
+ gear.setOriginalRankOrder(gear.getRankOrder());
+ }
+ }
+
// load attachments
List<Attachment> attachments = persistenceService.getAllAttachments(
model.getObjectType(), model.getObjectId());
@@ -256,14 +269,20 @@
@Override
public void addToSelected(Gear item) {
- Gear target = Gears.newGearWithRankOrder(item);
- // rank order = position in list
- int rankOrder = getSelectedListSize();
- target.setRankOrder((short) rankOrder);
- if (log.isInfoEnabled()) {
- log.info("Add to selected " + target.getRankOrder() + " - " + target.getName());
+ // always use a copy (with original rank order)
+ GearWithOriginalRankOrder target =
+ GearWithOriginalRankOrders.newGearWithOriginalRankOrder(item);
+
+ Short originalRankOrder = null;
+
+ if (item instanceof GearWithOriginalRankOrder) {
+ // take the incoming original rank order
+ originalRankOrder = ((GearWithOriginalRankOrder) item).getOriginalRankOrder();
}
-
+ if (originalRankOrder == null) {
+ originalRankOrder = 0;
+ }
+ target.setOriginalRankOrder(originalRankOrder);
super.addToSelected(target);
rebuildRankOrder();
}
@@ -312,7 +331,7 @@
});
initBeanList(ui.getGearList(),
allGearList,
- model.getGear(),
+ (List) model.getGear(),
getDecorator(Gear.class, DecoratorService.GEAR_WITH_RANK_ORDER));
// add more actions on selected gear popup
@@ -346,7 +365,7 @@
jList.clearSelection();
}
- Gear gear = (Gear) jList.getSelectedValue();
+ GearWithOriginalRankOrder gear = (GearWithOriginalRankOrder) jList.getSelectedValue();
updateGearActionsAndShowPoup(gear, jList, e.getX(), e.getY());
}
@@ -372,7 +391,7 @@
Point p = new Point(r.x + r.width / 2, r.y + r.height);
Object[] gears = source.getSelectedValues();
- Gear gear = gears != null && gears.length == 1 ? (Gear) gears[0] : null;
+ GearWithOriginalRankOrder gear = gears != null && gears.length == 1 ? (GearWithOriginalRankOrder) gears[0] : null;
updateGearActionsAndShowPoup(gear, source, p.x, p.y);
}
}
@@ -437,17 +456,21 @@
model.setName(name);
}
- protected void updateGearActionsAndShowPoup(Gear gear,
+ public static final JAXXContextEntryDef<GearWithOriginalRankOrder> GEAR_EDIT_CONTEXT =
+ JAXXUtil.newContextEntryDef("editGear", GearWithOriginalRankOrder.class);
+
+ protected void updateGearActionsAndShowPoup(GearWithOriginalRankOrder gear,
JComponent source,
int x,
int y) {
boolean editMenuEnabled = false;
boolean viewMenuEnabled = false;
if (gear != null) {
- editMenuEnabled = !getModel().isCreate() && !getModel().isModify()
- && (!gear.isScientificGear() || persistenceService.isTemporary(gear));
+ editMenuEnabled = !getModel().isCreate() &&
+ !getModel().isModify() &&
+ (!gear.isScientificGear() || persistenceService.isTemporary(gear));
viewMenuEnabled = true;
- ui.setContextValue(gear);
+ GEAR_EDIT_CONTEXT.setContextValue(ui, gear);
}
getModel().setCanEditGearCatacteristic(editMenuEnabled);
getModel().setCanShowGearCatacteristic(viewMenuEnabled);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -30,7 +30,7 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Cruises;
import fr.ifremer.tutti.persistence.entities.data.Program;
-import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
@@ -356,12 +356,12 @@
}
@Override
- public List<Gear> getGear() {
+ public List<GearWithOriginalRankOrder> getGear() {
return editObject.getGear();
}
@Override
- public void setGear(List<Gear> gear) {
+ public void setGear(List<GearWithOriginalRankOrder> gear) {
editObject.setGear(gear);
firePropertyChange(PROPERTY_GEAR, null, gear);
}
@@ -389,46 +389,48 @@
}
@Override
- public Gear getGear(int index) {
- return null;
+ public GearWithOriginalRankOrder getGear(int index) {
+ return editObject.getGear(index);
}
@Override
public boolean isGearEmpty() {
- return false;
+ return editObject.isGearEmpty();
}
@Override
public int sizeGear() {
- return 0;
+ return editObject.sizeGear();
}
@Override
- public void addGear(Gear gear) {
+ public void addGear(GearWithOriginalRankOrder gear) {
+ editObject.addGear(gear);
}
@Override
- public void addAllGear(Collection<Gear> gear) {
+ public void addAllGear(Collection<GearWithOriginalRankOrder> gear) {
+ editObject.addAllGear(gear);
}
@Override
- public boolean removeGear(Gear gear) {
- return false;
+ public boolean removeGear(GearWithOriginalRankOrder gear) {
+ return editObject.removeGear(gear);
}
@Override
- public boolean removeAllGear(Collection<Gear> gear) {
- return false;
+ public boolean removeAllGear(Collection<GearWithOriginalRankOrder> gear) {
+ return editObject.removeAllGear(gear);
}
@Override
- public boolean containsGear(Gear gear) {
- return false;
+ public boolean containsGear(GearWithOriginalRankOrder gear) {
+ return editObject.containsGear(gear);
}
@Override
- public boolean containsAllGear(Collection<Gear> gear) {
- return false;
+ public boolean containsAllGear(Collection<GearWithOriginalRankOrder> gear) {
+ return editObject.containsAllGear(gear);
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditGearCaracteristicsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditGearCaracteristicsAction.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditGearCaracteristicsAction.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -24,8 +24,9 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.referential.Gear;
-import fr.ifremer.tutti.service.DecoratorService;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
import org.apache.commons.logging.Log;
@@ -53,13 +54,24 @@
GearCaracteristicsEditorUI editor = getUI().getGearCaracteristicsEditor();
editor.getModel().setEditable(true);
- Gear gear = getUI().getContextValue(Gear.class);
- gear = persistenceService.getGearWithCaracteristics(gear, getDataContext().getCruise());
+ GearWithOriginalRankOrder gear =
+ EditCruiseUIHandler.GEAR_EDIT_CONTEXT.getContextValue(getUI());
+ CaracteristicMap caracteristics =
+ persistenceService.getGearCaracteristics(
+ getDataContext().getCruise().getId(),
+ gear.getId(),
+ gear.getOriginalRankOrder());
+
+ GearWithOriginalRankOrder gearToView =
+ GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear);
+ gearToView.setCaracteristics(caracteristics);
+
if (log.isInfoEnabled()) {
- log.info("Will edit gear " + decorate(gear, DecoratorService.GEAR_WITH_RANK_ORDER));
+ log.info("Will edit gear " + decorate(gearToView) +
+ " with " + gearToView.getCaracteristics().size() + " caracteristics.");
}
- editor.getModel().setGear(gear);
+ editor.getModel().setGear(gearToView);
getUI().getMainPanelLayout().setSelected(EditCruiseUIHandler.GEAR_CARACTERISTICS_CARD);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/GearCaracteristicsEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/GearCaracteristicsEditorUIHandler.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/GearCaracteristicsEditorUIHandler.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -91,10 +91,20 @@
@Override
protected void onAfterSelectedRowChanged(int oldRowIndex, GearCaracteristicsEditorRowModel oldRow, int newRowIndex, GearCaracteristicsEditorRowModel newRow) {
super.onAfterSelectedRowChanged(oldRowIndex, oldRow, newRowIndex, newRow);
- getModel().setRemoveCaracteristicEnabled(newRowIndex >= 0);
+ if (newRow != null) {
+ recomputeRowValidState(newRow);
+ }
+// getModel().setRemoveCaracteristicEnabled(newRowIndex >= 0);
}
@Override
+ protected void beforeOpenPopup(int rowIndex, int columnIndex) {
+ super.beforeOpenPopup(rowIndex, columnIndex);
+
+ getModel().setRemoveCaracteristicEnabled(rowIndex != -1);
+ }
+
+ @Override
protected void saveSelectedRowIfRequired(TuttiBeanMonitor<GearCaracteristicsEditorRowModel> rowMonitor,
GearCaracteristicsEditorRowModel row) {
if (row.isValid()) {
@@ -115,7 +125,8 @@
@Override
public void beforeInitUI() {
- GearCaracteristicsEditorUIModel model = createModel();
+ GearCaracteristicsEditorUIModel model =
+ new GearCaracteristicsEditorUIModel();
getUI().setContextValue(model);
model.addPropertyChangeListener(GearCaracteristicsEditorUIModel.PROPERTY_GEAR, new PropertyChangeListener() {
@@ -205,10 +216,6 @@
return ui.getNewRowKey();
}
- protected GearCaracteristicsEditorUIModel createModel() {
- return new GearCaracteristicsEditorUIModel();
- }
-
protected void saveRow(GearCaracteristicsEditorRowModel row) {
if (row.isValid()) {
@@ -296,6 +303,8 @@
if (caracteristicMap == null) {
caracteristicMap = new CaracteristicMap();
}
+ // always clear caracteristic map before all
+ model.getCaracteristicMap().clear();
model.getCaracteristicMap().putAll(caracteristicMap);
List<GearCaracteristicsEditorRowModel> rows = Lists.newArrayList();
@@ -326,6 +335,10 @@
keyCombo.getHandler().reset();
model.setModify(false);
+ } else {
+ cleanrRowMonitor();
+ getModel().setRows(Lists.<GearCaracteristicsEditorRowModel>newArrayList());
+ getTable().clearSelection();
}
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/SaveCruiseAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/SaveCruiseAction.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/SaveCruiseAction.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
@@ -97,6 +98,10 @@
context.setProgramId(saved.getProgram().getId());
context.setCruiseId(saved.getId());
+ // update originalRankOrder for all gears of the cruise
+ for (GearWithOriginalRankOrder gear : model.getGear()) {
+ gear.setOriginalRankOrder(gear.getRankOrder());
+ }
model.setModify(false);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ViewGearCaracteristicsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ViewGearCaracteristicsAction.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ViewGearCaracteristicsAction.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -24,8 +24,9 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.referential.Gear;
-import fr.ifremer.tutti.service.DecoratorService;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrder;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
import org.apache.commons.logging.Log;
@@ -53,14 +54,25 @@
GearCaracteristicsEditorUI editor = getUI().getGearCaracteristicsEditor();
editor.getModel().setEditable(false);
- Gear gear = getUI().getContextValue(Gear.class);
- gear = persistenceService.getGearWithCaracteristics(gear, getDataContext().getCruise());
+ GearWithOriginalRankOrder gear =
+ EditCruiseUIHandler.GEAR_EDIT_CONTEXT.getContextValue(getUI());
+ CaracteristicMap caracteristics =
+ persistenceService.getGearCaracteristics(
+ getDataContext().getCruise().getId(),
+ gear.getId(),
+ gear.getOriginalRankOrder());
+
+ GearWithOriginalRankOrder gearToEdit =
+ GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear);
+ gearToEdit.setCaracteristics(caracteristics);
+
if (log.isInfoEnabled()) {
- log.info("Will view gear " + decorate(gear, DecoratorService.GEAR_WITH_RANK_ORDER));
+ log.info("Will edit gear " + decorate(gearToEdit) +
+ " with " + gearToEdit.getCaracteristics().size() + " caracteristics.");
}
- editor.getModel().setGear(gear);
+ editor.getModel().setGear(gearToEdit);
getUI().getMainPanelLayout().setSelected(EditCruiseUIHandler.GEAR_CARACTERISTICS_CARD);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -26,6 +26,7 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.InvalidBatchModelException;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
@@ -34,7 +35,7 @@
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.FishingOperations;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
-import fr.ifremer.tutti.persistence.entities.referential.Gears;
+import fr.ifremer.tutti.persistence.entities.referential.GearWithOriginalRankOrders;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.service.PersistenceService;
@@ -349,19 +350,19 @@
log.info("Edit in ui fishingOperation: " + fishingOperation);
}
- // get the rankorder of the gear from cruise gears
- Gear gear = fishingOperation == null ? null : fishingOperation.getGear();
- if (gear != null) {
- Gear newGear = Gears.newGearWithRankOrder(gear);
- fishingOperation.setGear(newGear);
- Cruise cruise = getDataContext().getCruise();
- for (Gear cruiseGear : cruise.getGear()) {
- if (Gears.equals(cruiseGear, newGear)) {
- newGear.setRankOrder(cruiseGear.getRankOrder());
- break;
- }
- }
- }
+// // get the rankorder of the gear from cruise gears
+// Gear gear = fishingOperation == null ? null : fishingOperation.getGear();
+// if (gear != null) {
+// Gear newGear = Gears.newGearWithRankOrder(gear);
+// fishingOperation.setGear(newGear);
+// Cruise cruise = getDataContext().getCruise();
+// for (Gear cruiseGear : cruise.getGear()) {
+// if (Gears.equals(cruiseGear, newGear)) {
+// newGear.setRankOrder(cruiseGear.getRankOrder());
+// break;
+// }
+// }
+// }
// now fishing operation is edited
model.setEditFishingOperation(fishingOperation);
@@ -459,8 +460,16 @@
// add a equals on id + rankOrder
List<Gear> gears = Lists.newArrayList();
for (Gear gear : cruise.getGear()) {
- Gear gearWithCaracteristics = persistenceService.getGearWithCaracteristics(gear, cruise);
- gears.add(Gears.newGearWithRankOrder(gearWithCaracteristics));
+ CaracteristicMap caracteristics =
+ persistenceService.getGearCaracteristics(
+ cruise.getId(),
+ gear.getId(),
+ gear.getRankOrder());
+
+ Gear toKeep = GearWithOriginalRankOrders.newGearWithOriginalRankOrder(gear);
+ toKeep.setCaracteristics(caracteristics);
+
+ gears.add(toKeep);
}
ui.getGearComboBox().setData(gears);
}
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-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -39,7 +39,6 @@
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.service.PersistenceService;
-import fr.ifremer.tutti.service.TuttiCsvUtil;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.AbstractCaracteristicTabUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.GearUseFeatureTabUIModel;
@@ -49,6 +48,7 @@
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.action.TuttiActionHelper;
+import fr.ifremer.tutti.ui.swing.util.caracteristics.GearCaracteristicListCellRenderer;
import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
@@ -56,8 +56,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXDatePicker;
-import org.nuiton.csv.ValueFormatter;
-import org.nuiton.decorator.Decorator;
import javax.swing.JButton;
import javax.swing.JComboBox;
@@ -71,7 +69,6 @@
import java.awt.event.ItemListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@@ -273,7 +270,13 @@
null,
DecoratorService.GEAR_WITH_RANK_ORDER);
- final JComboBox combobox = ui.getGearComboBox().getCombobox();
+
+ JComboBox combobox = ui.getGearComboBox().getCombobox();
+ combobox.setRenderer(new GearCaracteristicListCellRenderer(
+ combobox.getRenderer(),
+ getDecorator(Caracteristic.class, DecoratorService.CARACTERISTIC_WITH_UNIT),
+ getDecorator(Gear.class, DecoratorService.GEAR_WITH_RANK_ORDER),
+ true));
combobox.addItemListener(new ItemListener() {
Map<Gear, String> tips = Maps.newHashMap();
@@ -281,52 +284,23 @@
public void itemStateChanged(ItemEvent e) {
Object item = e.getItem();
if (e.getStateChange() == ItemEvent.SELECTED) {
- if (log.isInfoEnabled()) {
- log.info("itemStateChanged selected " + item + " - " + (item != null ? item.getClass() : null));
+ if (log.isDebugEnabled()) {
+ log.debug("itemStateChanged selected " + item + " - " + (item != null ? item.getClass() : null));
}
- JComponent jC = (JComponent) combobox.getEditor().getEditorComponent();
- String toolTipText;
+ JComboBox combo = (JComboBox) e.getSource();
+ JComponent jC = (JComponent) combo.getEditor().getEditorComponent();
- if (item == null) {
- toolTipText = "";
- } else {
+ GearCaracteristicListCellRenderer renderer = (GearCaracteristicListCellRenderer) combo.getRenderer();
- Gear gear = (Gear) item;
+ String toolTipText = renderer.getToolTipText((Gear) item);
- if (tips.containsKey(gear)) {
-
- toolTipText = tips.get(gear);
- } else {
-
- Decorator<Caracteristic> decorator = getDecorator(Caracteristic.class, DecoratorService.CARACTERISTIC_WITH_UNIT);
- ValueFormatter<Serializable> caracteristicValueFormatter = TuttiCsvUtil.CARACTERISTIC_VALUE_FORMATTER;
- StringBuilder sb = new StringBuilder("<html><body>");
- if (gear.getCaracteristics() != null && !gear.getCaracteristics().isEmpty() ) {
-
- // got some caracteristics
- sb.append("<ul>");
- for (Map.Entry<Caracteristic, Serializable> entry : gear.getCaracteristics().entrySet()) {
- Caracteristic key = entry.getKey();
- String keyStr = decorator.toString(key);
- Serializable value = entry.getValue();
- String valueStr = caracteristicValueFormatter.format(value);
- sb.append("<li><strong>").append(keyStr).append("</strong> :");
- sb.append(valueStr).append("</li>");
- }
- sb.append("</ul>");
- } else {
-
- sb.append("<i>").append("Pas de caractéristiques").append("</i>");
- }
- sb.append("</body></html>");
-
- toolTipText = sb.toString();
- tips.put(gear, toolTipText);
- }
- }
-
jC.setToolTipText(toolTipText);
+ } else {
+ JComboBox combo = (JComboBox) e.getSource();
+ JComponent jC = (JComponent) combo.getEditor().getEditorComponent();
+
+ jC.setToolTipText(null);
}
}
});
@@ -713,4 +687,5 @@
getModel().removeAllAttachment(getModel().getAttachment());
getModel().addAllAttachment(attachments);
}
+
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -0,0 +1,120 @@
+package fr.ifremer.tutti.ui.swing.util.caracteristics;
+
+import com.google.common.collect.Maps;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.service.TuttiCsvUtil;
+import org.apache.commons.collections.MapUtils;
+import org.nuiton.csv.ValueFormatter;
+import org.nuiton.decorator.Decorator;
+
+import javax.swing.JComponent;
+import javax.swing.JList;
+import javax.swing.ListCellRenderer;
+import java.awt.Component;
+import java.io.Serializable;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Created on 10/2/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.7
+ */
+public class GearCaracteristicListCellRenderer implements ListCellRenderer {
+
+ private final ListCellRenderer delegate;
+
+ private final Decorator<Caracteristic> decorator;
+
+ private final Decorator<Gear> gearDecorator;
+
+ protected final Map<Gear, String> cache;
+
+ protected final boolean useCache;
+
+ public GearCaracteristicListCellRenderer(ListCellRenderer delegate,
+ Decorator<Caracteristic> decorator,
+ Decorator<Gear> gearDecorator, boolean useCache) {
+ this.gearDecorator = gearDecorator;
+ this.useCache = useCache;
+ this.delegate = delegate;
+ this.decorator = decorator;
+ this.cache = Maps.newHashMap();
+ }
+
+ public void clear() {
+ cache.clear();
+ }
+
+ @Override
+ public Component getListCellRendererComponent(JList list,
+ Object item,
+ int index,
+ boolean isSelected,
+ boolean cellHasFocus) {
+
+ String toolTipText = getToolTipText((Gear) item);
+
+ Component result = delegate.getListCellRendererComponent(list, item, index, isSelected, cellHasFocus);
+ ((JComponent) result).setToolTipText(toolTipText);
+ return result;
+ }
+
+ public String getToolTipText(Gear gear) {
+ String toolTipText;
+
+ if (gear == null) {
+ toolTipText = "";
+ } else {
+
+ if (useCache) {
+ if (cache.containsKey(gear)) {
+
+ toolTipText = cache.get(gear);
+ } else {
+ toolTipText = buildTip(gear);
+ cache.put(gear, toolTipText);
+ }
+ } else {
+ toolTipText = buildTip(gear);
+ }
+ }
+ return toolTipText;
+ }
+
+ protected String buildTip(Gear gear) {
+ String toolTipText;
+
+ ValueFormatter<Serializable> caracteristicValueFormatter = TuttiCsvUtil.CARACTERISTIC_VALUE_FORMATTER;
+ StringBuilder sb = new StringBuilder("<html><body>");
+
+ String gearStr = gearDecorator.toString(gear);
+ sb.append("<h3>").append(_("tutti.gear.withCaracteristics", gearStr)).append("</h3></hr>");
+
+ if (MapUtils.isNotEmpty(gear.getCaracteristics())) {
+
+ // got some caracteristics
+
+ sb.append("<ul>");
+ for (Map.Entry<Caracteristic, Serializable> entry : gear.getCaracteristics().entrySet()) {
+ Caracteristic key = entry.getKey();
+ String keyStr = decorator.toString(key);
+ Serializable value = entry.getValue();
+ String valueStr = caracteristicValueFormatter.format(value);
+ sb.append("<li>").append(keyStr).append(" :");
+ sb.append(valueStr).append("</strong></li>");
+ }
+ sb.append("</ul>");
+ } else {
+
+ sb.append("<i>").append(_("tutti.gear.noCaracteristics")).append("</i>");
+ }
+ sb.append("</body></html>");
+
+ toolTipText = sb.toString();
+ return toolTipText;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/GearCaracteristicListCellRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-10-02 10:08:19 UTC (rev 1265)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-10-02 16:26:49 UTC (rev 1266)
@@ -353,40 +353,42 @@
// need this for the first modification when no selection,
// otherwise monitor is set after the first alter, so won't be
// save directly...
- //if (!e.getValueIsAdjusting()) {
- ListSelectionModel source = (ListSelectionModel) e.getSource();
+ if (!e.getValueIsAdjusting()) {
+ ListSelectionModel source = (ListSelectionModel) e.getSource();
- int oldRowIndex = selectedRowIndex;
- int newRowIndex = source.getLeadSelectionIndex();
- if (oldRowIndex == newRowIndex) {
- return;
- }
- R oldRow = rowMonitor.getBean();
+ int oldRowIndex = selectedRowIndex;
+ int newRowIndex = source.getLeadSelectionIndex();
+ boolean skip = rowMonitor.getBean() != null &&
+ oldRowIndex == newRowIndex;
+ if (skip) {
+ return;
+ }
+ R oldRow = rowMonitor.getBean();
- R newRow;
+ R newRow;
- if (source.isSelectionEmpty()) {
+ if (source.isSelectionEmpty()) {
- newRow = null;
- } else {
- newRow = getTableModel().getEntry(newRowIndex);
- }
+ newRow = null;
+ } else {
+ newRow = getTableModel().getEntry(newRowIndex);
+ }
- // save selected entry if required
+ // save selected entry if required
// saveSelectedRowIfNeeded();
- if (log.isDebugEnabled()) {
- log.debug("Will monitor entry: " + newRow);
- }
- rowMonitor.setBean(newRow);
+ if (log.isDebugEnabled()) {
+ log.debug("Will monitor entry: " + newRow);
+ }
+ rowMonitor.setBean(newRow);
- selectedRowIndex = newRowIndex;
+ selectedRowIndex = newRowIndex;
- onAfterSelectedRowChanged(oldRowIndex,
- oldRow,
- selectedRowIndex,
- rowMonitor.getBean());
- //}
+ onAfterSelectedRowChanged(oldRowIndex,
+ oldRow,
+ selectedRowIndex,
+ rowMonitor.getBean());
+ }
}
};
1
0
02 Oct '13
Author: tchemit
Date: 2013-10-02 12:08:19 +0200 (Wed, 02 Oct 2013)
New Revision: 1265
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1265
Log:
fixes #3412: [EXPORT SUMATRA] le nombre d'individus dans la capture est faux
fixes #3414: [RAPPORT] ajouter sur onglet "R?\195?\169sum?\195?\169" un bouton pour obtenir la composition de la capture
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationReportAction.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ExportCatchesReportService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/sumatra/CatchesSumatraExportService.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SendCruiseReportAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeBatchWeightsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -471,6 +471,8 @@
int getFishingOperationCount(String cruiseId);
+ List<String> getAllFishingOperationIds(String cruiseId);
+
List<FishingOperation> getAllFishingOperation(String cruiseId);
FishingOperation getFishingOperation(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-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -630,6 +630,11 @@
}
@Override
+ public List<String> getAllFishingOperationIds(String cruiseId) {
+ return fishingOperationService.getAllFishingOperationIds(cruiseId);
+ }
+
+ @Override
public List<FishingOperation> getAllFishingOperation(String cruiseId) {
return fishingOperationService.getAllFishingOperation(cruiseId);
}
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-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -420,6 +420,11 @@
}
@Override
+ public List<String> getAllFishingOperationIds(String cruiseId) {
+ throw notImplemented();
+ }
+
+ @Override
public List<FishingOperation> getAllFishingOperation(String cruiseId) {
throw notImplemented();
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceService.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -42,6 +42,8 @@
int getFishingOperationCount(String cruiseId);
+ List<String> getAllFishingOperationIds(String cruiseId);
+
List<FishingOperation> getAllFishingOperation(String cruiseId);
FishingOperation getFishingOperation(String id);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/FishingOperationPersistenceServiceImpl.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -90,7 +90,6 @@
import java.io.Serializable;
import java.sql.Timestamp;
import java.text.MessageFormat;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
@@ -175,6 +174,23 @@
}
@Override
+ public List<String> getAllFishingOperationIds(String cruiseId) {
+ Preconditions.checkNotNull(cruiseId);
+
+ Iterator list = queryList(
+ "allFishingOperationIds",
+ "cruiseId", IntegerType.INSTANCE, Integer.valueOf(cruiseId)
+ );
+
+ List<String> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Integer id = (Integer) list.next();
+ result.add(id.toString());
+ }
+ return result;
+ }
+
+ @Override
public List<FishingOperation> getAllFishingOperation(String cruiseId) {
Preconditions.checkNotNull(cruiseId);
@@ -185,7 +201,7 @@
"pmfmIdMultirigAggregation", IntegerType.INSTANCE, enumeration.PMFM_ID_MULTIRIG_AGGREGATION
);
- List<FishingOperation> result = new ArrayList<FishingOperation>();
+ List<FishingOperation> result = Lists.newArrayList();
int fishingOperationRankOrder = 0;
while (list.hasNext()) {
Object[] source = list.next();
Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-10-02 10:08:19 UTC (rev 1265)
@@ -204,6 +204,7 @@
sc.id = :cruiseId
AND gpf.gear.id = :gearId
AND gpf.rankOrder = :rankOrder
+ AND gpm != null
]]>
<query-param name="cruiseId" type="java.lang.Integer"/>
<query-param name="gearId" type="java.lang.Integer"/>
@@ -227,6 +228,20 @@
<query-param name="cruiseId" type="java.lang.Integer"/>
</query>
+ <query cacheable="true" name="allFishingOperationIds">
+ <![CDATA[
+ SELECT
+ o.id AS id
+ FROM
+ FishingOperationImpl o
+ WHERE
+ o.fishingTrip.scientificCruise.id=:cruiseId
+ ORDER BY
+ o.startDateTime
+ ]]>
+ <query-param name="cruiseId" type="java.lang.Integer"/>
+ </query>
+
<query cacheable="true" name="allFishingOperations">
<![CDATA[
SELECT
@@ -242,7 +257,7 @@
LEFT OUTER JOIN o.vesselUseFeatures vuf
WHERE
o.fishingTrip.scientificCruise.id=:cruiseId
- ORDER BY
+ ORDER BY
o.startDateTime
]]>
<query-param name="cruiseId" type="java.lang.Integer"/>
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-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -955,6 +955,11 @@
}
@Override
+ public List<String> getAllFishingOperationIds(String cruiseId) {
+ return driver.getAllFishingOperationIds(cruiseId);
+ }
+
+ @Override
public List<FishingOperation> getAllFishingOperation(String cruiseId) {
return driver.getAllFishingOperation(cruiseId);
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ExportCatchesReportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ExportCatchesReportService.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ExportCatchesReportService.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -32,6 +32,7 @@
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
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.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.AbstractTuttiService;
@@ -99,118 +100,158 @@
}
/**
- * Generate the PDF report
+ * Generate the PDF report for the fiven cruise.
*
* @param targetFile pdf file to generate
* @param locale generated pdf locale
- * @return the generated file
* @throws TuttiBusinessException
*/
- public File generatePDFFile(File targetFile, String cruiseId, Locale locale) throws TuttiBusinessException {
+ public void generateCruisePDFFile(File targetFile,
+ String cruiseId,
+ Locale locale) throws TuttiBusinessException {
- File result = null;
- OutputStream os = null;
+ List<String> allFishingOperation =
+ persistenceService.getAllFishingOperationIds(cruiseId);
- Map<String, Object> data = Maps.newHashMap();
+ List<Map<String, Object>> operations = Lists.newArrayList();
+ for (String operationId : allFishingOperation) {
- List<FishingOperation> allFishingOperation =
- persistenceService.getAllFishingOperation(cruiseId);
+ prepareOperation(operationId, operations);
+ }
+
+ generatePdf(targetFile, locale, operations);
+ }
+
+ /**
+ * Generate the PDF report for the given fishing operation.
+ *
+ * @param targetFile pdf file to generate
+ * @param fishingOperationId id of the fishing operation to export
+ * @param locale generated pdf locale
+ * @throws TuttiBusinessException
+ * @since 2.7
+ */
+ public void generateFishingOperationPDFFile(File targetFile,
+ String fishingOperationId,
+ Locale locale) throws TuttiBusinessException {
+
List<Map<String, Object>> operations = Lists.newArrayList();
- for (FishingOperation fishingOperation : allFishingOperation) {
- // get operation and catch data
- String fishingOperationId = fishingOperation.getId();
+ prepareOperation(fishingOperationId, operations);
- boolean withCatchBatch =
- persistenceService.isFishingOperationWithCatchBatch(
- fishingOperationId);
+ generatePdf(targetFile, locale, operations);
+ }
- if (!withCatchBatch) {
- if (log.isWarnEnabled()) {
- log.warn("Skip fishing operation " + fishingOperation +
- " since no catchBatch associated.");
- }
- continue;
+ protected void prepareOperation(String fishingOperationId,
+ List<Map<String, Object>> operations) {
+
+ // get operation and catch data
+ boolean withCatchBatch =
+ persistenceService.isFishingOperationWithCatchBatch(
+ fishingOperationId);
+
+ if (!withCatchBatch) {
+ if (log.isWarnEnabled()) {
+ log.warn("Skip fishing operation " + fishingOperationId +
+ " since no catchBatch associated.");
}
- CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(fishingOperationId);
+ return;
+ }
- BatchContainer<SpeciesBatch> rootSpeciesBatch =
- weightComputingService.getComputedSpeciesBatches(fishingOperation);
+ FishingOperation fishingOperation =
+ persistenceService.getFishingOperation(fishingOperationId);
- BatchContainer<BenthosBatch> rootBenthosBatch =
- weightComputingService.getComputedBenthosBatches(fishingOperation);
+ CatchBatch catchBatch =
+ persistenceService.getCatchBatchFromFishingOperation(fishingOperationId);
- weightComputingService.computeCatchBatchWeights(catchBatch, rootSpeciesBatch, rootBenthosBatch, null);
+ BatchContainer<SpeciesBatch> rootSpeciesBatch =
+ weightComputingService.getComputedSpeciesBatches(fishingOperationId);
- // create operation data model
- Map<String, Object> op = createOperation(fishingOperation);
+ BatchContainer<BenthosBatch> rootBenthosBatch =
+ weightComputingService.getComputedBenthosBatches(fishingOperationId);
- Float totalWeight = catchBatch.getCatchTotalWeight();
- if (totalWeight == null) {
- totalWeight = catchBatch.getCatchTotalComputedWeight();
- }
- op.put("totalWeight", totalWeight);
+ BatchContainer<MarineLitterBatch> marineLitterBatches =
+ weightComputingService.getComputedMarineLitterBatches(
+ fishingOperationId,
+ catchBatch.getMarineLitterTotalWeight());
+ weightComputingService.computeCatchBatchWeights(catchBatch,
+ rootSpeciesBatch,
+ rootBenthosBatch,
+ marineLitterBatches);
- op.put("totalSortedWeight", catchBatch.getSpeciesTotalSampleSortedComputedWeight() + catchBatch.getBenthosTotalSampleSortedComputedWeight());
+ // create operation data model
+ Map<String, Object> op = createOperation(fishingOperation);
- // create catches data model
+ Float totalWeight = catchBatch.getCatchTotalWeight();
+ if (totalWeight == null) {
+ totalWeight = catchBatch.getCatchTotalComputedWeight();
+ }
+ op.put("totalWeight", totalWeight);
- // Species
+ op.put("totalSortedWeight", catchBatch.getSpeciesTotalSampleSortedComputedWeight() + catchBatch.getBenthosTotalSampleSortedComputedWeight());
- Map<Species, Map<String, Object>> catches = Maps.newHashMap();
- Float ratio = (totalWeight - catchBatch.getCatchTotalUnsortedComputedWeight()) / catchBatch.getCatchTotalSortedComputedWeight();
+ // create catches data model
- Float speciesTotalSortedWeight = catchBatch.getSpeciesTotalSortedWeight();
- if (speciesTotalSortedWeight == null) {
- speciesTotalSortedWeight = catchBatch.getSpeciesTotalSortedComputedWeight();
- }
- // ratio total species weight / total sorted sampled species weight
- Float speciesRatio = speciesTotalSortedWeight / catchBatch.getSpeciesTotalSampleSortedComputedWeight();
+ // Species
- // create catches rows
- if (rootSpeciesBatch != null) {
- List<SpeciesBatch> speciesBatches = rootSpeciesBatch.getChildren();
- for (SpeciesBatch batch : speciesBatches) {
- createSpeciesCatch(batch, catches, speciesRatio * ratio, totalWeight);
- }
- }
- List<Map<String, Object>> catchList = Lists.newArrayList(catches.values());
+ Map<Species, Map<String, Object>> catches = Maps.newHashMap();
+ Float ratio = (totalWeight - catchBatch.getCatchTotalUnsortedComputedWeight()) / catchBatch.getCatchTotalSortedComputedWeight();
- // Benthos
+ Float speciesTotalSortedWeight = catchBatch.getSpeciesTotalSortedWeight();
+ if (speciesTotalSortedWeight == null) {
+ speciesTotalSortedWeight = catchBatch.getSpeciesTotalSortedComputedWeight();
+ }
+ // ratio total species weight / total sorted sampled species weight
+ Float speciesRatio = speciesTotalSortedWeight / catchBatch.getSpeciesTotalSampleSortedComputedWeight();
- Float benthosTotalSortedWeight = catchBatch.getBenthosTotalSortedWeight();
- if (benthosTotalSortedWeight == null) {
- benthosTotalSortedWeight = catchBatch.getBenthosTotalSortedComputedWeight();
+ // create catches rows
+ if (rootSpeciesBatch != null) {
+ List<SpeciesBatch> speciesBatches = rootSpeciesBatch.getChildren();
+ for (SpeciesBatch batch : speciesBatches) {
+ createSpeciesCatch(batch, catches, speciesRatio * ratio, totalWeight);
}
- // ratio total benthos weight / total sorted sampled benthos weight
- Float benthosRatio = benthosTotalSortedWeight / catchBatch.getBenthosTotalSampleSortedComputedWeight();
+ }
+ List<Map<String, Object>> catchList = Lists.newArrayList(catches.values());
- // add the benthos row
- if (rootBenthosBatch != null) {
- if (CollectionUtils.isNotEmpty(rootBenthosBatch.getChildren())) {
- Map<String, Object> benthosCatch =
- createBenthosCatch(rootBenthosBatch, ratio * benthosRatio, totalWeight);
- catchList.add(benthosCatch);
- }
- }
+ // Benthos
- // Inert and living not itemized
- Map<String, Object> inertLivingNotItemizedCatch = createInertAndLivingNotItemizedCatch(catchBatch,
- ratio * speciesRatio,
- ratio * benthosRatio,
- totalWeight);
- if ((Float) inertLivingNotItemizedCatch.get("sortedWeight") > 0f) {
- catchList.add(inertLivingNotItemizedCatch);
+ Float benthosTotalSortedWeight = catchBatch.getBenthosTotalSortedWeight();
+ if (benthosTotalSortedWeight == null) {
+ benthosTotalSortedWeight = catchBatch.getBenthosTotalSortedComputedWeight();
+ }
+ // ratio total benthos weight / total sorted sampled benthos weight
+ Float benthosRatio = benthosTotalSortedWeight / catchBatch.getBenthosTotalSampleSortedComputedWeight();
+
+ // add the benthos row
+ if (rootBenthosBatch != null) {
+ if (CollectionUtils.isNotEmpty(rootBenthosBatch.getChildren())) {
+ Map<String, Object> benthosCatch =
+ createBenthosCatch(rootBenthosBatch, ratio * benthosRatio, totalWeight);
+ catchList.add(benthosCatch);
}
+ }
- op.put("catches", catchList);
- operations.add(op);
+ // Inert and living not itemized
+ Map<String, Object> inertLivingNotItemizedCatch = createInertAndLivingNotItemizedCatch(catchBatch,
+ ratio * speciesRatio,
+ ratio * benthosRatio,
+ totalWeight);
+ if ((Float) inertLivingNotItemizedCatch.get("sortedWeight") > 0f) {
+ catchList.add(inertLivingNotItemizedCatch);
}
+
+ op.put("catches", catchList);
+ operations.add(op);
+ }
+
+ protected void generatePdf(File targetFile, Locale locale, List<Map<String, Object>> operations) {
+
+ Map<String, Object> data = Maps.newHashMap();
data.put("operations", operations);
-
// generate the report
+ OutputStream os = null;
try {
// render freemarker template
@@ -235,8 +276,6 @@
} finally {
IOUtils.closeQuietly(os);
}
-
- return result;
}
protected Map<String, Object> createOperation(FishingOperation fishingOperation) {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/ValidateCruiseOperationsService.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -292,7 +292,7 @@
BatchContainer<MarineLitterBatch> rootMarineLitterBatch;
try {
Float weight = catchBatch == null ? null : catchBatch.getMarineLitterTotalWeight();
- rootMarineLitterBatch = weightComputingService.getComputedMarineLitterBatches(fishingOperation, weight);
+ rootMarineLitterBatch = weightComputingService.getComputedMarineLitterBatches(fishingOperationId, weight);
} catch (TuttiBusinessException e) {
errors.add(e.getMessage());
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -31,7 +31,6 @@
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.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
@@ -100,20 +99,18 @@
}
Map<String, String> result = Maps.newTreeMap();
- List<FishingOperation> allFishingOperation =
- persistenceService.getAllFishingOperation(cruiseId);
+ List<String> allFishingOperation =
+ persistenceService.getAllFishingOperationIds(cruiseId);
- for (FishingOperation fishingOperation : allFishingOperation) {
+ for (String fishingOperationId : allFishingOperation) {
- String fishingOperationId = fishingOperation.getId();
-
boolean withCatchBatch =
persistenceService.isFishingOperationWithCatchBatch(
fishingOperationId);
if (!withCatchBatch) {
if (log.isWarnEnabled()) {
- log.warn("Skip fishing operation " + fishingOperation +
+ log.warn("Skip fishing operation " + fishingOperationId +
" since no catchBatch associated.");
}
continue;
@@ -122,7 +119,7 @@
BatchContainer<SpeciesBatch> rootSpeciesBatch;
try {
- rootSpeciesBatch = getComputedSpeciesBatches(fishingOperation);
+ rootSpeciesBatch = getComputedSpeciesBatches(fishingOperationId);
} catch (TuttiBusinessException e) {
result.put(fishingOperationId, e.getMessage());
@@ -131,7 +128,7 @@
BatchContainer<BenthosBatch> rootBenthosBatch;
try {
- rootBenthosBatch = getComputedBenthosBatches(fishingOperation);
+ rootBenthosBatch = getComputedBenthosBatches(fishingOperationId);
} catch (TuttiBusinessException e) {
result.put(fishingOperationId, e.getMessage());
@@ -141,7 +138,7 @@
BatchContainer<MarineLitterBatch> rootMarineLitterBatch;
try {
Float weight = catchBatch == null ? null : catchBatch.getMarineLitterTotalWeight();
- rootMarineLitterBatch = getComputedMarineLitterBatches(fishingOperation, weight);
+ rootMarineLitterBatch = getComputedMarineLitterBatches(fishingOperationId, weight);
} catch (TuttiBusinessException e) {
result.put(fishingOperationId, e.getMessage());
@@ -347,12 +344,12 @@
private int currentSpeciesRowIndex;
- public BatchContainer<SpeciesBatch> getComputedSpeciesBatches(FishingOperation operation) {
+ public BatchContainer<SpeciesBatch> getComputedSpeciesBatches(String operationId) {
BatchContainer<SpeciesBatch> rootSpeciesBatch = null;
- if (persistenceService.isFishingOperationWithCatchBatch(operation.getId())) {
- rootSpeciesBatch = persistenceService.getRootSpeciesBatch(operation.getId(), null);
+ if (persistenceService.isFishingOperationWithCatchBatch(operationId)) {
+ rootSpeciesBatch = persistenceService.getRootSpeciesBatch(operationId, null);
currentSpeciesRowIndex = 0;
if (rootSpeciesBatch != null) {
@@ -540,12 +537,12 @@
private int currentBenthosRowIndex;
- public BatchContainer<BenthosBatch> getComputedBenthosBatches(FishingOperation operation) {
+ public BatchContainer<BenthosBatch> getComputedBenthosBatches(String operationId) {
BatchContainer<BenthosBatch> rootBenthosBatch = null;
- if (persistenceService.isFishingOperationWithCatchBatch(operation.getId())) {
- rootBenthosBatch = persistenceService.getRootBenthosBatch(operation.getId(), null);
+ if (persistenceService.isFishingOperationWithCatchBatch(operationId)) {
+ rootBenthosBatch = persistenceService.getRootBenthosBatch(operationId, null);
currentBenthosRowIndex = 0;
if (rootBenthosBatch != null) {
@@ -730,10 +727,9 @@
return result;
}
- public BatchContainer<MarineLitterBatch> getComputedMarineLitterBatches(FishingOperation operation,
+ public BatchContainer<MarineLitterBatch> getComputedMarineLitterBatches(String fishingOperationId,
Float marineLitterweight) {
- String fishingOperationId = operation.getId();
BatchContainer<MarineLitterBatch> rootMarineLitterBatch =
persistenceService.getRootMarineLitterBatch(fishingOperationId);
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-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -277,7 +277,6 @@
String cruiseStr = cruiseDecorator.toString(cruise);
throw new TuttiBusinessException(
_("tutti.service.export.invalid.cruise", cruiseStr, sb.toString()));
-// _("tutti.service.export.invalid.cruise2", cruiseStr, sb.toString()));
}
}
@@ -674,8 +673,6 @@
Caracteristic verticalOpeningCaracteristic,
Caracteristic horizontalOpeningWingCaracteristic,
Caracteristic horizontalOpeningDoorCaracteristic,
-// Caracteristic sampleIdCaracteristic,
-// Caracteristic otolitheIdCaracteristic,
Caracteristic weightMeasuredCaracteristic,
Caracteristic deadOrAliveCaracteristic,
Caracteristic genderCaracteristic,
@@ -746,8 +743,6 @@
pmfmIdCaracteristic);
individualObservationModel = new IndividualObservationExportModel(
csvSeparator,
-// sampleIdCaracteristic,
-// otolitheIdCaracteristic,
weightMeasuredCaracteristic,
pmfmIdCaracteristic);
@@ -859,7 +854,7 @@
boolean withError = false;
try {
- rootSpeciesBatch = weightComputingService.getComputedSpeciesBatches(operation);
+ rootSpeciesBatch = weightComputingService.getComputedSpeciesBatches(operationId);
} catch (Exception e) {
withError = true;
rootSpeciesBatch =
@@ -868,7 +863,7 @@
try {
rootBenthosBatch =
- weightComputingService.getComputedBenthosBatches(operation);
+ weightComputingService.getComputedBenthosBatches(operationId);
} catch (Exception e) {
withError = true;
rootBenthosBatch =
@@ -877,7 +872,7 @@
try {
rootMarineLitterBatch =
- weightComputingService.getComputedMarineLitterBatches(operation, catchBatch.getMarineLitterTotalWeight());
+ weightComputingService.getComputedMarineLitterBatches(operationId, catchBatch.getMarineLitterTotalWeight());
} catch (Exception e) {
withError = true;
rootMarineLitterBatch =
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/sumatra/CatchesSumatraExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/sumatra/CatchesSumatraExportService.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/sumatra/CatchesSumatraExportService.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -33,8 +33,10 @@
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.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.referential.Species;
@@ -74,6 +76,13 @@
weightComputingService = getService(WeightComputingService.class);
}
+ /**
+ * Export selected cruise with the csv sumatra format.
+ *
+ * @param file where to generate report
+ * @param cruiseId id of the cruise to export
+ * @since 2.0
+ */
public void exportCruiseForSumatra(File file,
String cruiseId) {
@@ -87,86 +96,56 @@
Cruise cruise = persistenceService.getCruise(cruiseId);
Preconditions.checkNotNull(cruise, "Cruise [" + cruiseId + "] not found");
- CatchRowModel csvModel =
- new CatchRowModel(context.getConfig().getCsvSeparator());
- List<CatchRow> rows = Lists.newArrayList();
+ List<String> operations =
+ persistenceService.getAllFishingOperationIds(cruiseId);
- List<FishingOperation> operations = persistenceService.getAllFishingOperation(cruiseId);
- if (operations != null) {
- for (FishingOperation operation : operations) {
+ prepareOperationsAndExport(file, operations);
+ }
- // add species rows
+ /**
+ * Export selected fishing operation with the csv sumatra format.
+ *
+ * @param file where to generate report
+ * @param cruiseId id of the cruise to export
+ * @param fishingOperationId id of the fishing operation to export
+ * @since 2.7
+ */
+ public void exportFishingOperationForSumatra(File file,
+ String cruiseId,
+ String fishingOperationId) {
- BatchContainer<SpeciesBatch> speciesBatchContainer =
- weightComputingService.getComputedSpeciesBatches(operation);
+ Preconditions.checkNotNull(file, "Cannot export to a null file");
+ Preconditions.checkNotNull(cruiseId, "Cannot export a null cruise");
+ Preconditions.checkNotNull(fishingOperationId, "Cannot export a null fishing operation");
- Map<Species, CatchRow> rowMap = Maps.newLinkedHashMap();
- if (speciesBatchContainer != null) {
- List<SpeciesBatch> speciesBatches = speciesBatchContainer.getChildren();
- for (SpeciesBatch batch : speciesBatches) {
- Species sp = batch.getSpecies();
+ if (log.isInfoEnabled()) {
+ log.info("Will export fishing operation " +
+ fishingOperationId + " to file: " + file);
+ }
- int number = Math.round(computeNumber(batch, 1.0f));
+ Cruise cruise = persistenceService.getCruise(cruiseId);
+ Preconditions.checkNotNull(cruise, "Cruise [" + cruiseId + "] not found");
- Float weight = TuttiEntities.getValueOrComputedValue(
- batch.getSampleCategoryWeight(),
- batch.getSampleCategoryComputedWeight());
+ List<String> operations = Lists.newArrayList(fishingOperationId);
+ prepareOperationsAndExport(file, operations);
+ }
- CatchRow row = rowMap.get(sp);
- if (row == null) {
- row = new CatchRow();
- row.setFishingOperation(operation);
- row.setSpecies(sp);
- row.setWeight(weight);
- row.setNumber(number);
+ protected void prepareOperationsAndExport(File file,
+ List<String> operations) {
- } else {
- row.setWeight(row.getWeight() + weight);
- row.setNumber(row.getNumber() + number);
- }
- rowMap.put(sp, row);
- }
- rows.addAll(rowMap.values());
- }
+ List<CatchRow> rows = Lists.newArrayList();
- // add benthos rows
+ if (operations != null) {
+ for (String operationId : operations) {
- BatchContainer<BenthosBatch> benthosBatchContainer =
- weightComputingService.getComputedBenthosBatches(operation);
-
- rowMap.clear();
- if (benthosBatchContainer != null) {
- List<BenthosBatch> benthosBatches = benthosBatchContainer.getChildren();
- for (BenthosBatch batch : benthosBatches) {
- Species sp = batch.getSpecies();
-
- Float weight = TuttiEntities.getValueOrComputedValue(
- batch.getSampleCategoryWeight(),
- batch.getSampleCategoryComputedWeight());
-
- int number = Math.round(computeNumber(batch, 1.0f));
-
- CatchRow row = rowMap.get(sp);
- if (row == null) {
- row = new CatchRow();
- row.setFishingOperation(operation);
- row.setSpecies(sp);
- row.setWeight(weight);
- row.setNumber(number);
-
- } else {
- row.setWeight(row.getWeight() + weight);
- row.setNumber(row.getNumber() + number);
- }
- rowMap.put(sp, row);
- }
- }
-
- rows.addAll(rowMap.values());
+ prepareFishingOperation(rows, operationId);
}
}
+ CatchRowModel csvModel =
+ new CatchRowModel(context.getConfig().getCsvSeparator());
+
BufferedWriter writer = null;
try {
writer = Files.newWriter(file, Charsets.UTF_8);
@@ -181,6 +160,132 @@
}
}
+ protected void prepareFishingOperation(List<CatchRow> rows, String operationId) {
+
+ FishingOperation operation = persistenceService.getFishingOperation(operationId);
+
+ CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(
+ operationId);
+
+ BatchContainer<SpeciesBatch> speciesBatchContainer =
+ weightComputingService.getComputedSpeciesBatches(operationId);
+ BatchContainer<BenthosBatch> benthosBatchContainer =
+ weightComputingService.getComputedBenthosBatches(operationId);
+
+ BatchContainer<MarineLitterBatch> marineLitterBatch =
+ weightComputingService.getComputedMarineLitterBatches(
+ operationId, catchBatch.getMarineLitterTotalWeight());
+
+ weightComputingService.computeCatchBatchWeights(catchBatch,
+ speciesBatchContainer,
+ benthosBatchContainer,
+ marineLitterBatch);
+
+ Float totalWeight = TuttiEntities.getValueOrComputedValue(
+ catchBatch.getCatchTotalWeight(),
+ catchBatch.getCatchTotalComputedWeight());
+
+ Float totalUnsortedWeight =
+ TuttiEntities.getValueOrComputedValue(
+ catchBatch.getCatchTotalUnsortedComputedWeight(),
+ 0f);
+
+ Float totalSortedSpeciesWeight = TuttiEntities.getValueOrComputedValue(
+ catchBatch.getSpeciesTotalSortedWeight(),
+ catchBatch.getSpeciesTotalSortedComputedWeight());
+
+ Float totalSampleSortedSpeciesWeight =
+ catchBatch.getSpeciesTotalSampleSortedComputedWeight();
+
+ Float totalSortedBenthosWeight = TuttiEntities.getValueOrComputedValue(
+ catchBatch.getBenthosTotalSortedWeight(),
+ catchBatch.getBenthosTotalSortedComputedWeight());
+
+ Float totalSampleSortedBenthosWeight =
+ catchBatch.getBenthosTotalSampleSortedComputedWeight();
+
+ Float totalSortedWeight = catchBatch.getCatchTotalSortedComputedWeight();
+
+ //FIXME tchemit 2013-07-12 J'utilise en fait la formule (Poids de la capture totale - poids du HV dans la capture totale) / (poids total capture triée)
+ // (Poids de la capture totale - poids du HV dans la capture totale) / (poids total capture triée - poids du HV dans la capture totale)
+
+ Float catchRaisingFactor = totalWeight == null || totalUnsortedWeight == null || totalSortedWeight == null ? 1 : (totalWeight - totalUnsortedWeight) / totalSortedWeight;
+
+ Float speciesCatchRaisingFactor = totalSampleSortedSpeciesWeight == null || totalSortedSpeciesWeight == null || totalSampleSortedSpeciesWeight == null ? 1 : (totalSampleSortedSpeciesWeight == 0 ? 0 : (totalSortedSpeciesWeight / totalSampleSortedSpeciesWeight) * catchRaisingFactor);
+ Float benthosCatchRaisingFactor = totalSampleSortedBenthosWeight == null || totalSortedBenthosWeight == null || totalSampleSortedBenthosWeight == null ? 1 : (totalSampleSortedBenthosWeight == 0 ? 0 : (totalSortedBenthosWeight / totalSampleSortedBenthosWeight) * catchRaisingFactor);
+
+ speciesCatchRaisingFactor *= catchRaisingFactor;
+ benthosCatchRaisingFactor *= catchRaisingFactor;
+
+ // add species rows
+ Map<Species, CatchRow> rowMap = Maps.newLinkedHashMap();
+ if (speciesBatchContainer != null) {
+ List<SpeciesBatch> speciesBatches = speciesBatchContainer.getChildren();
+ for (SpeciesBatch batch : speciesBatches) {
+ Species sp = batch.getSpecies();
+
+ int number = Math.round(computeNumber(batch, 1.0f));
+
+ Float weight = TuttiEntities.getValueOrComputedValue(
+ batch.getSampleCategoryWeight(),
+ batch.getSampleCategoryComputedWeight());
+
+ weight *= speciesCatchRaisingFactor;
+ number = (int) (speciesCatchRaisingFactor * (float) number);
+
+ CatchRow row = rowMap.get(sp);
+ if (row == null) {
+ row = new CatchRow();
+ row.setFishingOperation(operation);
+ row.setSpecies(sp);
+ row.setWeight(weight);
+ row.setNumber(number);
+
+ } else {
+ row.setWeight(row.getWeight() + weight);
+ row.setNumber(row.getNumber() + number);
+ }
+ rowMap.put(sp, row);
+ }
+ rows.addAll(rowMap.values());
+ }
+
+ // add benthos rows
+ rowMap.clear();
+ if (benthosBatchContainer != null) {
+ List<BenthosBatch> benthosBatches = benthosBatchContainer.getChildren();
+ for (BenthosBatch batch : benthosBatches) {
+ Species sp = batch.getSpecies();
+
+ int number = Math.round(computeNumber(batch, 1.0f));
+
+ Float weight = TuttiEntities.getValueOrComputedValue(
+ batch.getSampleCategoryWeight(),
+ batch.getSampleCategoryComputedWeight());
+
+ weight *= benthosCatchRaisingFactor;
+ number = (int) (benthosCatchRaisingFactor * (float) number);
+
+ CatchRow row = rowMap.get(sp);
+ if (row == null) {
+ row = new CatchRow();
+ row.setFishingOperation(operation);
+ row.setSpecies(sp);
+ row.setWeight(weight);
+ row.setNumber(number);
+
+ } else {
+ row.setWeight(row.getWeight() + weight);
+ row.setNumber(row.getNumber() + number);
+ }
+ rowMap.put(sp, row);
+ }
+ }
+
+ rows.addAll(rowMap.values());
+ }
+
+
protected float computeNumber(SpeciesAbleBatch batch, float rf) {
float result;
@@ -199,16 +304,6 @@
// no count
number = 0;
-
-// // try to get frequency
-// List<SpeciesBatchFrequency> frequencies =
-// persistenceService.getAllSpeciesBatchFrequency(batch.getId());
-// if (CollectionUtils.isNotEmpty(frequencies)) {
-//
-// for (SpeciesBatchFrequency frequency : frequencies) {
-// number += frequency.getNumber();
-// }
-// }
}
// get the sample weight
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -27,7 +27,6 @@
import com.google.common.io.Files;
import fr.ifremer.tutti.TuttiBusinessException;
import fr.ifremer.tutti.persistence.ProgressionModel;
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.ServiceDbResource;
import fr.ifremer.tutti.service.TuttiServiceContext;
@@ -95,8 +94,8 @@
// check there is a error while compute weight for a cruise
boolean errorDetected = false;
WeightComputingService computingService = serviceContext.getService(WeightComputingService.class);
- List<FishingOperation> allFishingOperation = persistenceService.getAllFishingOperation(CRUISE_ID);
- for (FishingOperation fishingOperation : allFishingOperation) {
+ List<String> allFishingOperation = persistenceService.getAllFishingOperationIds(CRUISE_ID);
+ for (String fishingOperation : allFishingOperation) {
try {
computingService.getComputedSpeciesBatches(fishingOperation);
} catch (Exception e) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SendCruiseReportAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SendCruiseReportAction.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SendCruiseReportAction.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -98,7 +98,7 @@
// export catches
ExportCatchesReportService service =
getContext().getGeneratePDFService();
- service.generatePDFFile(file, cruise.getId(), getConfig().getI18nLocale());
+ service.generateCruisePDFFile(file, cruise.getId(), getConfig().getI18nLocale());
try {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeBatchWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeBatchWeightsAction.java 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeBatchWeightsAction.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -110,9 +110,10 @@
BatchContainer<SpeciesBatch> computedSpeciesBatches;
Float totalSpeciesSortedWeight;
+ String operationId = model.getFishingOperation().getId();
try {
computedSpeciesBatches =
- weightComputingService.getComputedSpeciesBatches(model.getFishingOperation());
+ weightComputingService.getComputedSpeciesBatches(operationId);
totalSpeciesSortedWeight = computeSpeciesBatches(persistenceService, computedSpeciesBatches);
} catch (TuttiWeightComputingException e) {
@@ -139,7 +140,7 @@
Float totalBenthosSortedWeight;
try {
computedBenthosBatches =
- weightComputingService.getComputedBenthosBatches(model.getFishingOperation());
+ weightComputingService.getComputedBenthosBatches(operationId);
totalBenthosSortedWeight = computeBenthosBatches(persistenceService, computedBenthosBatches);
} catch (TuttiWeightComputingException e) {
@@ -165,7 +166,7 @@
BatchContainer<MarineLitterBatch> computedMarineLitterBatches;
try {
computedMarineLitterBatches =
- weightComputingService.getComputedMarineLitterBatches(model.getFishingOperation(),
+ weightComputingService.getComputedMarineLitterBatches(operationId,
model.getMarineLitterTotalWeight());
} catch (TuttiWeightComputingException e) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-10-02 10:08:19 UTC (rev 1265)
@@ -327,20 +327,20 @@
border: {BorderFactory.createTitledBorder(_("tutti.editCatchBatch.legend.individualObservation"))};
}
-#sendCruiseReportButton {
- actionIcon: email;
- text: "tutti.selectCruise.action.sendCruiseReport";
- toolTipText: "tutti.selectCruise.action.sendCruiseReport.tip";
- _tuttiAction: {SendCruiseReportAction.class};
- _help: {"tutti.selectCruise.action.sendCruiseReport.help"};
+#exportFishingOperationReportButton {
+ actionIcon: export;
+ text: "tutti.editCatchBatch.action.exportFishingOperationReport";
+ toolTipText: "tutti.editCatchBatch.action.exportFishingOperationReport.tip";
+ _tuttiAction: {ExportFishingOperationReportAction.class};
+ _help: {"tutti.editCatchBatch.action.exportFishingOperationReport.help"};
}
-#exportCruiseForSumatraButton {
+#exportFishingOperationReportForSumatraButton {
actionIcon: export;
- text: "tutti.selectCruise.action.exportCruiseForSumatra";
- toolTipText: "tutti.selectCruise.action.exportCruiseForSumatra.tip";
- _tuttiAction: {ExportCruiseForSumatraAction.class};
- _help: {"tutti.selectCruise.action.exportCruiseForSumatra.help"};
+ text: "tutti.editCatchBatch.action.exportFishingOperationReportForSumatra";
+ toolTipText: "tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.tip";
+ _tuttiAction: {ExportFishingOperationForSumatraAction.class};
+ _help: {"tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.help"};
}
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-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-10-02 10:08:19 UTC (rev 1265)
@@ -115,8 +115,8 @@
<TuttiHelpBroker id='broker' constructorParams='"tutti.editCatchBatch.help"'/>
<JToolBar id='catchesCaracteristicsTabToolBar'>
- <JButton id='sendCruiseReportButton'/>
- <JButton id='exportCruiseForSumatraButton'/>
+ <JButton id='exportFishingOperationReportButton'/>
+ <JButton id='exportFishingOperationReportForSumatraButton'/>
<ButtonAttachment id='catchesCaracteristicsAttachmentsButton'
constructorParams='getHandler().getContext(), getModel()'/>
</JToolBar>
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -0,0 +1,91 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+import com.google.common.base.Preconditions;
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.service.sumatra.CatchesSumatraExportService;
+import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.DateUtil;
+
+import java.io.File;
+import java.util.Date;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Created on 10/1/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.7
+ */
+public class ExportFishingOperationForSumatraAction extends AbstractTuttiAction<EditCatchesUIModel, EditCatchesUI, EditCatchesUIHandler> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ExportFishingOperationForSumatraAction.class);
+
+ protected File file;
+
+ public ExportFishingOperationForSumatraAction(EditCatchesUIHandler handler) {
+ super(handler, true);
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+
+ boolean doAction = super.prepareAction();
+
+ if (doAction) {
+
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+
+ String date = DateUtil.formatDate(new Date(), "dd-MM-yyyy");
+ // choose file to export
+ file = saveFile(
+ String.format("sumatra_%s_%s_%s", getDataContext().getCruise().getName(), fishingOperation.getId(), date),
+ "csv",
+ _("tutti.exportFishingOperationForSumatra.title.choose.exportFile"),
+ _("tutti.exportFishingOperationForSumatra.action.chooseFile"),
+ "^.+\\.csv$", _("tutti.common.file.csv")
+ );
+ doAction = file != null;
+ }
+ return doAction;
+ }
+
+ @Override
+ public void releaseAction() {
+ file = null;
+ super.releaseAction();
+ }
+
+ @Override
+ public void doAction() throws Exception {
+ Cruise cruise = getDataContext().getCruise();
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+ Preconditions.checkNotNull(cruise);
+ Preconditions.checkNotNull(fishingOperation);
+ Preconditions.checkNotNull(file);
+
+ if (log.isInfoEnabled()) {
+ log.info("Will export fishingOperation " + cruise.getId() + "-" + fishingOperation.getStationNumber() +
+ " to file: " + file);
+ }
+
+ // export catches
+ CatchesSumatraExportService service =
+ getContext().getCatchesSumatraExportService();
+ service.exportFishingOperationForSumatra(file,
+ cruise.getId(),
+ fishingOperation.getId());
+
+ }
+
+ @Override
+ public void postSuccessAction() {
+ super.postSuccessAction();
+ sendMessage(_("tutti.exportFishingOperationForSumatra.action.success", file));
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationForSumatraAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationReportAction.java (from rev 1264, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SendCruiseReportAction.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationReportAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ExportFishingOperationReportAction.java 2013-10-02 10:08:19 UTC (rev 1265)
@@ -0,0 +1,110 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.service.catches.ExportCatchesReportService;
+import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Opens a file chooser, exports the cruise catches into the selected file and open the default email editor.
+ *
+ * @author kmorin <morin(a)codelutin.com>
+ * @since 1.0
+ */
+public class ExportFishingOperationReportAction extends AbstractTuttiAction<EditCatchesUIModel, EditCatchesUI, EditCatchesUIHandler> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ExportFishingOperationReportAction.class);
+
+ protected File file;
+
+ public ExportFishingOperationReportAction(EditCatchesUIHandler handler) {
+ super(handler, true);
+ }
+
+ @Override
+ public boolean prepareAction() throws Exception {
+
+ boolean doAction = super.prepareAction();
+
+ if (doAction) {
+
+ Cruise cruise = getDataContext().getCruise();
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+ // choose file to export
+ file = saveFile(
+ "exportFishingOperation-" + cruise.getName() + "-" + fishingOperation.getStationNumber(),
+ "pdf",
+ _("tutti.exportFishingOperationReport.title.choose.exportFile"),
+ _("tutti.exportFishingOperationReport.action.chooseFile"),
+ "^.+\\.pdf$", _("tutti.common.file.pdf")
+ );
+ doAction = file != null;
+ }
+ return doAction;
+ }
+
+ @Override
+ public void releaseAction() {
+ file = null;
+ super.releaseAction();
+ }
+
+ @Override
+ public void doAction() throws Exception {
+ Cruise cruise = getDataContext().getCruise();
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+ Preconditions.checkNotNull(cruise);
+ Preconditions.checkNotNull(fishingOperation);
+ Preconditions.checkNotNull(file);
+
+ if (log.isInfoEnabled()) {
+ log.info("Will export fishingOperation " + cruise.getId() + "-" + fishingOperation.getStationNumber() +
+ " to file: " + file);
+ }
+
+ // export catches
+ ExportCatchesReportService service =
+ getContext().getGeneratePDFService();
+ service.generateFishingOperationPDFFile(file, fishingOperation.getId(), getConfig().getI18nLocale());
+
+ }
+
+ @Override
+ public void postSuccessAction() {
+ super.postSuccessAction();
+ sendMessage(_("tutti.exportFishingOperationReport.action.success", file));
+ }
+}
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-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-10-02 10:08:19 UTC (rev 1265)
@@ -513,9 +513,15 @@
tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.message.species=
tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.title=
tutti.editCatchBatch.action.computeWeights.tip=
+tutti.editCatchBatch.action.exportFishingOperationReport=
+tutti.editCatchBatch.action.exportFishingOperationReport.tip=
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra=
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.tip=
tutti.editCatchBatch.action.saveCatchBatch=
tutti.editCatchBatch.action.saveCatchBatch.mnemonic=
tutti.editCatchBatch.action.saveCatchBatch.tip=
+tutti.editCatchBatch.action.sendCruiseReport=
+tutti.editCatchBatch.action.sendCruiseReport.tip=
tutti.editCatchBatch.askCancelEditBeforeLeaving.cancelEditCatchBatch=
tutti.editCatchBatch.askSaveBeforeLeaving.saveCatchBatch=
tutti.editCatchBatch.field.benthosTotalSampleSortedWeight=
@@ -1058,6 +1064,15 @@
tutti.exportDb.step.createArchive=
tutti.exportDb.step.openDb=
tutti.exportDb.step.reloadApplication=
+tutti.exportFishingOperationForSumatra.action.chooseFile=
+tutti.exportFishingOperationForSumatra.action.success=
+tutti.exportFishingOperationForSumatra.title.choose.exportFile=
+tutti.exportFishingOperationReport.action.chooseFile=
+tutti.exportFishingOperationReport.action.success=
+tutti.exportFishingOperationReport.title.choose.exportFile=
+tutti.exportFishingOperationReportForSumatra.action.chooseFile=
+tutti.exportFishingOperationReportForSumatra.action.success=
+tutti.exportFishingOperationReportForSumatra.title.choose.exportFile=
tutti.exportProgram.action.exportErrors=
tutti.exportProgram.action.success=
tutti.exportProtocol.action.success=
@@ -1363,6 +1378,9 @@
tutti.sendCruiseReport.mail.body=
tutti.sendCruiseReport.mail.subject=
tutti.sendCruiseReport.title.choose.exportFile=
+tutti.sendFishingOperationReport.action.chooseFile=
+tutti.sendFishingOperationReport.action.success=
+tutti.sendFishingOperationReport.title.choose.exportFile=
tutti.splitBenthosBatch.action.cancel=
tutti.splitBenthosBatch.action.cancel.mnemonic=
tutti.splitBenthosBatch.action.cancel.tip=
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-10-01 12:57:43 UTC (rev 1264)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-10-02 10:08:19 UTC (rev 1265)
@@ -1,3 +1,4 @@
+enthosBatch.field.batchWeight=Poids total à catégoriser
swing.error.cannot.mail=Erreur lors de l'ouverture du client mail
swing.error.cannot.open.file=Aucun programme n'est défini pour ouvrir ce type de fichier. Enregistrez le fichier et ouvrez le en dehors de l'application
swing.error.cannot.open.link=Impossible d'ouvrir le fichier %s
@@ -512,15 +513,15 @@
tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.message.species=Le Poids total VRAC saisi sur les espèces est supérieur de moins de %s%% au Poids total Vrac trié.
tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.title=Poids total VRAC peu différent du Poids total Vrac trié
tutti.editCatchBatch.action.computeWeights.tip=Élever les poids
-tutti.editCatchBatch.action.exportCruiseForSumatra=Sumatra
-tutti.editCatchBatch.action.exportCruiseForSumatra.mnemonic=u
-tutti.editCatchBatch.action.exportCruiseForSumatra.tip=Exporter la campagne sélectionnée pour Sumatra
+tutti.editCatchBatch.action.exportFishingOperationReport=Résumé PDF
+tutti.editCatchBatch.action.exportFishingOperationReport.mnemonic=P
+tutti.editCatchBatch.action.exportFishingOperationReport.tip=Envoyer le résumé au format pdf du trait sélectionné
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra=Résumé Sumatra
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.mnemonic=u
+tutti.editCatchBatch.action.exportFishingOperationReportForSumatra.tip=Exporter le trait sélectionnée pour Sumatra (au format csv)
tutti.editCatchBatch.action.saveCatchBatch=Enregistrer
tutti.editCatchBatch.action.saveCatchBatch.mnemonic=S
tutti.editCatchBatch.action.saveCatchBatch.tip=Enregistrer la capture
-tutti.editCatchBatch.action.sendCruiseReport=Envoyer
-tutti.editCatchBatch.action.sendCruiseReport.mnemonic=E
-tutti.editCatchBatch.action.sendCruiseReport.tip=Envoyer le rapport de la campagne
tutti.editCatchBatch.askCancelEditBeforeLeaving.cancelEditCatchBatch=La capture n'est pas valide et ne peut pas être enregistrée
tutti.editCatchBatch.askSaveBeforeLeaving.saveCatchBatch=Des modifications sur la capture n'ont pas été enregistrées
tutti.editCatchBatch.field.benthosTotalSampleSortedWeight=Poids VRAC trié
@@ -1058,12 +1059,21 @@
tutti.exportCruise.action.exportErrors=Des erreurs sont apparues pendant l'élévation des poids de la campagne <strong>%s</strong>.<br/>L'export a cependant été réalisé.<hr/>Erreur(s) rencontrée(s) \: <br/>%s
tutti.exportCruise.action.success=La campagne <strong>%s</strong> a été exportée dans le fichier <strong>%s</strong>.
tutti.exportCruiseForSumatra.action.chooseFile=Choisir le fichier d'export
-tutti.exportCruiseForSumatra.action.success=Les captures ont correctement été exporté dans le fichier %s
-tutti.exportCruiseForSumatra.title.choose.exportFile=Exporter les captures de la campagne
+tutti.exportCruiseForSumatra.action.success=La campagne sélectionnée a été exportée dans le fichier <strong>%s</strong>
+tutti.exportCruiseForSumatra.title.choose.exportFile=Exporter la campagne
tutti.exportDb.step.closeDb=Fermeture de la base courante
tutti.exportDb.step.createArchive=Création de l'archive %s
tutti.exportDb.step.openDb=Réouverture de la base courante
tutti.exportDb.step.reloadApplication=Redémarrage de l'application
+tutti.exportFishingOperationForSumatra.action.chooseFile=Choisir le fichier d'export
+tutti.exportFishingOperationForSumatra.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
+tutti.exportFishingOperationForSumatra.title.choose.exportFile=Exporter le trait de la campagne
+tutti.exportFishingOperationReport.action.chooseFile=Choisir le fichier de rapport
+tutti.exportFishingOperationReport.action.success=Le trait a été exporté dans le fichier <strong>%s</strong>
+tutti.exportFishingOperationReport.title.choose.exportFile=Exporter le trait de la campagne
+tutti.exportFishingOperationReportForSumatra.action.chooseFile=Choisir le fichier d'export
+tutti.exportFishingOperationReportForSumatra.action.success=Les captures du trait ont correctement été exporté dans le fichier <strong>%s</strong>
+tutti.exportFishingOperationReportForSumatra.title.choose.exportFile=Exporter les captures du trait sélectionné
tutti.exportProgram.action.exportErrors=Des erreurs sont apparues pendant l'élévation des poids d'une campagne de la série <strong>%s</strong>.<br/>L'export a cependant été réalisé.<hr/>Erreur(s) rencontrée(s) \: <br/>%s
tutti.exportProgram.action.success=La série de campagne <strong>%s</strong> a été exportée dans le fichier <strong>%s</strong>.
tutti.exportProtocol.action.success=Protocole [%1s] exporté dans le fichier <strong>%2s</strong>.
@@ -1366,7 +1376,7 @@
tutti.sendCruiseReport.action.chooseFile=Choisir le fichier de rapport
tutti.sendCruiseReport.action.error.mail.message=<html>Le client email n'a pas pu être ouvert.<hr/>Vous pouvez ouvrir manuellement votre client email et ajouter le fichier<br/><em>%s</em><br/>en pièce-jointe.</html>
tutti.sendCruiseReport.action.error.mail.title=Impossible d'ouvrir le client d'email
-tutti.sendCruiseReport.action.success=Les captures ont correctement été exporté dans le fichier %s
+tutti.sendCruiseReport.action.success=Les captures ont correctement été exporté dans le fichier <strong>%s</strong>
tutti.sendCruiseReport.mail.body=Bonjour,\n\nVeuillez trouver ci-joint le rapport des captures de la campagne %1s.\n*Pensez à joindre le fichier %2s*\n\nCordialement,\n\n*Votre nom*
tutti.sendCruiseReport.mail.subject=Captures de la campagne %s
tutti.sendCruiseReport.title.choose.exportFile=Envoyer les captures de la campagne
@@ -1376,7 +1386,7 @@
tutti.splitBenthosBatch.action.save=Enregistrer
tutti.splitBenthosBatch.action.save.mnemonic=E
tutti.splitBenthosBatch.action.save.tip=Sauver le sous-échantillonnage
-tutti.splitBenthosBatch.field.batchWeight=Poids total à catégoriser
+tutti.splitBenthosBatch.field.batchWeight=
tutti.splitBenthosBatch.field.batchWeight.tip=Poids du lot père (si renseigné)
tutti.splitBenthosBatch.field.category=Catégorie
tutti.splitBenthosBatch.field.category.tip=Choisir le mode de catégorisation
@@ -1386,6 +1396,7 @@
tutti.splitBenthosBatch.table.header.selected=Sélection
tutti.splitBenthosBatch.table.header.weight=Poids
tutti.splitBenthosBatch.title=Catégorisation du lot
+tutti.splitBtutti.exportFishingOperationReport.action.success=Le trait a correctement été exporté dans le fichier <strong>%s</strong>
tutti.splitSpeciesBatch.action.cancel=Annuler
tutti.splitSpeciesBatch.action.cancel.mnemonic=A
tutti.splitSpeciesBatch.action.cancel.tip=Annuler le sous-échantillonnage
1
0
The Tutti team is pleased to announce the tutti-2.6.1 release!
Outil de saisie de données d'opérations et de captures au
cours des campagnes halieutiques.
Documentation of the project can be found here:
http://forge.codelutin.com/projects/tutti
Changes
-------
Changes in this version include:
New features:
o [RAPPORT] ajouter sur onglet "Résumé" un bouton pour obtenir la composition de la capture Issue: 3338. Thanks to Tony Chemit. Resolved by tchemit.
Fixed Bugs:
o [CAPTURE] gestion des poids dans le tableau (ne fonctionne pas pour le benthos) Issue: 3401. Thanks to Tony Chemit. Resolved by tchemit.
o [ESPECES] Catégorisation des lots : on ne peut plus ajouter une catégorie une fois la catégorisation effectuée Issue: 3405. Thanks to Tony Chemit. Resolved by tchemit.
o [PROPTOCOLE] erreur à l'import des espèces Issue: 3402. Thanks to Vincent BADTS. Resolved by tchemit.
o [PROPTOCOLE] erreur à l'import du benthos Issue: 3403. Thanks to Vincent BADTS. Resolved by tchemit.
Downloads
---------
No release file deployed. (all files are deployed in the maven repository)
Maven artifacts
---------------
Artifacts are deployed in nuiton maven repository
http://maven.nuiton.org/other-releases/
Have fun!
-Tutti team
1
0
r1264 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 01 Oct '13
by maven-release@users.forge.codelutin.com 01 Oct '13
01 Oct '13
Author: maven-release
Date: 2013-10-01 14:57:43 +0200 (Tue, 01 Oct 2013)
New Revision: 1264
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1264
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-10-01 12:57:37 UTC (rev 1263)
+++ trunk/pom.xml 2013-10-01 12:57:43 UTC (rev 1264)
@@ -32,7 +32,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.6.1</version>
+ <version>2.7-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Tutti</name>
@@ -86,12 +86,12 @@
</modules>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.6.1</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.6.1
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.6.1
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
<distributionManagement>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-10-01 12:57:37 UTC (rev 1263)
+++ trunk/tutti-persistence/pom.xml 2013-10-01 12:57:43 UTC (rev 1264)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.6.1</version>
+ <version>2.7-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-10-01 12:57:37 UTC (rev 1263)
+++ trunk/tutti-service/pom.xml 2013-10-01 12:57:43 UTC (rev 1264)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.6.1</version>
+ <version>2.7-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-10-01 12:57:37 UTC (rev 1263)
+++ trunk/tutti-ui-swing/pom.xml 2013-10-01 12:57:43 UTC (rev 1264)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.6.1</version>
+ <version>2.7-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0