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
September 2013
- 4 participants
- 100 discussions
r1202 - in trunk: tutti-service/src/main/java/fr/ifremer/tutti/service tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create
by tchemit@users.forge.codelutin.com 22 Sep '13
by tchemit@users.forge.codelutin.com 22 Sep '13
22 Sep '13
Author: tchemit
Date: 2013-09-22 13:29:17 +0200 (Sun, 22 Sep 2013)
New Revision: 1202
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1202
Log:
fixes #3297: [DONNEES INDIVIDUELLES] g?\195?\169rer les colonnes du tableau dans le protocole
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.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/CreateIndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-09-21 17:45:55 UTC (rev 1201)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-09-22 11:29:17 UTC (rev 1202)
@@ -54,6 +54,7 @@
public class DecoratorService extends AbstractTuttiService {
public static final String CARACTERISTIC_WITH_UNIT = "withUnit";
+ public static final String CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT = "parameterOnlyWithUnit";
public static final String CARACTERISTIC_PARAMETER_ONLY = "parameterOnly";
@@ -104,8 +105,7 @@
registerTuttiDecorator(Person.class, "${firstName}$s#${lastName}$s#${department}$s", SEPARATOR, " ");
registerTuttiDecorator(Caracteristic.class, "${parameterName}$s#${matrixName}$s#${fractionName}$s#${methodName}$s", SEPARATOR, " - ");
registerTuttiDecorator(Caracteristic.class, CARACTERISTIC_PARAMETER_ONLY, "${parameterName}$s", SEPARATOR, " - ");
-// registerMultiJXPathDecorator(Caracteristic.class, CARACTERISTIC_WITH_UNIT, "${parameterName}$s#${matrixName}$s#${fractionName}$s#${methodName}$s (${unit}$s)", SEPARATOR, " - ");
-// registerTuttiDecorator(CaracteristicQualitativeValue.class, "${name}$s", SEPARATOR, " - ");
+ registerTuttiDecorator(Caracteristic.class, CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT, "${parameterName}$s (${unit}$s)", SEPARATOR, " - ");
registerTuttiDecorator(CaracteristicQualitativeValue.class, "${description}$s", SEPARATOR, " - ");
registerTuttiDecorator(SpeciesProtocol.class, "${speciesReferenceTaxonId}", SEPARATOR, " - ");
registerTuttiDecorator(Attachment.class, "${name}$s", SEPARATOR, " - ");
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-09-21 17:45:55 UTC (rev 1201)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-09-22 11:29:17 UTC (rev 1202)
@@ -308,13 +308,6 @@
new IndividualObservationBatchUIModel(catchesUIModel,
defaultCaracteristic);
ui.setContextValue(model);
-
-// // propagate when value is changing
-// PropagatePropertyChangeListener.listenAndPropagate(
-// catchesUIModel,
-// model,
-// EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT,
-// EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT);
}
@Override
@@ -551,19 +544,25 @@
IndividualObservationBatch catchBean = row.toBean();
- // use a new instance of caracteristicMap
- CaracteristicMap caracteristics = CaracteristicMap.copy(catchBean.getCaracteristics());
+ CaracteristicMap caracteristics = new CaracteristicMap();
catchBean.setCaracteristics(caracteristics);
- // push back default caracteristics
- CaracteristicMap defaultCaracteristics = row.getDefaultCaracteristics();
- for (Map.Entry<Caracteristic, Serializable> entry : defaultCaracteristics.entrySet()) {
+ // push back not null caracteristics
+ for (Map.Entry<Caracteristic, Serializable> entry : row.getCaracteristics().entrySet()) {
Serializable value = entry.getValue();
if (value != null) {
caracteristics.put(entry.getKey(), value);
}
}
+ // push back not null default caracteristics
+ for (Map.Entry<Caracteristic, Serializable> entry : row.getDefaultCaracteristics().entrySet()) {
+ Serializable value = entry.getValue();
+ if (value != null) {
+ caracteristics.put(entry.getKey(), value);
+ }
+ }
+
FishingOperation fishingOperation = getModel().getFishingOperation();
catchBean.setFishingOperation(fishingOperation);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-09-21 17:45:55 UTC (rev 1201)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-09-22 11:29:17 UTC (rev 1202)
@@ -31,6 +31,7 @@
import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
@@ -45,13 +46,20 @@
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUI;
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUIModel;
import jaxx.runtime.SwingUtil;
+import jaxx.runtime.swing.Table;
+import jaxx.runtime.swing.editor.NumberEditor;
+import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.decorator.Decorator;
import javax.swing.JComponent;
+import javax.swing.JLabel;
import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
@@ -90,6 +98,7 @@
listModelIsModify(model);
}
+
@Override
public void afterInitUI() {
@@ -105,7 +114,7 @@
Lists.newArrayList(lengthStepCaracteristics),
null);
- if (context.isProtocolFilled()) {
+ if (getDataContext().isProtocolFilled()) {
// get loaded protocol
TuttiProtocol protocol = getDataContext().getProtocol();
@@ -134,9 +143,102 @@
}
}
});
+
+ // add default caracteristic editors
+ List<Caracteristic> caracteristics =
+ getDataContext().getDefaultIndividualObservationCaracteristics();
+
+ Table configurationPanel = ui.getConfigurationPanel();
+
+ Decorator<Caracteristic> caracteristicDecorator =
+ getDecorator(Caracteristic.class, DecoratorService.CARACTERISTIC_PARAMETER_ONLY_WITH_UNIT);
+
+ Decorator<Caracteristic> caracteristicTipDecorator =
+ getDecorator(Caracteristic.class, DecoratorService.CARACTERISTIC_WITH_UNIT);
+
+ int index = 4;
+ for (Caracteristic caracteristic : caracteristics) {
+
+ final CreateIndividualObservationBatchUIModel.CaracteristicMapPropertyEditor editorModel =
+ getModel().newCaracteristicEditor(caracteristic);
+
+ JComponent editor = null;
+
+ switch (caracteristic.getCaracteristicType()) {
+
+ case NUMBER: {
+ final NumberEditor numberEditor = new NumberEditor(ui);
+
+ String name = caracteristic.getId() + "CaracteristicField";
+ numberEditor.setName(name);
+ numberEditor.setProperty(CreateIndividualObservationBatchUIModel.CaracteristicMapPropertyEditor.PROPERTY_PROPERTY);
+ numberEditor.setUseFloat(true);
+ numberEditor.setShowReset(true);
+ numberEditor.setBean(editorModel);
+ numberEditor.setAutoPopup(getConfig().isAutoPopupNumberEditor());
+ numberEditor.setShowPopupButton(getConfig().isShowNumberEditorButton());
+ numberEditor.setNumberPattern(TuttiUI.DECIMAL3_PATTERN);
+
+ editorModel.addPropertyChangeListener(CreateIndividualObservationBatchUIModel.CaracteristicMapPropertyEditor.PROPERTY_PROPERTY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ numberEditor.setModel((Number) evt.getNewValue());
+ }
+ });
+
+ editor = numberEditor;
+ ui.get$objectMap().put(name, editor);
+
+ initNumberEditor(numberEditor);
+ }
+ break;
+ case QUALITATIVE:
+
+ {
+ final BeanFilterableComboBox<CaracteristicQualitativeValue> qualitativeValuesEditor = new BeanFilterableComboBox<CaracteristicQualitativeValue>(ui);
+
+ String name = caracteristic.getId() + "CaracteristicComboBox";
+ qualitativeValuesEditor.setName(name);
+ qualitativeValuesEditor.setI18nPrefix("tutti.property.");
+ qualitativeValuesEditor.setProperty(CreateIndividualObservationBatchUIModel.CaracteristicMapPropertyEditor.PROPERTY_PROPERTY);
+ qualitativeValuesEditor.setShowReset(true);
+ qualitativeValuesEditor.setBeanType(CaracteristicQualitativeValue.class);
+
+ qualitativeValuesEditor.setBean(editorModel);
+
+ editorModel.addPropertyChangeListener(CreateIndividualObservationBatchUIModel.CaracteristicMapPropertyEditor.PROPERTY_PROPERTY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ qualitativeValuesEditor.setSelectedItem(evt.getNewValue());
+ }
+ });
+
+ editor = qualitativeValuesEditor;
+ ui.get$objectMap().put(name, editor);
+
+ initBeanFilterableComboBox(qualitativeValuesEditor,
+ Lists.newArrayList(caracteristic.getQualitativeValue()),
+ null);
+ }
+
+ break;
+ case TEXT:
+ break;
+ }
+ JLabel jLabel = new JLabel();
+ jLabel.setText(caracteristicDecorator.toString(caracteristic));
+ jLabel.setToolTipText(caracteristicTipDecorator.toString(caracteristic));
+ jLabel.setLabelFor(editor);
+ jLabel.putClientProperty("help", "tutti.createIndividualObservationBatch.field.defaultCaracteristic.help");
+ ui.registerHelpId(ui.getBroker(), jLabel, "tutti.createIndividualObservationBatch.field.defaultCaracteristic.help");
+
+ configurationPanel.add(jLabel, new GridBagConstraints(0, index, 1, 1, 0.0, 0.0, 17, 1, new Insets(3, 3, 3, 3), 0, 0));
+ configurationPanel.add(SwingUtil.boxComponentWithJxLayer(editor), new GridBagConstraints(1, index, 2, 1, 1.0, 0.0, 10, 1, new Insets(3, 3, 3, 3), 0, 0));
+ index++;
+ }
}
- listenValidatorValid(ui.getValidator(), getModel());
+ listenValidatorValid(getValidator(), getModel());
}
@Override
@@ -152,7 +254,7 @@
}
// evict model from validator
- ui.getValidator().setBean(null);
+ getValidator().setBean(null);
// when canceling always invalid model
getModel().setValid(false);
@@ -187,7 +289,7 @@
CreateIndividualObservationBatchUIModel model = getModel();
// connect model to validator
- ui.getValidator().setBean(model);
+ getValidator().setBean(model);
model.reset();
@@ -196,9 +298,6 @@
List<Species> speciesListWithSurveyCode =
getDataContext().getReferentSpeciesWithSurveyCode();
-// Map<String, Species> speciesMap =
-// TuttiEntities.splitById(speciesListWithSurveyCode);
-
List<Species> speciesList;
EditCatchesUI parent =
@@ -267,18 +366,6 @@
// set last species filled here
Species lastSpeciesUsed = batchModel.getLastSpeciesUsed();
model.setSpecies(lastSpeciesUsed);
-// if (lastSpeciesUsed != null) {
-//
-// // use the version with surveycode
-// Species species = speciesMap.get(lastSpeciesUsed.getId());
-// if (species == null) {
-//
-// speciesMap = TuttiEntities.splitById(speciesList);
-// species = speciesMap.get(lastSpeciesUsed.getId());
-// }
-//
-// model.setSpecies(lastSpeciesUsed);
-// }
model.setLengthStepCaracteristic(batchModel.getLastLengthStepCaracteristicUsed());
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java 2013-09-21 17:45:55 UTC (rev 1201)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java 2013-09-22 11:29:17 UTC (rev 1202)
@@ -29,9 +29,12 @@
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
+import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jdesktop.beans.AbstractSerializableBean;
+import java.io.Serializable;
import java.util.List;
/**
@@ -46,6 +49,8 @@
public static final String PROPERTY_AVAILABLE_SPECIES = "availableSpecies";
+ public static final String PROPERTY_CARACTERISTICS = "caracteristics";
+
/**
* All available species (sets by protocol).
*
@@ -68,6 +73,14 @@
*/
protected final List<Caracteristic> defaultCaracteristic;
+ /**
+ * Default caracteristics editors.
+ *
+ * @since 2.5
+ */
+ protected final List<CaracteristicMapPropertyEditor> caracteristicEditors =
+ Lists.newArrayList();
+
public CreateIndividualObservationBatchUIModel(List<Caracteristic> defaultCaracteristic) {
super(IndividualObservationBatch.class, null, null);
this.defaultCaracteristic = defaultCaracteristic;
@@ -118,6 +131,13 @@
return editObject.getCaracteristics();
}
+ public void setCaracteristics(CaracteristicMap caracteristics) {
+
+ editObject.setCaracteristics(caracteristics);
+ firePropertyChange(IndividualObservationBatch.PROPERTY_CARACTERISTICS, null, caracteristics);
+
+ }
+
public List<Species> getAvailableSpecies() {
if (log.isDebugEnabled()) {
log.debug("getAvailableSpecies " + availableSpecies);
@@ -145,6 +165,52 @@
setWeight(null);
setSize(null);
setLengthStepCaracteristic(null);
+ for (CaracteristicMapPropertyEditor editor : caracteristicEditors) {
+ editor.setProperty(null);
+ }
getCaracteristics().clear();
}
+
+ public CaracteristicMapPropertyEditor newCaracteristicEditor(Caracteristic caracteristic) {
+ CaracteristicMapPropertyEditor editor = new CaracteristicMapPropertyEditor(caracteristic);
+ caracteristicEditors.add(editor);
+ return editor;
+ }
+
+ /**
+ * Model to edit a caracteristic and flush it in the caracteristc map of
+ * the global model.
+ * <p/>
+ * Acts as a bean for the given caracteristic.
+ *
+ * @since 2.5
+ */
+ public class CaracteristicMapPropertyEditor extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_PROPERTY = "property";
+
+ private final Caracteristic caracteristic;
+
+ protected Serializable property;
+
+ public Serializable getProperty() {
+ return property;
+ }
+
+ public void setProperty(Serializable property) {
+ Object oldValue = getProperty();
+ this.property = property;
+ getCaracteristics().put(caracteristic, property);
+ if (ObjectUtils.notEqual(oldValue, property)) {
+ firePropertyChange(PROPERTY_PROPERTY, oldValue, property);
+ CreateIndividualObservationBatchUIModel.this.firePropertyChanged(PROPERTY_CARACTERISTICS, null, getCaracteristics());
+ }
+ }
+
+ public CaracteristicMapPropertyEditor(Caracteristic caracteristic) {
+ this.caracteristic = caracteristic;
+ }
+ }
}
1
0
r1201 - in trunk/tutti-service/src: main/java/fr/ifremer/tutti/service test/java/fr/ifremer/tutti/service/catches/multipost test/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 21 Sep '13
by tchemit@users.forge.codelutin.com 21 Sep '13
21 Sep '13
Author: tchemit
Date: 2013-09-21 19:45:55 +0200 (Sat, 21 Sep 2013)
New Revision: 1201
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1201
Log:
fix tests
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportServiceTest.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java 2013-09-21 15:14:00 UTC (rev 1200)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiCsvUtil.java 2013-09-21 17:45:55 UTC (rev 1201)
@@ -482,7 +482,11 @@
}
// qualitive value
CaracteristicQualitativeValue qv = (CaracteristicQualitativeValue) value;
- return qv.getName();
+ String result = qv.getName();
+ if (!result.equals(qv.getDescription())) {
+ result += " - " + qv.getDescription();
+ }
+ return result;
}
}
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportServiceTest.java 2013-09-21 15:14:00 UTC (rev 1200)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportServiceTest.java 2013-09-21 17:45:55 UTC (rev 1201)
@@ -105,10 +105,12 @@
public static final String ACCIDENTAL_CATCH_ATTACHMENT_CONTENT = "batchId;name;comment;file";
- public static final String INDIVIDUAL_OBSERVATION_CONTENT = "batchId;species;weight;size;lengthStepCaracteristic;samplingCode;calcifiedPieceSamplingCode;comment\n" +
- "IndividualObservationRow_1;11242;0.1;10.0;307;A20;10;P1;";
+ public static final String INDIVIDUAL_OBSERVATION_CONTENT = "batchId;species;weight;size;lengthStepCaracteristic;comment\n" +
+ "IndividualObservationRow_1;11242;0.1;10.0;307;P1;";
public static final String INDIVIDUAL_OBSERVATION_CARACTERISTIC_CONTENT = "batchId;caracteristic;value\n" +
+ "IndividualObservationRow_1;1436;10;\n" +
+ "IndividualObservationRow_1;1435;A20;\n" +
"IndividualObservationRow_1;101;10.0;\n" +
"IndividualObservationRow_1;46;168;\n" +
"IndividualObservationRow_1;1388;5.0;";
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-09-21 15:14:00 UTC (rev 1200)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-09-21 17:45:55 UTC (rev 1201)
@@ -145,11 +145,11 @@
public static final String INDIVIDUAL_OBSERVATION_CONTENT =
"Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;BatchId;ReferenceTaxonId;ReferenceTaxonName;Commentaire;CaracteristicId;CaracteristicValue\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;1435;A20;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;1436;10;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;220;0.1;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;1433;307;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;307;10.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;1436;10;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;1435;A20;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;101;10.0;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;46;0L - 0 VMS - 1 LB;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;100000;11242;Aaptos;P1;1388;5.0;";
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/993/changes>
Changes:
[Tony Chemit] refs #3297: [DONNEES INDIVIDUELLES] gérer les colonnes du tableau dans le protocole (tableau dynamique ok)
fixes #3304: [DONNEES INDIVIDUELLES] Utilisation du code campagne sur les espèces
fixes #3303: [DONNEES INDIVIDUELLES] liste des espèces possibles. Saisie au km
[Tony Chemit] - improve i18n keys
- refs #3297: [DONNEES INDIVIDUELLES] gérer les colonnes du tableau dans le protocole (ne plus utiliser PMFM_ID_SAMPLE_ID et PMFM_ID_OTOLITHE_ID)
[Tony Chemit] fixes #3306: [DONNEES INDIVIDUELLES] L'ordre de saisie n'est pas conservé
fixes #3308: [CAPTURES ACCIDENTELLES] L'ordre de saisie n'est pas conservé
------------------------------------------
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-09-21T16:55:42.380 +0200'
U tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.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-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
D tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportExportService.java
U tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportService.java
U tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportService.java
U tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRowModel.java
U tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRow.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/ImportMultiPostAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/ImportMultiPostAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/ImportMultiPostAction.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
AU tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicColumnIdentifier.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapCellComponent.java
U tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapEditorUIHandler.java
U tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
U tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
G tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
U tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/config/SampleCategoryModelConverter.java
U tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
U tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties
U tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties
U tutti-persistence/src/main/resources/queries-override.hbm.xml
U tutti-persistence/src/main/xmi/tutti-persistence.zargo
At revision 1198
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 35640
<===[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.5-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.5-SNAPSHOT/tutti-2.5-SNAPSHOT.pom
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-2.5-SNAPSHOT-s…> to /var/local/maven/data/repository/fr/ifremer/tutti/2.5-SNAPSHOT/tutti-2.5-SNAPSHOT-site_fr.xml
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 2.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ tutti-persistence ---
[INFO]
[INFO] --- eugene-maven-plugin:2.7: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 13.825ms.
[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 978.904ms.
[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
WARN [pool-1-thread-1] (AbstractObjectModelReader.java:294) loadModelTagValue - Invalid model tag value [model.tagvalue.simpleBeanExtractInterface] : the tagvalue 'simpleBeanExtractInterface' is unkown.
INFO [pool-1-thread-1] (AbstractObjectModelReader.java:270) loadModelProperties - 24 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] 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 133 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/cl…>
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/main/…>: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ tutti-persistence ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/su…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ tutti-persistence ---
[INFO] Compiling 31 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/te…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[112,39] cannot find symbol
symbol: method setSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[113,39] cannot find symbol
symbol: method setCalcifiedPieceSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[143,39] cannot find symbol
symbol: method setSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[144,39] cannot find symbol
symbol: method setCalcifiedPieceSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[197,37] cannot find symbol
symbol: method getSamplingCode()
location: variable expected of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[197,63] cannot find symbol
symbol: method getSamplingCode()
location: variable actual of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[198,37] cannot find symbol
symbol: method getCalcifiedPieceSamplingCode()
location: variable expected of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[198,77] cannot find symbol
symbol: method getCalcifiedPieceSamplingCode()
location: variable actual of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[INFO] 8 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [2.248s]
[INFO] Tutti :: Persistence .............................. FAILURE [5.900s]
[INFO] Tutti :: Service .................................. SKIPPED
[INFO] Tutti :: UI ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.755s
[INFO] Finished at: Sat Sep 21 16:55:56 CEST 2013
[INFO] Final Memory: 32M/232M
[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-09-21_16-55-45/archive/fr.ifremer.tutti/tutti-service/2.5-SNAPSHOT/tutti-service-2.5-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-09-21_16-55-45/archive/fr.ifremer.tutti/tutti-ui-swing/2.5-SNAPSHOT/tutti-ui-swing-2.5-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-09-21_16-55-45/archive/fr.ifremer/tutti/2.5-SNAPSHOT/tutti-2.5-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-2.5-SNAPSHOT-s…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-09-21_16-55-45/archive/fr.ifremer/tutti/2.5-SNAPSHOT/tutti-2.5-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-09-21_16-55-45/archive/fr.ifremer.tutti/tutti-persistence/2.5-SNAPSHOT/tutti-persistence-2.5-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:testCompile (default-testCompile) on project tutti-persistence: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project tutti-persistence: Compilation failure
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
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:152)
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
2
21 Sep '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/9…>
Changes:
[Tony Chemit] - improve i18n keys
- refs #3297: [DONNEES INDIVIDUELLES] gérer les colonnes du tableau dans le protocole (ne plus utiliser PMFM_ID_SAMPLE_ID et PMFM_ID_OTOLITHE_ID)
[Tony Chemit] fixes #3306: [DONNEES INDIVIDUELLES] L'ordre de saisie n'est pas conservé
fixes #3308: [CAPTURES ACCIDENTELLES] L'ordre de saisie n'est pas conservé
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 2.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-persistence ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ tutti-persistence ---
[INFO]
[INFO] --- eugene-maven-plugin:2.7: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 13.825ms.
[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 978.904ms.
[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
WARN [pool-1-thread-1] (AbstractObjectModelReader.java:294) loadModelTagValue - Invalid model tag value [model.tagvalue.simpleBeanExtractInterface] : the tagvalue 'simpleBeanExtractInterface' is unkown.
INFO [pool-1-thread-1] (AbstractObjectModelReader.java:270) loadModelProperties - 24 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] 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 133 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[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]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ tutti-persistence ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ tutti-persistence ---
[INFO] Compiling 31 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
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[112,39] cannot find symbol
symbol: method setSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[113,39] cannot find symbol
symbol: method setCalcifiedPieceSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[143,39] cannot find symbol
symbol: method setSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[144,39] cannot find symbol
symbol: method setCalcifiedPieceSamplingCode(java.lang.String)
location: variable fullIndividualObservationBatch of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[197,37] cannot find symbol
symbol: method getSamplingCode()
location: variable expected of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[197,63] cannot find symbol
symbol: method getSamplingCode()
location: variable actual of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[198,37] cannot find symbol
symbol: method getCalcifiedPieceSamplingCode()
location: variable expected of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-persistence/w…>:[198,77] cannot find symbol
symbol: method getCalcifiedPieceSamplingCode()
location: variable actual of type fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch
[INFO] 8 errors
[INFO] -------------------------------------------------------------
1
2
r1200 - in trunk/tutti-persistence/src: main/java/fr/ifremer/tutti/persistence/test test/java/fr/ifremer/tutti/persistence/service
by tchemit@users.forge.codelutin.com 21 Sep '13
by tchemit@users.forge.codelutin.com 21 Sep '13
21 Sep '13
Author: tchemit
Date: 2013-09-21 17:14:00 +0200 (Sat, 21 Sep 2013)
New Revision: 1200
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1200
Log:
fix tests
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/test/DatabaseFixtures.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceWriteTest.java
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-09-21 15:00:19 UTC (rev 1199)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/test/DatabaseFixtures.java 2013-09-21 15:14:00 UTC (rev 1200)
@@ -103,7 +103,7 @@
}
public int refNbCaracteristic() {
- return 481;
+ return 485;
}
public int refNbSpecies() {
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceWriteTest.java 2013-09-21 15:00:19 UTC (rev 1199)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceWriteTest.java 2013-09-21 15:14:00 UTC (rev 1200)
@@ -109,8 +109,8 @@
caracteristicMap.put(stringCaracteristic, "Un texte!");
fullIndividualObservationBatch.setComment("IndividualObservationBatch-full");
- fullIndividualObservationBatch.setSamplingCode("SamplingCode");
- fullIndividualObservationBatch.setCalcifiedPieceSamplingCode("CalcifiedPieceSamplingCode");
+// fullIndividualObservationBatch.setSamplingCode("SamplingCode");
+// fullIndividualObservationBatch.setCalcifiedPieceSamplingCode("CalcifiedPieceSamplingCode");
fullIndividualObservationBatch.setLengthStepCaracteristic(referentialService.getCaracteristic(dbResource.getFixtures().refNumericalPmfmId()));
fullIndividualObservationBatch.setSize(10.0f);
@@ -140,8 +140,8 @@
modifiedIndividualObservationBatch.setSize(15f);
modifiedIndividualObservationBatch.setWeight(35f);
fullIndividualObservationBatch.setComment("IndividualObservationBatch-modified");
- fullIndividualObservationBatch.setSamplingCode("SamplingCode");
- fullIndividualObservationBatch.setCalcifiedPieceSamplingCode("CalcifiedPieceSamplingCode");
+// fullIndividualObservationBatch.setSamplingCode("SamplingCode");
+// fullIndividualObservationBatch.setCalcifiedPieceSamplingCode("CalcifiedPieceSamplingCode");
modifiedIndividualObservationBatch.getCaracteristics().clear();
IndividualObservationBatch savedIndividualObservationBatch = service.saveIndividualObservationBatch(modifiedIndividualObservationBatch);
@@ -194,8 +194,8 @@
Assert.assertEquals(expected.getId(), actual.getId());
Assert.assertEquals(expected.getSize(), actual.getSize());
Assert.assertEquals(expected.getComment(), actual.getComment());
- Assert.assertEquals(expected.getSamplingCode(), actual.getSamplingCode());
- Assert.assertEquals(expected.getCalcifiedPieceSamplingCode(), actual.getCalcifiedPieceSamplingCode());
+// Assert.assertEquals(expected.getSamplingCode(), actual.getSamplingCode());
+// Assert.assertEquals(expected.getCalcifiedPieceSamplingCode(), actual.getCalcifiedPieceSamplingCode());
Assert.assertEquals(expected.getLengthStepCaracteristic(), actual.getLengthStepCaracteristic());
Assert.assertEquals(expected.getWeight(), actual.getWeight());
Assert.assertEquals(expected.getCaracteristics(), actual.getCaracteristics());
1
0
r1199 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation
by tchemit@users.forge.codelutin.com 21 Sep '13
by tchemit@users.forge.codelutin.com 21 Sep '13
21 Sep '13
Author: tchemit
Date: 2013-09-21 17:00:19 +0200 (Sat, 21 Sep 2013)
New Revision: 1199
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1199
Log:
fixes #3309: [DONNEES INDIVIDUELLES] Ligne ?\195?\160 supprimer non s?\195?\169lectionn?\195?\169e
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.css
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.css 2013-09-21 14:47:57 UTC (rev 1198)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.css 2013-09-21 15:00:19 UTC (rev 1199)
@@ -56,7 +56,7 @@
#table {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
- selectionBackground: {null};
+ /*selectionBackground: {null};*/
selectionForeground: {Color.BLACK};
sortable: false;
}
1
0
21 Sep '13
Author: tchemit
Date: 2013-09-21 16:47:57 +0200 (Sat, 21 Sep 2013)
New Revision: 1198
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1198
Log:
refs #3297: [DONNEES INDIVIDUELLES] g?\195?\169rer les colonnes du tableau dans le protocole (tableau dynamique ok)
fixes #3304: [DONNEES INDIVIDUELLES] Utilisation du code campagne sur les esp?\195?\168ces
fixes #3303: [DONNEES INDIVIDUELLES] liste des esp?\195?\168ces possibles. Saisie au km
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicColumnIdentifier.java
Removed:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportExportService.java
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRow.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRowModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/ImportMultiPostAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/ImportMultiPostAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/ImportMultiPostAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapEditorUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -485,17 +485,17 @@
return driver.getDeadOrAliveCaracteristic();
}
- @Override
- public Caracteristic getSampleIdCaracteristic() {
- return driver.getSampleIdCaracteristic();
- }
+// @Override
+// public Caracteristic getSampleIdCaracteristic() {
+// return driver.getSampleIdCaracteristic();
+// }
+//
+// @Override
+// public Caracteristic getOtolitheIdCaracteristic() {
+// return driver.getOtolitheIdCaracteristic();
+// }
@Override
- public Caracteristic getOtolitheIdCaracteristic() {
- return driver.getOtolitheIdCaracteristic();
- }
-
- @Override
public Caracteristic getPmfmIdCaracteristic() {
return driver.getPmfmIdCaracteristic();
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -154,6 +154,8 @@
protected List<Gear> scientificGears;
+ protected List<Caracteristic> defaultIndividualObservationCaracteristics;
+
protected PersistenceService service;
TuttiDataContext() {
@@ -684,6 +686,31 @@
return scientificGears;
}
+ public List<Caracteristic> getDefaultIndividualObservationCaracteristics() {
+ if (defaultIndividualObservationCaracteristics == null) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Loading defaultIndividualObservationCaracteristics");
+ }
+ List<Caracteristic> list ;
+ if (isProtocolFilled()) {
+ List<String> individualObservationPmfmId = getProtocol().getIndividualObservationPmfmId();
+ list = Lists.newArrayListWithCapacity(individualObservationPmfmId.size());
+ for (String id : individualObservationPmfmId) {
+ Caracteristic caracteristic = service.getCaracteristic(Integer.valueOf(id));
+ list.add(caracteristic);
+ }
+ } else {
+ // no default caracteristics to use
+ list = Lists.newArrayList();
+ }
+
+ defaultIndividualObservationCaracteristics =
+ Collections.unmodifiableList(list);
+ }
+ return defaultIndividualObservationCaracteristics;
+ }
+
public void resetCruise() {
cruise = null;
}
@@ -691,6 +718,7 @@
public void resetProtocol() {
protocol = null;
lengthStepCaracteristics = null;
+ defaultIndividualObservationCaracteristics=null;
}
public void resetGears() {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRow.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRow.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRow.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -47,10 +47,10 @@
public static final String LENGTH_STEP_CARACTERISTIC = "lengthStepCaracteristic";
- public static final String SAMPLING_CODE = "samplingCode";
+// public static final String SAMPLING_CODE = "samplingCode";
+//
+// public static final String CALCIFIED_PIECE_SAMPLING_CODE = "calcifiedPieceSamplingCode";
- public static final String CALCIFIED_PIECE_SAMPLING_CODE = "calcifiedPieceSamplingCode";
-
public static final String COMMENT = "comment";
protected String batchId;
@@ -63,10 +63,10 @@
protected Caracteristic lengthStepCaracteristic;
- protected String samplingCode;
+// protected String samplingCode;
+//
+// protected String calcifiedPieceSamplingCode;
- protected String calcifiedPieceSamplingCode;
-
protected String comment;
public String getBatchId() {
@@ -109,22 +109,22 @@
this.lengthStepCaracteristic = lengthStepCaracteristic;
}
- public String getSamplingCode() {
- return samplingCode;
- }
+// public String getSamplingCode() {
+// return samplingCode;
+// }
+//
+// public void setSamplingCode(String samplingCode) {
+// this.samplingCode = samplingCode;
+// }
+//
+// public String getCalcifiedPieceSamplingCode() {
+// return calcifiedPieceSamplingCode;
+// }
+//
+// public void setCalcifiedPieceSamplingCode(String calcifiedPieceSamplingCode) {
+// this.calcifiedPieceSamplingCode = calcifiedPieceSamplingCode;
+// }
- public void setSamplingCode(String samplingCode) {
- this.samplingCode = samplingCode;
- }
-
- public String getCalcifiedPieceSamplingCode() {
- return calcifiedPieceSamplingCode;
- }
-
- public void setCalcifiedPieceSamplingCode(String calcifiedPieceSamplingCode) {
- this.calcifiedPieceSamplingCode = calcifiedPieceSamplingCode;
- }
-
public String getComment() {
return comment;
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRowModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRowModel.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/IndividualObservationRowModel.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -92,10 +92,10 @@
Caracteristic.PROPERTY_ID,
caracteristicMap);
- newColumnForImportExport(IndividualObservationRow.SAMPLING_CODE);
+// newColumnForImportExport(IndividualObservationRow.SAMPLING_CODE);
+//
+// newColumnForImportExport(IndividualObservationRow.CALCIFIED_PIECE_SAMPLING_CODE);
- newColumnForImportExport(IndividualObservationRow.CALCIFIED_PIECE_SAMPLING_CODE);
-
newColumnForImportExport(IndividualObservationRow.COMMENT);
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportService.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostExportService.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -318,8 +318,8 @@
row.setWeight(batch.getWeight());
row.setSize(batch.getSize());
row.setLengthStepCaracteristic(batch.getLengthStepCaracteristic());
- row.setSamplingCode(batch.getSamplingCode());
- row.setCalcifiedPieceSamplingCode(batch.getCalcifiedPieceSamplingCode());
+// row.setSamplingCode(batch.getSamplingCode());
+// row.setCalcifiedPieceSamplingCode(batch.getCalcifiedPieceSamplingCode());
row.setComment(batch.getComment());
rows.add(row);
Deleted: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportExportService.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportExportService.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -1,1647 +0,0 @@
-package fr.ifremer.tutti.service.catches.multipost;
-
-/*
- * #%L
- * Tutti :: Service
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 - 2013 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.base.Charsets;
-import com.google.common.base.Function;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.ListMultimap;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.io.Files;
-import fr.ifremer.tutti.TuttiBusinessException;
-import fr.ifremer.tutti.TuttiIOUtil;
-import fr.ifremer.tutti.TuttiTechnicalException;
-import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
-import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
-import fr.ifremer.tutti.persistence.entities.TuttiEntities;
-import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
-import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
-import fr.ifremer.tutti.persistence.entities.data.Attachment;
-import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
-import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
-import fr.ifremer.tutti.persistence.entities.data.BenthosBatchFrequency;
-import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
-import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
-import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
-import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.service.AbstractTuttiService;
-import fr.ifremer.tutti.service.DecoratorService;
-import fr.ifremer.tutti.service.PersistenceService;
-import fr.ifremer.tutti.service.TuttiDataContext;
-import fr.ifremer.tutti.service.TuttiServiceContext;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.tuple.Pair;
-import org.nuiton.csv.Export;
-import org.nuiton.csv.Import;
-import org.nuiton.util.ZipUtil;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Serializable;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- * Service to export batches from a satellite post or import batches into a master post.
- *
- * @author kmorin <kmorin(a)codelutin.com>
- * @since 2.2
- * @deprecated since 2.5, too long, too bad :(
- */
-@Deprecated
-public class TuttiMultiPostImportExportService extends AbstractTuttiService {
-
-// private static final Log log =
-// LogFactory.getLog(TuttiMultiPostImportExportService.class);
-
- public static final String BATCHES_KEY = "batchesKey";
-
- protected static final String ATTACHMENTS_DIRECTORY = "attachments";
-
- protected static final String ATTACHMENTS_FILE = "attachments.csv";
-
- protected static final String SPECIES_FILE = "species.csv";
-
- protected static final String BENTHOS_FILE = "benthos.csv";
-
- protected static final String MARINE_LITTER_FILE = "marineLitter.csv";
-
- protected static final String INDIVIDUAL_OBSERVATION_FILE = "individualObservation.csv";
-
- protected static final String ACCIDENTAL_CATCHES_FILE = "accidentalCatches.csv";
-
- protected static final String FREQUENCIES_FILE = "frequencies.csv";
-
- protected static final String CARACTERISTIC_FILE = "caracteristics.csv";
-
- protected static final String WEIGHTS_FILE = "weights.csv";
-
- protected PersistenceService persistenceService;
-
- protected DecoratorService decoratorService;
-
- protected char csvSeparator;
-
-// protected List<SampleCategoryEnum> samplingOrder;
-
- @Override
- public void setServiceContext(TuttiServiceContext context) {
- super.setServiceContext(context);
- persistenceService = getService(PersistenceService.class);
- decoratorService = getService(DecoratorService.class);
-
- csvSeparator = context.getConfig().getCsvSeparator();
-
-// Map<Integer, SampleCategoryEnum> idMapping = SampleCategoryEnum.toIdMapping();
-//
-// samplingOrder = Lists.newArrayList();
-//
-// // always first sampling category
-// samplingOrder.add(SampleCategoryEnum.sortedUnsorted);
-//
-// for (Integer categoryId : context.getConfig().getSamplingOrderIds()) {
-// SampleCategoryEnum categoryEnum = idMapping.get(categoryId);
-// if (SampleCategoryEnum.sortedUnsorted != categoryEnum) {
-// samplingOrder.add(categoryEnum);
-// }
-// }
- }
-
- /**
- * Export species batches.
- *
- * @param file the file to export the batches into
- * @param operation the operation to export
- */
- public void exportSpecies(File file, FishingOperation operation) {
-
- String operationId = operation.getId();
- if (persistenceService.isFishingOperationWithCatchBatch(operationId)) {
-
- BatchContainer<SpeciesBatch> speciesBatchContainer =
- persistenceService.getRootSpeciesBatch(operationId, null);
-
- List<CatchRow> rows = Lists.newArrayList();
- List<CatchFrequencyRow> frequencyRows = Lists.newArrayList();
- List<AttachmentRow> attachmentRows = Lists.newArrayList();
-
- for (SpeciesBatch batch : speciesBatchContainer.getChildren()) {
- createSpeciesRow(batch, null, rows, frequencyRows, attachmentRows);
- }
-
- // export weights
- CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(operationId);
- CatchWeightsRow weights = new CatchWeightsRow();
- weights.setTotalSortedWeight(catchBatch.getSpeciesTotalSortedWeight());
- weights.setInertWeight(catchBatch.getSpeciesTotalInertWeight());
- weights.setLivingNotItemizedWeight(catchBatch.getSpeciesTotalLivingNotItemizedWeight());
- exportOperation(weights, operation);
-
- exportCatches(file, SPECIES_FILE, weights, rows, frequencyRows, attachmentRows);
- }
- }
-
- /**
- * Export benthos batches.
- *
- * @param file the file to export the batches into
- * @param operation the operation to export
- */
- public void exportBenthos(File file, FishingOperation operation) {
-
- String operationId = operation.getId();
- if (persistenceService.isFishingOperationWithCatchBatch(operationId)) {
-
- BatchContainer<BenthosBatch> benthosBatchContainer =
- persistenceService.getRootBenthosBatch(operationId, null);
-
- List<CatchRow> rows = Lists.newArrayList();
- List<CatchFrequencyRow> frequencyRows = Lists.newArrayList();
- List<AttachmentRow> attachmentRows = Lists.newArrayList();
-
- for (BenthosBatch batch : benthosBatchContainer.getChildren()) {
- createBenthosRow(batch, null, rows, frequencyRows, attachmentRows);
- }
-
- // export weights
- CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(operationId);
- CatchWeightsRow weights = new CatchWeightsRow();
- weights.setTotalSortedWeight(catchBatch.getBenthosTotalSortedWeight());
- weights.setInertWeight(catchBatch.getBenthosTotalInertWeight());
- weights.setLivingNotItemizedWeight(catchBatch.getBenthosTotalLivingNotItemizedWeight());
- exportOperation(weights, operation);
-
- exportCatches(file, BENTHOS_FILE, weights, rows, frequencyRows, attachmentRows);
- }
- }
-
- /**
- * Export marine litter batches.
- *
- * @param file the file to export the batches into
- * @param operation the operation to export
- */
- public void exportMarineLitter(File file, FishingOperation operation) {
-
- String operationId = operation.getId();
- if (persistenceService.isFishingOperationWithCatchBatch(operationId)) {
-
- BatchContainer<MarineLitterBatch> marineLitterBatchContainer =
- persistenceService.getRootMarineLitterBatch(operationId);
-
- List<MarineLitterRow> rows = Lists.newArrayList();
- List<AttachmentRow> attachmentRows = Lists.newArrayList();
-
- for (MarineLitterBatch batch : marineLitterBatchContainer.getChildren()) {
- MarineLitterRow row = new MarineLitterRow();
-
- String id = UUID.randomUUID().toString();
- row.setBatchId(id);
-
- row.setCategory(batch.getMarineLitterCategory());
- row.setSizeCategory(batch.getMarineLitterSizeCategory());
- row.setNumber(batch.getNumber());
- row.setWeight(batch.getWeight());
- row.setComment(batch.getComment());
-
- rows.add(row);
-
- addAttachments(id, batch.getIdAsInt(), AttachementObjectTypeEnum.BATCH, attachmentRows);
- }
-
- MarineLitterRowModel csvModel = new MarineLitterRowModel(csvSeparator);
-
- BufferedWriter writer = null;
- File directory = Files.createTempDir();
- List<File> file2zip = Lists.newArrayList();
-
- File speciesFile = new File(directory, MARINE_LITTER_FILE);
- file2zip.add(speciesFile);
- try {
- writer = Files.newWriter(speciesFile, Charsets.UTF_8);
- Export export = Export.newExport(csvModel, rows);
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.batches.error", speciesFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- // export weight
- CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(operationId);
- MarineLitterWeightRow weight = new MarineLitterWeightRow();
- weight.setTotalWeight(catchBatch.getMarineLitterTotalWeight());
- exportOperation(weight, operation);
-
- MarineLitterWeightRowModel weightModel = new MarineLitterWeightRowModel(csvSeparator);
-
- File weightFile = new File(directory, WEIGHTS_FILE);
- file2zip.add(weightFile);
- try {
- writer = Files.newWriter(weightFile, Charsets.UTF_8);
- Export export = Export.newExport(weightModel, Lists.newArrayList(weight));
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.weight.error", weightFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- exportAttachments(directory, file2zip, attachmentRows);
-
- try {
- ZipUtil.compressFiles(file, directory, file2zip);
-
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.error", file), e);
-
- } finally {
- TuttiIOUtil.deleteDirectory(directory, _("tutti.service.multipost.export.deleteTempDirectory.error", file));
- }
- }
- }
-
- /**
- * Export individual observation batches.
- *
- * @param file the file to export the batches into
- * @param operation the operation to export
- */
- public void exportIndividualObservation(File file, FishingOperation operation) {
- List<IndividualObservationBatch> individualObservations =
- persistenceService.getAllIndividualObservationBatch(operation.getId());
-
- List<IndividualObservationRow> rows = Lists.newArrayList();
- List<CaracteristicRow> caracteristicRows = Lists.newArrayList();
- List<AttachmentRow> attachmentRows = Lists.newArrayList();
-
- for (IndividualObservationBatch batch : individualObservations) {
- IndividualObservationRow row = new IndividualObservationRow();
-
- String id = UUID.randomUUID().toString();
- row.setBatchId(id);
-
- row.setSpecies(batch.getSpecies());
- row.setWeight(batch.getWeight());
- row.setSize(batch.getSize());
- row.setLengthStepCaracteristic(batch.getLengthStepCaracteristic());
- row.setSamplingCode(batch.getSamplingCode());
- row.setCalcifiedPieceSamplingCode(batch.getCalcifiedPieceSamplingCode());
- row.setComment(batch.getComment());
-
- rows.add(row);
-
- CaracteristicMap caracteristicMap = batch.getCaracteristics();
- for (Caracteristic caracteristic : caracteristicMap.keySet()) {
- CaracteristicRow caracteristicRow = new CaracteristicRow();
- caracteristicRow.setBatchId(id);
- caracteristicRow.setCaracteristic(caracteristic);
- caracteristicRow.setValue(caracteristicMap.get(caracteristic));
- caracteristicRows.add(caracteristicRow);
- }
-
- addAttachments(id, batch.getIdAsInt(), AttachementObjectTypeEnum.SAMPLE, attachmentRows);
- }
-
- IndividualObservationRowModel csvModel = new IndividualObservationRowModel(csvSeparator);
-
- BufferedWriter writer = null;
- File directory = Files.createTempDir();
- List<File> file2zip = Lists.newArrayList();
-
- File individualObservationFile = new File(directory, INDIVIDUAL_OBSERVATION_FILE);
- file2zip.add(individualObservationFile);
- try {
- writer = Files.newWriter(individualObservationFile, Charsets.UTF_8);
- Export export = Export.newExport(csvModel, rows);
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.batches.error", file), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- CaracteristicRowModel caracteristicCsvModel = new CaracteristicRowModel(csvSeparator);
- File caracteristicFile = new File(directory, CARACTERISTIC_FILE);
- file2zip.add(caracteristicFile);
- try {
- writer = Files.newWriter(caracteristicFile, Charsets.UTF_8);
- Export export = Export.newExport(caracteristicCsvModel, caracteristicRows);
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.batches.error", caracteristicFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- // export operation
- FishingOperationRow foRow = new FishingOperationRow();
- exportOperation(foRow, operation);
-
- FishingOperationRowModel foRowModel = new FishingOperationRowModel(csvSeparator);
-
- File weightFile = new File(directory, WEIGHTS_FILE);
- file2zip.add(weightFile);
- try {
- writer = Files.newWriter(weightFile, Charsets.UTF_8);
- Export export = Export.newExport(foRowModel, Lists.newArrayList(foRow));
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.operation.error", weightFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- exportAttachments(directory, file2zip, attachmentRows);
-
- try {
- ZipUtil.compressFiles(file, directory, file2zip);
-
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.error", file), e);
-
- } finally {
- TuttiIOUtil.deleteDirectory(directory, _("tutti.service.multipost.export.deleteTempDirectory.error", file));
- }
- }
-
- /**
- * Export accidental catch batches.
- *
- * @param file the file to export the batches into
- * @param operation the operation to export
- */
- public void exportAccidentalCatch(File file, FishingOperation operation) {
- List<AccidentalBatch> accidentalCatches =
- persistenceService.getAllAccidentalBatch(operation.getId());
-
- List<AccidentalCatchRow> rows = Lists.newArrayList();
- List<CaracteristicRow> caracteristicRows = Lists.newArrayList();
- List<AttachmentRow> attachmentRows = Lists.newArrayList();
-
- for (AccidentalBatch batch : accidentalCatches) {
- AccidentalCatchRow row = new AccidentalCatchRow();
-
- String id = UUID.randomUUID().toString();
- row.setBatchId(id);
-
- row.setSpecies(batch.getSpecies());
- row.setGender(batch.getGender());
- row.setWeight(batch.getWeight());
- row.setSize(batch.getSize());
- row.setLengthStepCaracteristic(batch.getLengthStepCaracteristic());
- row.setDeadOrAlive(batch.getDeadOrAlive());
- row.setComment(batch.getComment());
-
- rows.add(row);
-
- CaracteristicMap caracteristicMap = batch.getCaracteristics();
- for (Caracteristic caracteristic : caracteristicMap.keySet()) {
- CaracteristicRow caracteristicRow = new CaracteristicRow();
- caracteristicRow.setBatchId(id);
- caracteristicRow.setCaracteristic(caracteristic);
- caracteristicRow.setValue(caracteristicMap.get(caracteristic));
- caracteristicRows.add(caracteristicRow);
- }
-
- addAttachments(id, batch.getIdAsInt(), AttachementObjectTypeEnum.SAMPLE, attachmentRows);
- }
-
- AccidentalCatchRowModel csvModel = new AccidentalCatchRowModel(csvSeparator);
-
- BufferedWriter writer = null;
- File directory = Files.createTempDir();
- List<File> file2zip = Lists.newArrayList();
-
- File accidentalCatchesFile = new File(directory, ACCIDENTAL_CATCHES_FILE);
- file2zip.add(accidentalCatchesFile);
- try {
- writer = Files.newWriter(accidentalCatchesFile, Charsets.UTF_8);
- Export export = Export.newExport(csvModel, rows);
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.batches.error", file), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- CaracteristicRowModel caracteristicCsvModel = new CaracteristicRowModel(csvSeparator);
- File caracteristicFile = new File(directory, CARACTERISTIC_FILE);
- file2zip.add(caracteristicFile);
- try {
- writer = Files.newWriter(caracteristicFile, Charsets.UTF_8);
- Export export = Export.newExport(caracteristicCsvModel, caracteristicRows);
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.batches.error", caracteristicFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- // export operation
- FishingOperationRow foRow = new FishingOperationRow();
- exportOperation(foRow, operation);
-
- FishingOperationRowModel foRowModel = new FishingOperationRowModel(csvSeparator);
-
- File weightFile = new File(directory, WEIGHTS_FILE);
- file2zip.add(weightFile);
- try {
- writer = Files.newWriter(weightFile, Charsets.UTF_8);
- Export export = Export.newExport(foRowModel, Lists.newArrayList(foRow));
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.operation.error", weightFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- exportAttachments(directory, file2zip, attachmentRows);
-
- try {
- ZipUtil.compressFiles(file, directory, file2zip);
-
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.error", file), e);
-
- } finally {
- TuttiIOUtil.deleteDirectory(directory, _("tutti.service.multipost.export.deleteTempDirectory.error", file));
- }
- }
-
- /**
- * Import species batches from a satellite post
- *
- * @param file the file to import the batches from
- * @param operation the operation in which to add the batches
- * @return the list of the species which have not been imported, because there were concurrent batches
- */
- public Map<String, Object> importSpecies(File file, FishingOperation operation) {
-
- Map<String, Object> notImportedData = Maps.newHashMap();
- final Map<String, SpeciesBatch> notImportedBatches = Maps.newLinkedHashMap();
-
- BatchContainer<SpeciesBatch> speciesBatches =
- persistenceService.getRootSpeciesBatch(operation.getId(), null);
-
- TuttiDataContext dataContext = context.getDataContext();
- List<Species> speciesList = dataContext.getReferentSpecies();
-
- // map containing the batches by their persistence id
- final Map<String, SpeciesBatch> batches = Maps.newHashMap();
-
- File tempDir = Files.createTempDir();
-
- try {
- ZipUtil.uncompress(file, tempDir);
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.uncompress.error", file));
- }
-
- //check operation
- CatchWeightsRowModel weightsModel = new CatchWeightsRowModel(csvSeparator);
- checkSameOperation(tempDir, weightsModel, operation);
-
- // Import batches
-
- File speciesFile = new File(tempDir, SPECIES_FILE);
-
- Reader reader = null;
- try {
- reader = Files.newReader(speciesFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.batches.error", speciesFile), e);
- }
-
- CatchRowModel csvModel = new CatchRowModel(csvSeparator,
- speciesList);
-
- Import<CatchRow> importer = Import.newImport(csvModel, reader);
-
- for (CatchRow row : importer) {
-
- // create batch
- SpeciesBatch batch = TuttiBeanFactory.newSpeciesBatch();
- batch.setFishingOperation(operation);
-
- Species species = row.getSpecies();
- batch.setSpecies(row.getSpecies());
- batch.setWeight(row.getWeight());
- batch.setNumber(row.getNumber());
- batch.setComment(row.getComment());
- batch.setSpeciesToConfirm(row.isToConfirm());
-
- Pair<Integer, Serializable> valueAndCategoryType = getValueAndCategoryType(row);
- Integer categoryId = valueAndCategoryType.getKey();
- Serializable value = valueAndCategoryType.getValue();
-
- batch.setSampleCategoryId(categoryId);
- batch.setSampleCategoryValue(value);
- batch.setSampleCategoryWeight(row.getCategoryWeight());
-
- // get parent batch
- String parentId = row.getParentId();
- String parentPersistedId = null;
- SpeciesBatch parent = null;
- if (StringUtils.isNotEmpty(parentId)) {
- parent = batches.get(parentId);
- parentPersistedId = parent.getId();
- }
-
- SpeciesBatch existingBatch = null;
- List<SpeciesBatch> batchesToBrowse;
- if (parent == null) {
- batchesToBrowse = speciesBatches.getChildren();
- } else {
- batchesToBrowse = parent.getChildBatchs();
- }
-
- // check if the parent has already a batch with the caracteristic value
- // and if the children batch are categorized with the same caracterstic
- if (batchesToBrowse != null) {
- for (SpeciesBatch sb : batchesToBrowse) {
- if (sb.getSpecies().equals(species)
- && (!sb.getSampleCategoryId().equals(batch.getSampleCategoryId())
- || sb.getSampleCategoryValue().equals(value))) {
-
- existingBatch = sb;
- batches.put(row.getId(), sb);
- notImportedBatches.put(row.getId(), batch);
- break;
- }
- }
- }
-
- if (existingBatch == null) {
- batch = persistenceService.createSpeciesBatch(batch, parentPersistedId);
- batches.put(row.getId(), batch);
- }
- }
-
- // Import frequencies
-
- File frequencyFile = new File(tempDir, FREQUENCIES_FILE);
- try {
- reader = Files.newReader(frequencyFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.frequencies.error", frequencyFile), e);
- }
-
- CatchFrequencyRowModel frequencyModel = new CatchFrequencyRowModel(csvSeparator,
- dataContext.getCaracteristics());
-
- Import<CatchFrequencyRow> frequencyImporter = Import.newImport(frequencyModel, reader);
-
- ListMultimap<String, SpeciesBatchFrequency> frequencyMap = ArrayListMultimap.create();
-
- for (CatchFrequencyRow frequencyRow : frequencyImporter) {
- if (notImportedBatches.get(frequencyRow.getBatchId()) == null) {
- SpeciesBatch batch = batches.get(frequencyRow.getBatchId());
- if (batch != null) {
- SpeciesBatchFrequency frequency = TuttiBeanFactory.newSpeciesBatchFrequency();
- frequency.setLengthStepCaracteristic(frequencyRow.getLengthStepCaracteristic());
- frequency.setLengthStep(frequencyRow.getLengthStep());
- frequency.setNumber(frequencyRow.getNumber());
- frequency.setWeight(frequencyRow.getWeight());
- frequency.setBatch(batch);
- frequencyMap.put(batch.getId(), frequency);
- }
- }
- }
- for (String batchId : frequencyMap.keySet()) {
- List<SpeciesBatchFrequency> frequencies = frequencyMap.get(batchId);
- persistenceService.saveSpeciesBatchFrequency(batchId, frequencies);
- }
-
- // Import attachments
- Function<AttachmentRow, Integer> getObjetcIdFunction = new Function<AttachmentRow, Integer>() {
- @Override
- public Integer apply(AttachmentRow input) {
- Integer result = null;
- if (notImportedBatches.get(input.getBatchId()) == null) {
- SpeciesBatch batch = batches.get(input.getBatchId());
- if (batch != null) {
- result = batch.getIdAsInt();
- }
- }
- return result;
- }
- };
- importAttachments(tempDir, getObjetcIdFunction, AttachementObjectTypeEnum.BATCH);
-
- // import weights
- File weightsFile = new File(tempDir, WEIGHTS_FILE);
- try {
- reader = Files.newReader(weightsFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.weights.error", weightsFile), e);
- }
-
- Import<CatchWeightsRow> weights = Import.newImport(weightsModel, reader);
-
- Iterator<CatchWeightsRow> iterator = weights.iterator();
- if (iterator.hasNext()) {
- CatchWeightsRow row = iterator.next();
- CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(operation.getId());
- catchBatch.setFishingOperation(operation);
-
- if (catchBatch.getSpeciesTotalSortedWeight() == null) {
- catchBatch.setSpeciesTotalSortedWeight(row.getTotalSortedWeight());
-
- } else if (row.getTotalSortedWeight() != null) {
- notImportedData.put(CatchBatch.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT, row.getTotalSortedWeight());
- }
-
- if (catchBatch.getSpeciesTotalInertWeight() == null) {
- catchBatch.setSpeciesTotalInertWeight(row.getInertWeight());
-
- } else if (row.getInertWeight() != null) {
- notImportedData.put(CatchBatch.PROPERTY_SPECIES_TOTAL_INERT_WEIGHT, row.getInertWeight());
- }
-
- if (catchBatch.getSpeciesTotalLivingNotItemizedWeight() == null) {
- catchBatch.setSpeciesTotalLivingNotItemizedWeight(row.getLivingNotItemizedWeight());
-
- } else if (row.getLivingNotItemizedWeight() != null) {
- notImportedData.put(CatchBatch.PROPERTY_SPECIES_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT,
- row.getLivingNotItemizedWeight());
- }
- persistenceService.saveCatchBatch(catchBatch);
- }
-
- notImportedData.put(BATCHES_KEY, notImportedBatches.values());
- return notImportedData;
- }
-
- /**
- * Import benthos batches from a satellite post
- *
- * @param file the file to import the batches from
- * @param operation the operation in which to add the batches
- * @return the list of the benthos which have not been imported, because there were concurrent batches
- */
- public Map<String, Object> importBenthos(File file, FishingOperation operation) {
-
- Map<String, Object> notImportedData = Maps.newHashMap();
- final Map<String, BenthosBatch> notImportedBatches = Maps.newLinkedHashMap();
-
- BatchContainer<BenthosBatch> benthosBatches =
- persistenceService.getRootBenthosBatch(operation.getId(), null);
-
- TuttiDataContext dataContext = context.getDataContext();
- List<Species> speciesList = dataContext.getReferentSpecies();
-
- // map containing the batches by their persistence id
- final Map<String, BenthosBatch> batches = Maps.newHashMap();
-
- File tempDir = Files.createTempDir();
- try {
- ZipUtil.uncompress(file, tempDir);
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.uncompress.error", file));
- }
-
- //check operation
- CatchWeightsRowModel weightsModel = new CatchWeightsRowModel(csvSeparator);
- checkSameOperation(tempDir, weightsModel, operation);
-
- // Import batches
-
- File benthosFile = new File(tempDir, BENTHOS_FILE);
-
- Reader reader = null;
- try {
- reader = Files.newReader(benthosFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.batches.error", benthosFile), e);
- }
-
- CatchRowModel csvModel = new CatchRowModel(csvSeparator,
- speciesList);
-
- Import<CatchRow> importer = Import.newImport(csvModel, reader);
-
- for (CatchRow row : importer) {
-
- // create batch
- BenthosBatch batch = TuttiBeanFactory.newBenthosBatch();
- batch.setFishingOperation(operation);
-
- Species species = row.getSpecies();
- batch.setSpecies(row.getSpecies());
- batch.setWeight(row.getWeight());
- batch.setNumber(row.getNumber());
- batch.setComment(row.getComment());
- batch.setSpeciesToConfirm(row.isToConfirm());
-
- Pair<Integer, Serializable> valueAndCategoryType = getValueAndCategoryType(row);
- Integer categoryId = valueAndCategoryType.getKey();
- Serializable value = valueAndCategoryType.getValue();
-
- batch.setSampleCategoryId(categoryId);
-// batch.setSampleCategoryType(categoryType);
- batch.setSampleCategoryValue(value);
- batch.setSampleCategoryWeight(row.getCategoryWeight());
-
- // get parent batch
- String parentId = row.getParentId();
- String parentPersistedId = null;
- BenthosBatch parent = null;
- if (StringUtils.isNotEmpty(parentId)) {
- parent = batches.get(parentId);
- parentPersistedId = parent.getId();
- }
-
- BenthosBatch existingBatch = null;
- List<BenthosBatch> batchesToBrowse;
- if (parent == null) {
- batchesToBrowse = benthosBatches.getChildren();
- } else {
- batchesToBrowse = parent.getChildBatchs();
- }
-
- // check if the parent has already a batch with the caracteristic value
- // and if the children batch are categorized with the same caracterstic
- if (batchesToBrowse != null) {
- for (BenthosBatch bb : batchesToBrowse) {
- if (bb.getSpecies().equals(species)
- && (!bb.getSampleCategoryId().equals(batch.getSampleCategoryId())
- || bb.getSampleCategoryValue().equals(value))) {
-
- existingBatch = bb;
- batches.put(row.getId(), bb);
- notImportedBatches.put(row.getId(), batch);
- break;
- }
- }
- }
-
- if (existingBatch == null) {
- batch = persistenceService.createBenthosBatch(batch, parentPersistedId);
- batches.put(row.getId(), batch);
- }
- }
-
- // Import frequencies
-
- File frequencyFile = new File(tempDir, FREQUENCIES_FILE);
- try {
- reader = Files.newReader(frequencyFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.frequencies.error", frequencyFile), e);
- }
-
- CatchFrequencyRowModel frequencyModel = new CatchFrequencyRowModel(csvSeparator,
- dataContext.getCaracteristics());
-
- Import<CatchFrequencyRow> frequencyImporter = Import.newImport(frequencyModel, reader);
-
- ListMultimap<String, BenthosBatchFrequency> frequencyMap = ArrayListMultimap.create();
-
- for (CatchFrequencyRow frequencyRow : frequencyImporter) {
- if (notImportedBatches.get(frequencyRow.getBatchId()) == null) {
- BenthosBatch batch = batches.get(frequencyRow.getBatchId());
- if (batch != null) {
- BenthosBatchFrequency frequency = TuttiBeanFactory.newBenthosBatchFrequency();
- frequency.setLengthStepCaracteristic(frequencyRow.getLengthStepCaracteristic());
- frequency.setLengthStep(frequencyRow.getLengthStep());
- frequency.setNumber(frequencyRow.getNumber());
- frequency.setWeight(frequencyRow.getWeight());
- frequency.setBatch(batch);
- frequencyMap.put(batch.getId(), frequency);
- }
- }
- }
- for (String batchId : frequencyMap.keySet()) {
- List<BenthosBatchFrequency> frequencies = frequencyMap.get(batchId);
- persistenceService.saveBenthosBatchFrequency(batchId, frequencies);
- }
-
- // Import attachments
- Function<AttachmentRow, Integer> getObjetcIdFunction = new Function<AttachmentRow, Integer>() {
- @Override
- public Integer apply(AttachmentRow input) {
- Integer result = null;
- if (notImportedBatches.get(input.getBatchId()) == null) {
- BenthosBatch batch = batches.get(input.getBatchId());
- if (batch != null) {
- result = batch.getIdAsInt();
- }
- }
- return result;
- }
- };
- importAttachments(tempDir, getObjetcIdFunction, AttachementObjectTypeEnum.BATCH);
-
- // import weights
- File weightsFile = new File(tempDir, WEIGHTS_FILE);
- try {
- reader = Files.newReader(weightsFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.weights.error", weightsFile), e);
- }
-
- Import<CatchWeightsRow> weights = Import.newImport(weightsModel, reader);
-
- Iterator<CatchWeightsRow> iterator = weights.iterator();
- if (iterator.hasNext()) {
- CatchWeightsRow row = iterator.next();
- CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(operation.getId());
- catchBatch.setFishingOperation(operation);
-
- if (catchBatch.getBenthosTotalSortedWeight() == null) {
- catchBatch.setBenthosTotalSortedWeight(row.getTotalSortedWeight());
-
- } else if (row.getTotalSortedWeight() != null) {
- notImportedData.put(CatchBatch.PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT, row.getTotalSortedWeight());
- }
-
- if (catchBatch.getBenthosTotalInertWeight() == null) {
- catchBatch.setBenthosTotalInertWeight(row.getInertWeight());
-
- } else if (row.getInertWeight() != null) {
- notImportedData.put(CatchBatch.PROPERTY_BENTHOS_TOTAL_INERT_WEIGHT, row.getInertWeight());
- }
-
- if (catchBatch.getBenthosTotalLivingNotItemizedWeight() == null) {
- catchBatch.setBenthosTotalLivingNotItemizedWeight(row.getLivingNotItemizedWeight());
-
- } else if (row.getLivingNotItemizedWeight() != null) {
- notImportedData.put(CatchBatch.PROPERTY_BENTHOS_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT,
- row.getLivingNotItemizedWeight());
- }
-
- persistenceService.saveCatchBatch(catchBatch);
- }
-
- notImportedData.put(BATCHES_KEY, notImportedBatches.values());
- return notImportedData;
- }
-
- /**
- * Import marine litter batches from a satellite post
- *
- * @param file the file to import the batches from
- * @param operation the operation in which to add the batches
- * @return the list of the marine litter which have not been imported, because there were concurrent batches
- */
- public Map<String, Object> importMarineLitter(File file, FishingOperation operation) {
-
- String operationId = operation.getId();
-
- Map<String, Object> notImportedData = Maps.newHashMap();
- final Map<String, MarineLitterBatch> notImportedBatches = Maps.newLinkedHashMap();
-
- BatchContainer<MarineLitterBatch> marineLitterBatches =
- persistenceService.getRootMarineLitterBatch(operationId);
-
- // map containing the batches by their persistence id
- final Map<String, MarineLitterBatch> batches = Maps.newHashMap();
-
- File tempDir = Files.createTempDir();
- try {
- ZipUtil.uncompress(file, tempDir);
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.uncompress.error", file));
- }
-
- //check operation
- MarineLitterWeightRowModel weightModel = new MarineLitterWeightRowModel(csvSeparator);
- checkSameOperation(tempDir, weightModel, operation);
-
- // Import batches
-
- File marineLitterFile = new File(tempDir, MARINE_LITTER_FILE);
-
- Reader reader = null;
- try {
- reader = Files.newReader(marineLitterFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.batches.error", marineLitterFile), e);
- }
-
- List<CaracteristicQualitativeValue> categoryValues =
- persistenceService.getMarineLitterCategoryCaracteristic().getQualitativeValue();
- List<CaracteristicQualitativeValue> sizeCategoryValues =
- persistenceService.getMarineLitterSizeCategoryCaracteristic().getQualitativeValue();
-
- MarineLitterRowModel csvModel = new MarineLitterRowModel(csvSeparator,
- categoryValues,
- sizeCategoryValues);
-
- Import<MarineLitterRow> importer = Import.newImport(csvModel, reader);
-
- for (MarineLitterRow row : importer) {
-
- // create batch
- MarineLitterBatch batch = TuttiBeanFactory.newMarineLitterBatch();
- batch.setFishingOperation(operation);
-
- batch.setWeight(row.getWeight());
- batch.setNumber(row.getNumber());
- batch.setComment(row.getComment());
- batch.setMarineLitterCategory(row.getCategory());
- batch.setMarineLitterSizeCategory(row.getSizeCategory());
-
- MarineLitterBatch existingBatch = null;
- List<MarineLitterBatch> batchesToBrowse = marineLitterBatches.getChildren();
-
- // check if the parent has already a batch with the caracteristic value
- // and if the children batch are categorized with the same caracterstic
- if (batchesToBrowse != null) {
- for (MarineLitterBatch mlb : batchesToBrowse) {
- if (mlb.getMarineLitterCategory().equals(batch.getMarineLitterCategory())
- && mlb.getMarineLitterSizeCategory().equals(batch.getMarineLitterSizeCategory())) {
-
- existingBatch = mlb;
- batches.put(row.getBatchId(), mlb);
- notImportedBatches.put(row.getBatchId(), batch);
- break;
- }
- }
- }
-
- if (existingBatch == null) {
- batch = persistenceService.createMarineLitterBatch(batch);
- batches.put(row.getBatchId(), batch);
- }
- }
-
- // Import attachments
- Function<AttachmentRow, Integer> getObjetcIdFunction = new Function<AttachmentRow, Integer>() {
- @Override
- public Integer apply(AttachmentRow input) {
- Integer result = null;
- if (notImportedBatches.get(input.getBatchId()) == null) {
- MarineLitterBatch batch = batches.get(input.getBatchId());
- if (batch != null) {
- result = batch.getIdAsInt();
- }
- }
- return result;
- }
- };
- importAttachments(tempDir, getObjetcIdFunction, AttachementObjectTypeEnum.BATCH);
-
- // import weights
- File weightsFile = new File(tempDir, WEIGHTS_FILE);
- try {
- reader = Files.newReader(weightsFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.weights.error", weightsFile), e);
- }
-
- Import<MarineLitterWeightRow> weight = Import.newImport(weightModel, reader);
-
- Iterator<MarineLitterWeightRow> iterator = weight.iterator();
- if (iterator.hasNext()) {
- MarineLitterWeightRow row = iterator.next();
- CatchBatch catchBatch = persistenceService.getCatchBatchFromFishingOperation(operationId);
- catchBatch.setFishingOperation(operation);
-
- if (catchBatch.getMarineLitterTotalWeight() == null) {
- catchBatch.setMarineLitterTotalWeight(row.getTotalWeight());
-
- } else if (row.getTotalWeight() != null) {
- notImportedData.put(CatchBatch.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT, row.getTotalWeight());
- }
-
- persistenceService.saveCatchBatch(catchBatch);
- }
-
- notImportedData.put(BATCHES_KEY, notImportedBatches.values());
- return notImportedData;
- }
-
- /**
- * Import individual observation batches from a satellite post
- *
- * @param file the file to import the batches from
- * @param operation the operation in which to add the batches
- */
- public void importIndividualObservation(File file, FishingOperation operation) {
-
- // map containing the batches by their persistence id
- final Map<String, IndividualObservationBatch> batches = Maps.newLinkedHashMap();
-
- File tempDir = Files.createTempDir();
- try {
- ZipUtil.uncompress(file, tempDir);
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.uncompress.error", file));
- }
-
- //check operation
- FishingOperationRowModel operationModel = new FishingOperationRowModel(csvSeparator);
- checkSameOperation(tempDir, operationModel, operation);
-
- // Import batches
-
- File observationFile = new File(tempDir, INDIVIDUAL_OBSERVATION_FILE);
-
- Reader reader = null;
- try {
- reader = Files.newReader(observationFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.batches.error", observationFile), e);
- }
-
- TuttiDataContext dataContext = context.getDataContext();
- List<Species> speciesList = dataContext.getReferentSpecies();
- List<Caracteristic> caracteristics = dataContext.getCaracteristicWithProtected();
-
- IndividualObservationRowModel csvModel = new IndividualObservationRowModel(csvSeparator,
- speciesList,
- caracteristics);
- Import<IndividualObservationRow> importer = Import.newImport(csvModel, reader);
-
- for (IndividualObservationRow row : importer) {
-
- // create batch
- IndividualObservationBatch batch = TuttiBeanFactory.newIndividualObservationBatch();
- batch.setFishingOperation(operation);
-
- batch.setSpecies(row.getSpecies());
- batch.setWeight(row.getWeight());
- batch.setSize(row.getSize());
- batch.setLengthStepCaracteristic(row.getLengthStepCaracteristic());
- batch.setSamplingCode(row.getSamplingCode());
- batch.setCalcifiedPieceSamplingCode(row.getCalcifiedPieceSamplingCode());
- batch.setComment(row.getComment());
- batch.setCaracteristics(new CaracteristicMap());
-
- batches.put(row.getBatchId(), batch);
- }
-
- // Import caracteristics
-
- File caracteristicFile = new File(tempDir, CARACTERISTIC_FILE);
- try {
- reader = Files.newReader(caracteristicFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.caracteristics.error", caracteristicFile), e);
- }
-
- CaracteristicRowModel caracteristicModel = new CaracteristicRowModel(csvSeparator,
- caracteristics);
-
- Import<CaracteristicRow> caracteristicImporter = Import.newImport(caracteristicModel, reader);
-
- for (CaracteristicRow caracteristicRow : caracteristicImporter) {
- IndividualObservationBatch batch = batches.get(caracteristicRow.getBatchId());
- if (batch != null) {
- Caracteristic caracteristic = caracteristicRow.getCaracteristic();
- Serializable value = caracteristicRow.getValue();
-
- switch (caracteristic.getCaracteristicType()) {
- case QUALITATIVE:
- value = TuttiEntities.getQualitativeValue(caracteristic, Integer.parseInt(value.toString()));
- break;
-
- case NUMBER:
- value = Float.parseFloat(value.toString());
- break;
- }
- CaracteristicMap map = batch.getCaracteristics();
- map.put(caracteristic, value);
- }
- }
- for (IndividualObservationBatch batch : batches.values()) {
- persistenceService.createIndividualObservationBatch(batch);
- }
-
- // Import attachments
- Function<AttachmentRow, Integer> getObjetcIdFunction = new Function<AttachmentRow, Integer>() {
- @Override
- public Integer apply(AttachmentRow input) {
- Integer result = null;
- IndividualObservationBatch batch = batches.get(input.getBatchId());
- if (batch != null) {
- result = batch.getIdAsInt();
- }
- return result;
- }
- };
- importAttachments(tempDir, getObjetcIdFunction, AttachementObjectTypeEnum.SAMPLE);
- }
-
- /**
- * Import accidental catches batches from a satellite post
- *
- * @param file the file to import the batches from
- * @param operation the operation in which to add the batches
- */
- public void importAccidentalCatches(File file, FishingOperation operation) {
-
- // map containing the batches by their persistence id
- final Map<String, AccidentalBatch> batches = Maps.newLinkedHashMap();
-
- File tempDir = Files.createTempDir();
- try {
- ZipUtil.uncompress(file, tempDir);
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.uncompress.error", file));
- }
-
- //check operation
- FishingOperationRowModel operationModel = new FishingOperationRowModel(csvSeparator);
- checkSameOperation(tempDir, operationModel, operation);
-
- // Import batches
-
- File accidentalFile = new File(tempDir, ACCIDENTAL_CATCHES_FILE);
-
- Reader reader = null;
- try {
- reader = Files.newReader(accidentalFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.batches.error", accidentalFile), e);
- }
-
- TuttiDataContext dataContext = context.getDataContext();
- List<Species> speciesList = dataContext.getReferentSpecies();
- List<CaracteristicQualitativeValue> genderValues = dataContext.getGenderValues();
- List<Caracteristic> caracteristics = dataContext.getCaracteristicWithProtected();
- List<CaracteristicQualitativeValue> dedOrAliveValues = dataContext.getDeadOrAliveValues();
-
- AccidentalCatchRowModel csvModel = new AccidentalCatchRowModel(csvSeparator,
- speciesList,
- genderValues,
- caracteristics,
- dedOrAliveValues);
- Import<AccidentalCatchRow> importer = Import.newImport(csvModel, reader);
-
- for (AccidentalCatchRow row : importer) {
-
- // create batch
- AccidentalBatch batch = TuttiBeanFactory.newAccidentalBatch();
- batch.setFishingOperation(operation);
-
- batch.setSpecies(row.getSpecies());
- batch.setGender(row.getGender());
- batch.setWeight(row.getWeight());
- batch.setSize(row.getSize());
- batch.setLengthStepCaracteristic(row.getLengthStepCaracteristic());
- batch.setDeadOrAlive(row.getDeadOrAlive());
- batch.setComment(row.getComment());
- batch.setCaracteristics(new CaracteristicMap());
-
- batches.put(row.getBatchId(), batch);
- }
-
- // Import caracteristics
-
- File caracteristicFile = new File(tempDir, CARACTERISTIC_FILE);
- try {
- reader = Files.newReader(caracteristicFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.caracteristics.error", caracteristicFile), e);
- }
-
- CaracteristicRowModel caracteristicModel = new CaracteristicRowModel(csvSeparator,
- caracteristics);
-
- Import<CaracteristicRow> caracteristicImporter = Import.newImport(caracteristicModel, reader);
-
- for (CaracteristicRow caracteristicRow : caracteristicImporter) {
- AccidentalBatch batch = batches.get(caracteristicRow.getBatchId());
- if (batch != null) {
- Caracteristic caracteristic = caracteristicRow.getCaracteristic();
- Serializable value = caracteristicRow.getValue();
-
- switch (caracteristic.getCaracteristicType()) {
- case QUALITATIVE:
- value = TuttiEntities.getQualitativeValue(caracteristic, Integer.parseInt(value.toString()));
- break;
-
- case NUMBER:
- value = Float.parseFloat(value.toString());
- break;
- }
- CaracteristicMap map = batch.getCaracteristics();
- map.put(caracteristic, value);
- }
- }
- for (AccidentalBatch batch : batches.values()) {
- persistenceService.createAccidentalBatch(batch);
- }
-
- // Import attachments
- Function<AttachmentRow, Integer> getObjetcIdFunction = new Function<AttachmentRow, Integer>() {
- @Override
- public Integer apply(AttachmentRow input) {
- Integer result = null;
- AccidentalBatch batch = batches.get(input.getBatchId());
- if (batch != null) {
- result = batch.getIdAsInt();
- }
- return result;
- }
- };
- importAttachments(tempDir, getObjetcIdFunction, AttachementObjectTypeEnum.SAMPLE);
- }
-
- /*
- * Protected methods
- */
-
- protected void exportCatches(File file,
- String batchFile,
- CatchWeightsRow weights,
- List<CatchRow> rows,
- List<CatchFrequencyRow> frequencyRows,
- List<AttachmentRow> attachmentRows) {
- CatchRowModel csvModel = new CatchRowModel(csvSeparator);
- CatchFrequencyRowModel csvFrequencyModel = new CatchFrequencyRowModel(csvSeparator);
- CatchWeightsRowModel catchWeightsModel = new CatchWeightsRowModel(csvSeparator);
-
- BufferedWriter writer = null;
- File directory = Files.createTempDir();
- List<File> file2zip = Lists.newArrayList();
-
- File weightsFile = new File(directory, WEIGHTS_FILE);
- file2zip.add(weightsFile);
- try {
- writer = Files.newWriter(weightsFile, Charsets.UTF_8);
- Export export = Export.newExport(catchWeightsModel, Lists.newArrayList(weights));
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.weights.error", weightsFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- File speciesFile = new File(directory, batchFile);
- file2zip.add(speciesFile);
- try {
- writer = Files.newWriter(speciesFile, Charsets.UTF_8);
- Export export = Export.newExport(csvModel, rows);
- export.write(writer);
- writer.close();
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.batches.error", file), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- File frequencyFile = new File(directory, FREQUENCIES_FILE);
- file2zip.add(frequencyFile);
- try {
- writer = Files.newWriter(frequencyFile, Charsets.UTF_8);
- Export export = Export.newExport(csvFrequencyModel, frequencyRows);
- export.write(writer);
- writer.close();
-
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.frequencies.error", frequencyFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
-
- exportAttachments(directory, file2zip, attachmentRows);
-
- try {
- ZipUtil.compressFiles(file, directory, file2zip);
-
- } catch (IOException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.error", file), e);
-
- } finally {
- TuttiIOUtil.deleteDirectory(directory, _("tutti.service.multipost.export.deleteTempDirectory.error", file));
- }
- }
-
- protected void createSpeciesRow(SpeciesBatch batch,
- String parentId,
- List<CatchRow> rows,
- List<CatchFrequencyRow> frequencyRows,
- List<AttachmentRow> attachmentRows) {
- CatchRow row = new CatchRow();
-
- String id = UUID.randomUUID().toString();
- row.setId(id);
- row.setParentId(parentId);
- row.setSpecies(batch.getSpecies());
-
- row.setCategoryId(batch.getSampleCategoryId());
- row.setCategoryValue(batch.getSampleCategoryValue());
-
-// switch (batch.getSampleCategoryType()) {
-// case sortedUnsorted:
-// row.setSortedUnsortedSampleCategory(batch.getSampleCategoryValue());
-// break;
-// case sex:
-// row.setSexSampleCategory(batch.getSampleCategoryValue());
-// break;
-// case size:
-// row.setSizeSampleCategory(batch.getSampleCategoryValue());
-// break;
-// case maturity:
-// row.setMaturitySampleCategory(batch.getSampleCategoryValue());
-// break;
-// case age:
-// row.setAgeSampleCategory(batch.getSampleCategoryValue());
-// break;
-// }
- row.setCategoryWeight(batch.getSampleCategoryWeight());
- row.setWeight(batch.getWeight());
- row.setNumber(batch.getNumber());
- row.setComment(batch.getComment());
- row.setToConfirm(batch.isSpeciesToConfirm());
-
- rows.add(row);
-
- addFrequencies(id, batch.getId(), frequencyRows);
- addAttachments(id, batch.getIdAsInt(), AttachementObjectTypeEnum.BATCH, attachmentRows);
-
- for (SpeciesBatch child : batch.getChildBatchs()) {
- createSpeciesRow(child, id, rows, frequencyRows, attachmentRows);
- }
- }
-
- protected void createBenthosRow(BenthosBatch batch,
- String parentId,
- List<CatchRow> rows,
- List<CatchFrequencyRow> frequencyRows,
- List<AttachmentRow> attachmentRows) {
- CatchRow row = new CatchRow();
-
- String id = UUID.randomUUID().toString();
- row.setId(id);
- row.setParentId(parentId);
- row.setSpecies(batch.getSpecies());
-
- row.setCategoryId(batch.getSampleCategoryId());
- row.setCategoryValue(batch.getSampleCategoryValue());
-
-// switch (batch.getSampleCategoryType()) {
-// case sortedUnsorted:
-// row.setSortedUnsortedSampleCategory(batch.getSampleCategoryValue());
-// break;
-// case sex:
-// row.setSexSampleCategory(batch.getSampleCategoryValue());
-// break;
-// case size:
-// row.setSizeSampleCategory(batch.getSampleCategoryValue());
-// break;
-// case maturity:
-// row.setMaturitySampleCategory(batch.getSampleCategoryValue());
-// break;
-// case age:
-// row.setAgeSampleCategory(batch.getSampleCategoryValue());
-// break;
-// }
- row.setCategoryWeight(batch.getSampleCategoryWeight());
- row.setWeight(batch.getWeight());
- row.setNumber(batch.getNumber());
- row.setComment(batch.getComment());
- row.setToConfirm(batch.isSpeciesToConfirm());
-
- rows.add(row);
-
- addFrequencies(id, batch.getId(), frequencyRows);
- addAttachments(id, batch.getIdAsInt(), AttachementObjectTypeEnum.BATCH, attachmentRows);
-
- for (BenthosBatch child : batch.getChildBatchs()) {
- createBenthosRow(child, id, rows, frequencyRows, attachmentRows);
- }
- }
-
- protected void exportOperation(AbstractFishingOperationRow afoRow, FishingOperation operation) {
- afoRow.setStationNumber(operation.getStationNumber());
- afoRow.setOperationNumber(operation.getFishingOperationNumber());
- afoRow.setMultirigAggregation(operation.getMultirigAggregation());
- afoRow.setDate(operation.getGearShootingStartDate());
- }
-
- protected void exportAttachments(File directory, List<File> file2zip, List<AttachmentRow> attachmentRows) {
-
- AttachmentRowModel csvAttachmentModel = new AttachmentRowModel(csvSeparator);
-
- File attachmentDirectory = new File(directory, ATTACHMENTS_DIRECTORY);
- attachmentDirectory.mkdir();
- file2zip.add(attachmentDirectory);
- for (AttachmentRow attachmentRow : attachmentRows) {
- File attachmentFile = attachmentRow.getFile();
- File destFile = new File(attachmentDirectory, attachmentFile.getName());
- TuttiIOUtil.copyFile(attachmentFile,
- destFile,
- _("tutti.service.multipost.attachment.copy.error", attachmentFile));
- file2zip.add(destFile);
- }
-
- File attachmentFile = new File(directory, ATTACHMENTS_FILE);
- file2zip.add(attachmentFile);
- Writer writer = null;
- try {
- writer = Files.newWriter(attachmentFile, Charsets.UTF_8);
- Export export = Export.newExport(csvAttachmentModel, attachmentRows);
- export.write(writer);
- writer.close();
-
- } catch (Exception e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.export.attachments.error", attachmentFile), e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
- }
-
- protected void addFrequencies(String rowId,
- String batchId,
- List<CatchFrequencyRow> frequencyRows) {
- List<SpeciesBatchFrequency> frequencies =
- persistenceService.getAllSpeciesBatchFrequency(batchId);
- for (SpeciesBatchFrequency frequency : frequencies) {
- CatchFrequencyRow frequencyRow = new CatchFrequencyRow();
- frequencyRow.setBatchId(rowId);
- frequencyRow.setLengthStepCaracteristic(frequency.getLengthStepCaracteristic());
- frequencyRow.setLengthStep(frequency.getLengthStep());
- frequencyRow.setNumber(frequency.getNumber());
- frequencyRow.setWeight(frequency.getWeight());
- frequencyRows.add(frequencyRow);
- }
- }
-
- protected void addAttachments(String batchId,
- int objectId,
- AttachementObjectTypeEnum objectType,
- List<AttachmentRow> attachmentRows) {
- List<Attachment> attachments =
- persistenceService.getAllAttachments(objectType, objectId);
- for (Attachment attachment : attachments) {
- AttachmentRow attachmentRow = new AttachmentRow();
- attachmentRow.setBatchId(batchId);
- attachmentRow.setName(attachment.getName());
- attachmentRow.setComment(attachment.getComment());
- attachmentRow.setFile(persistenceService.getAttachmentFile(attachment.getId()));
- attachmentRows.add(attachmentRow);
- }
- }
-
- protected Pair<Integer, Serializable> getValueAndCategoryType(CatchRow row) {
-
-// String sortedUnsortedValue = (String) row.getSortedUnsortedSampleCategory();
-// String sizeValue = (String) row.getSizeSampleCategory();
-// String sexValue = (String) row.getSexSampleCategory();
-// String maturityValue = (String) row.getMaturitySampleCategory();
-// String ageValue = (String) row.getAgeSampleCategory();
-
- Serializable value = row.getCategoryValue();
- Integer categoryId = row.getCategoryId();
-// SampleCategoryEnum categoryType = null;
-//
-// if (StringUtils.isNotEmpty(sortedUnsortedValue)) {
-// Integer id = Integer.parseInt(sortedUnsortedValue);
-// Caracteristic caracteristic = persistenceService.getSortedUnsortedCaracteristic();
-// value = TuttiEntities.getQualitativeValue(caracteristic, id);
-// categoryType = SampleCategoryEnum.sortedUnsorted;
-//
-// } else if (StringUtils.isNotEmpty(sizeValue)) {
-// Integer id = Integer.parseInt(sizeValue);
-// Caracteristic caracteristic = persistenceService.getSizeCategoryCaracteristic();
-// value = TuttiEntities.getQualitativeValue(caracteristic, id);
-// categoryType = SampleCategoryEnum.size;
-//
-// } else if (StringUtils.isNotEmpty(sexValue)) {
-// Integer id = Integer.parseInt(sexValue);
-// Caracteristic caracteristic = persistenceService.getSexCaracteristic();
-// value = TuttiEntities.getQualitativeValue(caracteristic, id);
-// categoryType = SampleCategoryEnum.sex;
-//
-// } else if (StringUtils.isNotEmpty(maturityValue)) {
-// Integer id = Integer.parseInt(maturityValue);
-// Caracteristic caracteristic = persistenceService.getMaturityCaracteristic();
-// value = TuttiEntities.getQualitativeValue(caracteristic, id);
-// categoryType = SampleCategoryEnum.maturity;
-//
-// } else if (StringUtils.isNotEmpty(ageValue)) {
-// categoryType = SampleCategoryEnum.age;
-// value = Float.parseFloat(ageValue);
-// }
-
-// return new Object[]{categoryType, value};
- return Pair.of(categoryId, value);
- }
-
- protected void importAttachments(File directory,
- Function<AttachmentRow, Integer> getObjetcIdFunction,
- AttachementObjectTypeEnum objectType) {
- File attachmentFile = new File(directory, ATTACHMENTS_FILE);
- File attachmentDirectory = new File(directory, ATTACHMENTS_DIRECTORY);
- Reader reader;
-
- try {
- reader = Files.newReader(attachmentFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.attachments.error", attachmentFile), e);
- }
-
- AttachmentRowModel attachmentModel = new AttachmentRowModel(csvSeparator, attachmentDirectory);
-
- Import<AttachmentRow> attachmentImporter = Import.newImport(attachmentModel, reader);
-
- for (AttachmentRow row : attachmentImporter) {
- Integer objectId = getObjetcIdFunction.apply(row);
- if (objectId != null) {
- Attachment attachment = TuttiBeanFactory.newAttachment();
- attachment.setName(row.getName());
- attachment.setComment(row.getComment());
- attachment.setObjectType(objectType);
-
- attachment.setObjectId(objectId);
-
- persistenceService.createAttachment(attachment, row.getFile());
- }
- }
- }
-
- protected void checkSameOperation(File directory,
- AbstractFishingOperationRowModel fishingOperationRowModel,
- FishingOperation operation) {
- File operationFile = new File(directory, WEIGHTS_FILE);
- Reader reader;
-
- try {
- reader = Files.newReader(operationFile, Charsets.UTF_8);
-
- } catch (FileNotFoundException e) {
- throw new TuttiTechnicalException(_("tutti.service.multipost.import.operation.error", operationFile), e);
- }
-
- Import<AbstractFishingOperationRow> fishingOperationImporter = Import.newImport(fishingOperationRowModel, reader);
-
- Iterator<AbstractFishingOperationRow> iterator = fishingOperationImporter.iterator();
- if (iterator.hasNext()) {
- AbstractFishingOperationRow row = iterator.next();
- if (ObjectUtils.notEqual(row.getStationNumber(), operation.getStationNumber())
- || ObjectUtils.notEqual(row.getOperationNumber(), operation.getFishingOperationNumber())
- || ObjectUtils.notEqual(row.getMultirigAggregation(), operation.getMultirigAggregation())
- || ObjectUtils.notEqual(row.getDate(), operation.getGearShootingStartDate())) {
-
- throw new TuttiBusinessException(_("tutti.service.multipost.import.wrongOperation.error",
- decoratorService.getDecoratorByType(FishingOperation.class)
- .toString(operation)));
- }
- }
- }
-}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportService.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/multipost/TuttiMultiPostImportService.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -932,8 +932,8 @@
batch.setWeight(row.getWeight());
batch.setSize(row.getSize());
batch.setLengthStepCaracteristic(row.getLengthStepCaracteristic());
- batch.setSamplingCode(row.getSamplingCode());
- batch.setCalcifiedPieceSamplingCode(row.getCalcifiedPieceSamplingCode());
+// batch.setSamplingCode(row.getSamplingCode());
+// batch.setCalcifiedPieceSamplingCode(row.getCalcifiedPieceSamplingCode());
batch.setComment(row.getComment());
batch.setCaracteristics(new CaracteristicMap());
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -32,7 +32,6 @@
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiCsvUtil;
import org.apache.commons.collections.CollectionUtils;
@@ -50,24 +49,24 @@
*/
public class IndividualObservationExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<IndividualObservationExportRow> {
- protected final Caracteristic caracteristicSample;
+// protected final Caracteristic caracteristicSample;
+//
+// protected final Caracteristic caracteristicOtolithe;
- protected final Caracteristic caracteristicOtolithe;
-
protected final Caracteristic caracteristicWeight;
protected final Caracteristic caracteristicPmfmId;
public IndividualObservationExportModel(
char separator,
- Caracteristic caracteristicSample,
- Caracteristic caracteristicOtolithe,
+// Caracteristic caracteristicSample,
+// Caracteristic caracteristicOtolithe,
Caracteristic caracteristicWeight,
Caracteristic caracteristicPmfmId) {
super(separator);
- this.caracteristicSample = caracteristicSample;
- this.caracteristicOtolithe = caracteristicOtolithe;
+// this.caracteristicSample = caracteristicSample;
+// this.caracteristicOtolithe = caracteristicOtolithe;
this.caracteristicWeight = caracteristicWeight;
this.caracteristicPmfmId = caracteristicPmfmId;
@@ -99,24 +98,24 @@
if (CollectionUtils.isNotEmpty(observations)) {
for (IndividualObservationBatch child : observations) {
- addCaracteristicRow(rows,
- cruise,
- operation,
- child,
- caracteristicSample,
- child.getSamplingCode());
+// addCaracteristicRow(rows,
+// cruise,
+// operation,
+// child,
+// caracteristicSample,
+// child.getSamplingCode());
+//
+// addCaracteristicRow(rows,
+// cruise,
+// operation,
+// child,
+// caracteristicOtolithe,
+// child.getCalcifiedPieceSamplingCode());
addCaracteristicRow(rows,
cruise,
operation,
child,
- caracteristicOtolithe,
- child.getCalcifiedPieceSamplingCode());
-
- addCaracteristicRow(rows,
- cruise,
- operation,
- child,
caracteristicWeight,
child.getWeight());
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-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -103,10 +103,10 @@
protected SampleCategoryModel sampleCategoryModel;
- protected Caracteristic sampleIdCaracteristic;
+// protected Caracteristic sampleIdCaracteristic;
+//
+// protected Caracteristic otolitheIdCaracteristic;
- protected Caracteristic otolitheIdCaracteristic;
-
protected Caracteristic deadOrAliveCaracteristic;
protected Caracteristic genderCaracteristic;
@@ -128,8 +128,8 @@
verticalOpeningCaracteristic = persistenceService.getVerticalOpeningCaracteristic();
horizontalOpeningWingCaracteristic = persistenceService.getHorizontalOpeningWingCaracteristic();
horizontalOpeningDoorCaracteristic = persistenceService.getHorizontalOpeningDoorCaracteristic();
- sampleIdCaracteristic = persistenceService.getSampleIdCaracteristic();
- otolitheIdCaracteristic = persistenceService.getOtolitheIdCaracteristic();
+// sampleIdCaracteristic = persistenceService.getSampleIdCaracteristic();
+// otolitheIdCaracteristic = persistenceService.getOtolitheIdCaracteristic();
weightMeasuredCaracteristic = persistenceService.getWeightMeasuredCaracteristic();
pmfmIdCaracteristic = persistenceService.getPmfmIdCaracteristic();
deadOrAliveCaracteristic = persistenceService.getDeadOrAliveCaracteristic();
@@ -233,8 +233,8 @@
verticalOpeningCaracteristic,
horizontalOpeningWingCaracteristic,
horizontalOpeningDoorCaracteristic,
- sampleIdCaracteristic,
- otolitheIdCaracteristic,
+// sampleIdCaracteristic,
+// otolitheIdCaracteristic,
weightMeasuredCaracteristic,
deadOrAliveCaracteristic,
genderCaracteristic,
@@ -671,8 +671,8 @@
Caracteristic verticalOpeningCaracteristic,
Caracteristic horizontalOpeningWingCaracteristic,
Caracteristic horizontalOpeningDoorCaracteristic,
- Caracteristic sampleIdCaracteristic,
- Caracteristic otolitheIdCaracteristic,
+// Caracteristic sampleIdCaracteristic,
+// Caracteristic otolitheIdCaracteristic,
Caracteristic weightMeasuredCaracteristic,
Caracteristic deadOrAliveCaracteristic,
Caracteristic genderCaracteristic,
@@ -743,8 +743,8 @@
pmfmIdCaracteristic);
individualObservationModel = new IndividualObservationExportModel(
csvSeparator,
- sampleIdCaracteristic,
- otolitheIdCaracteristic,
+// sampleIdCaracteristic,
+// otolitheIdCaracteristic,
weightMeasuredCaracteristic,
pmfmIdCaracteristic);
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-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-21 14:47:57 UTC (rev 1198)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Fri Sep 20 11:03:34 CEST 2013
+#Sat Sep 21 15:16:31 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -26,6 +26,8 @@
tutti.createIndividualObservationBatch.action.addSpecies.help=editFishingOperation.html\#captureObservationsIndividuellesActions
tutti.createIndividualObservationBatch.action.cancel.help=editFishingOperation.html\#captureObservationsIndividuellesActions
tutti.createIndividualObservationBatch.action.save.help=editFishingOperation.html\#captureObservationsIndividuellesActions
+tutti.createIndividualObservationBatch.action.saveAndClose.help=
+tutti.createIndividualObservationBatch.action.saveAndContinue.help=
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.help=editFishingOperation.html\#captureObservationsIndividuellesFields
tutti.createIndividualObservationBatch.field.individualObservationSize.help=editFishingOperation.html\#captureObservationsIndividuellesFields
tutti.createIndividualObservationBatch.field.individualObservationSpecies.help=editFishingOperation.html\#captureObservationsIndividuellesFields
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-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-21 14:47:57 UTC (rev 1198)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Fri Sep 20 11:03:34 CEST 2013
+#Sat Sep 21 15:16:31 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -25,7 +25,8 @@
tutti.createBenthosBatch.help=editFishingOperation.html\#captureBenthos
tutti.createIndividualObservationBatch.action.addSpecies.help=editFishingOperation.html\#captureObservationsIndividuellesActions
tutti.createIndividualObservationBatch.action.cancel.help=editFishingOperation.html\#captureObservationsIndividuellesActions
-tutti.createIndividualObservationBatch.action.save.help=editFishingOperation.html\#captureObservationsIndividuellesActions
+tutti.createIndividualObservationBatch.action.saveAndClose.help=editFishingOperation.html\#captureObservationsIndividuellesActions
+tutti.createIndividualObservationBatch.action.saveAndContinue.help=editFishingOperation.html\#captureObservationsIndividuellesActions
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.help=editFishingOperation.html\#captureObservationsIndividuellesFields
tutti.createIndividualObservationBatch.field.individualObservationSize.help=editFishingOperation.html\#captureObservationsIndividuellesFields
tutti.createIndividualObservationBatch.field.individualObservationSpecies.help=editFishingOperation.html\#captureObservationsIndividuellesFields
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -25,6 +25,7 @@
*/
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -366,7 +367,7 @@
{ // Other caracteristics column
addColumnToModel(columnModel,
- CaracteristicMapCellComponent.newEditor(ui),
+ CaracteristicMapCellComponent.newEditor(ui, Sets.<Caracteristic>newHashSet()),
CaracteristicMapCellComponent.newRender(getContext()),
IndividualObservationBatchTableModel.OTHER_CARACTERISTICS);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/ImportMultiPostAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/ImportMultiPostAction.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/ImportMultiPostAction.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -27,7 +27,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.service.catches.multipost.TuttiMultiPostImportExportService;
+import fr.ifremer.tutti.service.catches.multipost.TuttiMultiPostImportService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractImportMultiPostAction;
import fr.ifremer.tutti.ui.swing.content.operation.catches.MultiPostImportLogDialog;
@@ -89,7 +89,7 @@
MultiPostImportLogDialog dialog = new MultiPostImportLogDialog((Dialog) getContext().getActionUI());
Collection<BenthosBatch> notImportedBenthosBatches =
- (Collection<BenthosBatch>) notImportedData.get(TuttiMultiPostImportExportService.BATCHES_KEY);
+ (Collection<BenthosBatch>) notImportedData.get(TuttiMultiPostImportService.BATCHES_KEY);
StringBuffer stringBuffer = new StringBuffer();
Float totalSortedWeight = (Float) notImportedData.get(CatchBatch.PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -37,6 +37,7 @@
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
+import java.io.Serializable;
import java.util.Collection;
import java.util.List;
@@ -49,6 +50,8 @@
private static final long serialVersionUID = 1L;
+ public static final String PROPERTY_DEFAULT_CARACTERISTICS = "defaultCaracteristics";
+
/**
* Delegate edit object.
*
@@ -64,6 +67,13 @@
*/
protected final List<Attachment> attachment = Lists.newArrayList();
+ /**
+ * Map of default caracteristics (used if filled in the protocol.
+ *
+ * @since 2.5
+ */
+ protected CaracteristicMap defaultCaracteristics = new CaracteristicMap();
+
protected static final Binder<IndividualObservationBatch, IndividualObservationBatchRowModel> fromBeanBinder =
BinderFactory.newBinder(IndividualObservationBatch.class,
IndividualObservationBatchRowModel.class);
@@ -76,15 +86,41 @@
super(IndividualObservationBatch.class, fromBeanBinder, toBeanBinder);
}
- public IndividualObservationBatchRowModel(IndividualObservationBatch aBatch) {
+ public IndividualObservationBatchRowModel(IndividualObservationBatch aBatch,
+ Collection<Caracteristic> defaultCaracteristicsSet) {
this();
fromBean(aBatch);
Float weightInG = getWeight();
if (weightInG != null) {
setWeight(weightInG * 1000.0f);
}
+ if (getCaracteristics() == null) {
+ setCaracteristics(new CaracteristicMap());
+ }
+
+ // move default caracteristics from caracteristic map
+ CaracteristicMap caracteristics = getCaracteristics();
+ for (Caracteristic caracteristic : defaultCaracteristicsSet) {
+ if (caracteristics.containsKey(caracteristic)) {
+ Serializable value = caracteristics.remove(caracteristic);
+ defaultCaracteristics.put(caracteristic, value);
+ }
+ }
}
+ public CaracteristicMap getDefaultCaracteristics() {
+ return defaultCaracteristics;
+ }
+
+ public void setDefaultCaracteristics(CaracteristicMap defaultCaracteristics) {
+ this.defaultCaracteristics = defaultCaracteristics;
+ firePropertyChange(PROPERTY_DEFAULT_CARACTERISTICS, null, defaultCaracteristics);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiBeanUIModel --//
+ //------------------------------------------------------------------------//
+
@Override
protected IndividualObservationBatch newEntity() {
return TuttiBeanFactory.newIndividualObservationBatch();
@@ -164,31 +200,31 @@
firePropertyChange(PROPERTY_CARACTERISTICS, oldValue, caracteristics);
}
- @Override
- public String getSamplingCode() {
- return editObject.getSamplingCode();
- }
+// @Override
+// public String getSamplingCode() {
+// return editObject.getSamplingCode();
+// }
+//
+// @Override
+// public void setSamplingCode(String samplingCode) {
+// Object oldValue = getSamplingCode();
+// editObject.setSamplingCode(samplingCode);
+// firePropertyChange(PROPERTY_SAMPLING_CODE, oldValue, samplingCode);
+// }
+//
+// @Override
+// public String getCalcifiedPieceSamplingCode() {
+// return editObject.getCalcifiedPieceSamplingCode();
+// }
+//
+// @Override
+// public void setCalcifiedPieceSamplingCode(String calcifiedPieceSamplingCode) {
+// Object oldValue = getCalcifiedPieceSamplingCode();
+// editObject.setCalcifiedPieceSamplingCode(calcifiedPieceSamplingCode);
+// firePropertyChange(PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE, oldValue, calcifiedPieceSamplingCode);
+// }
@Override
- public void setSamplingCode(String samplingCode) {
- Object oldValue = getSamplingCode();
- editObject.setSamplingCode(samplingCode);
- firePropertyChange(PROPERTY_SAMPLING_CODE, oldValue, samplingCode);
- }
-
- @Override
- public String getCalcifiedPieceSamplingCode() {
- return editObject.getCalcifiedPieceSamplingCode();
- }
-
- @Override
- public void setCalcifiedPieceSamplingCode(String calcifiedPieceSamplingCode) {
- Object oldValue = getCalcifiedPieceSamplingCode();
- editObject.setCalcifiedPieceSamplingCode(calcifiedPieceSamplingCode);
- firePropertyChange(PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE, oldValue, calcifiedPieceSamplingCode);
- }
-
- @Override
public String getComment() {
return editObject.getComment();
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -61,16 +61,16 @@
n_("tutti.editIndividualObservationBatch.table.header.otherCaracteristics"),
n_("tutti.editIndividualObservationBatch.table.header.otherCaracteristics.tip"));
- public static final ColumnIdentifier<IndividualObservationBatchRowModel> CALCIFIED_PIECE_SAMPLING_CODE = ColumnIdentifier.newId(
- IndividualObservationBatchRowModel.PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE,
- n_("tutti.editIndividualObservationBatch.table.header.calcifiedPieceSamplingCode"),
- n_("tutti.editIndividualObservationBatch.table.header.calcifiedPieceSamplingCode.tip"));
+// public static final ColumnIdentifier<IndividualObservationBatchRowModel> CALCIFIED_PIECE_SAMPLING_CODE = ColumnIdentifier.newId(
+// IndividualObservationBatchRowModel.PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE,
+// n_("tutti.editIndividualObservationBatch.table.header.calcifiedPieceSamplingCode"),
+// n_("tutti.editIndividualObservationBatch.table.header.calcifiedPieceSamplingCode.tip"));
+//
+// public static final ColumnIdentifier<IndividualObservationBatchRowModel> SAMPLING_CODE = ColumnIdentifier.newId(
+// IndividualObservationBatchRowModel.PROPERTY_SAMPLING_CODE,
+// n_("tutti.editIndividualObservationBatch.table.header.samplingCode"),
+// n_("tutti.editIndividualObservationBatch.table.header.samplingCode.tip"));
- public static final ColumnIdentifier<IndividualObservationBatchRowModel> SAMPLING_CODE = ColumnIdentifier.newId(
- IndividualObservationBatchRowModel.PROPERTY_SAMPLING_CODE,
- n_("tutti.editIndividualObservationBatch.table.header.samplingCode"),
- n_("tutti.editIndividualObservationBatch.table.header.samplingCode.tip"));
-
public static final ColumnIdentifier<IndividualObservationBatchRowModel> COMMENT = ColumnIdentifier.newId(
IndividualObservationBatchRowModel.PROPERTY_COMMENT,
n_("tutti.editIndividualObservationBatch.table.header.comment"),
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-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -23,12 +23,14 @@
*/
import com.google.common.collect.Lists;
-import fr.ifremer.tutti.PropagatePropertyChangeListener;
+import com.google.common.collect.Sets;
+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.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.service.ValidationService;
@@ -49,6 +51,7 @@
import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor;
import fr.ifremer.tutti.ui.swing.util.comment.CommentCellRenderer;
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
+import fr.ifremer.tutti.ui.swing.util.table.CaracteristicColumnIdentifier;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
@@ -66,8 +69,12 @@
import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Component;
+import java.io.Serializable;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -89,8 +96,9 @@
IndividualObservationBatchRowModel.PROPERTY_SIZE,
IndividualObservationBatchRowModel.PROPERTY_LENGTH_STEP_CARACTERISTIC,
IndividualObservationBatchRowModel.PROPERTY_CARACTERISTICS,
- IndividualObservationBatchRowModel.PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE,
- IndividualObservationBatchRowModel.PROPERTY_SAMPLING_CODE,
+ IndividualObservationBatchRowModel.PROPERTY_DEFAULT_CARACTERISTICS,
+// IndividualObservationBatchRowModel.PROPERTY_CALCIFIED_PIECE_SAMPLING_CODE,
+// IndividualObservationBatchRowModel.PROPERTY_SAMPLING_CODE,
IndividualObservationBatchRowModel.PROPERTY_COMMENT,
IndividualObservationBatchRowModel.PROPERTY_ATTACHMENT);
}
@@ -123,6 +131,17 @@
persistenceService.getAllIndividualObservationBatch(bean.getId());
for (IndividualObservationBatch aBatch : batches) {
+
+ // set the surveycode
+ if (getDataContext().isProtocolFilled()) {
+ // get the surveycode from the species list of the model
+ List<Species> speciesList = getDataContext().getReferentSpeciesWithSurveyCode();
+ int i = speciesList.indexOf(aBatch.getSpecies());
+ if (i > -1) {
+ aBatch.setSpecies(speciesList.get(i));
+ }
+ }
+
IndividualObservationBatchRowModel entry = loadBatch(aBatch);
rows.add(entry);
}
@@ -135,7 +154,8 @@
protected IndividualObservationBatchRowModel loadBatch(IndividualObservationBatch aBatch) {
IndividualObservationBatchRowModel newRow =
- new IndividualObservationBatchRowModel(aBatch);
+ new IndividualObservationBatchRowModel(
+ aBatch, getModel().getDefaultCaracteristic());
List<Attachment> attachments =
persistenceService.getAllAttachments(newRow.getObjectType(),
@@ -277,18 +297,24 @@
log.debug("beforeInit: " + ui);
}
+ // get the default caracteristics
+ List<Caracteristic> defaultCaracteristic =
+ getDataContext().getDefaultIndividualObservationCaracteristics();
+
+ // create model
EditCatchesUIModel catchesUIModel =
ui.getContextValue(EditCatchesUIModel.class);
-
- IndividualObservationBatchUIModel model = new IndividualObservationBatchUIModel(catchesUIModel);
+ IndividualObservationBatchUIModel model =
+ new IndividualObservationBatchUIModel(catchesUIModel,
+ defaultCaracteristic);
ui.setContextValue(model);
- // propagate when value is changing
- PropagatePropertyChangeListener.listenAndPropagate(
- catchesUIModel,
- model,
- EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT);
+// // propagate when value is changing
+// PropagatePropertyChangeListener.listenAndPropagate(
+// catchesUIModel,
+// model,
+// EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT,
+// EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT);
}
@Override
@@ -311,13 +337,16 @@
Decorator<Caracteristic> caracteristicDecorator =
getDecorator(Caracteristic.class, null);
+ Decorator<CaracteristicQualitativeValue> caracteristicQualitativeDecorator =
+ getDecorator(CaracteristicQualitativeValue.class, null);
+
{ // Species column
Decorator<Species> speciesDecorator = getDecorator(
Species.class, DecoratorService.FROM_PROTOCOL);
addComboDataColumnToModel(columnModel,
IndividualObservationBatchTableModel.SPECIES,
- speciesDecorator, getDataContext().getReferentSpecies());
+ speciesDecorator, getDataContext().getReferentSpeciesWithSurveyCode());
}
{ // Weight column
@@ -342,27 +371,70 @@
}
- { // Other caracteristics column
+ List<Caracteristic> defaultCaracteristic =
+ getModel().getDefaultCaracteristic();
- addColumnToModel(columnModel,
- CaracteristicMapCellComponent.newEditor(ui),
- CaracteristicMapCellComponent.newRender(getContext()),
- IndividualObservationBatchTableModel.OTHER_CARACTERISTICS);
- }
+ for (Caracteristic caracteristic : defaultCaracteristic) {
+ String header = caracteristicDecorator.toString(caracteristic);
- { // Calcified piece sampling code column
+ CaracteristicColumnIdentifier id = CaracteristicColumnIdentifier.newCaracteristicId(
+ caracteristic,
+ IndividualObservationBatchRowModel.PROPERTY_DEFAULT_CARACTERISTICS,
+ header,
+ header
+ );
- addColumnToModel(columnModel,
- IndividualObservationBatchTableModel.CALCIFIED_PIECE_SAMPLING_CODE);
+ switch (caracteristic.getCaracteristicType()) {
+
+ case NUMBER:
+
+ addFloatColumnToModel(columnModel,
+ id,
+ TuttiUI.DECIMAL3_PATTERN);
+
+ break;
+ case QUALITATIVE:
+ List<CaracteristicQualitativeValue> values =
+ caracteristic.getQualitativeValue();
+ addComboDataColumnToModel(
+ columnModel,
+ id,
+ caracteristicQualitativeDecorator,
+ values);
+ break;
+ case TEXT:
+
+ addColumnToModel(columnModel, id);
+
+ break;
+ }
}
- { // Sampling code column
+ { // Other caracteristics column
+ Set<Caracteristic> caracteristicsToSkip = Collections.unmodifiableSet(
+ Sets.newHashSet(getModel().getDefaultCaracteristic()));
+
addColumnToModel(columnModel,
- IndividualObservationBatchTableModel.SAMPLING_CODE);
+ CaracteristicMapCellComponent.newEditor(ui, caracteristicsToSkip),
+ CaracteristicMapCellComponent.newRender(getContext()),
+ IndividualObservationBatchTableModel.OTHER_CARACTERISTICS);
+
}
+// { // Calcified piece sampling code column
+//
+// addColumnToModel(columnModel,
+// IndividualObservationBatchTableModel.CALCIFIED_PIECE_SAMPLING_CODE);
+// }
+//
+// { // Sampling code column
+//
+// addColumnToModel(columnModel,
+// IndividualObservationBatchTableModel.SAMPLING_CODE);
+// }
+
{ // Comment column
addColumnToModel(columnModel,
@@ -443,6 +515,7 @@
newRow.setWeight(model.getWeight());
newRow.setSize(model.getSize());
newRow.setLengthStepCaracteristic(model.getLengthStepCaracteristic());
+ newRow.getDefaultCaracteristics().putAll(model.getCaracteristics());
recomputeRowValidState(newRow);
@@ -478,6 +551,19 @@
IndividualObservationBatch catchBean = row.toBean();
+ // use a new instance of caracteristicMap
+ CaracteristicMap caracteristics = CaracteristicMap.copy(catchBean.getCaracteristics());
+ catchBean.setCaracteristics(caracteristics);
+
+ // push back default caracteristics
+ CaracteristicMap defaultCaracteristics = row.getDefaultCaracteristics();
+ for (Map.Entry<Caracteristic, Serializable> entry : defaultCaracteristics.entrySet()) {
+ Serializable value = entry.getValue();
+ if (value != null) {
+ caracteristics.put(entry.getKey(), value);
+ }
+ }
+
FishingOperation fishingOperation = getModel().getFishingOperation();
catchBean.setFishingOperation(fishingOperation);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -22,6 +22,7 @@
* #L%
*/
+import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
@@ -29,6 +30,8 @@
import fr.ifremer.tutti.ui.swing.util.TabContentModel;
import org.apache.commons.collections.CollectionUtils;
+import java.util.List;
+
import static org.nuiton.i18n.I18n.n_;
/**
@@ -45,9 +48,20 @@
/** Can user remove a selected batch? */
protected boolean removeBatchEnabled;
- public IndividualObservationBatchUIModel(EditCatchesUIModel catchesUIModel) {
+ /**
+ * Default caracteristics coming from protocol.
+ *
+ * @since 2.5
+ */
+ protected final List<Caracteristic> defaultCaracteristic;
+
+ public IndividualObservationBatchUIModel(EditCatchesUIModel catchesUIModel,
+ List<Caracteristic> defaultCaracteristic) {
super(catchesUIModel,
EditCatchesUIModel.PROPERTY_BATCH_UPDATED);
+ this.defaultCaracteristic = defaultCaracteristic == null ?
+ Lists.<Caracteristic>newArrayList() :
+ Lists.newArrayList(defaultCaracteristic);
}
public boolean isRemoveBatchEnabled() {
@@ -60,6 +74,10 @@
firePropertyChange(PROPERTY_REMOVE_BATCH_ENABLED, oldValue, removeBatchEnabled);
}
+ public List<Caracteristic> getDefaultCaracteristic() {
+ return defaultCaracteristic;
+ }
+
public Species getLastSpeciesUsed() {
Species result = null;
if (!rows.isEmpty()) {
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-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-09-21 14:47:57 UTC (rev 1198)
@@ -97,15 +97,24 @@
_help: {"tutti.createIndividualObservationBatch.action.addSpecies.help"};
}
-#saveButton {
+#saveAndContinueButton {
actionIcon: save;
- text: "tutti.createIndividualObservationBatch.action.save";
- toolTipText: "tutti.createIndividualObservationBatch.action.save.tip";
- i18nMnemonic: "tutti.createIndividualObservationBatch.action.save.mnemonic";
+ text: "tutti.createIndividualObservationBatch.action.saveAndContinue";
+ toolTipText: "tutti.createIndividualObservationBatch.action.saveAndContinue.tip";
+ i18nMnemonic: "tutti.createIndividualObservationBatch.action.saveAndContinue.mnemonic";
enabled: {model.isValid()};
- _help: {"tutti.createIndividualObservationBatch.action.save.help"};
+ _help: {"tutti.createIndividualObservationBatch.action.saveAndContinue.help"};
}
+#saveAndCloseButton {
+ actionIcon: save;
+ text: "tutti.createIndividualObservationBatch.action.saveAndClose";
+ toolTipText: "tutti.createIndividualObservationBatch.action.saveAndClose.tip";
+ i18nMnemonic: "tutti.createIndividualObservationBatch.action.saveAndClose.mnemonic";
+ enabled: {model.isValid()};
+ _help: {"tutti.createIndividualObservationBatch.action.saveAndClose.help"};
+}
+
#cancelButton {
actionIcon: cancel;
text: "tutti.createIndividualObservationBatch.action.cancel";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx 2013-09-21 14:47:57 UTC (rev 1198)
@@ -128,6 +128,7 @@
<!-- Form Actions -->
<JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
- <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ <JButton id='saveAndContinueButton' onActionPerformed='handler.saveAndContinue()'/>
+ <JButton id='saveAndCloseButton' onActionPerformed='handler.saveAndClose()'/>
</JPanel>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -25,15 +25,20 @@
import com.google.common.base.Preconditions;
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.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchRowModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
@@ -41,6 +46,7 @@
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUIModel;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -50,6 +56,7 @@
import java.beans.PropertyChangeListener;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -72,7 +79,13 @@
@Override
public void beforeInitUI() {
- CreateIndividualObservationBatchUIModel model = new CreateIndividualObservationBatchUIModel();
+
+ // get the default caracteristics
+ List<Caracteristic> defaultCaracteristic =
+ getDataContext().getDefaultIndividualObservationCaracteristics();
+
+ CreateIndividualObservationBatchUIModel model =
+ new CreateIndividualObservationBatchUIModel(defaultCaracteristic);
ui.setContextValue(model);
listModelIsModify(model);
}
@@ -84,7 +97,8 @@
initBeanFilterableComboBox(ui.getIndividualObservationSpeciesComboBox(),
Lists.newArrayList(getDataContext().getReferentSpeciesWithSurveyCode()),
- null);
+ null,
+ DecoratorService.FROM_PROTOCOL);
List<Caracteristic> lengthStepCaracteristics = getDataContext().getLengthStepCaracteristics();
initBeanFilterableComboBox(ui.getIndividualObservationLengthStepCaracteristicComboBox(),
@@ -177,17 +191,118 @@
model.reset();
- model.setSpecies(batchModel.getLastSpeciesUsed());
+ // compute list of available species
+ List<Species> speciesListWithSurveyCode =
+ getDataContext().getReferentSpeciesWithSurveyCode();
+
+// Map<String, Species> speciesMap =
+// TuttiEntities.splitById(speciesListWithSurveyCode);
+
+ List<Species> speciesList;
+
+ EditCatchesUI parent =
+ SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ List<SpeciesBatchRowModel> speciesRows =
+ parent.getSpeciesTabContent().getModel().getRows();
+ if (CollectionUtils.isNotEmpty(speciesRows)) {
+
+ // use species from species batch
+ Set<Species> speciesSet = Sets.newHashSet();
+ for (SpeciesBatchRowModel row : speciesRows) {
+ if (row.isBatchRoot()) {
+ Species species = row.getSpecies();
+ speciesSet.add(species);
+ }
+ }
+
+ // plus readd the species filled here (individualObservations)
+ List<IndividualObservationBatchRowModel> rows = batchModel.getRows();
+
+ if (CollectionUtils.isNotEmpty(rows)) {
+ for (IndividualObservationBatchRowModel row : rows) {
+ Species species = row.getSpecies();
+ speciesSet.add(species);
+ }
+ }
+ speciesList = Lists.newArrayList(speciesSet);
+ if (log.isInfoEnabled()) {
+ log.info("Use speciesBatch + individualObservation species : " + speciesList.size());
+ }
+ } else {
+
+ if (getDataContext().isProtocolFilled()) {
+
+ // using protocol species
+ speciesList = Lists.newArrayList(speciesListWithSurveyCode);
+
+ // readd the species filled here (individualObservations)
+ List<IndividualObservationBatchRowModel> rows = batchModel.getRows();
+
+ if (CollectionUtils.isNotEmpty(rows)) {
+ for (IndividualObservationBatchRowModel row : rows) {
+
+ Species species = row.getSpecies();
+ if (!speciesList.contains(species)) {
+ speciesList.add(species);
+ }
+ }
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Use protocol + individualObservation species : " + speciesList.size());
+ }
+ } else {
+
+ // no species batch, no protocol use all possible species
+ speciesList = speciesListWithSurveyCode;
+
+ if (log.isInfoEnabled()) {
+ log.info("Use all species : " + speciesList.size());
+ }
+ }
+ }
+ model.setAvailableSpecies(speciesList);
+
+ // set last species filled here
+ Species lastSpeciesUsed = batchModel.getLastSpeciesUsed();
+ model.setSpecies(lastSpeciesUsed);
+// if (lastSpeciesUsed != null) {
+//
+// // use the version with surveycode
+// Species species = speciesMap.get(lastSpeciesUsed.getId());
+// if (species == null) {
+//
+// speciesMap = TuttiEntities.splitById(speciesList);
+// species = speciesMap.get(lastSpeciesUsed.getId());
+// }
+//
+// model.setSpecies(lastSpeciesUsed);
+// }
model.setLengthStepCaracteristic(batchModel.getLastLengthStepCaracteristicUsed());
+ }
- model.setAvailableSpecies(getDataContext().getReferentSpeciesWithSurveyCode());
+ public void saveAndContinue() {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Save And Continue UI " + ui);
+ }
+
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ IndividualObservationBatchUI individualObservationTabContent = parent.getIndividualObservationTabContent();
+ individualObservationTabContent.getHandler().addBatch(getModel());
+
+ // re-open dialog
+ openUI(individualObservationTabContent.getModel());
+
+ // set focus to weight field
+ ui.getIndividualObservationWeightField().grabFocus();
}
- public void save() {
+ public void saveAndClose() {
if (log.isDebugEnabled()) {
- log.debug("Save UI " + ui);
+ log.debug("Save And Close UI " + ui);
}
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -22,6 +22,8 @@
* #L%
*/
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
@@ -36,7 +38,7 @@
* @author kmorin <kmorin(a)codelutin.com>
* @since 1.4
*/
-public class CreateIndividualObservationBatchUIModel extends AbstractTuttiBeanUIModel<CreateIndividualObservationBatchUIModel, CreateIndividualObservationBatchUIModel> {
+public class CreateIndividualObservationBatchUIModel extends AbstractTuttiBeanUIModel<IndividualObservationBatch, CreateIndividualObservationBatchUIModel> {
private static final long serialVersionUID = 1L;
@@ -59,8 +61,17 @@
protected final IndividualObservationBatch editObject =
TuttiBeanFactory.newIndividualObservationBatch();
- public CreateIndividualObservationBatchUIModel() {
- super(CreateIndividualObservationBatchUIModel.class, null, null);
+ /**
+ * Default caracteristics coming from protocol.
+ *
+ * @since 2.5
+ */
+ protected final List<Caracteristic> defaultCaracteristic;
+
+ public CreateIndividualObservationBatchUIModel(List<Caracteristic> defaultCaracteristic) {
+ super(IndividualObservationBatch.class, null, null);
+ this.defaultCaracteristic = defaultCaracteristic;
+ editObject.setCaracteristics(new CaracteristicMap());
}
public Species getSpecies() {
@@ -103,6 +114,10 @@
firePropertyChange(IndividualObservationBatch.PROPERTY_LENGTH_STEP_CARACTERISTIC, oldValue, individualObservationLengthStepCaracteristic);
}
+ public CaracteristicMap getCaracteristics() {
+ return editObject.getCaracteristics();
+ }
+
public List<Species> getAvailableSpecies() {
if (log.isDebugEnabled()) {
log.debug("getAvailableSpecies " + availableSpecies);
@@ -115,20 +130,21 @@
if (log.isDebugEnabled()) {
log.debug("setAvailableSpecies " + availableSpecies);
}
- Object oldValue = getAvailableSpecies();
this.availableSpecies = availableSpecies;
- firePropertyChange(PROPERTY_AVAILABLE_SPECIES, oldValue, availableSpecies);
+ firePropertyChange(PROPERTY_AVAILABLE_SPECIES, null, availableSpecies);
}
@Override
- protected CreateIndividualObservationBatchUIModel newEntity() {
- return new CreateIndividualObservationBatchUIModel();
+ protected IndividualObservationBatch newEntity() {
+ return TuttiBeanFactory.newIndividualObservationBatch();
}
public void reset() {
+ setAvailableSpecies(Lists.<Species>newArrayList());
setSpecies(null);
setWeight(null);
setSize(null);
setLengthStepCaracteristic(null);
+ getCaracteristics().clear();
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/ImportMultiPostAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/ImportMultiPostAction.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/ImportMultiPostAction.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -27,7 +27,7 @@
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.service.catches.multipost.TuttiMultiPostImportExportService;
+import fr.ifremer.tutti.service.catches.multipost.TuttiMultiPostImportService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractImportMultiPostAction;
import fr.ifremer.tutti.ui.swing.content.operation.catches.MultiPostImportLogDialog;
@@ -89,7 +89,7 @@
MultiPostImportLogDialog dialog = new MultiPostImportLogDialog((Dialog) getContext().getActionUI());
Collection<MarineLitterBatch> notImportedMarineLitterBatches =
- (Collection<MarineLitterBatch>) notImportedData.get(TuttiMultiPostImportExportService.BATCHES_KEY);
+ (Collection<MarineLitterBatch>) notImportedData.get(TuttiMultiPostImportService.BATCHES_KEY);
StringBuffer stringBuffer = new StringBuffer();
Float totalWeight = (Float) notImportedData.get(CatchBatch.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/ImportMultiPostAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/ImportMultiPostAction.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/ImportMultiPostAction.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -27,7 +27,7 @@
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
-import fr.ifremer.tutti.service.catches.multipost.TuttiMultiPostImportExportService;
+import fr.ifremer.tutti.service.catches.multipost.TuttiMultiPostImportService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.AbstractImportMultiPostAction;
import fr.ifremer.tutti.ui.swing.content.operation.catches.MultiPostImportLogDialog;
@@ -89,7 +89,7 @@
MultiPostImportLogDialog dialog = new MultiPostImportLogDialog((Dialog) getContext().getActionUI());
Collection<SpeciesBatch> notImportedSpeciesBatches =
- (Collection<SpeciesBatch>) notImportedData.get(TuttiMultiPostImportExportService.BATCHES_KEY);
+ (Collection<SpeciesBatch>) notImportedData.get(TuttiMultiPostImportService.BATCHES_KEY);
StringBuffer stringBuffer = new StringBuffer();
Float totalSortedWeight = (Float) notImportedData.get(CatchBatch.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapCellComponent.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapCellComponent.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -23,6 +23,7 @@
*/
import com.google.common.base.Preconditions;
+import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
@@ -50,7 +51,6 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.Serializable;
-import java.util.HashSet;
import java.util.Set;
import static org.nuiton.i18n.I18n._;
@@ -127,8 +127,8 @@
return new CaracteristicMapCellRenderer(context);
}
- public static TableCellEditor newEditor(TuttiUI ui) {
- return new CaracteristicMapCellEditor(ui);
+ public static TableCellEditor newEditor(TuttiUI ui, Set<Caracteristic> caracteristicsToSkip) {
+ return new CaracteristicMapCellEditor(ui, caracteristicsToSkip);
}
public static class CaracteristicMapCellEditor extends AbstractCellEditor implements TableCellEditor {
@@ -147,13 +147,18 @@
protected Set<Caracteristic> caracteristicsUsed;
+ protected Set<Caracteristic> caracteristicsToSkip;
+
protected Integer rowIndex;
protected Integer columnIndex;
- public CaracteristicMapCellEditor(TuttiUI ui) {
+ public CaracteristicMapCellEditor(TuttiUI ui,
+ Set<Caracteristic> caracteristicsToSkip) {
this.ui = ui;
- component = new CaracteristicMapCellComponent(ui.getHandler().getContext());
+ this.caracteristicsToSkip = caracteristicsToSkip;
+ component = new CaracteristicMapCellComponent(ui.getHandler().getContext()
+ );
component.setBorder(new LineBorder(Color.BLACK));
component.addKeyListener(new KeyAdapter() {
@Override
@@ -189,7 +194,7 @@
// get the caracteristics set to the other rows
if (caracteristicsUsed == null) {
- caracteristicsUsed = new HashSet<Caracteristic>();
+ caracteristicsUsed = Sets.newHashSet();
for (CaracteristicMapColumnRowModel row : tableModel.getRows()) {
CaracteristicMap map = row.getCaracteristics();
if (map != null) {
@@ -197,9 +202,12 @@
}
}
}
+ caracteristicsUsed.removeAll(caracteristicsToSkip);
CaracteristicMapColumnUIHandler handler = (CaracteristicMapColumnUIHandler) ui.getHandler();
CaracteristicMapEditorUI caracteristicMapEditor = handler.getCaracteristicMapEditor();
+ // remove all default caracteristics (caracteristicsToSkip)
+ caracteristicMapEditor.getModel().getAvailableCaracteristics().removeAll(caracteristicsToSkip);
caracteristicMapEditor.getHandler().editBatch(editRow, this, caracteristicsUsed);
handler.showCaracteristicMapEditor(editRow.getSpecies());
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapEditorUIHandler.java 2013-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapEditorUIHandler.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -127,7 +127,7 @@
initUI(getUI());
initBeanFilterableComboBox(getKeyCombo(), Lists.<Caracteristic>newArrayList(), null);
- getModel().setAvailableCaracteristics(getDataContext().getCaracteristicWithProtected());
+ getModel().setAvailableCaracteristics(Lists.newArrayList(getDataContext().getCaracteristicWithProtected()));
JXTable table = getTable();
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicColumnIdentifier.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicColumnIdentifier.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicColumnIdentifier.java 2013-09-21 14:47:57 UTC (rev 1198)
@@ -0,0 +1,56 @@
+package fr.ifremer.tutti.ui.swing.util.table;
+
+import com.google.common.base.Preconditions;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+
+import java.io.Serializable;
+
+/**
+ * To identify a column that represents a caracteristic.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.5
+ */
+public class CaracteristicColumnIdentifier<R> extends ColumnIdentifier<R> {
+
+ private static final long serialVersionUID = 1L;
+
+ public static <R> CaracteristicColumnIdentifier newCaracteristicId(
+ Caracteristic caracteristic,
+ String propertyName,
+ String headerI18nKey,
+ String headerTipI18nKey) {
+
+ return new CaracteristicColumnIdentifier<R>(caracteristic, propertyName,
+ headerI18nKey,
+ headerTipI18nKey
+ );
+ }
+
+ protected Caracteristic caracteristic;
+
+ protected CaracteristicColumnIdentifier(Caracteristic caracteristic,
+ String propertyName,
+ String headerI18nKey,
+ String headerTipI18nKey) {
+ super(propertyName, headerI18nKey, headerTipI18nKey);
+ this.caracteristic = caracteristic;
+ }
+
+ @Override
+ public Object getValue(R entry) {
+ CaracteristicMap map = (CaracteristicMap) super.getValue(entry);
+ Serializable result = map.get(caracteristic);
+ return result;
+ }
+
+ @Override
+ public void setValue(R entry, Object value) {
+ CaracteristicMap map = (CaracteristicMap) super.getValue(entry);
+ Preconditions.checkNotNull(map, "caracteristicMap (" + getPropertyName() + ") is null in " + entry);
+ map.put(caracteristic, (Serializable) value);
+ // reset the map in bean to fire property
+ super.setValue(entry, map);
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicColumnIdentifier.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-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-21 14:47:57 UTC (rev 1198)
@@ -210,6 +210,12 @@
tutti.createIndividualObservationBatch.action.save=
tutti.createIndividualObservationBatch.action.save.mnemonic=
tutti.createIndividualObservationBatch.action.save.tip=
+tutti.createIndividualObservationBatch.action.saveAndClose=
+tutti.createIndividualObservationBatch.action.saveAndClose.mnemonic=
+tutti.createIndividualObservationBatch.action.saveAndClose.tip=
+tutti.createIndividualObservationBatch.action.saveAndContinue=
+tutti.createIndividualObservationBatch.action.saveAndContinue.mnemonic=
+tutti.createIndividualObservationBatch.action.saveAndContinue.tip=
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic=
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.tip=
tutti.createIndividualObservationBatch.field.individualObservationSize=
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-09-21 14:45:35 UTC (rev 1197)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-21 14:47:57 UTC (rev 1198)
@@ -191,9 +191,12 @@
tutti.createIndividualObservationBatch.action.cancel=Annuler
tutti.createIndividualObservationBatch.action.cancel.mnemonic=A
tutti.createIndividualObservationBatch.action.cancel.tip=Annuler la création de l'observation individuelle
-tutti.createIndividualObservationBatch.action.save=Enregistrer
-tutti.createIndividualObservationBatch.action.save.mnemonic=E
-tutti.createIndividualObservationBatch.action.save.tip=Enregistrer l'observation individuelle
+tutti.createIndividualObservationBatch.action.saveAndClose=Créer et Fermer
+tutti.createIndividualObservationBatch.action.saveAndClose.mnemonic=F
+tutti.createIndividualObservationBatch.action.saveAndClose.tip=Créer l'observation individuelle et fermer
+tutti.createIndividualObservationBatch.action.saveAndContinue=Créer et Continuer
+tutti.createIndividualObservationBatch.action.saveAndContinue.mnemonic=C
+tutti.createIndividualObservationBatch.action.saveAndContinue.tip=Créer et saisir une nouvelle observation indidivuelle
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic=Classe de taille
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.tip=Classe de taille
tutti.createIndividualObservationBatch.field.individualObservationSize=Taille
1
0
r1197 - in trunk/tutti-persistence/src/main: java/fr/ifremer/tutti/persistence java/fr/ifremer/tutti/persistence/config java/fr/ifremer/tutti/persistence/entities/protocol java/fr/ifremer/tutti/persistence/service resources/i18n xmi
by tchemit@users.forge.codelutin.com 21 Sep '13
by tchemit@users.forge.codelutin.com 21 Sep '13
21 Sep '13
Author: tchemit
Date: 2013-09-21 16:45:35 +0200 (Sat, 21 Sep 2013)
New Revision: 1197
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1197
Log:
- improve i18n keys
- refs #3297: [DONNEES INDIVIDUELLES] g?\195?\169rer les colonnes du tableau dans le protocole (ne plus utiliser PMFM_ID_SAMPLE_ID et PMFM_ID_OTOLITHE_ID)
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/config/SampleCategoryModelConverter.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties
trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
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-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -280,10 +280,10 @@
Caracteristic getDeadOrAliveCaracteristic();
- Caracteristic getSampleIdCaracteristic();
+// Caracteristic getSampleIdCaracteristic();
+//
+// Caracteristic getOtolitheIdCaracteristic();
- Caracteristic getOtolitheIdCaracteristic();
-
Caracteristic getPmfmIdCaracteristic();
Caracteristic getWeightMeasuredCaracteristic();
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-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -429,17 +429,17 @@
return referentialService.getDeadOrAliveCaracteristic();
}
- @Override
- public Caracteristic getSampleIdCaracteristic() {
- return referentialService.getSampleIdCaracteristic();
- }
+// @Override
+// public Caracteristic getSampleIdCaracteristic() {
+// return referentialService.getSampleIdCaracteristic();
+// }
+//
+// @Override
+// public Caracteristic getOtolitheIdCaracteristic() {
+// return referentialService.getOtolitheIdCaracteristic();
+// }
@Override
- public Caracteristic getOtolitheIdCaracteristic() {
- return referentialService.getOtolitheIdCaracteristic();
- }
-
- @Override
public Caracteristic getPmfmIdCaracteristic() {
return referentialService.getPmfmIdCaracteristic();
}
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-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -249,17 +249,17 @@
throw notImplemented();
}
- @Override
- public Caracteristic getSampleIdCaracteristic() {
- throw notImplemented();
- }
+// @Override
+// public Caracteristic getSampleIdCaracteristic() {
+// throw notImplemented();
+// }
+//
+// @Override
+// public Caracteristic getOtolitheIdCaracteristic() {
+// throw notImplemented();
+// }
@Override
- public Caracteristic getOtolitheIdCaracteristic() {
- throw notImplemented();
- }
-
- @Override
public Caracteristic getPmfmIdCaracteristic() {
throw notImplemented();
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/config/SampleCategoryModelConverter.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/config/SampleCategoryModelConverter.java 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/config/SampleCategoryModelConverter.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -81,7 +81,7 @@
}
}
throw new ConversionException(
- _("nuitonutil.error.no.convertor", aClass.getName(), value));
+ _("tutti.persistence.error.no.convertor", aClass.getName(), value));
}
protected boolean isEnabled(Class<?> aClass) {
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -210,11 +210,11 @@
if (log.isWarnEnabled()) {
log.warn("Could not find caracteristic with id: " + id);
}
- caracteristicStr = _("tutti.common.caracteristic.notFound");
+ caracteristicStr = _("tutti.persistence.error.caracteristic.notFound");
}
badCategoriesStr.add("<li>" + id + " : " + caracteristicStr + "</li>");
}
- String message = _("tutti.common.protocol.categories.not.compatible", Joiner.on("").join(badCategoriesStr));
+ String message = _("tutti.persistence.error.protocol.categories.not.compatible", Joiner.on("").join(badCategoriesStr));
return message;
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/IndividualObservationBatchPersistenceServiceImpl.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -284,20 +284,20 @@
CaracteristicMap caracteristics =
CaracteristicMap.copy(source.getCaracteristics());
- if (source.getSamplingCode() != null) {
+// if (source.getSamplingCode() != null) {
+//
+// Caracteristic caracteristic =
+// referentialService.getSampleIdCaracteristic();
+// caracteristics.put(caracteristic, source.getSamplingCode());
+// }
+//
+// if (source.getCalcifiedPieceSamplingCode() != null) {
+//
+// Caracteristic caracteristic =
+// referentialService.getOtolitheIdCaracteristic();
+// caracteristics.put(caracteristic, source.getCalcifiedPieceSamplingCode());
+// }
- Caracteristic caracteristic =
- referentialService.getSampleIdCaracteristic();
- caracteristics.put(caracteristic, source.getSamplingCode());
- }
-
- if (source.getCalcifiedPieceSamplingCode() != null) {
-
- Caracteristic caracteristic =
- referentialService.getOtolitheIdCaracteristic();
- caracteristics.put(caracteristic, source.getCalcifiedPieceSamplingCode());
- }
-
if (source.getWeight() != null) {
Caracteristic caracteristic = referentialService.getWeightMeasuredCaracteristic();
@@ -332,16 +332,16 @@
samplePersistenceHelper.fillSampleMeasurements(
result, batch.getIdAsInt());
- String sampleCode = (String) result.remove(referentialService.getSampleIdCaracteristic());
- if (sampleCode != null) {
- batch.setSamplingCode(sampleCode);
- }
+// String sampleCode = (String) result.remove(referentialService.getSampleIdCaracteristic());
+// if (sampleCode != null) {
+// batch.setSamplingCode(sampleCode);
+// }
+//
+// String calcifiedPieceSampleCode = (String) result.remove(referentialService.getOtolitheIdCaracteristic());
+// if (sampleCode != null) {
+// batch.setCalcifiedPieceSamplingCode(calcifiedPieceSampleCode);
+// }
- String calcifiedPieceSampleCode = (String) result.remove(referentialService.getOtolitheIdCaracteristic());
- if (sampleCode != null) {
- batch.setCalcifiedPieceSamplingCode(calcifiedPieceSampleCode);
- }
-
Float weight = (Float) result.remove(referentialService.getWeightMeasuredCaracteristic());
if (weight != null) {
batch.setWeight(weight);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -245,10 +245,10 @@
Caracteristic getDeadOrAliveCaracteristic();
- Caracteristic getSampleIdCaracteristic();
+// Caracteristic getSampleIdCaracteristic();
+//
+// Caracteristic getOtolitheIdCaracteristic();
- Caracteristic getOtolitheIdCaracteristic();
-
Caracteristic getPmfmIdCaracteristic();
Caracteristic getWeightMeasuredCaracteristic();
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -626,21 +626,21 @@
return result;
}
- @Override
- public Caracteristic getSampleIdCaracteristic() {
- Integer pmfmId = enumeration.PMFM_ID_SAMPLE_ID;
- Caracteristic result = thisService.getCaracteristic(pmfmId);
- return result;
- }
+// @Override
+// public Caracteristic getSampleIdCaracteristic() {
+// Integer pmfmId = enumeration.PMFM_ID_SAMPLE_ID;
+// Caracteristic result = thisService.getCaracteristic(pmfmId);
+// return result;
+// }
+//
+// @Override
+// public Caracteristic getOtolitheIdCaracteristic() {
+// Integer pmfmId = enumeration.PMFM_ID_OTOLITHE_ID;
+// Caracteristic result = thisService.getCaracteristic(pmfmId);
+// return result;
+// }
@Override
- public Caracteristic getOtolitheIdCaracteristic() {
- Integer pmfmId = enumeration.PMFM_ID_OTOLITHE_ID;
- Caracteristic result = thisService.getCaracteristic(pmfmId);
- return result;
- }
-
- @Override
public Caracteristic getPmfmIdCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_ID_PSFM;
Caracteristic result = thisService.getCaracteristic(pmfmId);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-09-21 14:45:35 UTC (rev 1197)
@@ -284,12 +284,12 @@
@Value("${PmfmId.ID_PSFM}")
public final Integer PMFM_ID_ID_PSFM = null;
- @Value("${PmfmId.SAMPLE_ID}")
- public final Integer PMFM_ID_SAMPLE_ID = null;
+// @Value("${PmfmId.SAMPLE_ID}")
+// public final Integer PMFM_ID_SAMPLE_ID = null;
+//
+// @Value("${PmfmId.OTOLITHE_ID}")
+// public final Integer PMFM_ID_OTOLITHE_ID = null;
- @Value("${PmfmId.OTOLITHE_ID}")
- public final Integer PMFM_ID_OTOLITHE_ID = null;
-
protected Set<Integer> propertedPmfmIds;
public void init() {
Modified: trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties 2013-09-21 14:45:35 UTC (rev 1197)
@@ -1,6 +1,3 @@
-nuitonutil.error.no.convertor=
-tutti.common.caracteristic.notFound=
-tutti.common.protocol.categories.not.compatible=
tutti.config.option.persistence.SampleCategoryModel.description=
tutti.config.option.persistence.db.attachment.directory.description=
tutti.config.option.persistence.db.backup.directory.description=
@@ -45,6 +42,9 @@
tutti.persistence.config.generateFile.error=
tutti.persistence.cruise.gearUsedInOperations.error=
tutti.persistence.dbMetadata.instanciation.error=
+tutti.persistence.error.caracteristic.notFound=
+tutti.persistence.error.no.convertor=
+tutti.persistence.error.protocol.categories.not.compatible=
tutti.persistence.loader.error=
tutti.persistence.mkDir.error=
tutti.persistence.protocol.delete.error=
Modified: trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties 2013-09-21 14:42:34 UTC (rev 1196)
+++ trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties 2013-09-21 14:45:35 UTC (rev 1197)
@@ -1,6 +1,3 @@
-nuitonutil.error.no.convertor=
-tutti.common.caracteristic.notFound=Caractéristique inconnue
-tutti.common.protocol.categories.not.compatible=Le protocole utilise des catégories non connues par la configuration des catégorisations \: <ul>%s</ul>
tutti.config.option.persistence.SampleCategoryModel.description=Configuration des catégories d'échantillonnage
tutti.config.option.persistence.db.attachment.directory.description=Répertoire où sont stockées les pièces-jointes
tutti.config.option.persistence.db.backup.directory.description=Répertoire où sont enregistrées les sauvegardes de la base
@@ -45,6 +42,9 @@
tutti.persistence.config.generateFile.error=Erreur lors de la génération du fichier de configuration de la base de données
tutti.persistence.cruise.gearUsedInOperations.error=Vous essayez d'enlever un ou plusieurs engins qui sont utilisés sur des traits.<hr/>Veuillez changer l'engin des traits en question pour pouvoir les enlever de la campagne.
tutti.persistence.dbMetadata.instanciation.error=Erreur lors de l'initialisation des metadata de la base de données par la connexion %s
+tutti.persistence.error.caracteristic.notFound=Caractéristique inconnue
+tutti.persistence.error.no.convertor=Impossible de convertir en modeèle de catégorie le type %s avec la valeur %s
+tutti.persistence.error.protocol.categories.not.compatible=Le protocole utilise des catégories non connues par la configuration des catégorisations \: <ul>%s</ul>
tutti.persistence.loader.error=Erreur de conversion du dossier %s en URL
tutti.persistence.mkDir.error=Erreur lors de la création du dossier %s
tutti.persistence.protocol.delete.error=Erreur lors de la suppression du protocole %1s (fichier %2s)
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
1
0
21 Sep '13
Author: tchemit
Date: 2013-09-21 16:42:34 +0200 (Sat, 21 Sep 2013)
New Revision: 1196
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1196
Log:
fixes #3306: [DONNEES INDIVIDUELLES] L'ordre de saisie n'est pas conserv?\195?\169
fixes #3308: [CAPTURES ACCIDENTELLES] L'ordre de saisie n'est pas conserv?\195?\169
Modified:
trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-09-20 13:54:16 UTC (rev 1195)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-09-21 14:42:34 UTC (rev 1196)
@@ -379,7 +379,7 @@
s.fishingOperation.id= :fishingOperationId
AND s.batch IS NULL
ORDER BY
- s.creationDate
+ s.id
]]>
<query-param name="fishingOperationId" type="java.lang.Integer"/>
</query>
@@ -396,7 +396,7 @@
s.fishingOperation.id= :fishingOperationId
AND s.batch.id = :batchId
ORDER BY
- s.creationDate
+ s.id
]]>
<query-param name="fishingOperationId" type="java.lang.Integer"/>
<query-param name="batchId" type="java.lang.Integer"/>
1
0
r1195 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service tutti-persistence/src/main/xmi tutti-ui-swing/src/main/filtered-resources tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol tutti-ui-swing/src/main/resources/i18n
by tchemit@users.forge.codelutin.com 20 Sep '13
by tchemit@users.forge.codelutin.com 20 Sep '13
20 Sep '13
Author: tchemit
Date: 2013-09-20 15:54:16 +0200 (Fri, 20 Sep 2013)
New Revision: 1195
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1195
Log:
refs #3297: [OBSERVATIONS INDIVIDUELLES] g?\195?\169rer les colonnes du tableau dans le protocole (configuration dans le protocole)
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
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/protocol/EditProtocolUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-09-20 13:54:16 UTC (rev 1195)
@@ -326,10 +326,10 @@
PMFM_ID_TRAWL_DISTANCE,
PMFM_ID_SURVEY_PART,
PMFM_ID_SORTED_UNSORTED,
- PMFM_ID_SIZE_CATEGORY,
- PMFM_ID_MATURITY,
- PMFM_ID_SEX,
- PMFM_ID_AGE,
+// PMFM_ID_SIZE_CATEGORY,
+// PMFM_ID_MATURITY,
+// PMFM_ID_SEX,
+// PMFM_ID_AGE,
PMFM_ID_ID_PSFM
);
}
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
===================================================================
--- trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-09-20 13:54:16 UTC (rev 1195)
@@ -45,6 +45,7 @@
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.gearUseFeaturePmfmId.stereotype=ordered
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.vesselUseFeaturePmfmId.stereotype=ordered
+fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.individualObservationPmfmId.stereotype=ordered
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.lengthClassesPmfmId.stereotype=ordered
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.species.stereotype=ordered
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.benthos.stereotype=ordered
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
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-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-20 13:54:16 UTC (rev 1195)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Thu Sep 19 23:07:37 CEST 2013
+#Fri Sep 20 11:03:34 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -213,6 +213,7 @@
tutti.editProtocol.field.benthos.help=editProtocol.html\#fieldsBenthos
tutti.editProtocol.field.comment.help=editProtocol.html\#fields
tutti.editProtocol.field.gearUseFeature.help=editProtocol.html\#fieldsCaracteristics
+tutti.editProtocol.field.individualObservation.help=
tutti.editProtocol.field.lengthClasses.help=editProtocol.html\#fieldsCaracteristics
tutti.editProtocol.field.name.help=editProtocol.html\#fields
tutti.editProtocol.field.species.help=editProtocol.html\#fieldsSpecies
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-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-20 13:54:16 UTC (rev 1195)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Thu Sep 19 22:01:50 CEST 2013
+#Fri Sep 20 11:03:34 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -89,8 +89,8 @@
tutti.editBenthosBatch.help=editFishingOperation.html\#captureBenthos
tutti.editBenthosFrequencies.action.cancel.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosFrequencies.action.generate.help=editFishingOperation.html\#captureBenthosActions
+tutti.editBenthosFrequencies.action.saveAndClose.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosFrequencies.action.saveAndContinue.help=editFishingOperation.html\#captureBenthosActions
-tutti.editBenthosFrequencies.action.saveAndClose.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosFrequencies.field.lengthStepCaracteristic.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosFrequencies.field.maxStep.help=editFishingOperation.html\#captureBenthosFields
tutti.editBenthosFrequencies.field.minStep.help=editFishingOperation.html\#captureBenthosFields
@@ -212,6 +212,7 @@
tutti.editProtocol.field.benthos.help=editProtocol.html\#fieldsBenthos
tutti.editProtocol.field.comment.help=editProtocol.html\#fields
tutti.editProtocol.field.gearUseFeature.help=editProtocol.html\#fieldsCaracteristics
+tutti.editProtocol.field.individualObservation.help=
tutti.editProtocol.field.lengthClasses.help=editProtocol.html\#fieldsCaracteristics
tutti.editProtocol.field.name.help=editProtocol.html\#fields
tutti.editProtocol.field.species.help=editProtocol.html\#fieldsSpecies
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2013-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2013-09-20 13:54:16 UTC (rev 1195)
@@ -129,6 +129,11 @@
_help: {"tutti.editProtocol.field.vesselUseFeature.help"};
}
+#individualObservationList {
+ property: individualObservationPmfm;
+ _help: {"tutti.editProtocol.field.individualObservation.help"};
+}
+
#lengthClassesList {
property: lengthClassesPmfm;
_help: {"tutti.editProtocol.field.lengthClasses.help"};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-09-20 13:54:16 UTC (rev 1195)
@@ -128,6 +128,10 @@
<BeanDoubleList id='gearUseFeatureList'
genericType='Caracteristic'/>
</tab>
+ <tab title='tutti.editProtocol.tab.caracteristic.individualObservation'>
+ <BeanDoubleList id='individualObservationList'
+ genericType='Caracteristic'/>
+ </tab>
<tab title='tutti.editProtocol.tab.caracteristic.vesselUseFeature'>
<BeanDoubleList id='vesselUseFeatureList'
genericType='Caracteristic'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-20 13:54:16 UTC (rev 1195)
@@ -117,6 +117,8 @@
protected final SampleCategoryModel sampleCategoryModel;
+ protected List<BeanDoubleList<Caracteristic>> allDoubleLists;
+
public EditProtocolUIHandler(TuttiUI parentUi, EditProtocolUI ui) {
super(parentUi.getHandler().getContext(), ui);
this.persistenceService = context.getPersistenceService();
@@ -275,8 +277,8 @@
model.setSpeciesRow(speciesRows);
model.setBenthosRow(benthosRows);
- ui.getSpeciesComboBox().getHandler().reset();
- ui.getBenthosComboBox().getHandler().reset();
+ ui.getSpeciesComboBox().reset();
+ ui.getBenthosComboBox().reset();
{
// create species table model
@@ -399,44 +401,32 @@
tableModel.setRows(benthosRows);
}
+ allDoubleLists = Lists.newArrayList(
+ ui.getLengthClassesList(),
+ ui.getGearUseFeatureList(),
+ ui.getIndividualObservationList(),
+ ui.getVesselUseFeatureList()
+ );
+
initDoubleList(EditProtocolUIModel.PROPERTY_LENGTH_CLASSES_PMFM_ID,
ui.getLengthClassesList(),
Lists.newArrayList(model.getCaracteristics()),
- model.getLengthClassesPmfmId(),
- new Predicate<Caracteristic>() {
+ model.getLengthClassesPmfmId());
- public boolean apply(Caracteristic input) {
- boolean result = !ui.getGearUseFeatureList().getModel().getSelected().contains(input);
- result &= !ui.getVesselUseFeatureList().getModel().getSelected().contains(input);
- return result;
- }
- });
-
initDoubleList(EditProtocolUIModel.PROPERTY_GEAR_USE_FEATURE_PMFM_ID,
ui.getGearUseFeatureList(),
Lists.newArrayList(model.getCaracteristics()),
- model.getGearUseFeaturePmfmId(),
- new Predicate<Caracteristic>() {
+ model.getGearUseFeaturePmfmId());
- public boolean apply(Caracteristic input) {
- boolean result = !ui.getLengthClassesList().getModel().getSelected().contains(input);
- result &= !ui.getVesselUseFeatureList().getModel().getSelected().contains(input);
- return result;
- }
- });
-
initDoubleList(EditProtocolUIModel.PROPERTY_VESSEL_USE_FEATURE_PMFM_ID,
ui.getVesselUseFeatureList(),
Lists.newArrayList(model.getCaracteristics()),
- model.getVesselUseFeaturePmfmId(),
- new Predicate<Caracteristic>() {
+ model.getVesselUseFeaturePmfmId());
- public boolean apply(Caracteristic input) {
- boolean result = !ui.getGearUseFeatureList().getModel().getSelected().contains(input);
- result &= !ui.getLengthClassesList().getModel().getSelected().contains(input);
- return result;
- }
- });
+ initDoubleList(EditProtocolUIModel.PROPERTY_INDIVIDUAL_OBSERVATION_PMFM_ID,
+ ui.getIndividualObservationList(),
+ Lists.newArrayList(model.getCaracteristics()),
+ model.getIndividualObservationPmfmId());
// if new protocol can already cancel his creation
model.setModify(model.isCreate() || model.isCleaned());
@@ -458,6 +448,10 @@
break;
case 2:
+ selectedDoubleList = ui.getIndividualObservationList();
+ break;
+
+ case 3:
selectedDoubleList = ui.getVesselUseFeatureList();
break;
@@ -545,40 +539,23 @@
//------------------------------------------------------------------------//
public void addDoubleListListeners() {
- String id;
- UpdateSelectedList updateListener;
EditProtocolUIModel model = getModel();
- id = (String) ui.getLengthClassesList().getClientProperty("_updateListenerId");
- updateListener = (UpdateSelectedList) ui.getLengthClassesList().getClientProperty("_updateListener");
- model.addPropertyChangeListener(id, updateListener);
-
- id = (String) ui.getVesselUseFeatureList().getClientProperty("_updateListenerId");
- updateListener = (UpdateSelectedList) ui.getVesselUseFeatureList().getClientProperty("_updateListener");
- model.addPropertyChangeListener(id, updateListener);
-
- id = (String) ui.getGearUseFeatureList().getClientProperty("_updateListenerId");
- updateListener = (UpdateSelectedList) ui.getGearUseFeatureList().getClientProperty("_updateListener");
- model.addPropertyChangeListener(id, updateListener);
+ for (BeanDoubleList<Caracteristic> list : allDoubleLists) {
+ String id = (String) list.getClientProperty("_updateListenerId");
+ UpdateSelectedList updateListener = (UpdateSelectedList) list.getClientProperty("_updateListener");
+ model.addPropertyChangeListener(id, updateListener);
+ }
}
public void removeDoubleListListeners() {
- String id;
- UpdateSelectedList updateListener;
EditProtocolUIModel model = getModel();
- id = (String) ui.getLengthClassesList().getClientProperty("_updateListenerId");
- updateListener = (UpdateSelectedList) ui.getLengthClassesList().getClientProperty("_updateListener");
-
- model.removePropertyChangeListener(id, updateListener);
-
- id = (String) ui.getVesselUseFeatureList().getClientProperty("_updateListenerId");
- updateListener = (UpdateSelectedList) ui.getVesselUseFeatureList().getClientProperty("_updateListener");
- model.removePropertyChangeListener(id, updateListener);
-
- id = (String) ui.getGearUseFeatureList().getClientProperty("_updateListenerId");
- updateListener = (UpdateSelectedList) ui.getGearUseFeatureList().getClientProperty("_updateListener");
- model.removePropertyChangeListener(id, updateListener);
+ for (BeanDoubleList<Caracteristic> list : allDoubleLists) {
+ String id = (String) list.getClientProperty("_updateListenerId");
+ UpdateSelectedList updateListener = (UpdateSelectedList) list.getClientProperty("_updateListener");
+ model.removePropertyChangeListener(id, updateListener);
+ }
}
public Species openSelectOtherSpeciesDialog(String title, List<Species> species) {
@@ -598,8 +575,7 @@
protected void initDoubleList(String propertyId,
BeanDoubleList<Caracteristic> widget,
List<Caracteristic> availableCaracteristics,
- List<String> selectedCaracteristics,
- Predicate<Caracteristic> filter) {
+ List<String> selectedCaracteristics) {
initBeanList(widget, availableCaracteristics,
Lists.<Caracteristic>newArrayList());
@@ -611,7 +587,10 @@
widget.putClientProperty("_updateListenerId", propertyId);
listener.select(selectedCaracteristics);
- widget.getHandler().addFilter(filter);
+ // add a filter to keep only in universe everything except what is selected by other double lists
+ List<BeanDoubleList<Caracteristic>> list = Lists.newArrayList(allDoubleLists);
+ list.remove(widget);
+ widget.getHandler().addFilter(new SelectValuePredicate(list));
}
protected void selectLengthClasses(List<String> ids, JComboBox comboBox) {
@@ -750,4 +729,26 @@
model.setSelected(selection);
}
}
+
+ protected static class SelectValuePredicate implements Predicate<Caracteristic> {
+
+ protected final List<BeanDoubleList<Caracteristic>> lists;
+
+ public SelectValuePredicate(List<BeanDoubleList<Caracteristic>> lists) {
+ this.lists = lists;
+ }
+
+ @Override
+ public boolean apply(Caracteristic input) {
+
+ boolean result = true;
+ for (BeanDoubleList<Caracteristic> list : lists) {
+ if (list.getModel().getSelected().contains(input)) {
+ result = false;
+ break;
+ }
+ }
+ return result;
+ }
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-09-20 13:54:16 UTC (rev 1195)
@@ -151,6 +151,11 @@
setVesselUseFeaturePmfmId(ids);
}
+ public void setIndividualObservationPmfm(List<Caracteristic> individualObservationPmfm) {
+ List<String> ids = TuttiEntities.collecIds(individualObservationPmfm);
+ setIndividualObservationPmfmId(ids);
+ }
+
public List<EditProtocolSpeciesRowModel> getSpeciesRow() {
return speciesRow;
}
@@ -324,7 +329,6 @@
@Override
public void setGearUseFeaturePmfmId(List<String> gearUseFeaturePmfmId) {
- Object oldValue = getGearUseFeaturePmfmId();
editObject.setGearUseFeaturePmfmId(gearUseFeaturePmfmId);
firePropertyChange(PROPERTY_GEAR_USE_FEATURE_PMFM_ID, null, gearUseFeaturePmfmId);
}
@@ -336,12 +340,22 @@
@Override
public void setVesselUseFeaturePmfmId(List<String> vesselUseFeaturePmfmId) {
- Object oldValue = getVesselUseFeaturePmfmId();
editObject.setVesselUseFeaturePmfmId(vesselUseFeaturePmfmId);
firePropertyChange(PROPERTY_VESSEL_USE_FEATURE_PMFM_ID, null, vesselUseFeaturePmfmId);
}
@Override
+ public List<String> getIndividualObservationPmfmId() {
+ return editObject.getIndividualObservationPmfmId();
+ }
+
+ @Override
+ public void setIndividualObservationPmfmId(List<String> individualObservationPmfmId) {
+ editObject.setIndividualObservationPmfmId(individualObservationPmfmId);
+ firePropertyChange(PROPERTY_INDIVIDUAL_OBSERVATION_PMFM_ID, null, individualObservationPmfmId);
+ }
+
+ @Override
public String getGearUseFeaturePmfmId(int index) {
return null;
}
@@ -428,6 +442,49 @@
}
@Override
+ public String getIndividualObservationPmfmId(int index) {
+ return null;
+ }
+
+ @Override
+ public boolean isIndividualObservationPmfmIdEmpty() {
+ return false;
+ }
+
+ @Override
+ public int sizeIndividualObservationPmfmId() {
+ return 0;
+ }
+
+ @Override
+ public void addIndividualObservationPmfmId(String individualObservationPmfmId) {
+ }
+
+ @Override
+ public void addAllIndividualObservationPmfmId(Collection<String> individualObservationPmfmId) {
+ }
+
+ @Override
+ public boolean removeIndividualObservationPmfmId(String individualObservationPmfmId) {
+ return false;
+ }
+
+ @Override
+ public boolean removeAllIndividualObservationPmfmId(Collection<String> individualObservationPmfmId) {
+ return false;
+ }
+
+ @Override
+ public boolean containsIndividualObservationPmfmId(String individualObservationPmfmId) {
+ return false;
+ }
+
+ @Override
+ public boolean containsAllIndividualObservationPmfmId(Collection<String> individualObservationPmfmId) {
+ return false;
+ }
+
+ @Override
public String getLengthClassesPmfmId(int index) {
return null;
}
@@ -472,7 +529,7 @@
@Override
public SpeciesProtocol getSpecies(int index) {
- return null;
+ return editObject.getSpecies(index);
}
@Override
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-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-20 13:54:16 UTC (rev 1195)
@@ -845,6 +845,7 @@
tutti.editProtocol.tab.benthos=
tutti.editProtocol.tab.caracteristic=
tutti.editProtocol.tab.caracteristic.gearUseFeature=
+tutti.editProtocol.tab.caracteristic.individualObservation=
tutti.editProtocol.tab.caracteristic.lengthClasses=
tutti.editProtocol.tab.caracteristic.vesselUseFeature=
tutti.editProtocol.tab.info=
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-09-19 21:16:52 UTC (rev 1194)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-20 13:54:16 UTC (rev 1195)
@@ -818,6 +818,7 @@
tutti.editProtocol.tab.benthos=Benthos
tutti.editProtocol.tab.caracteristic=Caractéristiques
tutti.editProtocol.tab.caracteristic.gearUseFeature=Mise en œuvre de l'engin
+tutti.editProtocol.tab.caracteristic.individualObservation=Observations individuelles
tutti.editProtocol.tab.caracteristic.lengthClasses=Classes de taille
tutti.editProtocol.tab.caracteristic.vesselUseFeature=Autres caractéristiques
tutti.editProtocol.tab.info=Informations générales
1
0