Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- 4058 discussions
r532 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table
by tchemit@users.forge.codelutin.com 04 Mar '13
by tchemit@users.forge.codelutin.com 04 Mar '13
04 Mar '13
Author: tchemit
Date: 2013-03-04 19:40:32 +0100 (Mon, 04 Mar 2013)
New Revision: 532
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/532
Log:
improve comment highlight
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-04 18:03:49 UTC (rev 531)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-04 18:40:32 UTC (rev 532)
@@ -42,6 +42,7 @@
import jaxx.runtime.swing.renderer.DecoratorTableCellRenderer;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
@@ -303,12 +304,15 @@
new HighlightPredicate.AndHighlightPredicate(
new MyIdentifierHighlightPredicate(SpeciesBatchTableModel.COMMENT),
// for not null value
- new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate()),
- new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate(""))
- ), cellWithValueColor);
+ new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ return StringUtils.isNotBlank((String) adapter.getValue());
+ }
+ }), cellWithValueColor);
table.addHighlighter(commentHighlighter);
- // paint in a special color for attachment cell (with not null value)
+ // paint in a special color for attachment cell (when some attachments)
Highlighter attachmentHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
new HighlightPredicate.AndHighlightPredicate(
new MyIdentifierHighlightPredicate(SpeciesBatchTableModel.ATTACHMENTS),
1
0
r531 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/operation/catches/species util/editor util/table
by tchemit@users.forge.codelutin.com 04 Mar '13
by tchemit@users.forge.codelutin.com 04 Mar '13
04 Mar '13
Author: tchemit
Date: 2013-03-04 19:03:49 +0100 (Mon, 04 Mar 2013)
New Revision: 531
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/531
Log:
fixes #1861: [CAPTURE] - Fonctionnalit?\195?\169s de pi?\195?\168ces jointes
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/ColumnIdentifier.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -196,11 +196,11 @@
protected String comment;
/**
- * Attachments
+ * Attachments (should never be null).
*
* @since 0.2
*/
- protected List<Attachment> attachments;
+ protected final List<Attachment> attachments;
/**
* List of frequencies observed for this batch.
@@ -236,6 +236,7 @@
public SpeciesBatchRowModel() {
super(SpeciesBatch.class, fromBeanBinder, toBeanBinder);
frequency = Lists.newArrayList();
+ attachments = Lists.newArrayList();
sortedUnsortedCategory = SampleCategory.newSample(SampleCategoryType.sortedUnsorted);
sizeCategory = SampleCategory.newSample(SampleCategoryType.size);
sexCategory = SampleCategory.newSample(SampleCategoryType.sex);
@@ -278,12 +279,14 @@
}
public SpeciesBatchRowModel(SpeciesBatch aBatch,
- List<SpeciesBatchFrequency> frequencies) {
+ List<SpeciesBatchFrequency> frequencies,
+ List<Attachment> attachments) {
this();
fromBean(aBatch);
List<SpeciesFrequencyRowModel> frequencyRows =
SpeciesFrequencyRowModel.fromBeans(frequencies);
frequency.addAll(frequencyRows);
+ this.attachments.addAll(attachments);
Collections.sort(frequency);
}
@@ -596,11 +599,11 @@
return attachments;
}
- public void setAttachments(List<Attachment> attachments) {
- Object oldValue = getAttachments();
- this.attachments = attachments;
- firePropertyChange(PROPERTY_ATTACHMENTS, oldValue, attachments);
- }
+// public void setAttachments(List<Attachment> attachments) {
+// Object oldValue = getAttachments();
+// this.attachments = attachments;
+// firePropertyChange(PROPERTY_ATTACHMENTS, oldValue, attachments);
+// }
public List<SpeciesFrequencyRowModel> getFrequency() {
return frequency;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -139,7 +139,7 @@
n_("tutti.table.species.batch.header.comment"),
n_("tutti.table.species.batch.header.comment"));
- public static final ColumnIdentifier<SpeciesBatchRowModel> ATTACHMENTS = ColumnIdentifier.newId(
+ public static final ColumnIdentifier<SpeciesBatchRowModel> ATTACHMENTS = ColumnIdentifier.newReadOnlyId(
SpeciesBatchRowModel.PROPERTY_ATTACHMENTS,
n_("tutti.table.species.batch.header.file"),
n_("tutti.table.species.batch.header.file"));
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-04 18:03:49 UTC (rev 531)
@@ -178,7 +178,7 @@
}
#filterSpeciesBatchRootButton {
- text: {_("tutti.label.filterSpeciesBatchMode.mode.root", model.getRootNumber())};
+ text: {handler.getFilterSpeciesBatchRootButtonText(model.getRootNumber())};
toolTipText: "tutti.label.filterSpeciesBatchMode.mode.root.tip";
value: "root";
selected: {model.isTableViewModeRoot()};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -937,6 +937,10 @@
row.setFrequency(frequencyRows);
}
+ public String getFilterSpeciesBatchRootButtonText(int rootNumber) {
+ return _("tutti.label.filterSpeciesBatchMode.mode.root", getModel().getRootNumber());
+ }
+
protected void recomputeBatchActionEnable() {
int rowIndex = getTable().getSelectedRow();
@@ -1051,11 +1055,16 @@
SpeciesBatchRowModel parentRow,
List<SpeciesBatchRowModel> rows) {
+ String id = aBatch.getId();
+
List<SpeciesBatchFrequency> frequencies =
- persistenceService.getAllSpeciesBatchFrequency(aBatch.getId());
+ persistenceService.getAllSpeciesBatchFrequency(id);
+ List<Attachment> attachments =
+ persistenceService.getAllAttachments(Integer.valueOf(id));
+
SpeciesBatchRowModel newRow =
- new SpeciesBatchRowModel(aBatch, frequencies);
+ new SpeciesBatchRowModel(aBatch, frequencies, attachments);
SampleCategoryEnum sampleCategoryEnum =
aBatch.getSampleCategoryType();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -34,6 +34,7 @@
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import jaxx.runtime.SwingUtil;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.decorator.Decorator;
@@ -106,8 +107,6 @@
protected final AttachmentCellComponent component;
-// protected final AttachmentEditorUI ui;
-
protected AttachmentEditor attachmentEditor;
protected Frame frame;
@@ -158,8 +157,13 @@
// stop edition
stopCellEditing();
+ // refresh cell
+ tableModel.fireTableCellUpdated(r, c);
+
// reselect this cell
AbstractSelectTableAction.doSelectCell(table, r, c);
+
+ // focus on table
table.requestFocus();
}
};
@@ -315,8 +319,6 @@
private final Decorator<Attachment> decorator;
- protected String propertyName;
-
public AttachmentCellRenderer(Decorator<Attachment> decorator,
String noneText) {
component = new AttachmentCellComponent();
@@ -336,19 +338,17 @@
if (table != null) {
+ Collection<Attachment> attachments = (Collection<Attachment>) value;
+
String textValue;
- if (value == null) {
- if (propertyName == null) {
- AbstractTuttiTableModel tableModel =
- (AbstractTuttiTableModel) table.getModel();
- ColumnIdentifier columnIdentifier = tableModel.getPropertyName(column);
- propertyName = columnIdentifier.getPropertyName();
- }
+
+ if (CollectionUtils.isEmpty(attachments)) {
+
// use HTML to show the tooltip in italic
textValue = "<i>" + _(noneText) + "</i>";
} else {
- Collection<Attachment> attachments = (Collection<Attachment>) value;
+
StringBuilder sb = new StringBuilder();
for (Attachment attachment : attachments) {
sb.append("<br/>").append(decorator.toString(attachment));
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -77,6 +77,7 @@
setUndecorated(true);
add(editor);
setResizable(true);
+ pack();
ComponentResizer cr = new ComponentResizer();
cr.registerComponent(this);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -25,7 +25,6 @@
*/
import com.ezware.oxbow.swingbits.util.Preconditions;
-import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
@@ -115,7 +114,6 @@
Preconditions.checkNotNull(list);
list.remove(attachment);
- TuttiUIUtil.setProperty(bean, property, list);
ui.getAttachments().remove(hbox);
@@ -164,10 +162,7 @@
AbstractTuttiBeanUIModel bean = ui.getBean();
String property = ui.getProperty();
List<Attachment> list = (List<Attachment>) TuttiUIUtil.getProperty(bean, property);
- if (list == null) {
- list = Lists.newArrayList();
- TuttiUIUtil.setProperty(bean, property, list);
- }
+ Preconditions.checkNotNull(list, "Attachments list can not be null");
Attachment attachment = new Attachment();
File file = ui.getFile().getSelectedFile();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -73,6 +73,7 @@
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
@@ -312,7 +313,12 @@
new HighlightPredicate.AndHighlightPredicate(
new MyIdentifierHighlightPredicate(SpeciesBatchTableModel.ATTACHMENTS),
// for not null value
- new HighlightPredicate.NotHighlightPredicate(new HighlightPredicate.EqualsHighlightPredicate())
+ new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ return CollectionUtils.isNotEmpty((Collection) adapter.getValue());
+ }
+ }
), cellWithValueColor);
table.addHighlighter(attachmentHighlighter);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/ColumnIdentifier.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/ColumnIdentifier.java 2013-03-04 17:05:50 UTC (rev 530)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/ColumnIdentifier.java 2013-03-04 18:03:49 UTC (rev 531)
@@ -50,6 +50,22 @@
headerTipI18nKey);
}
+ public static <R> ColumnIdentifier<R> newReadOnlyId(String propertyName,
+ String headerI18nKey,
+ String headerTipI18nKey) {
+ return new ColumnIdentifier<R>(propertyName,
+ headerI18nKey,
+ headerTipI18nKey) {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void setValue(R entry, Object value) {
+ // no set
+ }
+ };
+ }
+
protected ColumnIdentifier(String propertyName,
String headerI18nKey,
String headerTipI18nKey) {
1
0
r530 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/operation/catches/species util/editor
by tchemit@users.forge.codelutin.com 04 Mar '13
by tchemit@users.forge.codelutin.com 04 Mar '13
04 Mar '13
Author: tchemit
Date: 2013-03-04 18:05:50 +0100 (Mon, 04 Mar 2013)
New Revision: 530
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/530
Log:
refs #1861: [CAPTURE] - Fonctionnalit?\195?\169s de pi?\195?\168ces jointes (review Attachmenteditor + add it on SpeciesBatch)
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-03-04 16:57:44 UTC (rev 529)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-03-04 17:05:50 UTC (rev 530)
@@ -75,7 +75,7 @@
<LongTextEditorUI id='longTextEditor'/>
- <AttachmentEditorUI id='attachmentEditor'/>
+ <!--<AttachmentEditorUI id='attachmentEditor'/>-->
<JPopupMenu id='tablePopup'>
<!--onPopupMenuWillBecomeVisible='handler.updateTablePopup()'>-->
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 16:57:44 UTC (rev 529)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 17:05:50 UTC (rev 530)
@@ -30,6 +30,7 @@
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+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.FishingOperation;
@@ -622,7 +623,10 @@
{ // File column
addColumnToModel(columnModel,
- AttachmentCellComponent.newEditor(ui),
+ AttachmentCellComponent.newEditor(ui,
+ AttachementObjectTypeEnum.SAMPLE,
+ "id",
+ _(SpeciesBatchTableModel.ATTACHMENTS.getHeaderI18nKey())),
AttachmentCellComponent.newRender(
getDecorator(Attachment.class, null),
n_("tutti.tooltip.attachment.none")),
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-04 16:57:44 UTC (rev 529)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-04 17:05:50 UTC (rev 530)
@@ -140,6 +140,8 @@
private boolean renameSpeciesBatchEnabled;
+ private String rootBatchId;
+
public SpeciesBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_COMPUTED_WEIGHT,
@@ -337,4 +339,11 @@
firePropertyChange(PROPERTY_CREATE_MELAG_ENABLED, oldValue, createMelagEnabled);
}
+ public void setRootBatchId(String rootBatchId) {
+ this.rootBatchId = rootBatchId;
+ }
+
+ public String getRootBatchId() {
+ return rootBatchId;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2013-03-04 16:57:44 UTC (rev 529)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2013-03-04 17:05:50 UTC (rev 530)
@@ -25,23 +25,20 @@
*/
import com.google.common.base.Preconditions;
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
-import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
-import jaxx.runtime.swing.ComponentMover;
-import jaxx.runtime.swing.ComponentResizer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.decorator.Decorator;
import javax.swing.AbstractCellEditor;
-import javax.swing.BorderFactory;
-import javax.swing.JDialog;
import javax.swing.JTable;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableCellRenderer;
@@ -50,18 +47,12 @@
import java.awt.Color;
import java.awt.Component;
import java.awt.Frame;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
import java.util.Collection;
import static org.nuiton.i18n.I18n._;
/**
- * Component to edit a cell containing attachments
+ * Component to edit a cell containing attachments.
*
* @author kmorin
* @since 0.2
@@ -87,18 +78,38 @@
return new AttachmentCellRenderer(decorator, noneText);
}
+ //FIXME remove this
public static TableCellEditor newEditor(AttachmentEditorUI ui) {
- return new AttachmentCellEditor(ui);
+ return new AttachmentCellEditor(null, null, null, null, null);
}
+ public static TableCellEditor newEditor(TuttiUI ui,
+ AttachementObjectTypeEnum objectType,
+ String objectIdProperty,
+ String title) {
+
+ Frame frame = SwingUtil.getParentContainer(ui, Frame.class);
+
+ AttachmentCellComponent component = new AttachmentCellComponent();
+ component.setBorder(new LineBorder(Color.BLACK));
+
+ return new AttachmentCellEditor(frame,
+ component,
+ objectType,
+ objectIdProperty,
+ title);
+ }
+
public static class AttachmentCellEditor extends AbstractCellEditor implements TableCellEditor {
private static final long serialVersionUID = 1L;
protected final AttachmentCellComponent component;
- protected final AttachmentEditorUI ui;
+// protected final AttachmentEditorUI ui;
+ protected AttachmentEditor attachmentEditor;
+
protected Frame frame;
protected JTable table;
@@ -113,103 +124,144 @@
protected Integer columnIndex;
- public AttachmentCellEditor(AttachmentEditorUI ui) {
- this.ui = ui;
+ public AttachmentCellEditor(Frame frame,
+ AttachmentCellComponent component,
+ AttachementObjectTypeEnum objectTypeProperty,
+ String objectIdProperty,
+ String title) {
- component = new AttachmentCellComponent();
- component.setBorder(new LineBorder(Color.BLACK));
- component.addKeyListener(new KeyAdapter() {
+ this.component = component;
+ this.attachmentEditor = new AttachmentEditor(frame,
+ component,
+ objectTypeProperty,
+ objectIdProperty,
+ title) {
+
+ private static final long serialVersionUID = 1L;
+
@Override
- public void keyReleased(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_ENTER ||
- e.getKeyCode() == KeyEvent.VK_SPACE) {
- e.consume();
- startEdit();
- }
+ protected AbstractTuttiBeanUIModel getBean() {
+ return editRow;
}
- });
- component.addMouseListener(new MouseAdapter() {
@Override
- public void mouseClicked(MouseEvent e) {
- e.consume();
- startEdit();
+ protected String getProperty() {
+ return columnIdentifier.getPropertyName();
}
- });
- }
- protected void startEdit() {
- if (frame == null) {
- frame = SwingUtil.getParentContainer(ui, Frame.class);
- }
+ @Override
+ public void startEdit() {
+ super.startEdit();
+ int r = rowIndex;
+ int c = columnIndex;
- ui.setBorder(BorderFactory.createTitledBorder(_(columnIdentifier.getHeaderI18nKey())));
- ui.setBean(editRow);
- ui.setProperty(columnIdentifier.getPropertyName());
+ // stop edition
+ stopCellEditing();
- JDialog editor = new JDialog(frame, true);
- editor.setUndecorated(true);
- editor.add(ui);
- editor.setResizable(true);
- editor.pack();
-
- ComponentResizer cr = new ComponentResizer();
- cr.registerComponent(editor);
- ComponentMover cm = new ComponentMover();
- cm.setDragInsets(cr.getDragInsets());
- cm.registerComponent(editor);
-
- editor.addWindowListener(new WindowAdapter() {
-
- @Override
- public void windowClosed(WindowEvent e) {
- Component ui = (Component) e.getSource();
- if (log.isInfoEnabled()) {
- log.info("Destroy ui " + ui);
- }
- JAXXUtil.destroy(ui);
+ // reselect this cell
+ AbstractSelectTableAction.doSelectCell(table, r, c);
+ table.requestFocus();
}
- });
+ };
+ }
- // Computes the location of bottom left corner of the cell
- Component comp = component;
- int x = 0;
- int y = component.getHeight();
- while (comp != null) {
- x += comp.getX();
- y += comp.getY();
- comp = comp.getParent();
- }
- // if the editor is too big on the right,
- // then align its right side to the right side of the cell
- if (x + editor.getWidth() > frame.getX() + frame.getWidth()) {
- x = x - editor.getWidth() + component.getWidth();
- }
- editor.setLocation(x, y);
- editor.setVisible(true);
+// public AttachmentCellEditor(AttachmentEditorUI ui) {
+// this.ui = ui;
+//
+// this.attachmentEditor = new AttachmentEditor(SwingUtil.getParentContainer(ui, Frame.class));
+//
+// component = new AttachmentCellComponent();
+// component.setBorder(new LineBorder(Color.BLACK));
+// component.addKeyListener(new KeyAdapter() {
+// @Override
+// public void keyReleased(KeyEvent e) {
+// if (e.getKeyCode() == KeyEvent.VK_ENTER ||
+// e.getKeyCode() == KeyEvent.VK_SPACE) {
+// e.consume();
+// startEdit();
+// }
+// }
+// });
+//
+// component.addMouseListener(new MouseAdapter() {
+// @Override
+// public void mouseClicked(MouseEvent e) {
+// e.consume();
+// startEdit();
+// }
+// });
+// }
+//
+// protected void startEdit() {
+// if (frame == null) {
+// frame = SwingUtil.getParentContainer(ui, Frame.class);
+// }
+//
+// ui.setBorder(BorderFactory.createTitledBorder(_(columnIdentifier.getHeaderI18nKey())));
+// ui.setBean(editRow);
+// ui.setProperty(columnIdentifier.getPropertyName());
+//
+// JDialog editor = new JDialog(frame, true);
+// editor.setUndecorated(true);
+// editor.add(ui);
+// editor.setResizable(true);
+// editor.pack();
+//
+// ComponentResizer cr = new ComponentResizer();
+// cr.registerComponent(editor);
+// ComponentMover cm = new ComponentMover();
+// cm.setDragInsets(cr.getDragInsets());
+// cm.registerComponent(editor);
+//
+// editor.addWindowListener(new WindowAdapter() {
+//
+// @Override
+// public void windowClosed(WindowEvent e) {
+// Component ui = (Component) e.getSource();
+// if (log.isInfoEnabled()) {
+// log.info("Destroy ui " + ui);
+// }
+// JAXXUtil.destroy(ui);
+// }
+// });
+//
+// // Computes the location of bottom left corner of the cell
+// Component comp = component;
+// int x = 0;
+// int y = component.getHeight();
+// while (comp != null) {
+// x += comp.getX();
+// y += comp.getY();
+// comp = comp.getParent();
+// }
+// // if the editor is too big on the right,
+// // then align its right side to the right side of the cell
+// if (x + editor.getWidth() > frame.getX() + frame.getWidth()) {
+// x = x - editor.getWidth() + component.getWidth();
+// }
+// editor.setLocation(x, y);
+// editor.setVisible(true);
+//
+// int r = rowIndex;
+// int c = columnIndex;
+//
+// // stop edition
+// stopCellEditing();
+//
+// // reselect this cell
+// AbstractSelectTableAction.doSelectCell(table, r, c);
+// table.requestFocus();
+// }
- int r = rowIndex;
- int c = columnIndex;
-
- // stop edition
- stopCellEditing();
-
- // reselect this cell
- AbstractSelectTableAction.doSelectCell(table, r, c);
- table.requestFocus();
- }
-
@Override
public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column) {
- if (tableModel == null) {
- tableModel = (AbstractTuttiTableModel<AbstractTuttiBeanUIModel>) table.getModel();
- this.table = table;
- columnIdentifier = tableModel.getPropertyName(column);
- }
+ this.table = table;
+ this.tableModel = (AbstractTuttiTableModel<AbstractTuttiBeanUIModel>) table.getModel();
+ columnIdentifier = tableModel.getPropertyName(column);
rowIndex = row;
columnIndex = column;
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java 2013-03-04 17:05:50 UTC (rev 530)
@@ -0,0 +1,146 @@
+package fr.ifremer.tutti.ui.swing.util.editor;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
+import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.swing.ComponentMover;
+import jaxx.runtime.swing.ComponentResizer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import java.awt.Component;
+import java.awt.Frame;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+/**
+ * Editor of attachment.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.2
+ */
+public abstract class AttachmentEditor extends JDialog {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(AttachmentEditor.class);
+
+ protected AttachmentEditorUI editor;
+
+ protected JComponent component;
+
+ public AttachmentEditor(Frame owner,
+ JComponent component,
+ AttachementObjectTypeEnum objectType,
+ String objectIdProperty,
+ String title) {
+ super(owner, true);
+
+ this.component = component;
+ editor = new AttachmentEditorUI();
+ editor.setBorder(BorderFactory.createTitledBorder(title));
+ editor.setObjectType(objectType);
+ editor.setObjectIdProperty(objectIdProperty);
+
+ setUndecorated(true);
+ add(editor);
+ setResizable(true);
+
+ ComponentResizer cr = new ComponentResizer();
+ cr.registerComponent(this);
+ ComponentMover cm = new ComponentMover();
+ cm.setDragInsets(cr.getDragInsets());
+ cm.registerComponent(this);
+
+ addWindowListener(new WindowAdapter() {
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ Component ui = (Component) e.getSource();
+ if (log.isInfoEnabled()) {
+ log.info("Destroy ui " + ui);
+ }
+ JAXXUtil.destroy(ui);
+ }
+ });
+
+ component.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER ||
+ e.getKeyCode() == KeyEvent.VK_SPACE) {
+ e.consume();
+ startEdit();
+ }
+ }
+ });
+
+ component.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ e.consume();
+ startEdit();
+ }
+ });
+ }
+
+ protected abstract AbstractTuttiBeanUIModel getBean();
+
+ protected abstract String getProperty();
+
+ public void startEdit() {
+
+ editor.setBean(getBean());
+ editor.setProperty(getProperty());
+
+ // Computes the location of bottom left corner of the cell
+ Component comp = component;
+ int x = 0;
+ int y = component.getHeight();
+ while (comp != null) {
+ x += comp.getX();
+ y += comp.getY();
+ comp = comp.getParent();
+ }
+ // if the editor is too big on the right,
+ // then align its right side to the right side of the cell
+ if (x + getWidth() > getOwner().getX() + getOwner().getWidth()) {
+ x = x - getWidth() + component.getWidth();
+ }
+ setLocation(x, y);
+ setVisible(true);
+ }
+
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx 2013-03-04 16:57:44 UTC (rev 529)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx 2013-03-04 17:05:50 UTC (rev 530)
@@ -26,9 +26,16 @@
<import>
fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel
fr.ifremer.tutti.persistence.entities.data.Attachment
+ fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum
jaxx.runtime.swing.editor.FileEditor
</import>
+ <!-- bean property where to find the objectId to attach to Attachment (see Attachment#objectId) -->
+ <String id='objectIdProperty' javaBean='""'/>
+
+ <!-- object type of attachments (see Attachment#objectType) -->
+ <AttachementObjectTypeEnum id='objectType' javaBean='null'/>
+
<!-- bean property linked state -->
<String id='property' javaBean='""'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java 2013-03-04 16:57:44 UTC (rev 529)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java 2013-03-04 17:05:50 UTC (rev 530)
@@ -24,8 +24,11 @@
* #L%
*/
+import com.ezware.oxbow.swingbits.util.Preconditions;
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import jaxx.runtime.SwingUtil;
@@ -50,22 +53,28 @@
import java.util.List;
/**
- * Handler of the LongTextEditorUI
- *
- * @author kmorin
+ * @author kmorin <morin(a)codelutin.com>
+ * @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
public class AttachmentEditorUIHandler {
- private static final Log log = LogFactory.getLog(AttachmentEditorUIHandler.class);
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(AttachmentEditorUIHandler.class);
private final AttachmentEditorUI ui;
- public AttachmentEditorUIHandler(AttachmentEditorUI attachmentEditorUI) {
- ui = attachmentEditorUI;
+ private final PersistenceService persistenceService;
- ui.addPropertyChangeListener(new PropertyChangeListener() {
+ public AttachmentEditorUIHandler(AttachmentEditorUI ui) {
+ this.ui = ui;
+ persistenceService =
+ TuttiUIContext.getApplicationContext().getPersistenceService();
+
+ this.ui.addPropertyChangeListener(new PropertyChangeListener() {
+
@Override
public void propertyChange(PropertyChangeEvent evt) {
init();
@@ -98,13 +107,16 @@
@Override
public void actionPerformed(ActionEvent e) {
AbstractTuttiBeanUIModel bean = ui.getBean();
+
+ persistenceService.deleteAttachment(attachment.getId());
+
String property = ui.getProperty();
List<Attachment> list = (List<Attachment>) TuttiUIUtil.getProperty(bean, property);
- if (list != null) {
- list.remove(attachment);
- TuttiUIUtil.setProperty(bean, property, list);
- }
+ Preconditions.checkNotNull(list);
+ list.remove(attachment);
+ TuttiUIUtil.setProperty(bean, property, list);
+
ui.getAttachments().remove(hbox);
JDialog parent = SwingUtil.getParentContainer(ui, JDialog.class);
@@ -120,7 +132,8 @@
@Override
public void mouseClicked(MouseEvent e) {
- SwingUtil.openLink("file://" + attachment.getFile().getAbsolutePath());
+ File file = persistenceService.getAttachmentFile(attachment.getId());
+ SwingUtil.openLink("file://" + file.getAbsolutePath());
}
@Override
@@ -147,33 +160,30 @@
SwingUtil.getParentContainer(ui, Window.class).dispose();
}
-// public void chooseFile() {
-// if (fileChooser.showOpenDialog(ui) == JFileChooser.APPROVE_OPTION) {
-// File file = fileChooser.getSelectedFile();
-// getModel().setFile(file);
-// ui.getFile().setText(file.getAbsolutePath());
-// }
-// }
-
public void addAttachment() {
AbstractTuttiBeanUIModel bean = ui.getBean();
String property = ui.getProperty();
List<Attachment> list = (List<Attachment>) TuttiUIUtil.getProperty(bean, property);
if (list == null) {
list = Lists.newArrayList();
+ TuttiUIUtil.setProperty(bean, property, list);
}
Attachment attachment = new Attachment();
+
File file = ui.getFile().getSelectedFile();
if (file != null) {
- attachment.setFile(file);
String name = ui.getFileName().getText();
if (StringUtils.isEmpty(name)) {
name = file.getName();
}
+ attachment.setObjectType(ui.getObjectType());
+ attachment.setObjectId(Integer.valueOf(String.valueOf(TuttiUIUtil.getProperty(bean, ui.getObjectIdProperty()))));
attachment.setName(name);
attachment.setComment(ui.getFileComment().getText());
+
+ attachment = persistenceService.createAttachment(attachment, file);
+
list.add(attachment);
- TuttiUIUtil.setProperty(bean, property, list);
resetFields();
addAttachment(attachment);
1
0
r529 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/operation/catches content/operation/catches/species content/operation/catches/species/frequency content/operation/catches/species/split util/table
by kmorin@users.forge.codelutin.com 04 Mar '13
by kmorin@users.forge.codelutin.com 04 Mar '13
04 Mar '13
Author: kmorin
Date: 2013-03-04 17:57:44 +0100 (Mon, 04 Mar 2013)
New Revision: 529
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/529
Log:
- do not hide screen when computing weights
- select last create batch in species catches
- reset simple count when leaving frequency screen
- reset the selected category when leaving the split screen, otherwise, the selected data are not reset
- clear the rows before creating the new rows in setRows
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-03-04 16:44:45 UTC (rev 528)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-03-04 16:57:44 UTC (rev 529)
@@ -11,15 +11,15 @@
* %%
* 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
+ * 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
+ *
+ * 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%
@@ -60,7 +60,7 @@
"generate",
_("tutti.action.computeWeights"),
_("tutti.action.computeWeights.tip"),
- true);
+ false);
}
@Override
@@ -176,10 +176,10 @@
errorComponent = ui.getSpeciesTotalSortedWeightField();
} else if (speciesTotalSortedWeight < 1.05 * totalSortedWeight) {
- // TODO Si le "Poids total VRAC" est saisi est que sa valeur
- // est supérieure de moins de x% (x en configuration)
- // du "Poids total Vrac trié", demander confirmation que
- // le "Poids total VRAC" est bien une valeur observée
+ // TODO Si le "Poids total VRAC" est saisi est que sa valeur
+ // est supérieure de moins de x% (x en configuration)
+ // du "Poids total Vrac trié", demander confirmation que
+ // le "Poids total VRAC" est bien une valeur observée
// sinon la remplacer par le "Poids total Vrac trié"
}
@@ -262,7 +262,7 @@
errorComponent = null;
} else if (categoryWeight == null && frequencyWeight != null) {
- // if the category weight is null and the frequencies have a weight,
+ // if the category weight is null and the frequencies have a weight,
// then this weight is the result
finestCategory.setComputedWeight(frequencyWeight);
result = frequencyWeight;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 16:44:45 UTC (rev 528)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 16:57:44 UTC (rev 529)
@@ -10,15 +10,15 @@
* %%
* 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
+ * 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
+ *
+ * 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%
@@ -59,6 +59,7 @@
import fr.ifremer.tutti.ui.swing.util.editor.AttachmentCellComponent;
import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent;
import fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataTableCell;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
@@ -735,6 +736,7 @@
recomputeRowValidState(newRow);
tableModel.addNewRow(newRow);
+ AbstractSelectTableAction.doSelectCell(getTable(), tableModel.getRowCount() - 1, 0);
saveRow(newRow);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-04 16:44:45 UTC (rev 528)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-04 16:57:44 UTC (rev 529)
@@ -10,15 +10,15 @@
* %%
* 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
+ * 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
+ *
+ * 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%
@@ -295,6 +295,8 @@
// when canceling always invalid model (in that way)
getModel().setValid(false);
+ getModel().setSimpleCount(null);
+
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
parent.getHandler().setSpeciesSelectedCard(EditCatchesUIHandler.MAIN_CARD);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-03-04 16:44:45 UTC (rev 528)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-03-04 16:57:44 UTC (rev 529)
@@ -10,15 +10,15 @@
* %%
* 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
+ * 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
+ *
+ * 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%
@@ -216,6 +216,7 @@
// when canceling always invalid model
getModel().setValid(false);
+ getModel().setSelectedCategory(null);
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
parent.getHandler().setSpeciesSelectedCard(EditCatchesUIHandler.MAIN_CARD);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java 2013-03-04 16:44:45 UTC (rev 528)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java 2013-03-04 16:57:44 UTC (rev 529)
@@ -10,15 +10,15 @@
* %%
* 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
+ * 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
+ *
+ * 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%
@@ -145,6 +145,7 @@
// can't accept a empty data list
Preconditions.checkNotNull(data, "Data list can not be null.");
+ this.rows = null;
if (createEmptyRowIsEmpty && data.isEmpty()) {
if (log.isInfoEnabled()) {
1
0
04 Mar '13
Author: tchemit
Date: 2013-03-04 17:44:45 +0100 (Mon, 04 Mar 2013)
New Revision: 528
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/528
Log:
refs #2073: [TECH] Mise en place de la persistence des pi?\195?\168ces-jointes (remove Attachment#file)
Modified:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
1
0
r527 - trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch
by tchemit@users.forge.codelutin.com 04 Mar '13
by tchemit@users.forge.codelutin.com 04 Mar '13
04 Mar '13
Author: tchemit
Date: 2013-03-04 17:44:15 +0100 (Mon, 04 Mar 2013)
New Revision: 527
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/527
Log:
benthos as warning in tree validation (for now)
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-04 15:26:13 UTC (rev 526)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-04 16:44:15 UTC (rev 527)
@@ -127,7 +127,7 @@
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE,
enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
if (benthosBatch == null) {
- addError(errors, n_("tutti.persistence.batch.validation.vracBenthosNotFound"), null);
+ addWarning(errors, n_("tutti.persistence.batch.validation.vracBenthosNotFound"));
} else {
// Vrac > Benthos > Inert
SortingBatch inertBatch = catchBatchDao.getSortingBatch(benthosBatch.getChildBatchs(),
1
0
04 Mar '13
Author: tchemit
Date: 2013-03-04 16:26:13 +0100 (Mon, 04 Mar 2013)
New Revision: 526
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/526
Log:
refs #1963: [CAPTURE] - Global - Ajouter pi?\195?\168ce jointe sur tous les onglets (obtenir depuis le service le sur lot)
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/BatchContainer.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
@@ -261,7 +262,6 @@
/**
* Get all attachments for the given object {@code objectId}.
*
- *
* @param objectId id of the object
* @return list of all attachments for the given {@code objectId}.
*/
@@ -424,15 +424,16 @@
//------------------------------------------------------------------------//
/**
- * Get all root {@link SpeciesBatch} for the given fishing operation.
+ * Get the batch parent of all root {@link SpeciesBatch} for the given
+ * fishing operation.
* <p/>
* <strong>Note:</strong> All childs of the batch should be loaded here.
*
* @param fishingOperationId if of the fishing operation to seek
* @return the list of root {@link SpeciesBatch}
- * @since 1.0
+ * @since 1.0.2
*/
- List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId);
+ BatchContainer<SpeciesBatch> getRootSpeciesBatch(String fishingOperationId);
@Transactional(readOnly = false)
SpeciesBatch createSpeciesBatch(SpeciesBatch bean, String parentBatchId);
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-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -29,6 +29,7 @@
import fr.ifremer.adagio.core.service.technical.CacheService;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
@@ -514,8 +515,8 @@
//------------------------------------------------------------------------//
@Override
- public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
- return batchService.getAllRootSpeciesBatch(fishingOperationId);
+ public BatchContainer<SpeciesBatch> getRootSpeciesBatch(String fishingOperationId) {
+ return batchService.getRootSpeciesBatch(fishingOperationId);
}
@Override
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
@@ -334,7 +335,7 @@
}
@Override
- public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
+ public BatchContainer<SpeciesBatch> getRootSpeciesBatch(String fishingOperationId) {
throw new RuntimeException("method not implemented");
}
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/BatchContainer.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/BatchContainer.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/BatchContainer.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -0,0 +1,49 @@
+package fr.ifremer.tutti.persistence.entities.data;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.Lists;
+
+import java.util.List;
+
+/**
+ * Container of batches.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.2
+ */
+public class BatchContainer<B extends AbstractBatch> extends AbstractTuttiDataEntity {
+ private static final long serialVersionUID = 1L;
+
+ protected final List<B> children = Lists.newArrayList();
+
+ public List<B> getChildren() {
+ return children;
+ }
+
+ public void addChildren(B batch) {
+ children.add(batch);
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/BatchContainer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java 2013-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceService.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -28,6 +28,7 @@
import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidationException;
import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
@@ -103,15 +104,16 @@
//------------------------------------------------------------------------//
/**
- * Get all root {@link SpeciesBatch} for the given fishing operation.
+ * Get the batch parent of all root {@link SpeciesBatch} for the given
+ * fishing operation.
* <p/>
* <strong>Note:</strong> All childs of the batch should be loaded here.
*
* @param fishingOperationId if of the fishing operation to seek
* @return the list of root {@link SpeciesBatch}
- * @since 1.0
+ * @since 1.0.2
*/
- List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId);
+ BatchContainer<SpeciesBatch> getRootSpeciesBatch(String fishingOperationId);
@Transactional(readOnly = false)
SpeciesBatch createSpeciesBatch(SpeciesBatch bean, String parentBatchId);
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -42,6 +42,7 @@
import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxon;
import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxonImpl;
import fr.ifremer.adagio.core.dao.technical.synchronization.SynchronizationStatus;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
@@ -279,18 +280,22 @@
//------------------------------------------------------------------------//
@Override
- public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
+ public BatchContainer<SpeciesBatch> getRootSpeciesBatch(String fishingOperationId) {
// Load batch tree
Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(Integer.valueOf(fishingOperationId));
fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId);
- List<SpeciesBatch> result = new ArrayList<SpeciesBatch>();
-
// Vrac / Species
SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+
+ // container of speciesBatch is arbitraty put on vrac type (there is
+ // no common ancestor for all species batch).
+ BatchContainer result = new BatchContainer<SpeciesBatch>();
+ result.setId(String.valueOf(vracSpeciesBatch.getId()));
+
for (Batch batch1 : vracSpeciesBatch.getChildBatchs()) {
SortingBatch source = (SortingBatch) batch1;
@@ -301,7 +306,7 @@
SpeciesBatch target = new SpeciesBatch();
entityToBean(source, target);
- result.add(target);
+ result.addChildren(target);
}
}
@@ -316,12 +321,57 @@
SpeciesBatch target = new SpeciesBatch();
entityToBean(source, target);
- result.add(target);
+ result.addChildren(target);
}
}
+
return result;
}
+// @Override
+// public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
+//
+// // Load batch tree
+// Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(Integer.valueOf(fishingOperationId));
+// fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId);
+//
+// List<SpeciesBatch> result = new ArrayList<SpeciesBatch>();
+//
+// // Vrac / Species
+// SortingBatch vracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
+// "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
+// "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+// for (Batch batch1 : vracSpeciesBatch.getChildBatchs()) {
+// SortingBatch source = (SortingBatch) batch1;
+//
+// // evict some special batches : Life (or Biota) and Inert
+// if (source.getReferenceTaxon() != null
+// && !enumeration.REFERENCE_TAXON_ID_LIFE.equals(source.getReferenceTaxon().getId())
+// && !enumeration.REFERENCE_TAXON_ID_INERT.equals(source.getReferenceTaxon().getId())) {
+// SpeciesBatch target = new SpeciesBatch();
+//
+// entityToBean(source, target);
+// result.add(target);
+// }
+// }
+//
+// // Hors-Vrac / Species
+// SortingBatch horsVracSpeciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
+// "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID,
+// "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
+// if (horsVracSpeciesBatch != null) {
+// for (Batch batch : horsVracSpeciesBatch.getChildBatchs()) {
+// SortingBatch source = (SortingBatch) batch;
+//
+// SpeciesBatch target = new SpeciesBatch();
+//
+// entityToBean(source, target);
+// result.add(target);
+// }
+// }
+// return result;
+// }
+
@Override
public SpeciesBatch createSpeciesBatch(SpeciesBatch bean,
String parentBatchId) {
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -121,6 +121,7 @@
}
}
+ //FIXME - make this work with data to repair :(
// Vrac > Benthos
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(vracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE,
@@ -160,6 +161,7 @@
addWarning(errors, n_("tutti.persistence.batch.validation.horsVracSpeciesNotFound"));
}
+ //FIXME - make this work with data to repair :(
// Hors Vrac > Benthos
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE,
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java 2013-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -25,14 +25,12 @@
*/
import fr.ifremer.tutti.persistence.DatabaseResource;
-import fr.ifremer.tutti.persistence.TuttiRunner;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
-import org.junit.runner.RunWith;
import java.io.File;
import java.util.List;
@@ -43,7 +41,6 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0.2
*/
-(a)RunWith(TuttiRunner.class)
public class AttachmentPersistenceServiceWriteTest {
@ClassRule
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-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -32,6 +32,7 @@
import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
@@ -535,8 +536,8 @@
//------------------------------------------------------------------------//
@Override
- public List<SpeciesBatch> getAllRootSpeciesBatch(String fishingOperationId) {
- return driver.getAllRootSpeciesBatch(fishingOperationId);
+ public BatchContainer<SpeciesBatch> getRootSpeciesBatch(String fishingOperationId) {
+ return driver.getRootSpeciesBatch(fishingOperationId);
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 09:10:58 UTC (rev 525)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-04 15:26:13 UTC (rev 526)
@@ -31,6 +31,7 @@
import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
@@ -209,9 +210,20 @@
if (!TuttiEntities.isNew(bean)) {
// get all batch species root (says the one with only a species sample category)
- List<SpeciesBatch> catches =
- persistenceService.getAllRootSpeciesBatch(bean.getId());
+ BatchContainer<SpeciesBatch> rootSpeciesBatch =
+ persistenceService.getRootSpeciesBatch(bean.getId());
+ model.setRootBatchId(rootSpeciesBatch.getId());
+
+ if (log.isInfoEnabled()) {
+ log.info("species root batch id: " + model.getRootBatchId());
+ }
+
+ List<SpeciesBatch> catches = rootSpeciesBatch.getChildren();
+
+// List<SpeciesBatch> catches =
+// persistenceService.getAllRootSpeciesBatch(bean.getId());
+//
for (SpeciesBatch aBatch : catches) {
// root batch sample categroy is species
@@ -609,7 +621,7 @@
{ // File column
addColumnToModel(columnModel,
- AttachmentCellComponent.newEditor(ui.getAttachmentEditor()),
+ AttachmentCellComponent.newEditor(ui),
AttachmentCellComponent.newRender(
getDecorator(Attachment.class, null),
n_("tutti.tooltip.attachment.none")),
1
0
04 Mar '13
Author: tchemit
Date: 2013-03-04 10:10:58 +0100 (Mon, 04 Mar 2013)
New Revision: 525
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/525
Log:
fixes #2073: [TECH] Mise en place de la persistence des pi?\195?\168ces-jointes
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/AttachementObjectTypeEnum.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/TuttiRunner.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -261,10 +261,11 @@
/**
* Get all attachments for the given object {@code objectId}.
*
+ *
* @param objectId id of the object
* @return list of all attachments for the given {@code objectId}.
*/
- List<Attachment> getAllAttachments(String objectId);
+ List<Attachment> getAllAttachments(Integer objectId);
/**
* Get the file of the given {@code attachmentId}.
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-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -348,7 +348,7 @@
//------------------------------------------------------------------------//
@Override
- public List<Attachment> getAllAttachments(String objectId) {
+ public List<Attachment> getAllAttachments(Integer objectId) {
return attachmentService.getAllAttachments(objectId);
}
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-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -489,7 +489,7 @@
}
@Override
- public List<Attachment> getAllAttachments(String objectId) {
+ public List<Attachment> getAllAttachments(Integer objectId) {
throw new RuntimeException("method not implemented");
}
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/AttachementObjectTypeEnum.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/AttachementObjectTypeEnum.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/AttachementObjectTypeEnum.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -0,0 +1,86 @@
+package fr.ifremer.tutti.persistence.entities.data;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+import fr.ifremer.adagio.core.dao.referential.ObjectType;
+import fr.ifremer.tutti.persistence.service.TuttiEnumerationFile;
+
+/**
+ * Define all usable {@link ObjectType} in {@link Attachment}.
+ *
+ * <strong>Note: </strong>This enumeration implements {@link TuttiEnumerationFile.TuttiEnumerable},
+ * so all values must be synched to the enumeration file and before usage we
+ * must be invoke the {@link TuttiEnumerationFile#init()} method.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see Attachment#getObjectType()
+ * @since 1.0.2
+ */
+public enum AttachementObjectTypeEnum implements TuttiEnumerationFile.TuttiEnumerable<String> {
+
+ SCIENTIFIC_CRUISE("OBJECT_TYPE_SCIENTIFIC_CRUISE"),
+ OPERATION("OBJECT_TYPE_OPERATION"),
+ CATCH_BATCH("OBJECT_TYPE_CATCH_BATCH"),
+ SAMPLE("OBJECT_TYPE_SAMPLE");
+
+ private final String fieldName;
+
+ private String fieldValue;
+
+ private boolean init;
+
+ AttachementObjectTypeEnum(String fieldName) {
+ this.fieldName = fieldName;
+ }
+
+ @Override
+ public String getFieldName() {
+ return fieldName;
+ }
+
+ @Override
+ public String getFieldValue() {
+ Preconditions.checkState(
+ isInit(),
+ "Enumeration " + getClass() + " was not init!");
+ return fieldValue;
+ }
+
+ @Override
+ public void setFieldValue(Object fieldValue) {
+ this.fieldValue = String.valueOf(fieldValue);
+ }
+
+ @Override
+ public boolean isInit() {
+ return init;
+ }
+
+ @Override
+ public void setInit(boolean init) {
+ this.init = init;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/AttachementObjectTypeEnum.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceService.java 2013-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceService.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -46,7 +46,7 @@
* @param objectId id of the object
* @return list of all attachments for the given {@code objectId}.
*/
- List<Attachment> getAllAttachments(String objectId);
+ List<Attachment> getAllAttachments(Integer objectId);
/**
* Get the file of the given {@code attachmentId}.
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceImpl.java 2013-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceImpl.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -32,12 +32,12 @@
import fr.ifremer.adagio.core.dao.referential.QualityFlagImpl;
import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmImpl;
import fr.ifremer.tutti.TuttiIOUtil;
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.type.IntegerType;
-import org.hibernate.type.StringType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
@@ -62,7 +62,7 @@
LogFactory.getLog(AttachmentPersistenceServiceImpl.class);
protected static final String ATTACHMENT_PATH_FORMAT =
- "%1$s/OBJ-%2$s/%1$s-%2$s-%3$s.%4$s";
+ "%1$s/OBJ%2$s/%1$s-OBJ%2$s-%3$s.%4$s";
@Autowired
protected ReferentialPersistenceService referentialService;
@@ -87,10 +87,11 @@
//------------------------------------------------------------------------//
@Override
- public List<Attachment> getAllAttachments(String objectId) {
+ public List<Attachment> getAllAttachments(Integer objectId) {
Iterator<Object[]> list = queryList(
"allAttachment",
- "objectId", StringType.INSTANCE, objectId);
+ "objectId", IntegerType.INSTANCE, objectId,
+ "pmfmId", IntegerType.INSTANCE, enumeration.PMFM_ID_MEASUREMENT_FILE);
List<Attachment> result = Lists.newArrayList();
while (list.hasNext()) {
@@ -106,7 +107,7 @@
public File getAttachmentFile(String attachmentId) {
Object[] source = queryUnique(
"attachment",
- "attachmetId", IntegerType.INSTANCE, Integer.valueOf(attachmentId));
+ "attachmentId", IntegerType.INSTANCE, Integer.valueOf(attachmentId));
if (source == null) {
throw new DataRetrievalFailureException(
@@ -123,15 +124,12 @@
public Attachment createAttachment(Attachment attachment, File file) {
Preconditions.checkNotNull(attachment);
Preconditions.checkNotNull(attachment.getObjectType());
- Preconditions.checkNotNull(attachment.getObjectType().getId());
+ Preconditions.checkNotNull(attachment.getObjectId());
Preconditions.checkArgument(
attachment.getId() == null,
"Attachment 'id' must be null to call createAttachment().");
Preconditions.checkNotNull(file);
- // Use first a fake filePath (we don't know the id of attachment entity)
- attachment.setPath("FAKE-" + System.nanoTime());
-
// Create measurement file
MeasurementFile measurementFile = MeasurementFile.Factory.newInstance();
@@ -142,8 +140,14 @@
measurementFile.setQualityFlag(load(QualityFlagImpl.class, enumeration.QUALITY_FLAG_CODE_NOT_QUALIFIED));
// set objectType
- measurementFile.setObjectType(load(ObjectTypeImpl.class, attachment.getObjectType().getId()));
+ measurementFile.setObjectType(load(ObjectTypeImpl.class, attachment.getObjectType().getFieldValue()));
+ // set objectId
+ measurementFile.setObjectId(attachment.getObjectId());
+
+ // Use first a fake filePath (we don't know the id of attachment entity)
+ measurementFile.setPath("FAKE-" + System.nanoTime());
+
// copy our property
attachmentToEntity(attachment, measurementFile);
measurementFileDao.create(measurementFile);
@@ -177,15 +181,17 @@
file, targetFile,
"Could not copy attachment file " + file + " to " + targetFile);
- return null;
+ return attachment;
}
@Override
public Attachment saveAttachment(Attachment attachment) {
Preconditions.checkNotNull(attachment);
Preconditions.checkNotNull(attachment.getObjectType());
- Preconditions.checkNotNull(attachment.getObjectType().getId());
- Preconditions.checkNotNull(attachment.getId(), "Attachment 'id' must not be null or empty to be saved.");
+ Preconditions.checkNotNull(attachment.getObjectId());
+ Preconditions.checkNotNull(
+ attachment.getId(),
+ "Attachment 'id' must not be null or empty to be saved.");
MeasurementFile measurementFile = measurementFileDao.load(Integer.valueOf(attachment.getId()));
if (measurementFile == null) {
@@ -193,13 +199,21 @@
}
// can't change the objectType
- if (ObjectUtils.notEqual(attachment.getObjectType().getId(),
- measurementFile.getObjectType().getCode())) {
+ String oldObjectTypeCode = measurementFile.getObjectType().getCode();
+ if (ObjectUtils.notEqual(attachment.getObjectType().getFieldValue(),
+ oldObjectTypeCode)) {
throw new InvalidDataAccessResourceUsageException(
- "Can't change objectId, was before " +
- measurementFile.getObjectType().getCode());
+ "Can't change objectType, was before " + oldObjectTypeCode);
}
+ // can't change either objectId
+ Integer oldObjectId = measurementFile.getObjectId();
+ if (ObjectUtils.notEqual(attachment.getObjectId(),
+ oldObjectId)) {
+ throw new InvalidDataAccessResourceUsageException(
+ "Can't change objectId, was before " + oldObjectId);
+ }
+
attachmentToEntity(attachment, measurementFile);
measurementFileDao.update(measurementFile);
return attachment;
@@ -210,7 +224,7 @@
Integer id = Integer.valueOf(attachmentId);
Object[] source = queryUnique(
"attachment",
- "attachmetId", IntegerType.INSTANCE, id);
+ "attachmentId", IntegerType.INSTANCE, id);
if (source == null) {
throw new DataRetrievalFailureException(
@@ -234,10 +248,12 @@
protected void loadAttachment(Object[] source,
Attachment target) {
- target.setId(String.valueOf(source[0]));
- target.setPath((String) source[1]);
- target.setName((String) source[2]);
- target.setComment((String) source[3]);
+ target.setObjectType(AttachementObjectTypeEnum.valueOf((String) source[0]));
+ target.setObjectId((Integer) source[1]);
+ target.setId(String.valueOf(source[2]));
+ target.setPath((String) source[3]);
+ target.setName((String) source[4]);
+ target.setComment((String) source[5]);
}
protected void attachmentToEntity(Attachment attachment,
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-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -25,10 +25,13 @@
*/
import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Field;
+import java.util.Map;
/**
* Contains all constants usable via the enumeration file.
@@ -189,9 +192,8 @@
public final Integer PMFM_ID_SURVEY_PART = null;
@Value("${PmfmId.MEASUREMENT_FILE}")
- public final Integer PMFM_ID_MEASUREMENT_FILE= null;
+ public final Integer PMFM_ID_MEASUREMENT_FILE = null;
-
@Value("${ProgramCode.SCIENTIFIC_CRUISE_PREFIX}")
public final String PROGRAM_CODE_SCIENTIFIC_CRUISE_PREFIX = null;
@@ -204,8 +206,45 @@
@Value("${ReferenceTaxonId.INERT}")
public final Integer REFERENCE_TAXON_ID_INERT = null;
+ @Value("${ObjectTypeCode.SCIENTIFIC_CRUISE}")
+ public final String OBJECT_TYPE_SCIENTIFIC_CRUISE = null;
+
+ @Value("${ObjectTypeCode.CATCH_BATCH}")
+ public final String OBJECT_TYPE_CATCH_BATCH = null;
+
+ @Value("${ObjectTypeCode.OPERATION}")
+ public final String OBJECT_TYPE_OPERATION = null;
+
+ @Value("${ObjectTypeCode.SAMPLE}")
+ public final String OBJECT_TYPE_SAMPLE = null;
+
+
+ /**
+ * Contract to place on enumeration that must be synched to field inside this class.
+ * <p/>
+ * {@link #getFieldValue()} will be filled when {@link #init()} method is
+ * invoked and then the {@link #isInit()} will return true.
+ *
+ * @param <O> type of fieldValue
+ * @since 1.0.2
+ */
+ public interface TuttiEnumerable<O> {
+
+ String getFieldName();
+
+ O getFieldValue();
+
+ void setFieldValue(Object fieldValue);
+
+ boolean isInit();
+
+ void setInit(boolean init);
+ }
+
public void init() {
+ Map<String, Object> annotatedFieldValues = Maps.newTreeMap();
+
Field[] declaredFields = getClass().getDeclaredFields();
for (Field declaredField : declaredFields) {
Value annotation = declaredField.getAnnotation(Value.class);
@@ -213,11 +252,33 @@
// check on that field that his value is here
Object fieldValue = ReflectionUtils.getField(declaredField, this);
+ String fieldName = declaredField.getName();
Preconditions.checkNotNull(
fieldValue,
annotation.value() + " constant not found (field " +
- declaredField.getName() + ")");
+ fieldName + ")");
+ annotatedFieldValues.put(fieldName, fieldValue);
}
}
+
+ // init enums
+ initEnum(AttachementObjectTypeEnum.class, annotatedFieldValues);
}
+
+ protected <O, E extends Enum<E> & TuttiEnumerable<O>> void initEnum(
+ Class<E> enumType,
+ Map<String, Object> annotatedFieldValues) {
+ for (E e : enumType.getEnumConstants()) {
+ if (!e.isInit()) {
+ String fieldName = e.getFieldName();
+ Object field = annotatedFieldValues.get(fieldName);
+ Preconditions.checkNotNull(
+ field,
+ "Could not find field " + fieldName + ")");
+ e.setFieldValue(field);
+ e.setInit(true);
+ }
+
+ }
+ }
}
Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-03-04 09:10:58 UTC (rev 525)
@@ -358,6 +358,8 @@
<query name="allAttachment">
<![CDATA[
SELECT
+ m.objectType.code as attachmentObjectType,
+ m.objectId AS attachmentObjectId,
m.id AS attachmentId,
m.path AS attachmentPath,
m.name AS attachmentName,
@@ -376,6 +378,8 @@
<query name="attachment">
<![CDATA[
SELECT
+ m.objectType.code as attachmentObjectType,
+ m.objectId AS attachmentObjectId,
m.id AS attachmentId,
m.path AS attachmentPath,
m.name AS attachmentName,
@@ -383,9 +387,9 @@
FROM
MeasurementFileImpl m
WHERE
- m.id = :id
+ m.id = :attachmentId
]]>
- <query-param name="id" type="java.lang.Integer"/>
+ <query-param name="attachmentId" type="java.lang.Integer"/>
</query>
<!-- ===================================================================== -->
Modified: trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-03-04 09:10:58 UTC (rev 525)
@@ -391,4 +391,10 @@
ReferenceTaxonId.LIFE=7637
#Reference taxon correspondant à "Non Biota" (ou "Non Vie" - matière inerte)
# TODO : a creer dans la base harmonie et achanger !
-ReferenceTaxonId.INERT=1
\ No newline at end of file
+ReferenceTaxonId.INERT=1
+
+# TODO : A Creer (dans les énumerations Allegro)
+ObjectTypeCode.SCIENTIFIC_CRUISE=SCIENTIFIC_CRUISE
+ObjectTypeCode.OPERATION=OPERATION
+ObjectTypeCode.CATCH_BATCH=CATCH_BATCH
+ObjectTypeCode.SAMPLE=SAMPLE
\ No newline at end of file
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java 2013-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/DatabaseResource.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -200,6 +200,8 @@
copyDb(config.getDbDirectory(), !writeDb, null);
}
+ toDetroy.add(config.getDbAttachmentDirectory());
+
// load db config
File dbConfig = new File(config.getDbDirectory(), config.getDbName() + ".properties");
Properties p = new Properties();
Added: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/TuttiRunner.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/TuttiRunner.java (rev 0)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/TuttiRunner.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -0,0 +1,64 @@
+package fr.ifremer.tutti.persistence;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+
+/**
+ * To use {@link TuttiRunListener}.
+ * <p/>
+ * Add this on top of your test (when run in IDE, otherise maven already add
+ * the listener for you, so no need of the runner).
+ * <pre>
+ * \(a)RunWith(TuttiRunner.class)
+ * </pre>
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.2
+ */
+
+public class TuttiRunner extends BlockJUnit4ClassRunner {
+
+ public static final TuttiRunListener TUTTI_RUN_LISTENER = new TuttiRunListener();
+
+ /**
+ * Creates a BlockJUnit4ClassRunner to run {@code klass}
+ *
+ * @throws InitializationError if the test class is malformed.
+ */
+ public TuttiRunner(Class<?> klass) throws InitializationError {
+ super(klass);
+ }
+
+ @Override
+ protected void runChild(FrameworkMethod method, RunNotifier notifier) {
+ notifier.removeListener(TUTTI_RUN_LISTENER);
+ notifier.addListener(TUTTI_RUN_LISTENER);
+ super.runChild(method, notifier);
+ }
+}
Property changes on: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/TuttiRunner.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java (rev 0)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -0,0 +1,144 @@
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.persistence.DatabaseResource;
+import fr.ifremer.tutti.persistence.TuttiRunner;
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
+import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * To test {@link AttachmentPersistenceService} for write operation.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.2
+ */
+(a)RunWith(TuttiRunner.class)
+public class AttachmentPersistenceServiceWriteTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = DatabaseResource.writeDb();
+
+ protected AttachmentPersistenceService service;
+
+ @Before
+ public void setUp() throws Exception {
+ service = TuttiPersistenceServiceLocator.getAttachmentPersistenceService();
+ }
+
+ @Test
+ public void createAndSaveAttachment() {
+
+ List<Attachment> allAttachments;
+
+ Integer cruiseId = Integer.valueOf(dbResource.getFixtures().cruiseId());
+
+ allAttachments = service.getAllAttachments(cruiseId);
+ Assert.assertTrue(allAttachments.isEmpty());
+
+ //
+ // create attachment
+ //
+
+ Attachment attachment = new Attachment();
+ attachment.setObjectType(AttachementObjectTypeEnum.SCIENTIFIC_CRUISE);
+ attachment.setObjectId(cruiseId);
+ long buildTime = System.nanoTime();
+ attachment.setName("AttachmentName-" + buildTime);
+ attachment.setComment("AttachmentComment-" + buildTime);
+ File fileToAttach = dbResource.getConfig().getDbConfigurationPath();
+ Attachment savedAttachment = service.createAttachment(attachment, fileToAttach);
+ assertAttachment(attachment, savedAttachment);
+
+ //
+ // get Attachment file
+ //
+
+ File attachmentFile = service.getAttachmentFile(attachment.getId());
+ Assert.assertNotNull(attachmentFile);
+ Assert.assertTrue(attachmentFile.exists());
+ Assert.assertEquals(fileToAttach.length(), attachmentFile.length());
+
+ //
+ // reload it
+ //
+
+ allAttachments = service.getAllAttachments(cruiseId);
+ Assert.assertFalse(allAttachments.isEmpty());
+ Assert.assertEquals(1, allAttachments.size());
+
+ Attachment reloadedAttachment = allAttachments.get(0);
+ assertAttachment(attachment, reloadedAttachment);
+
+ //
+ // modifiy it and save it
+ //
+
+ attachment.setName(attachment.getName() + "-2");
+ attachment.setComment(attachment.getComment() + "-2");
+
+ savedAttachment = service.saveAttachment(attachment);
+ assertAttachment(attachment, savedAttachment);
+
+ //
+ // reload it
+ //
+
+ allAttachments = service.getAllAttachments(cruiseId);
+ Assert.assertFalse(allAttachments.isEmpty());
+ Assert.assertEquals(1, allAttachments.size());
+
+ reloadedAttachment = allAttachments.get(0);
+ assertAttachment(attachment, reloadedAttachment);
+
+ //
+ // delete it
+ //
+
+ service.deleteAttachment(attachment.getId());
+ allAttachments = service.getAllAttachments(cruiseId);
+ Assert.assertTrue(allAttachments.isEmpty());
+ Assert.assertFalse(attachmentFile.exists());
+ }
+
+ protected void assertAttachment(Attachment expected, Attachment actual) {
+ Assert.assertNotNull(expected);
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(expected.getId(), actual.getId());
+ Assert.assertEquals(expected.getPath(), actual.getPath());
+ Assert.assertEquals(expected.getName(), actual.getName());
+ Assert.assertEquals(expected.getComment(), actual.getComment());
+ Assert.assertEquals(expected.getObjectType(), actual.getObjectType());
+ Assert.assertEquals(expected.getObjectId(), actual.getObjectId());
+ }
+}
Property changes on: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/AttachmentPersistenceServiceWriteTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-03-04 08:45:29 UTC (rev 524)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-04 09:10:58 UTC (rev 525)
@@ -373,7 +373,7 @@
//------------------------------------------------------------------------//
@Override
- public List<Attachment> getAllAttachments(String objectId) {
+ public List<Attachment> getAllAttachments(Integer objectId) {
return driver.getAllAttachments(objectId);
}
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/428/changes>
Changes:
[Tony Chemit] use new Applicationconfig and Applicationupdater API
------------------------------------------
[...truncated 29 lines...]
At revision 519
Parsing POMs
Modules changed, recalculating dependency graph
[trunk] $ /opt/jdk/bin/java -Xmx256m -XX:-UseGCOverheadLimit -cp /var/local/jenkins/data/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/opt/maven3/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /opt/maven3 /opt/repo/apache-tomcat-7.0.34/webapps/jenkins/WEB-INF/lib/remoting-2.20.jar /var/local/jenkins/data/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 57005
<===[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
Projects to build: [MavenProject: fr.ifremer:tutti:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-service:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-ui-swing:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml]>
projectStarted fr.ifremer:tutti:1.0.2-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir)
[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
mojoSucceeded org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir)
mojoStarted org.apache.maven.plugins:maven-site-plugin:3.2(attach-descriptor)
[INFO]
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor) @ tutti ---
mojoSucceeded org.apache.maven.plugins:maven-site-plugin:3.2(attach-descriptor)
mojoStarted org.apache.maven.plugins:maven-install-plugin:2.4(default-install)
[INFO]
[INFO] --- maven-install-plugin:2.4: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/1.0.2-SNAPSHOT/tutti-1.0.2-SNAPSHOT.pom
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-1.0.2-SNAPSHOT…> to /var/local/maven/data/repository/fr/ifremer/tutti/1.0.2-SNAPSHOT/tutti-1.0.2-SNAPSHOT-site_fr.xml
mojoSucceeded org.apache.maven.plugins:maven-install-plugin:2.4(default-install)
projectSucceeded fr.ifremer:tutti:1.0.2-SNAPSHOT
projectStarted fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Persistence 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/fr/ifremer/adagio/adagi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (2 KB at 5.5 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/fr/ifremer/adagio/adagi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (8 KB at 200.4 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/fr/ifremer/adagio/adagi…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (600 B at 17.8 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (16 KB at 510.3 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (2 KB at 41.1 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (2 KB at 25.4 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (7 KB at 142.0 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (823 B at 13.0 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (823 B at 10.6 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (12 KB at 247.2 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-confi…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (2 KB at 26.9 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-confi… (2 KB at 26.9 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-confi…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-confi… (5 KB at 147.5 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/fr/ifremer/adagio/… (2509 KB at 9153.7 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-confi…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-confi… (35 KB at 891.3 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-utils… (293 KB at 3752.2 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[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>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-persistence ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
[INFO]
[INFO] --- eugene-maven-plugin:2.6.1: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 61.673ms.
[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 3.128s.
[INFO] Process phase [model] for one entry.
INFO [pool-1-thread-1] (ObjectModelReader.java:273) loadModelProperties - 19 tag values were succesfull imported from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
[INFO] Apply generator JavaInterfaceTransformer
[INFO] Apply generator SimpleJavaBeanTransformer
INFO [pool-1-thread-1] (ObjectModelTransformerToJava.java:911) isInClassPath - Will not generate [fr.ifremer.tutti.persistence.entities.data.Program], already found in class-path.
[INFO] Apply generator JavaEnumerationTransformer
[INFO] No file generated.
[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}]}}
mojoSucceeded org.nuiton.eugene:eugene-maven-plugin:2.6.1(default)
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT[INFO] Copying tutti-persistence.properties to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/ge…>
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:get (get) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-persistence ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO] Copying 0 resource
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-persistence ---
[INFO] Compiling 82 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/cl…>
mojoSucceeded org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
mojoStarted org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir)
[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
mojoSucceeded org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-testResources)
[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
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-testResources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-testCompile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ tutti-persistence ---
[INFO] Compiling 27 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/te…>
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[53,51] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[190,8] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[190,50] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[191,25] error: no suitable method found for loadDefaultOptions(TuttiPersistenceConfigOption[])
[ERROR]
O#2 extends OptionDef declared in method <O#2>loadDefaultOptions(Class<O#2>)
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/src/test/…>:[198,17] error: constructor TuttiPersistenceConfig in class TuttiPersistenceConfig cannot be applied to given types;
[INFO] 5 errors
[INFO] -------------------------------------------------------------
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-testCompile)
projectFailed fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT
sessionEnded
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [19.618s]
[INFO] Tutti :: Persistence .............................. FAILURE [26.471s]
[INFO] Tutti :: Service .................................. SKIPPED
[INFO] Tutti :: UI ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.299s
[INFO] Finished at: Sun Mar 03 17:03:07 CET 2013
[INFO] Final Memory: 32M/128M
[INFO] ------------------------------------------------------------------------
Projects to build: [MavenProject: fr.ifremer:tutti:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-persistence:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-service:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-ui-swing:1.0.2-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml]>
[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-03-03_17-02-09/archive/fr.ifremer.tutti/tutti-service/1.0.2-SNAPSHOT/tutti-service-1.0.2-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-03-03_17-02-09/archive/fr.ifremer.tutti/tutti-ui-swing/1.0.2-SNAPSHOT/tutti-ui-swing-1.0.2-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-03-03_17-02-09/archive/fr.ifremer/tutti/1.0.2-SNAPSHOT/tutti-1.0.2-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-1.0.2-SNAPSHOT…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-03-03_17-02-09/archive/fr.ifremer/tutti/1.0.2-SNAPSHOT/tutti-1.0.2-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-03-03_17-02-09/archive/fr.ifremer.tutti/tutti-persistence/1.0.2-SNAPSHOT/tutti-persistence-1.0.2-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:2.5.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:2.5.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:601)
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:158)
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$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.TestCompilerMojo.execute(TestCompilerMojo.java:161)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com chemit(a)codelutin.com
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com chemit(a)codelutin.com
channel stopped
1
5
04 Mar '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/429/>
------------------------------------------
projectStarted fr.ifremer.tutti:tutti-service:1.0.2-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: Service 1.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-csv/2…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (2 KB at 43.6 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-csv/2… (2 KB at 32.5 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-csv/2…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-csv/2… (6 KB at 150.4 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-csv/2…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-csv/2… (72 KB at 1248.8 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-service ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/ta…>
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-service ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-service ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-service:1.0.2-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:get (get) @ tutti-service ---
[INFO] Copying tutti-service.properties to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/ta…>
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-service:1.0.2-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-service ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-service ---
[INFO] Compiling 24 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/ta…>
mojoSucceeded org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
mojoStarted org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir)
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ tutti-service ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/ta…>
[INFO] Executed tasks
mojoSucceeded org.apache.maven.plugins:maven-antrun-plugin:1.7(generate-surefire-workdir)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-testResources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ tutti-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-testResources)
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-testCompile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ tutti-service ---
[INFO] Compiling 2 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/ta…>
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/sr…>:[46,22] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/sr…>:[256,8] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/sr…>:[257,20] [deprecation] ApplicationConfig in org.nuiton.util has been deprecated
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/sr…>:[258,25] error: no suitable method found for loadDefaultOptions(TuttiPersistenceConfigOption[])
[ERROR]
O#2 extends OptionDef declared in method <O#2>loadDefaultOptions(Class<O#2>)
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-service/ws/sr…>:[271,16] error: constructor TuttiServiceConfig in class TuttiServiceConfig cannot be applied to given types;
[INFO] 5 errors
[INFO] -------------------------------------------------------------
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-testCompile)
projectFailed fr.ifremer.tutti:tutti-service:1.0.2-SNAPSHOT
1
4